Skip to content

Commit f0d2320

Browse files
JoePercheslinvjw
authored andcommitted
net: mac80211: Convert printk(KERN_DEBUG to pr_debug
Standardize the debugging to be able to use dynamic_debug. Coalesce formats, align arguments. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 6efb71b commit f0d2320

17 files changed

Lines changed: 181 additions & 227 deletions

‎net/mac80211/agg-rx.c‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,16 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
7575
RCU_INIT_POINTER(sta->ampdu_mlme.tid_rx[tid], NULL);
7676

7777
#ifdef CONFIG_MAC80211_HT_DEBUG
78-
printk(KERN_DEBUG
79-
"Rx BA session stop requested for %pM tid %u %s reason: %d\n",
80-
sta->sta.addr, tid,
81-
initiator == WLAN_BACK_RECIPIENT ? "recipient" : "inititator",
82-
(int)reason);
78+
pr_debug("Rx BA session stop requested for %pM tid %u %s reason: %d\n",
79+
sta->sta.addr, tid,
80+
initiator == WLAN_BACK_RECIPIENT ? "recipient" : "inititator",
81+
(int)reason);
8382
#endif /* CONFIG_MAC80211_HT_DEBUG */
8483

8584
if (drv_ampdu_action(local, sta->sdata, IEEE80211_AMPDU_RX_STOP,
8685
&sta->sta, tid, NULL, 0))
87-
printk(KERN_DEBUG "HW problem - can not stop rx "
88-
"aggregation for tid %d\n", tid);
86+
pr_debug("HW problem - can not stop rx aggregation for tid %d\n",
87+
tid);
8988

9089
/* check if this is a self generated aggregation halt */
9190
if (initiator == WLAN_BACK_RECIPIENT && tx)
@@ -156,7 +155,7 @@ static void sta_rx_agg_session_timer_expired(unsigned long data)
156155
}
157156

158157
#ifdef CONFIG_MAC80211_HT_DEBUG
159-
printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid);
158+
pr_debug("rx session timer expired on tid %d\n", (u16)*ptid);
160159
#endif
161160
set_bit(*ptid, sta->ampdu_mlme.tid_rx_timer_expired);
162161
ieee80211_queue_work(&sta->local->hw, &sta->ampdu_mlme.work);
@@ -245,8 +244,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
245244

246245
if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) {
247246
#ifdef CONFIG_MAC80211_HT_DEBUG
248-
printk(KERN_DEBUG "Suspend in progress. "
249-
"Denying ADDBA request\n");
247+
pr_debug("Suspend in progress - Denying ADDBA request\n");
250248
#endif
251249
goto end_no_lock;
252250
}
@@ -320,7 +318,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
320318
ret = drv_ampdu_action(local, sta->sdata, IEEE80211_AMPDU_RX_START,
321319
&sta->sta, tid, &start_seq_num, 0);
322320
#ifdef CONFIG_MAC80211_HT_DEBUG
323-
printk(KERN_DEBUG "Rx A-MPDU request on tid %d result %d\n", tid, ret);
321+
pr_debug("Rx A-MPDU request on tid %d result %d\n", tid, ret);
324322
#endif /* CONFIG_MAC80211_HT_DEBUG */
325323

326324
if (ret) {

‎net/mac80211/agg-tx.c‎

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
185185
spin_unlock_bh(&sta->lock);
186186

187187
#ifdef CONFIG_MAC80211_HT_DEBUG
188-
printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
189-
sta->sta.addr, tid);
188+
pr_debug("Tx BA session stop requested for %pM tid %u\n",
189+
sta->sta.addr, tid);
190190
#endif /* CONFIG_MAC80211_HT_DEBUG */
191191

192192
del_timer_sync(&tid_tx->addba_resp_timer);
@@ -254,15 +254,14 @@ static void sta_addba_resp_timer_expired(unsigned long data)
254254
test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) {
255255
rcu_read_unlock();
256256
#ifdef CONFIG_MAC80211_HT_DEBUG
257-
printk(KERN_DEBUG "timer expired on tid %d but we are not "
258-
"(or no longer) expecting addBA response there\n",
259-
tid);
257+
pr_debug("timer expired on tid %d but we are not (or no longer) expecting addBA response there\n",
258+
tid);
260259
#endif
261260
return;
262261
}
263262

264263
#ifdef CONFIG_MAC80211_HT_DEBUG
265-
printk(KERN_DEBUG "addBA response timer expired on tid %d\n", tid);
264+
pr_debug("addBA response timer expired on tid %d\n", tid);
266265
#endif
267266

268267
ieee80211_stop_tx_ba_session(&sta->sta, tid);
@@ -373,8 +372,8 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
373372
&sta->sta, tid, &start_seq_num, 0);
374373
if (ret) {
375374
#ifdef CONFIG_MAC80211_HT_DEBUG
376-
printk(KERN_DEBUG "BA request denied - HW unavailable for"
377-
" tid %d\n", tid);
375+
pr_debug("BA request denied - HW unavailable for tid %d\n",
376+
tid);
378377
#endif
379378
spin_lock_bh(&sta->lock);
380379
ieee80211_agg_splice_packets(sdata, tid_tx, tid);
@@ -389,7 +388,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
389388
/* activate the timer for the recipient's addBA response */
390389
mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL);
391390
#ifdef CONFIG_MAC80211_HT_DEBUG
392-
printk(KERN_DEBUG "activated addBA response timer on tid %d\n", tid);
391+
pr_debug("activated addBA response timer on tid %d\n", tid);
393392
#endif
394393

395394
spin_lock_bh(&sta->lock);
@@ -438,7 +437,7 @@ static void sta_tx_agg_session_timer_expired(unsigned long data)
438437
rcu_read_unlock();
439438

440439
#ifdef CONFIG_MAC80211_HT_DEBUG
441-
printk(KERN_DEBUG "tx session timer expired on tid %d\n", (u16)*ptid);
440+
pr_debug("tx session timer expired on tid %d\n", (u16)*ptid);
442441
#endif
443442

444443
ieee80211_stop_tx_ba_session(&sta->sta, *ptid);
@@ -464,8 +463,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
464463
return -EINVAL;
465464

466465
#ifdef CONFIG_MAC80211_HT_DEBUG
467-
printk(KERN_DEBUG "Open BA session requested for %pM tid %u\n",
468-
pubsta->addr, tid);
466+
pr_debug("Open BA session requested for %pM tid %u\n",
467+
pubsta->addr, tid);
469468
#endif /* CONFIG_MAC80211_HT_DEBUG */
470469

471470
if (sdata->vif.type != NL80211_IFTYPE_STATION &&
@@ -477,8 +476,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
477476

478477
if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) {
479478
#ifdef CONFIG_MAC80211_HT_DEBUG
480-
printk(KERN_DEBUG "BA sessions blocked. "
481-
"Denying BA session request\n");
479+
pr_debug("BA sessions blocked - Denying BA session request\n");
482480
#endif
483481
return -EINVAL;
484482
}
@@ -498,8 +496,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
498496
if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC &&
499497
!sta->sta.ht_cap.ht_supported) {
500498
#ifdef CONFIG_MAC80211_HT_DEBUG
501-
printk(KERN_DEBUG "BA request denied - IBSS STA %pM"
502-
"does not advertise HT support\n", pubsta->addr);
499+
pr_debug("BA request denied - IBSS STA %pM does not advertise HT support\n",
500+
pubsta->addr);
503501
#endif /* CONFIG_MAC80211_HT_DEBUG */
504502
return -EINVAL;
505503
}
@@ -521,10 +519,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
521519
time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] +
522520
HT_AGG_RETRIES_PERIOD)) {
523521
#ifdef CONFIG_MAC80211_HT_DEBUG
524-
printk(KERN_DEBUG "BA request denied - "
525-
"waiting a grace period after %d failed requests "
526-
"on tid %u\n",
527-
sta->ampdu_mlme.addba_req_num[tid], tid);
522+
pr_debug("BA request denied - waiting a grace period after %d failed requests on tid %u\n",
523+
sta->ampdu_mlme.addba_req_num[tid], tid);
528524
#endif /* CONFIG_MAC80211_HT_DEBUG */
529525
ret = -EBUSY;
530526
goto err_unlock_sta;
@@ -534,8 +530,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
534530
/* check if the TID is not in aggregation flow already */
535531
if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) {
536532
#ifdef CONFIG_MAC80211_HT_DEBUG
537-
printk(KERN_DEBUG "BA request denied - session is not "
538-
"idle on tid %u\n", tid);
533+
pr_debug("BA request denied - session is not idle on tid %u\n",
534+
tid);
539535
#endif /* CONFIG_MAC80211_HT_DEBUG */
540536
ret = -EAGAIN;
541537
goto err_unlock_sta;
@@ -592,7 +588,7 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
592588
tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
593589

594590
#ifdef CONFIG_MAC80211_HT_DEBUG
595-
printk(KERN_DEBUG "Aggregation is on for tid %d\n", tid);
591+
pr_debug("Aggregation is on for tid %d\n", tid);
596592
#endif
597593

598594
drv_ampdu_action(local, sta->sdata,
@@ -628,8 +624,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid)
628624

629625
if (tid >= STA_TID_NUM) {
630626
#ifdef CONFIG_MAC80211_HT_DEBUG
631-
printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n",
632-
tid, STA_TID_NUM);
627+
pr_debug("Bad TID value: tid = %d (>= %d)\n", tid, STA_TID_NUM);
633628
#endif
634629
return;
635630
}
@@ -639,7 +634,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid)
639634
if (!sta) {
640635
mutex_unlock(&local->sta_mtx);
641636
#ifdef CONFIG_MAC80211_HT_DEBUG
642-
printk(KERN_DEBUG "Could not find station: %pM\n", ra);
637+
pr_debug("Could not find station: %pM\n", ra);
643638
#endif
644639
return;
645640
}
@@ -649,7 +644,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid)
649644

650645
if (WARN_ON(!tid_tx)) {
651646
#ifdef CONFIG_MAC80211_HT_DEBUG
652-
printk(KERN_DEBUG "addBA was not requested!\n");
647+
pr_debug("addBA was not requested!\n");
653648
#endif
654649
goto unlock;
655650
}
@@ -751,23 +746,21 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid)
751746

752747
if (tid >= STA_TID_NUM) {
753748
#ifdef CONFIG_MAC80211_HT_DEBUG
754-
printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n",
755-
tid, STA_TID_NUM);
749+
pr_debug("Bad TID value: tid = %d (>= %d)\n", tid, STA_TID_NUM);
756750
#endif
757751
return;
758752
}
759753

760754
#ifdef CONFIG_MAC80211_HT_DEBUG
761-
printk(KERN_DEBUG "Stopping Tx BA session for %pM tid %d\n",
762-
ra, tid);
755+
pr_debug("Stopping Tx BA session for %pM tid %d\n", ra, tid);
763756
#endif /* CONFIG_MAC80211_HT_DEBUG */
764757

765758
mutex_lock(&local->sta_mtx);
766759

767760
sta = sta_info_get_bss(sdata, ra);
768761
if (!sta) {
769762
#ifdef CONFIG_MAC80211_HT_DEBUG
770-
printk(KERN_DEBUG "Could not find station: %pM\n", ra);
763+
pr_debug("Could not find station: %pM\n", ra);
771764
#endif
772765
goto unlock;
773766
}
@@ -778,7 +771,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid)
778771

779772
if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) {
780773
#ifdef CONFIG_MAC80211_HT_DEBUG
781-
printk(KERN_DEBUG "unexpected callback to A-MPDU stop\n");
774+
pr_debug("unexpected callback to A-MPDU stop\n");
782775
#endif
783776
goto unlock_sta;
784777
}
@@ -856,15 +849,15 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
856849

857850
if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) {
858851
#ifdef CONFIG_MAC80211_HT_DEBUG
859-
printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid);
852+
pr_debug("wrong addBA response token, tid %d\n", tid);
860853
#endif
861854
goto out;
862855
}
863856

864857
del_timer_sync(&tid_tx->addba_resp_timer);
865858

866859
#ifdef CONFIG_MAC80211_HT_DEBUG
867-
printk(KERN_DEBUG "switched off addBA timer for tid %d\n", tid);
860+
pr_debug("switched off addBA timer for tid %d\n", tid);
868861
#endif
869862

870863
/*
@@ -875,9 +868,8 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
875868
if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) ||
876869
test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) {
877870
#ifdef CONFIG_MAC80211_HT_DEBUG
878-
printk(KERN_DEBUG
879-
"got addBA resp for tid %d but we already gave up\n",
880-
tid);
871+
pr_debug("got addBA resp for tid %d but we already gave up\n",
872+
tid);
881873
#endif
882874
goto out;
883875
}

‎net/mac80211/cfg.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,7 +2679,7 @@ static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
26792679
return -EINVAL;
26802680

26812681
#ifdef CONFIG_MAC80211_VERBOSE_TDLS_DEBUG
2682-
printk(KERN_DEBUG "TDLS mgmt action %d peer %pM\n", action_code, peer);
2682+
pr_debug("TDLS mgmt action %d peer %pM\n", action_code, peer);
26832683
#endif
26842684

26852685
skb = dev_alloc_skb(local->hw.extra_tx_headroom +
@@ -2790,7 +2790,7 @@ static int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
27902790
return -EINVAL;
27912791

27922792
#ifdef CONFIG_MAC80211_VERBOSE_TDLS_DEBUG
2793-
printk(KERN_DEBUG "TDLS oper %d peer %pM\n", oper, peer);
2793+
pr_debug("TDLS oper %d peer %pM\n", oper, peer);
27942794
#endif
27952795

27962796
switch (oper) {

‎net/mac80211/debugfs_netdev.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,6 @@ void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
685685

686686
sprintf(buf, "netdev:%s", sdata->name);
687687
if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
688-
printk(KERN_ERR "mac80211: debugfs: failed to rename debugfs "
688+
pr_err("mac80211: debugfs: failed to rename debugfs "
689689
"dir to %s\n", buf);
690690
}

0 commit comments

Comments
 (0)