Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: clean up debugging

There are a few things that make the logging and
debugging in mac80211 less useful than it should
be right now:
* a lot of messages should be pr_info, not pr_debug
* wholesale use of pr_debug makes it require *both*
Kconfig and dynamic configuration
* there are still a lot of ifdefs
* the style is very inconsistent, sometimes the
sdata->name is printed in front

Clean up everything, introducing new macros and
separating out the station MLME debugging into
a new Kconfig symbol.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+519 -453
-24
include/net/mac80211.h
··· 3842 3842 */ 3843 3843 int ieee80211_ave_rssi(struct ieee80211_vif *vif); 3844 3844 3845 - /* Extra debugging macros */ 3846 - 3847 - #ifdef CONFIG_MAC80211_HT_DEBUG 3848 - #define ht_vdbg(fmt, ...) \ 3849 - pr_debug(fmt, ##__VA_ARGS__) 3850 - #else 3851 - #define ht_vdbg(fmt, ...) \ 3852 - do { \ 3853 - if (0) \ 3854 - pr_debug(fmt, ##__VA_ARGS__); \ 3855 - } while (0) 3856 - #endif 3857 - 3858 - #ifdef CONFIG_MAC80211_IBSS_DEBUG 3859 - #define ibss_vdbg(fmt, ...) \ 3860 - pr_debug(fmt, ##__VA_ARGS__) 3861 - #else 3862 - #define ibss_vdbg(fmt, ...) \ 3863 - do { \ 3864 - if (0) \ 3865 - pr_debug(fmt, ##__VA_ARGS__); \ 3866 - } while (0) 3867 - #endif 3868 - 3869 3845 #endif /* MAC80211_H */
+26 -6
net/mac80211/Kconfig
··· 140 140 141 141 Do not select this option. 142 142 143 + config MAC80211_MLME_DEBUG 144 + bool "Verbose managed MLME output" 145 + depends on MAC80211_DEBUG_MENU 146 + ---help--- 147 + Selecting this option causes mac80211 to print out 148 + debugging messages for the managed-mode MLME. It 149 + should not be selected on production systems as some 150 + of the messages are remotely triggerable. 151 + 152 + Do not select this option. 153 + 154 + config MAC80211_STA_DEBUG 155 + bool "Verbose station debugging" 156 + depends on MAC80211_DEBUG_MENU 157 + ---help--- 158 + Selecting this option causes mac80211 to print out 159 + debugging messages for station addition/removal. 160 + 161 + Do not select this option. 162 + 143 163 config MAC80211_HT_DEBUG 144 164 bool "Verbose HT debugging" 145 165 depends on MAC80211_DEBUG_MENU ··· 183 163 184 164 Do not select this option. 185 165 186 - config MAC80211_VERBOSE_PS_DEBUG 166 + config MAC80211_PS_DEBUG 187 167 bool "Verbose powersave mode debugging" 188 168 depends on MAC80211_DEBUG_MENU 189 169 ---help--- ··· 195 175 196 176 Do not select this option. 197 177 198 - config MAC80211_VERBOSE_MPL_DEBUG 178 + config MAC80211_MPL_DEBUG 199 179 bool "Verbose mesh peer link debugging" 200 180 depends on MAC80211_DEBUG_MENU 201 181 depends on MAC80211_MESH ··· 208 188 209 189 Do not select this option. 210 190 211 - config MAC80211_VERBOSE_MPATH_DEBUG 191 + config MAC80211_MPATH_DEBUG 212 192 bool "Verbose mesh path debugging" 213 193 depends on MAC80211_DEBUG_MENU 214 194 depends on MAC80211_MESH ··· 221 201 222 202 Do not select this option. 223 203 224 - config MAC80211_VERBOSE_MHWMP_DEBUG 204 + config MAC80211_MHWMP_DEBUG 225 205 bool "Verbose mesh HWMP routing debugging" 226 206 depends on MAC80211_DEBUG_MENU 227 207 depends on MAC80211_MESH ··· 234 214 235 215 Do not select this option. 236 216 237 - config MAC80211_VERBOSE_MESH_SYNC_DEBUG 217 + config MAC80211_MESH_SYNC_DEBUG 238 218 bool "Verbose mesh mesh synchronization debugging" 239 219 depends on MAC80211_DEBUG_MENU 240 220 depends on MAC80211_MESH ··· 245 225 246 226 Do not select this option. 247 227 248 - config MAC80211_VERBOSE_TDLS_DEBUG 228 + config MAC80211_TDLS_DEBUG 249 229 bool "Verbose TDLS debugging" 250 230 depends on MAC80211_DEBUG_MENU 251 231 ---help---
+1 -1
net/mac80211/Makefile
··· 58 58 mac80211-$(CONFIG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y) 59 59 mac80211-$(CONFIG_MAC80211_RC_MINSTREL_HT) += $(rc80211_minstrel_ht-y) 60 60 61 - ccflags-y += -D__CHECK_ENDIAN__ 61 + ccflags-y += -D__CHECK_ENDIAN__ -DDEBUG
+17 -17
net/mac80211/agg-rx.c
··· 74 74 75 75 RCU_INIT_POINTER(sta->ampdu_mlme.tid_rx[tid], NULL); 76 76 77 - ht_vdbg("Rx BA session stop requested for %pM tid %u %s reason: %d\n", 78 - sta->sta.addr, tid, 79 - initiator == WLAN_BACK_RECIPIENT ? "recipient" : "inititator", 80 - (int)reason); 77 + ht_dbg(sta->sdata, 78 + "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); 81 82 82 83 if (drv_ampdu_action(local, sta->sdata, IEEE80211_AMPDU_RX_STOP, 83 84 &sta->sta, tid, NULL, 0)) 84 - pr_debug("HW problem - can not stop rx aggregation for tid %d\n", 85 - tid); 85 + sdata_info(sta->sdata, 86 + "HW problem - can not stop rx aggregation for tid %d\n", 87 + tid); 86 88 87 89 /* check if this is a self generated aggregation halt */ 88 90 if (initiator == WLAN_BACK_RECIPIENT && tx) ··· 159 157 } 160 158 rcu_read_unlock(); 161 159 162 - ht_vdbg("rx session timer expired on tid %d\n", (u16)*ptid); 160 + ht_dbg(sta->sdata, "rx session timer expired on tid %d\n", (u16)*ptid); 163 161 164 162 set_bit(*ptid, sta->ampdu_mlme.tid_rx_timer_expired); 165 163 ieee80211_queue_work(&sta->local->hw, &sta->ampdu_mlme.work); ··· 247 245 status = WLAN_STATUS_REQUEST_DECLINED; 248 246 249 247 if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) { 250 - ht_vdbg("Suspend in progress - Denying ADDBA request\n"); 248 + ht_dbg(sta->sdata, "Suspend in progress - Denying ADDBA request\n"); 251 249 goto end_no_lock; 252 250 } 253 251 ··· 259 257 (!(sta->sta.ht_cap.cap & IEEE80211_HT_CAP_DELAY_BA))) || 260 258 (buf_size > IEEE80211_MAX_AMPDU_BUF)) { 261 259 status = WLAN_STATUS_INVALID_QOS_PARAM; 262 - #ifdef CONFIG_MAC80211_HT_DEBUG 263 - net_dbg_ratelimited("AddBA Req with bad params from %pM on tid %u. policy %d, buffer size %d\n", 264 - mgmt->sa, tid, ba_policy, buf_size); 265 - #endif /* CONFIG_MAC80211_HT_DEBUG */ 260 + ht_dbg_ratelimited(sta->sdata, 261 + "AddBA Req with bad params from %pM on tid %u. policy %d, buffer size %d\n", 262 + mgmt->sa, tid, ba_policy, buf_size); 266 263 goto end_no_lock; 267 264 } 268 265 /* determine default buffer size */ ··· 276 275 mutex_lock(&sta->ampdu_mlme.mtx); 277 276 278 277 if (sta->ampdu_mlme.tid_rx[tid]) { 279 - #ifdef CONFIG_MAC80211_HT_DEBUG 280 - net_dbg_ratelimited("unexpected AddBA Req from %pM on tid %u\n", 281 - mgmt->sa, tid); 282 - #endif /* CONFIG_MAC80211_HT_DEBUG */ 278 + ht_dbg_ratelimited(sta->sdata, 279 + "unexpected AddBA Req from %pM on tid %u\n", 280 + mgmt->sa, tid); 283 281 284 282 /* delete existing Rx BA session on the same tid */ 285 283 ___ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_RECIPIENT, ··· 317 317 318 318 ret = drv_ampdu_action(local, sta->sdata, IEEE80211_AMPDU_RX_START, 319 319 &sta->sta, tid, &start_seq_num, 0); 320 - ht_vdbg("Rx A-MPDU request on tid %d result %d\n", tid, ret); 320 + ht_dbg(sta->sdata, "Rx A-MPDU request on tid %d result %d\n", tid, ret); 321 321 if (ret) { 322 322 kfree(tid_agg_rx->reorder_buf); 323 323 kfree(tid_agg_rx->reorder_time);
+41 -31
net/mac80211/agg-tx.c
··· 184 184 185 185 spin_unlock_bh(&sta->lock); 186 186 187 - ht_vdbg("Tx BA session stop requested for %pM tid %u\n", 188 - sta->sta.addr, tid); 187 + ht_dbg(sta->sdata, "Tx BA session stop requested for %pM tid %u\n", 188 + sta->sta.addr, tid); 189 189 190 190 del_timer_sync(&tid_tx->addba_resp_timer); 191 191 del_timer_sync(&tid_tx->session_timer); ··· 251 251 if (!tid_tx || 252 252 test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) { 253 253 rcu_read_unlock(); 254 - ht_vdbg("timer expired on tid %d but we are not (or no longer) expecting addBA response there\n", 255 - tid); 254 + ht_dbg(sta->sdata, 255 + "timer expired on tid %d but we are not (or no longer) expecting addBA response there\n", 256 + tid); 256 257 return; 257 258 } 258 259 259 - ht_vdbg("addBA response timer expired on tid %d\n", tid); 260 + ht_dbg(sta->sdata, "addBA response timer expired on tid %d\n", tid); 260 261 261 262 ieee80211_stop_tx_ba_session(&sta->sta, tid); 262 263 rcu_read_unlock(); ··· 317 316 318 317 ieee80211_stop_queue_agg(sdata, tid); 319 318 320 - if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates" 321 - " from the pending queue\n", tid)) 319 + if (WARN(!tid_tx, 320 + "TID %d gone but expected when splicing aggregates from the pending queue\n", 321 + tid)) 322 322 return; 323 323 324 324 if (!skb_queue_empty(&tid_tx->pending)) { ··· 367 365 ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START, 368 366 &sta->sta, tid, &start_seq_num, 0); 369 367 if (ret) { 370 - ht_vdbg("BA request denied - HW unavailable for tid %d\n", tid); 368 + ht_dbg(sdata, 369 + "BA request denied - HW unavailable for tid %d\n", tid); 371 370 spin_lock_bh(&sta->lock); 372 371 ieee80211_agg_splice_packets(sdata, tid_tx, tid); 373 372 ieee80211_assign_tid_tx(sta, tid, NULL); ··· 381 378 382 379 /* activate the timer for the recipient's addBA response */ 383 380 mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); 384 - ht_vdbg("activated addBA response timer on tid %d\n", tid); 381 + ht_dbg(sdata, "activated addBA response timer on tid %d\n", tid); 385 382 386 383 spin_lock_bh(&sta->lock); 387 384 sta->ampdu_mlme.last_addba_req_time[tid] = jiffies; ··· 428 425 429 426 rcu_read_unlock(); 430 427 431 - ht_vdbg("tx session timer expired on tid %d\n", (u16)*ptid); 428 + ht_dbg(sta->sdata, "tx session timer expired on tid %d\n", (u16)*ptid); 432 429 433 430 ieee80211_stop_tx_ba_session(&sta->sta, *ptid); 434 431 } ··· 452 449 (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW)) 453 450 return -EINVAL; 454 451 455 - ht_vdbg("Open BA session requested for %pM tid %u\n", 456 - pubsta->addr, tid); 452 + ht_dbg(sdata, "Open BA session requested for %pM tid %u\n", 453 + pubsta->addr, tid); 457 454 458 455 if (sdata->vif.type != NL80211_IFTYPE_STATION && 459 456 sdata->vif.type != NL80211_IFTYPE_MESH_POINT && ··· 463 460 return -EINVAL; 464 461 465 462 if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) { 466 - ht_vdbg("BA sessions blocked - Denying BA session request\n"); 463 + ht_dbg(sdata, 464 + "BA sessions blocked - Denying BA session request\n"); 467 465 return -EINVAL; 468 466 } 469 467 ··· 482 478 */ 483 479 if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC && 484 480 !sta->sta.ht_cap.ht_supported) { 485 - ht_vdbg("BA request denied - IBSS STA %pM does not advertise HT support\n", 486 - pubsta->addr); 481 + ht_dbg(sdata, 482 + "BA request denied - IBSS STA %pM does not advertise HT support\n", 483 + pubsta->addr); 487 484 return -EINVAL; 488 485 } 489 486 ··· 504 499 if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES && 505 500 time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] + 506 501 HT_AGG_RETRIES_PERIOD)) { 507 - ht_vdbg("BA request denied - waiting a grace period after %d failed requests on tid %u\n", 508 - sta->ampdu_mlme.addba_req_num[tid], tid); 502 + ht_dbg(sdata, 503 + "BA request denied - waiting a grace period after %d failed requests on tid %u\n", 504 + sta->ampdu_mlme.addba_req_num[tid], tid); 509 505 ret = -EBUSY; 510 506 goto err_unlock_sta; 511 507 } ··· 514 508 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 515 509 /* check if the TID is not in aggregation flow already */ 516 510 if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { 517 - ht_vdbg("BA request denied - session is not idle on tid %u\n", 518 - tid); 511 + ht_dbg(sdata, 512 + "BA request denied - session is not idle on tid %u\n", 513 + tid); 519 514 ret = -EAGAIN; 520 515 goto err_unlock_sta; 521 516 } ··· 571 564 572 565 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 573 566 574 - ht_vdbg("Aggregation is on for tid %d\n", tid); 567 + ht_dbg(sta->sdata, "Aggregation is on for tid %d\n", tid); 575 568 576 569 drv_ampdu_action(local, sta->sdata, 577 570 IEEE80211_AMPDU_TX_OPERATIONAL, ··· 605 598 trace_api_start_tx_ba_cb(sdata, ra, tid); 606 599 607 600 if (tid >= STA_TID_NUM) { 608 - ht_vdbg("Bad TID value: tid = %d (>= %d)\n", tid, STA_TID_NUM); 601 + ht_dbg(sdata, "Bad TID value: tid = %d (>= %d)\n", 602 + tid, STA_TID_NUM); 609 603 return; 610 604 } 611 605 ··· 614 606 sta = sta_info_get_bss(sdata, ra); 615 607 if (!sta) { 616 608 mutex_unlock(&local->sta_mtx); 617 - ht_vdbg("Could not find station: %pM\n", ra); 609 + ht_dbg(sdata, "Could not find station: %pM\n", ra); 618 610 return; 619 611 } 620 612 ··· 622 614 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 623 615 624 616 if (WARN_ON(!tid_tx)) { 625 - ht_vdbg("addBA was not requested!\n"); 617 + ht_dbg(sdata, "addBA was not requested!\n"); 626 618 goto unlock; 627 619 } 628 620 ··· 722 714 trace_api_stop_tx_ba_cb(sdata, ra, tid); 723 715 724 716 if (tid >= STA_TID_NUM) { 725 - ht_vdbg("Bad TID value: tid = %d (>= %d)\n", tid, STA_TID_NUM); 717 + ht_dbg(sdata, "Bad TID value: tid = %d (>= %d)\n", 718 + tid, STA_TID_NUM); 726 719 return; 727 720 } 728 721 729 - ht_vdbg("Stopping Tx BA session for %pM tid %d\n", ra, tid); 722 + ht_dbg(sdata, "Stopping Tx BA session for %pM tid %d\n", ra, tid); 730 723 731 724 mutex_lock(&local->sta_mtx); 732 725 733 726 sta = sta_info_get_bss(sdata, ra); 734 727 if (!sta) { 735 - ht_vdbg("Could not find station: %pM\n", ra); 728 + ht_dbg(sdata, "Could not find station: %pM\n", ra); 736 729 goto unlock; 737 730 } 738 731 ··· 742 733 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 743 734 744 735 if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { 745 - ht_vdbg("unexpected callback to A-MPDU stop\n"); 736 + ht_dbg(sdata, "unexpected callback to A-MPDU stop\n"); 746 737 goto unlock_sta; 747 738 } 748 739 ··· 818 809 goto out; 819 810 820 811 if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) { 821 - ht_vdbg("wrong addBA response token, tid %d\n", tid); 812 + ht_dbg(sta->sdata, "wrong addBA response token, tid %d\n", tid); 822 813 goto out; 823 814 } 824 815 825 816 del_timer_sync(&tid_tx->addba_resp_timer); 826 817 827 - ht_vdbg("switched off addBA timer for tid %d\n", tid); 818 + ht_dbg(sta->sdata, "switched off addBA timer for tid %d\n", tid); 828 819 829 820 /* 830 821 * addba_resp_timer may have fired before we got here, and ··· 833 824 */ 834 825 if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || 835 826 test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { 836 - ht_vdbg("got addBA resp for tid %d but we already gave up\n", 837 - tid); 827 + ht_dbg(sta->sdata, 828 + "got addBA resp for tid %d but we already gave up\n", 829 + tid); 838 830 goto out; 839 831 } 840 832
+3 -6
net/mac80211/cfg.c
··· 2771 2771 !sdata->u.mgd.associated) 2772 2772 return -EINVAL; 2773 2773 2774 - #ifdef CONFIG_MAC80211_VERBOSE_TDLS_DEBUG 2775 - pr_debug("TDLS mgmt action %d peer %pM\n", action_code, peer); 2776 - #endif 2774 + tdls_dbg(sdata, "TDLS mgmt action %d peer %pM\n", 2775 + action_code, peer); 2777 2776 2778 2777 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 2779 2778 max(sizeof(struct ieee80211_mgmt), ··· 2881 2882 if (sdata->vif.type != NL80211_IFTYPE_STATION) 2882 2883 return -EINVAL; 2883 2884 2884 - #ifdef CONFIG_MAC80211_VERBOSE_TDLS_DEBUG 2885 - pr_debug("TDLS oper %d peer %pM\n", oper, peer); 2886 - #endif 2885 + tdls_dbg(sdata, "TDLS oper %d peer %pM\n", oper, peer); 2887 2886 2888 2887 switch (oper) { 2889 2888 case NL80211_TDLS_ENABLE_LINK:
+152
net/mac80211/debug.h
··· 1 + #ifndef __MAC80211_DEBUG_H 2 + #define __MAC80211_DEBUG_H 3 + 4 + #ifdef CONFIG_MAC80211_IBSS_DEBUG 5 + #define MAC80211_IBSS_DEBUG 1 6 + #else 7 + #define MAC80211_IBSS_DEBUG 0 8 + #endif 9 + 10 + #ifdef CONFIG_MAC80211_PS_DEBUG 11 + #define MAC80211_PS_DEBUG 1 12 + #else 13 + #define MAC80211_PS_DEBUG 0 14 + #endif 15 + 16 + #ifdef CONFIG_MAC80211_HT_DEBUG 17 + #define MAC80211_HT_DEBUG 1 18 + #else 19 + #define MAC80211_HT_DEBUG 0 20 + #endif 21 + 22 + #ifdef CONFIG_MAC80211_MPL_DEBUG 23 + #define MAC80211_MPL_DEBUG 1 24 + #else 25 + #define MAC80211_MPL_DEBUG 0 26 + #endif 27 + 28 + #ifdef CONFIG_MAC80211_MPATH_DEBUG 29 + #define MAC80211_MPATH_DEBUG 1 30 + #else 31 + #define MAC80211_MPATH_DEBUG 0 32 + #endif 33 + 34 + #ifdef CONFIG_MAC80211_MHWMP_DEBUG 35 + #define MAC80211_MHWMP_DEBUG 1 36 + #else 37 + #define MAC80211_MHWMP_DEBUG 0 38 + #endif 39 + 40 + #ifdef CONFIG_MAC80211_MESH_SYNC_DEBUG 41 + #define MAC80211_MESH_SYNC_DEBUG 1 42 + #else 43 + #define MAC80211_MESH_SYNC_DEBUG 0 44 + #endif 45 + 46 + #ifdef CONFIG_MAC80211_TDLS_DEBUG 47 + #define MAC80211_TDLS_DEBUG 1 48 + #else 49 + #define MAC80211_TDLS_DEBUG 0 50 + #endif 51 + 52 + #ifdef CONFIG_MAC80211_STA_DEBUG 53 + #define MAC80211_STA_DEBUG 1 54 + #else 55 + #define MAC80211_STA_DEBUG 0 56 + #endif 57 + 58 + #ifdef CONFIG_MAC80211_MLME_DEBUG 59 + #define MAC80211_MLME_DEBUG 1 60 + #else 61 + #define MAC80211_MLME_DEBUG 0 62 + #endif 63 + 64 + #define _sdata_info(sdata, fmt, ...) \ 65 + do { \ 66 + pr_info("%s: " fmt, \ 67 + (sdata)->name, ##__VA_ARGS__); \ 68 + } while (0) 69 + 70 + #define _sdata_dbg(print, sdata, fmt, ...) \ 71 + do { \ 72 + if (print) \ 73 + pr_debug("%s: " fmt, \ 74 + (sdata)->name, ##__VA_ARGS__); \ 75 + } while (0) 76 + 77 + #define _sdata_err(sdata, fmt, ...) \ 78 + do { \ 79 + pr_err("%s: " fmt, \ 80 + (sdata)->name, ##__VA_ARGS__); \ 81 + } while (0) 82 + 83 + #define _wiphy_dbg(print, wiphy, fmt, ...) \ 84 + do { \ 85 + if (print) \ 86 + wiphy_dbg((wiphy), fmt, ##__VA_ARGS__); \ 87 + } while (0) 88 + 89 + #define sdata_info(sdata, fmt, ...) \ 90 + _sdata_info(sdata, fmt, ##__VA_ARGS__) 91 + #define sdata_err(sdata, fmt, ...) \ 92 + _sdata_err(sdata, fmt, ##__VA_ARGS__) 93 + #define sdata_dbg(sdata, fmt, ...) \ 94 + _sdata_dbg(1, sdata, fmt, ##__VA_ARGS__) 95 + 96 + #define ht_dbg(sdata, fmt, ...) \ 97 + _sdata_dbg(MAC80211_HT_DEBUG, \ 98 + sdata, fmt, ##__VA_ARGS__) 99 + 100 + #define ht_dbg_ratelimited(sdata, fmt, ...) \ 101 + _sdata_dbg(MAC80211_HT_DEBUG && net_ratelimit(), \ 102 + sdata, fmt, ##__VA_ARGS__) 103 + 104 + #define ibss_dbg(sdata, fmt, ...) \ 105 + _sdata_dbg(MAC80211_IBSS_DEBUG, \ 106 + sdata, fmt, ##__VA_ARGS__) 107 + 108 + #define ps_dbg(sdata, fmt, ...) \ 109 + _sdata_dbg(MAC80211_PS_DEBUG, \ 110 + sdata, fmt, ##__VA_ARGS__) 111 + 112 + #define ps_dbg_hw(hw, fmt, ...) \ 113 + _wiphy_dbg(MAC80211_PS_DEBUG, \ 114 + (hw)->wiphy, fmt, ##__VA_ARGS__) 115 + 116 + #define ps_dbg_ratelimited(sdata, fmt, ...) \ 117 + _sdata_dbg(MAC80211_PS_DEBUG && net_ratelimit(), \ 118 + sdata, fmt, ##__VA_ARGS__) 119 + 120 + #define mpl_dbg(sdata, fmt, ...) \ 121 + _sdata_dbg(MAC80211_MPL_DEBUG, \ 122 + sdata, fmt, ##__VA_ARGS__) 123 + 124 + #define mpath_dbg(sdata, fmt, ...) \ 125 + _sdata_dbg(MAC80211_MPATH_DEBUG, \ 126 + sdata, fmt, ##__VA_ARGS__) 127 + 128 + #define mhwmp_dbg(sdata, fmt, ...) \ 129 + _sdata_dbg(MAC80211_MHWMP_DEBUG, \ 130 + sdata, fmt, ##__VA_ARGS__) 131 + 132 + #define msync_dbg(sdata, fmt, ...) \ 133 + _sdata_dbg(MAC80211_MESH_SYNC_DEBUG, \ 134 + sdata, fmt, ##__VA_ARGS__) 135 + 136 + #define tdls_dbg(sdata, fmt, ...) \ 137 + _sdata_dbg(MAC80211_TDLS_DEBUG, \ 138 + sdata, fmt, ##__VA_ARGS__) 139 + 140 + #define sta_dbg(sdata, fmt, ...) \ 141 + _sdata_dbg(MAC80211_STA_DEBUG, \ 142 + sdata, fmt, ##__VA_ARGS__) 143 + 144 + #define mlme_dbg(sdata, fmt, ...) \ 145 + _sdata_dbg(MAC80211_MLME_DEBUG, \ 146 + sdata, fmt, ##__VA_ARGS__) 147 + 148 + #define mlme_dbg_ratelimited(sdata, fmt, ...) \ 149 + _sdata_dbg(MAC80211_MLME_DEBUG && net_ratelimit(), \ 150 + sdata, fmt, ##__VA_ARGS__) 151 + 152 + #endif /* __MAC80211_DEBUG_H */
+3 -2
net/mac80211/debugfs_netdev.c
··· 695 695 696 696 sprintf(buf, "netdev:%s", sdata->name); 697 697 if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf)) 698 - pr_err("mac80211: debugfs: failed to rename debugfs " 699 - "dir to %s\n", buf); 698 + sdata_err(sdata, 699 + "debugfs: failed to rename debugfs dir to %s\n", 700 + buf); 700 701 }
+4 -6
net/mac80211/ht.c
··· 305 305 tid = (params & IEEE80211_DELBA_PARAM_TID_MASK) >> 12; 306 306 initiator = (params & IEEE80211_DELBA_PARAM_INITIATOR_MASK) >> 11; 307 307 308 - #ifdef CONFIG_MAC80211_HT_DEBUG 309 - net_dbg_ratelimited("delba from %pM (%s) tid %d reason code %d\n", 310 - mgmt->sa, initiator ? "initiator" : "recipient", 311 - tid, 312 - le16_to_cpu(mgmt->u.action.u.delba.reason_code)); 313 - #endif /* CONFIG_MAC80211_HT_DEBUG */ 308 + ht_dbg_ratelimited(sdata, "delba from %pM (%s) tid %d reason code %d\n", 309 + mgmt->sa, initiator ? "initiator" : "recipient", 310 + tid, 311 + le16_to_cpu(mgmt->u.action.u.delba.reason_code)); 314 312 315 313 if (initiator == WLAN_BACK_INITIATOR) 316 314 __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_INITIATOR, 0,
+43 -46
net/mac80211/ibss.c
··· 261 261 262 262 memcpy(addr, sta->sta.addr, ETH_ALEN); 263 263 264 - #ifdef CONFIG_MAC80211_IBSS_DEBUG 265 - wiphy_debug(sdata->local->hw.wiphy, 266 - "Adding new IBSS station %pM (dev=%s)\n", 267 - addr, sdata->name); 268 - #endif 264 + ibss_dbg(sdata, "Adding new IBSS station %pM\n", addr); 269 265 270 266 sta_info_pre_move_state(sta, IEEE80211_STA_AUTH); 271 267 sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC); ··· 276 280 if (sta_info_insert_rcu(sta)) 277 281 return sta_info_get(sdata, addr); 278 282 if (auth && !sdata->u.ibss.auth_frame_registrations) { 279 - ibss_vdbg("TX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=1)\n", 280 - sdata->vif.addr, sdata->u.ibss.bssid, addr); 283 + ibss_dbg(sdata, 284 + "TX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=1)\n", 285 + sdata->vif.addr, sdata->u.ibss.bssid, addr); 281 286 ieee80211_send_auth(sdata, 1, WLAN_AUTH_OPEN, NULL, 0, 282 287 addr, sdata->u.ibss.bssid, NULL, 0, 0); 283 288 } ··· 301 304 * allow new one to be added. 302 305 */ 303 306 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { 304 - net_dbg_ratelimited("%s: No room for a new IBSS STA entry %pM\n", 307 + net_info_ratelimited("%s: No room for a new IBSS STA entry %pM\n", 305 308 sdata->name, addr); 306 309 rcu_read_lock(); 307 310 return NULL; ··· 348 351 349 352 if (auth_alg != WLAN_AUTH_OPEN || auth_transaction != 1) 350 353 return; 351 - ibss_vdbg("%s: RX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=%d)\n", 352 - sdata->name, mgmt->sa, mgmt->da, mgmt->bssid, 353 - auth_transaction); 354 + ibss_dbg(sdata, 355 + "RX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=%d)\n", 356 + mgmt->sa, mgmt->da, mgmt->bssid, auth_transaction); 354 357 sta_info_destroy_addr(sdata, mgmt->sa); 355 358 ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, 0, false); 356 359 rcu_read_unlock(); ··· 413 416 ieee80211_mandatory_rates(local, band); 414 417 415 418 if (sta->sta.supp_rates[band] != prev_rates) { 416 - ibss_vdbg("%s: updated supp_rates set for %pM based on beacon/probe_resp (0x%x -> 0x%x)\n", 417 - sdata->name, sta->sta.addr, 418 - prev_rates, 419 - sta->sta.supp_rates[band]); 419 + ibss_dbg(sdata, 420 + "updated supp_rates set for %pM based on beacon/probe_resp (0x%x -> 0x%x)\n", 421 + sta->sta.addr, prev_rates, 422 + sta->sta.supp_rates[band]); 420 423 rates_updated = true; 421 424 } 422 425 } else { ··· 531 534 rx_timestamp = drv_get_tsf(local, sdata); 532 535 } 533 536 534 - ibss_vdbg("RX beacon SA=%pM BSSID=%pM TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n", 535 - mgmt->sa, mgmt->bssid, 536 - (unsigned long long)rx_timestamp, 537 - (unsigned long long)beacon_timestamp, 538 - (unsigned long long)(rx_timestamp - beacon_timestamp), 539 - jiffies); 537 + ibss_dbg(sdata, 538 + "RX beacon SA=%pM BSSID=%pM TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n", 539 + mgmt->sa, mgmt->bssid, 540 + (unsigned long long)rx_timestamp, 541 + (unsigned long long)beacon_timestamp, 542 + (unsigned long long)(rx_timestamp - beacon_timestamp), 543 + jiffies); 540 544 541 545 if (beacon_timestamp > rx_timestamp) { 542 - ibss_vdbg("%s: beacon TSF higher than local TSF - IBSS merge with BSSID %pM\n", 543 - sdata->name, mgmt->bssid); 546 + ibss_dbg(sdata, 547 + "beacon TSF higher than local TSF - IBSS merge with BSSID %pM\n", 548 + mgmt->bssid); 544 549 ieee80211_sta_join_ibss(sdata, bss); 545 550 supp_rates = ieee80211_sta_get_rates(local, elems, band, NULL); 546 551 ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, ··· 568 569 * allow new one to be added. 569 570 */ 570 571 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { 571 - net_dbg_ratelimited("%s: No room for a new IBSS STA entry %pM\n", 572 + net_info_ratelimited("%s: No room for a new IBSS STA entry %pM\n", 572 573 sdata->name, addr); 573 574 return; 574 575 } ··· 644 645 if (ifibss->fixed_channel) 645 646 return; 646 647 647 - pr_debug("%s: No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)\n", 648 - sdata->name); 648 + sdata_info(sdata, 649 + "No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)\n"); 649 650 650 651 ieee80211_request_internal_scan(sdata, 651 652 ifibss->ssid, ifibss->ssid_len, NULL); ··· 673 674 bssid[0] |= 0x02; 674 675 } 675 676 676 - pr_debug("%s: Creating new IBSS network, BSSID %pM\n", 677 - sdata->name, bssid); 677 + sdata_info(sdata, "Creating new IBSS network, BSSID %pM\n", bssid); 678 678 679 679 capability = WLAN_CAPABILITY_IBSS; 680 680 ··· 704 706 lockdep_assert_held(&ifibss->mtx); 705 707 706 708 active_ibss = ieee80211_sta_active_ibss(sdata); 707 - ibss_vdbg("%s: sta_find_ibss (active_ibss=%d)\n", 708 - sdata->name, active_ibss); 709 + ibss_dbg(sdata, "sta_find_ibss (active_ibss=%d)\n", active_ibss); 709 710 710 711 if (active_ibss) 711 712 return; ··· 727 730 struct ieee80211_bss *bss; 728 731 729 732 bss = (void *)cbss->priv; 730 - ibss_vdbg(" sta_find_ibss: selected %pM current %pM\n", 731 - cbss->bssid, ifibss->bssid); 732 - pr_debug("%s: Selected IBSS BSSID %pM based on configured SSID\n", 733 - sdata->name, cbss->bssid); 733 + ibss_dbg(sdata, 734 + "sta_find_ibss: selected %pM current %pM\n", 735 + cbss->bssid, ifibss->bssid); 736 + sdata_info(sdata, 737 + "Selected IBSS BSSID %pM based on configured SSID\n", 738 + cbss->bssid); 734 739 735 740 ieee80211_sta_join_ibss(sdata, bss); 736 741 ieee80211_rx_bss_put(local, bss); 737 742 return; 738 743 } 739 744 740 - ibss_vdbg(" did not try to join ibss\n"); 745 + ibss_dbg(sdata, "sta_find_ibss: did not try to join ibss\n"); 741 746 742 747 /* Selected IBSS not found in current scan results - try to scan */ 743 748 if (time_after(jiffies, ifibss->last_scan_completed + 744 749 IEEE80211_SCAN_INTERVAL)) { 745 - pr_debug("%s: Trigger new scan to find an IBSS to join\n", 746 - sdata->name); 750 + sdata_info(sdata, "Trigger new scan to find an IBSS to join\n"); 747 751 748 752 ieee80211_request_internal_scan(sdata, 749 753 ifibss->ssid, ifibss->ssid_len, ··· 758 760 ieee80211_sta_create_ibss(sdata); 759 761 return; 760 762 } 761 - pr_debug("%s: IBSS not allowed on %d MHz\n", 762 - sdata->name, 763 - local->hw.conf.channel->center_freq); 763 + sdata_info(sdata, "IBSS not allowed on %d MHz\n", 764 + local->hw.conf.channel->center_freq); 764 765 765 766 /* No IBSS found - decrease scan interval and continue 766 767 * scanning. */ ··· 794 797 795 798 tx_last_beacon = drv_tx_last_beacon(local); 796 799 797 - ibss_vdbg("%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM (tx_last_beacon=%d)\n", 798 - sdata->name, mgmt->sa, mgmt->da, 799 - mgmt->bssid, tx_last_beacon); 800 + ibss_dbg(sdata, 801 + "RX ProbeReq SA=%pM DA=%pM BSSID=%pM (tx_last_beacon=%d)\n", 802 + mgmt->sa, mgmt->da, mgmt->bssid, tx_last_beacon); 800 803 801 804 if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da)) 802 805 return; ··· 809 812 pos = mgmt->u.probe_req.variable; 810 813 if (pos[0] != WLAN_EID_SSID || 811 814 pos + 2 + pos[1] > end) { 812 - ibss_vdbg("%s: Invalid SSID IE in ProbeReq from %pM\n", 813 - sdata->name, mgmt->sa); 815 + ibss_dbg(sdata, "Invalid SSID IE in ProbeReq from %pM\n", 816 + mgmt->sa); 814 817 return; 815 818 } 816 819 if (pos[1] != 0 && ··· 827 830 828 831 resp = (struct ieee80211_mgmt *) skb->data; 829 832 memcpy(resp->da, mgmt->sa, ETH_ALEN); 830 - ibss_vdbg("%s: Sending ProbeResp to %pM\n", sdata->name, resp->da); 833 + ibss_dbg(sdata, "Sending ProbeResp to %pM\n", resp->da); 831 834 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 832 835 ieee80211_tx_skb(sdata, skb); 833 836 }
+1
net/mac80211/ieee80211_i.h
··· 30 30 #include <net/mac80211.h> 31 31 #include "key.h" 32 32 #include "sta_info.h" 33 + #include "debug.h" 33 34 34 35 struct ieee80211_local; 35 36
+1 -12
net/mac80211/iface.c
··· 57 57 return -EINVAL; 58 58 } 59 59 60 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 61 - pr_debug("%s: setting MTU %d\n", dev->name, new_mtu); 62 - #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 63 60 dev->mtu = new_mtu; 64 61 return 0; 65 62 } ··· 1220 1223 1221 1224 if (__ffs64(mask) + hweight64(mask) != fls64(mask)) { 1222 1225 /* not a contiguous mask ... not handled now! */ 1223 - pr_debug("not contiguous\n"); 1226 + pr_info("not contiguous\n"); 1224 1227 break; 1225 1228 } 1226 1229 ··· 1411 1414 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE)) 1412 1415 return 0; 1413 1416 1414 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1415 - wiphy_debug(local->hw.wiphy, "device no longer idle - %s\n", reason); 1416 - #endif 1417 - 1418 1417 local->hw.conf.flags &= ~IEEE80211_CONF_IDLE; 1419 1418 return IEEE80211_CONF_CHANGE_IDLE; 1420 1419 } ··· 1419 1426 { 1420 1427 if (local->hw.conf.flags & IEEE80211_CONF_IDLE) 1421 1428 return 0; 1422 - 1423 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1424 - wiphy_debug(local->hw.wiphy, "device now idle\n"); 1425 - #endif 1426 1429 1427 1430 drv_flush(local, false); 1428 1431
+2 -2
net/mac80211/key.c
··· 139 139 } 140 140 141 141 if (ret != -ENOSPC && ret != -EOPNOTSUPP) 142 - wiphy_err(key->local->hw.wiphy, 142 + sdata_err(sdata, 143 143 "failed to set key (%d, %pM) to hardware (%d)\n", 144 144 key->conf.keyidx, 145 145 sta ? sta->sta.addr : bcast_addr, ret); ··· 186 186 sta ? &sta->sta : NULL, &key->conf); 187 187 188 188 if (ret) 189 - wiphy_err(key->local->hw.wiphy, 189 + sdata_err(sdata, 190 190 "failed to remove key (%d, %pM) from hardware (%d)\n", 191 191 key->conf.keyidx, 192 192 sta ? sta->sta.addr : bcast_addr, ret);
-4
net/mac80211/mesh.c
··· 523 523 { 524 524 bool free_plinks; 525 525 526 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 527 - pr_debug("%s: running mesh housekeeping\n", sdata->name); 528 - #endif 529 - 530 526 ieee80211_sta_expire(sdata, IEEE80211_MESH_PEER_INACTIVITY_LIMIT); 531 527 mesh_path_expire(sdata); 532 528
+19 -23
net/mac80211/mesh_hwmp.c
··· 13 13 #include "wme.h" 14 14 #include "mesh.h" 15 15 16 - #ifdef CONFIG_MAC80211_VERBOSE_MHWMP_DEBUG 17 - #define mhwmp_dbg(fmt, args...) \ 18 - pr_debug("Mesh HWMP (%s): " fmt "\n", sdata->name, ##args) 19 - #else 20 - #define mhwmp_dbg(fmt, args...) do { (void)(0); } while (0) 21 - #endif 22 - 23 16 #define TEST_FRAME_LEN 8192 24 17 #define MAX_METRIC 0xffffffff 25 18 #define ARITH_SHIFT 8 ··· 137 144 138 145 switch (action) { 139 146 case MPATH_PREQ: 140 - mhwmp_dbg("sending PREQ to %pM", target); 147 + mhwmp_dbg(sdata, "sending PREQ to %pM\n", target); 141 148 ie_len = 37; 142 149 pos = skb_put(skb, 2 + ie_len); 143 150 *pos++ = WLAN_EID_PREQ; 144 151 break; 145 152 case MPATH_PREP: 146 - mhwmp_dbg("sending PREP to %pM", target); 153 + mhwmp_dbg(sdata, "sending PREP to %pM\n", target); 147 154 ie_len = 31; 148 155 pos = skb_put(skb, 2 + ie_len); 149 156 *pos++ = WLAN_EID_PREP; 150 157 break; 151 158 case MPATH_RANN: 152 - mhwmp_dbg("sending RANN from %pM", orig_addr); 159 + mhwmp_dbg(sdata, "sending RANN from %pM\n", orig_addr); 153 160 ie_len = sizeof(struct ieee80211_rann_ie); 154 161 pos = skb_put(skb, 2 + ie_len); 155 162 *pos++ = WLAN_EID_RANN; ··· 528 535 flags = PREQ_IE_FLAGS(preq_elem); 529 536 root_is_gate = !!(flags & RANN_FLAG_IS_GATE); 530 537 531 - mhwmp_dbg("received PREQ from %pM", orig_addr); 538 + mhwmp_dbg(sdata, "received PREQ from %pM\n", orig_addr); 532 539 533 540 if (ether_addr_equal(target_addr, sdata->vif.addr)) { 534 - mhwmp_dbg("PREQ is for us"); 541 + mhwmp_dbg(sdata, "PREQ is for us\n"); 535 542 forward = false; 536 543 reply = true; 537 544 metric = 0; ··· 583 590 lifetime = PREQ_IE_LIFETIME(preq_elem); 584 591 ttl = ifmsh->mshcfg.element_ttl; 585 592 if (ttl != 0) { 586 - mhwmp_dbg("replying to the PREQ"); 593 + mhwmp_dbg(sdata, "replying to the PREQ\n"); 587 594 mesh_path_sel_frame_tx(MPATH_PREP, 0, orig_addr, 588 595 cpu_to_le32(orig_sn), 0, target_addr, 589 596 cpu_to_le32(target_sn), mgmt->sa, 0, ttl, ··· 604 611 ifmsh->mshstats.dropped_frames_ttl++; 605 612 return; 606 613 } 607 - mhwmp_dbg("forwarding the PREQ from %pM", orig_addr); 614 + mhwmp_dbg(sdata, "forwarding the PREQ from %pM\n", orig_addr); 608 615 --ttl; 609 616 preq_id = PREQ_IE_PREQ_ID(preq_elem); 610 617 hopcount = PREQ_IE_HOPCOUNT(preq_elem) + 1; ··· 651 658 u8 next_hop[ETH_ALEN]; 652 659 u32 target_sn, orig_sn, lifetime; 653 660 654 - mhwmp_dbg("received PREP from %pM", PREP_IE_ORIG_ADDR(prep_elem)); 661 + mhwmp_dbg(sdata, "received PREP from %pM\n", 662 + PREP_IE_ORIG_ADDR(prep_elem)); 655 663 656 664 orig_addr = PREP_IE_ORIG_ADDR(prep_elem); 657 665 if (ether_addr_equal(orig_addr, sdata->vif.addr)) ··· 778 784 if (ether_addr_equal(orig_addr, sdata->vif.addr)) 779 785 return; 780 786 781 - mhwmp_dbg("received RANN from %pM via neighbour %pM (is_gate=%d)", 782 - orig_addr, mgmt->sa, root_is_gate); 787 + mhwmp_dbg(sdata, 788 + "received RANN from %pM via neighbour %pM (is_gate=%d)\n", 789 + orig_addr, mgmt->sa, root_is_gate); 783 790 784 791 rcu_read_lock(); 785 792 sta = sta_info_get(sdata, mgmt->sa); ··· 813 818 root_path_confirmation_jiffies(sdata)) || 814 819 time_before(jiffies, mpath->last_preq_to_root))) && 815 820 !(mpath->flags & MESH_PATH_FIXED) && (ttl != 0)) { 816 - mhwmp_dbg("%s time to refresh root mpath %pM", sdata->name, 817 - orig_addr); 821 + mhwmp_dbg(sdata, 822 + "time to refresh root mpath %pM\n", 823 + orig_addr); 818 824 mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH); 819 825 mpath->last_preq_to_root = jiffies; 820 826 } ··· 922 926 923 927 preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC); 924 928 if (!preq_node) { 925 - mhwmp_dbg("could not allocate PREQ node"); 929 + mhwmp_dbg(sdata, "could not allocate PREQ node\n"); 926 930 return; 927 931 } 928 932 ··· 931 935 spin_unlock_bh(&ifmsh->mesh_preq_queue_lock); 932 936 kfree(preq_node); 933 937 if (printk_ratelimit()) 934 - mhwmp_dbg("PREQ node queue full"); 938 + mhwmp_dbg(sdata, "PREQ node queue full\n"); 935 939 return; 936 940 } 937 941 ··· 1179 1183 if (!mpath->is_gate && mesh_gate_num(sdata) > 0) { 1180 1184 ret = mesh_path_send_to_gates(mpath); 1181 1185 if (ret) 1182 - mhwmp_dbg("no gate was reachable"); 1186 + mhwmp_dbg(sdata, "no gate was reachable\n"); 1183 1187 } else 1184 1188 mesh_path_flush_pending(mpath); 1185 1189 } ··· 1217 1221 0, cpu_to_le32(ifmsh->preq_id++), sdata); 1218 1222 break; 1219 1223 default: 1220 - mhwmp_dbg("Proactive mechanism not supported"); 1224 + mhwmp_dbg(sdata, "Proactive mechanism not supported\n"); 1221 1225 return; 1222 1226 } 1223 1227 }
+12 -18
net/mac80211/mesh_pathtbl.c
··· 18 18 #include "ieee80211_i.h" 19 19 #include "mesh.h" 20 20 21 - #ifdef CONFIG_MAC80211_VERBOSE_MPATH_DEBUG 22 - #define mpath_dbg(fmt, args...) pr_debug(fmt, ##args) 23 - #else 24 - #define mpath_dbg(fmt, args...) do { (void)(0); } while (0) 25 - #endif 26 - 27 21 /* There will be initially 2^INIT_PATHS_SIZE_ORDER buckets */ 28 22 #define INIT_PATHS_SIZE_ORDER 2 29 23 ··· 316 322 317 323 spin_lock_irqsave(&gate_mpath->frame_queue.lock, flags); 318 324 skb_queue_splice(&gateq, &gate_mpath->frame_queue); 319 - mpath_dbg("Mpath queue for gate %pM has %d frames\n", 320 - gate_mpath->dst, 321 - skb_queue_len(&gate_mpath->frame_queue)); 325 + mpath_dbg(gate_mpath->sdata, "Mpath queue for gate %pM has %d frames\n", 326 + gate_mpath->dst, skb_queue_len(&gate_mpath->frame_queue)); 322 327 spin_unlock_irqrestore(&gate_mpath->frame_queue.lock, flags); 323 328 324 329 if (!copy) ··· 439 446 hlist_add_head_rcu(&new_gate->list, tbl->known_gates); 440 447 spin_unlock_bh(&tbl->gates_lock); 441 448 rcu_read_unlock(); 442 - mpath_dbg("Mesh path (%s): Recorded new gate: %pM. %d known gates\n", 443 - mpath->sdata->name, mpath->dst, 444 - mpath->sdata->u.mesh.num_gates); 449 + mpath_dbg(mpath->sdata, 450 + "Mesh path: Recorded new gate: %pM. %d known gates\n", 451 + mpath->dst, mpath->sdata->u.mesh.num_gates); 445 452 return 0; 446 453 err_rcu: 447 454 rcu_read_unlock(); ··· 470 477 spin_unlock_bh(&tbl->gates_lock); 471 478 mpath->sdata->u.mesh.num_gates--; 472 479 mpath->is_gate = false; 473 - mpath_dbg("Mesh path (%s): Deleted gate: %pM. " 474 - "%d known gates\n", mpath->sdata->name, 480 + mpath_dbg(mpath->sdata, 481 + "Mesh path: Deleted gate: %pM. %d known gates\n", 475 482 mpath->dst, mpath->sdata->u.mesh.num_gates); 476 483 break; 477 484 } ··· 939 946 continue; 940 947 941 948 if (gate->mpath->flags & MESH_PATH_ACTIVE) { 942 - mpath_dbg("Forwarding to %pM\n", gate->mpath->dst); 949 + mpath_dbg(sdata, "Forwarding to %pM\n", gate->mpath->dst); 943 950 mesh_path_move_to_queue(gate->mpath, from_mpath, copy); 944 951 from_mpath = gate->mpath; 945 952 copy = true; 946 953 } else { 947 - mpath_dbg("Not forwarding %p\n", gate->mpath); 948 - mpath_dbg("flags %x\n", gate->mpath->flags); 954 + mpath_dbg(sdata, 955 + "Not forwarding %p (flags %#x)\n", 956 + gate->mpath, gate->mpath->flags); 949 957 } 950 958 } 951 959 952 960 hlist_for_each_entry_rcu(gate, n, known_gates, list) 953 961 if (gate->mpath->sdata == sdata) { 954 - mpath_dbg("Sending to %pM\n", gate->mpath->dst); 962 + mpath_dbg(sdata, "Sending to %pM\n", gate->mpath->dst); 955 963 mesh_path_tx_pending(gate->mpath); 956 964 } 957 965
+32 -29
net/mac80211/mesh_plink.c
··· 13 13 #include "rate.h" 14 14 #include "mesh.h" 15 15 16 - #ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG 17 - #define mpl_dbg(fmt, args...) pr_debug(fmt, ##args) 18 - #else 19 - #define mpl_dbg(fmt, args...) do { (void)(0); } while (0) 20 - #endif 21 - 22 16 #define PLINK_GET_LLID(p) (p + 2) 23 17 #define PLINK_GET_PLID(p) (p + 4) 24 18 ··· 128 134 129 135 switch (sta->ch_type) { 130 136 case NL80211_CHAN_NO_HT: 131 - mpl_dbg("mesh_plink %pM: nonHT sta (%pM) is present", 137 + mpl_dbg(sdata, 138 + "mesh_plink %pM: nonHT sta (%pM) is present\n", 132 139 sdata->vif.addr, sta->sta.addr); 133 140 non_ht_sta = true; 134 141 goto out; 135 142 case NL80211_CHAN_HT20: 136 - mpl_dbg("mesh_plink %pM: HT20 sta (%pM) is present", 143 + mpl_dbg(sdata, 144 + "mesh_plink %pM: HT20 sta (%pM) is present\n", 137 145 sdata->vif.addr, sta->sta.addr); 138 146 ht20_sta = true; 139 147 default: ··· 156 160 sdata->vif.bss_conf.ht_operation_mode = ht_opmode; 157 161 sdata->u.mesh.mshcfg.ht_opmode = ht_opmode; 158 162 changed = BSS_CHANGED_HT; 159 - mpl_dbg("mesh_plink %pM: protection mode changed to %d", 163 + mpl_dbg(sdata, 164 + "mesh_plink %pM: protection mode changed to %d\n", 160 165 sdata->vif.addr, ht_opmode); 161 166 } 162 167 ··· 434 437 spin_unlock_bh(&sta->lock); 435 438 return; 436 439 } 437 - mpl_dbg("Mesh plink timer for %pM fired on state %d\n", 440 + mpl_dbg(sta->sdata, 441 + "Mesh plink timer for %pM fired on state %d\n", 438 442 sta->sta.addr, sta->plink_state); 439 443 reason = 0; 440 444 llid = sta->llid; ··· 448 450 /* retry timer */ 449 451 if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { 450 452 u32 rand; 451 - mpl_dbg("Mesh plink for %pM (retry, timeout): %d %d\n", 453 + mpl_dbg(sta->sdata, 454 + "Mesh plink for %pM (retry, timeout): %d %d\n", 452 455 sta->sta.addr, sta->plink_retries, 453 456 sta->plink_timeout); 454 457 get_random_bytes(&rand, sizeof(u32)); ··· 529 530 sta->plink_state = NL80211_PLINK_OPN_SNT; 530 531 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); 531 532 spin_unlock_bh(&sta->lock); 532 - mpl_dbg("Mesh plink: starting establishment with %pM\n", 533 + mpl_dbg(sdata, 534 + "Mesh plink: starting establishment with %pM\n", 533 535 sta->sta.addr); 534 536 535 537 return mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_OPEN, ··· 565 565 u8 *baseaddr; 566 566 u32 changed = 0; 567 567 __le16 plid, llid, reason; 568 - #ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG 569 568 static const char *mplstates[] = { 570 569 [NL80211_PLINK_LISTEN] = "LISTEN", 571 570 [NL80211_PLINK_OPN_SNT] = "OPN-SNT", ··· 574 575 [NL80211_PLINK_HOLDING] = "HOLDING", 575 576 [NL80211_PLINK_BLOCKED] = "BLOCKED" 576 577 }; 577 - #endif 578 578 579 579 /* need action_code, aux */ 580 580 if (len < IEEE80211_MIN_ACTION_SIZE + 3) 581 581 return; 582 582 583 583 if (is_multicast_ether_addr(mgmt->da)) { 584 - mpl_dbg("Mesh plink: ignore frame from multicast address"); 584 + mpl_dbg(sdata, 585 + "Mesh plink: ignore frame from multicast address\n"); 585 586 return; 586 587 } 587 588 ··· 594 595 } 595 596 ieee802_11_parse_elems(baseaddr, len - baselen, &elems); 596 597 if (!elems.peering) { 597 - mpl_dbg("Mesh plink: missing necessary peer link ie\n"); 598 + mpl_dbg(sdata, 599 + "Mesh plink: missing necessary peer link ie\n"); 598 600 return; 599 601 } 600 602 if (elems.rsn_len && 601 603 sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) { 602 - mpl_dbg("Mesh plink: can't establish link with secure peer\n"); 604 + mpl_dbg(sdata, 605 + "Mesh plink: can't establish link with secure peer\n"); 603 606 return; 604 607 } 605 608 ··· 611 610 (ftype == WLAN_SP_MESH_PEERING_CONFIRM && ie_len != 6) || 612 611 (ftype == WLAN_SP_MESH_PEERING_CLOSE && ie_len != 6 613 612 && ie_len != 8)) { 614 - mpl_dbg("Mesh plink: incorrect plink ie length %d %d\n", 615 - ftype, ie_len); 613 + mpl_dbg(sdata, 614 + "Mesh plink: incorrect plink ie length %d %d\n", 615 + ftype, ie_len); 616 616 return; 617 617 } 618 618 619 619 if (ftype != WLAN_SP_MESH_PEERING_CLOSE && 620 620 (!elems.mesh_id || !elems.mesh_config)) { 621 - mpl_dbg("Mesh plink: missing necessary ie\n"); 621 + mpl_dbg(sdata, "Mesh plink: missing necessary ie\n"); 622 622 return; 623 623 } 624 624 /* Note the lines below are correct, the llid in the frame is the plid ··· 634 632 635 633 sta = sta_info_get(sdata, mgmt->sa); 636 634 if (!sta && ftype != WLAN_SP_MESH_PEERING_OPEN) { 637 - mpl_dbg("Mesh plink: cls or cnf from unknown peer\n"); 635 + mpl_dbg(sdata, "Mesh plink: cls or cnf from unknown peer\n"); 638 636 rcu_read_unlock(); 639 637 return; 640 638 } 641 639 642 640 if (ftype == WLAN_SP_MESH_PEERING_OPEN && 643 641 !rssi_threshold_check(sta, sdata)) { 644 - mpl_dbg("Mesh plink: %pM does not meet rssi threshold\n", 642 + mpl_dbg(sdata, "Mesh plink: %pM does not meet rssi threshold\n", 645 643 mgmt->sa); 646 644 rcu_read_unlock(); 647 645 return; 648 646 } 649 647 650 648 if (sta && !test_sta_flag(sta, WLAN_STA_AUTH)) { 651 - mpl_dbg("Mesh plink: Action frame from non-authed peer\n"); 649 + mpl_dbg(sdata, "Mesh plink: Action frame from non-authed peer\n"); 652 650 rcu_read_unlock(); 653 651 return; 654 652 } ··· 685 683 } else if (!sta) { 686 684 /* ftype == WLAN_SP_MESH_PEERING_OPEN */ 687 685 if (!mesh_plink_free_count(sdata)) { 688 - mpl_dbg("Mesh plink error: no more free plinks\n"); 686 + mpl_dbg(sdata, "Mesh plink error: no more free plinks\n"); 689 687 rcu_read_unlock(); 690 688 return; 691 689 } ··· 726 724 event = CLS_ACPT; 727 725 break; 728 726 default: 729 - mpl_dbg("Mesh plink: unknown frame subtype\n"); 727 + mpl_dbg(sdata, "Mesh plink: unknown frame subtype\n"); 730 728 rcu_read_unlock(); 731 729 return; 732 730 } ··· 736 734 /* allocate sta entry if necessary and update info */ 737 735 sta = mesh_peer_init(sdata, mgmt->sa, &elems); 738 736 if (!sta) { 739 - mpl_dbg("Mesh plink: failed to init peer!\n"); 737 + mpl_dbg(sdata, "Mesh plink: failed to init peer!\n"); 740 738 rcu_read_unlock(); 741 739 return; 742 740 } 743 741 } 744 742 745 - mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %s %d %d %d\n", 743 + mpl_dbg(sdata, 744 + "Mesh plink (peer, state, llid, plid, event): %pM %s %d %d %d\n", 746 745 mgmt->sa, mplstates[sta->plink_state], 747 746 le16_to_cpu(sta->llid), le16_to_cpu(sta->plid), 748 747 event); ··· 854 851 mesh_plink_inc_estab_count(sdata); 855 852 changed |= mesh_set_ht_prot_mode(sdata); 856 853 changed |= BSS_CHANGED_BEACON; 857 - mpl_dbg("Mesh plink with %pM ESTABLISHED\n", 854 + mpl_dbg(sdata, "Mesh plink with %pM ESTABLISHED\n", 858 855 sta->sta.addr); 859 856 break; 860 857 default: ··· 890 887 mesh_plink_inc_estab_count(sdata); 891 888 changed |= mesh_set_ht_prot_mode(sdata); 892 889 changed |= BSS_CHANGED_BEACON; 893 - mpl_dbg("Mesh plink with %pM ESTABLISHED\n", 890 + mpl_dbg(sdata, "Mesh plink with %pM ESTABLISHED\n", 894 891 sta->sta.addr); 895 892 mesh_plink_frame_tx(sdata, 896 893 WLAN_SP_MESH_PEERING_CONFIRM,
+20 -27
net/mac80211/mesh_sync.c
··· 12 12 #include "mesh.h" 13 13 #include "driver-ops.h" 14 14 15 - #ifdef CONFIG_MAC80211_VERBOSE_MESH_SYNC_DEBUG 16 - #define msync_dbg(fmt, args...) \ 17 - pr_debug("Mesh sync (%s): " fmt "\n", sdata->name, ##args) 18 - #else 19 - #define msync_dbg(fmt, args...) do { (void)(0); } while (0) 20 - #endif 21 - 22 15 /* This is not in the standard. It represents a tolerable tbtt drift below 23 16 * which we do no TSF adjustment. 24 17 */ ··· 58 65 spin_lock_bh(&ifmsh->sync_offset_lock); 59 66 60 67 if (ifmsh->sync_offset_clockdrift_max < beacon_int_fraction) { 61 - msync_dbg("TBTT : max clockdrift=%lld; adjusting", 62 - (long long) ifmsh->sync_offset_clockdrift_max); 68 + msync_dbg(sdata, "TBTT : max clockdrift=%lld; adjusting\n", 69 + (long long) ifmsh->sync_offset_clockdrift_max); 63 70 tsfdelta = -ifmsh->sync_offset_clockdrift_max; 64 71 ifmsh->sync_offset_clockdrift_max = 0; 65 72 } else { 66 - msync_dbg("TBTT : max clockdrift=%lld; adjusting by %llu", 67 - (long long) ifmsh->sync_offset_clockdrift_max, 68 - (unsigned long long) beacon_int_fraction); 73 + msync_dbg(sdata, "TBTT : max clockdrift=%lld; adjusting by %llu\n", 74 + (long long) ifmsh->sync_offset_clockdrift_max, 75 + (unsigned long long) beacon_int_fraction); 69 76 tsfdelta = -beacon_int_fraction; 70 77 ifmsh->sync_offset_clockdrift_max -= beacon_int_fraction; 71 78 } ··· 113 120 114 121 if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) { 115 122 clear_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN); 116 - msync_dbg("STA %pM : is adjusting TBTT", sta->sta.addr); 123 + msync_dbg(sdata, "STA %pM : is adjusting TBTT\n", sta->sta.addr); 117 124 goto no_sync; 118 125 } 119 126 ··· 162 169 if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) { 163 170 s64 t_clockdrift = sta->t_offset_setpoint 164 171 - sta->t_offset; 165 - msync_dbg("STA %pM : sta->t_offset=%lld, sta->t_offset_setpoint=%lld, t_clockdrift=%lld", 172 + msync_dbg(sdata, 173 + "STA %pM : sta->t_offset=%lld, sta->t_offset_setpoint=%lld, t_clockdrift=%lld\n", 166 174 sta->sta.addr, 167 175 (long long) sta->t_offset, 168 176 (long long) ··· 172 178 173 179 if (t_clockdrift > TOFFSET_MAXIMUM_ADJUSTMENT || 174 180 t_clockdrift < -TOFFSET_MAXIMUM_ADJUSTMENT) { 175 - msync_dbg("STA %pM : t_clockdrift=%lld too large, setpoint reset", 181 + msync_dbg(sdata, 182 + "STA %pM : t_clockdrift=%lld too large, setpoint reset\n", 176 183 sta->sta.addr, 177 184 (long long) t_clockdrift); 178 185 clear_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN); ··· 192 197 } else { 193 198 sta->t_offset_setpoint = sta->t_offset - TOFFSET_SET_MARGIN; 194 199 set_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN); 195 - msync_dbg("STA %pM : offset was invalid, " 196 - " sta->t_offset=%lld", 200 + msync_dbg(sdata, 201 + "STA %pM : offset was invalid, sta->t_offset=%lld\n", 197 202 sta->sta.addr, 198 203 (long long) sta->t_offset); 199 204 rcu_read_unlock(); ··· 221 226 * to the driver tsf setter, we punt 222 227 * the tsf adjustment to the mesh tasklet 223 228 */ 224 - msync_dbg("TBTT : kicking off TBTT " 225 - "adjustment with " 226 - "clockdrift_max=%lld", 227 - ifmsh->sync_offset_clockdrift_max); 229 + msync_dbg(sdata, 230 + "TBTT : kicking off TBTT adjustment with clockdrift_max=%lld\n", 231 + ifmsh->sync_offset_clockdrift_max); 228 232 set_bit(MESH_WORK_DRIFT_ADJUST, 229 233 &ifmsh->wrkq_flags); 230 234 } else { 231 - msync_dbg("TBTT : max clockdrift=%lld; " 232 - "too small to adjust", 233 - (long long) 234 - ifmsh->sync_offset_clockdrift_max); 235 + msync_dbg(sdata, 236 + "TBTT : max clockdrift=%lld; too small to adjust\n", 237 + (long long)ifmsh->sync_offset_clockdrift_max); 235 238 ifmsh->sync_offset_clockdrift_max = 0; 236 239 } 237 240 spin_unlock_bh(&ifmsh->sync_offset_lock); ··· 261 268 const u8 *oui; 262 269 263 270 WARN_ON(sdata->u.mesh.mesh_sp_id != IEEE80211_SYNC_METHOD_VENDOR); 264 - msync_dbg("called mesh_sync_vendor_rx_bcn_presp"); 271 + msync_dbg(sdata, "called mesh_sync_vendor_rx_bcn_presp\n"); 265 272 oui = mesh_get_vendor_oui(sdata); 266 273 /* here you would implement the vendor offset tracking for this oui */ 267 274 } ··· 271 278 const u8 *oui; 272 279 273 280 WARN_ON(sdata->u.mesh.mesh_sp_id != IEEE80211_SYNC_METHOD_VENDOR); 274 - msync_dbg("called mesh_sync_vendor_adjust_tbtt"); 281 + msync_dbg(sdata, "called mesh_sync_vendor_adjust_tbtt\n"); 275 282 oui = mesh_get_vendor_oui(sdata); 276 283 /* here you would implement the vendor tsf adjustment for this oui */ 277 284 }
+93 -110
net/mac80211/mlme.c
··· 1186 1186 params.txop = get_unaligned_le16(pos + 2); 1187 1187 params.uapsd = uapsd; 1188 1188 1189 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1190 - wiphy_debug(local->hw.wiphy, 1191 - "WMM queue=%d aci=%d acm=%d aifs=%d " 1192 - "cWmin=%d cWmax=%d txop=%d uapsd=%d\n", 1193 - queue, aci, acm, 1194 - params.aifs, params.cw_min, params.cw_max, 1195 - params.txop, params.uapsd); 1196 - #endif 1189 + mlme_dbg(sdata, 1190 + "WMM queue=%d aci=%d acm=%d aifs=%d cWmin=%d cWmax=%d txop=%d uapsd=%d\n", 1191 + queue, aci, acm, 1192 + params.aifs, params.cw_min, params.cw_max, 1193 + params.txop, params.uapsd); 1197 1194 sdata->tx_conf[queue] = params; 1198 1195 if (drv_conf_tx(local, sdata, queue, &params)) 1199 - wiphy_debug(local->hw.wiphy, 1200 - "failed to set TX queue parameters for queue %d\n", 1201 - queue); 1196 + sdata_err(sdata, 1197 + "failed to set TX queue parameters for queue %d\n", 1198 + queue); 1202 1199 } 1203 1200 1204 1201 /* enable WMM or activate new settings */ ··· 1562 1565 goto out; 1563 1566 } 1564 1567 1565 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1566 1568 if (beacon) 1567 - net_dbg_ratelimited("%s: detected beacon loss from AP - sending probe request\n", 1568 - sdata->name); 1569 - #endif 1569 + mlme_dbg_ratelimited(sdata, 1570 + "detected beacon loss from AP - sending probe request\n"); 1571 + 1570 1572 ieee80211_cqm_rssi_notify(&sdata->vif, 1571 1573 NL80211_CQM_RSSI_BEACON_LOSS_EVENT, GFP_KERNEL); 1572 1574 ··· 1650 1654 1651 1655 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); 1652 1656 1653 - pr_debug("%s: Connection to AP %pM lost\n", sdata->name, bssid); 1657 + sdata_info(sdata, "Connection to AP %pM lost\n", bssid); 1654 1658 1655 1659 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 1656 1660 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, ··· 1784 1788 return RX_MGMT_NONE; 1785 1789 1786 1790 if (status_code != WLAN_STATUS_SUCCESS) { 1787 - pr_debug("%s: %pM denied authentication (status %d)\n", 1788 - sdata->name, mgmt->sa, status_code); 1791 + sdata_info(sdata, "%pM denied authentication (status %d)\n", 1792 + mgmt->sa, status_code); 1789 1793 ieee80211_destroy_auth_data(sdata, false); 1790 1794 return RX_MGMT_CFG80211_RX_AUTH; 1791 1795 } ··· 1808 1812 return RX_MGMT_NONE; 1809 1813 } 1810 1814 1811 - pr_debug("%s: authenticated\n", sdata->name); 1815 + sdata_info(sdata, "authenticated\n"); 1812 1816 ifmgd->auth_data->done = true; 1813 1817 ifmgd->auth_data->timeout = jiffies + IEEE80211_AUTH_WAIT_ASSOC; 1814 1818 run_again(ifmgd, ifmgd->auth_data->timeout); ··· 1821 1825 goto out_err; 1822 1826 } 1823 1827 if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) { 1824 - pr_debug("%s: failed moving %pM to auth\n", sdata->name, bssid); 1828 + sdata_info(sdata, "failed moving %pM to auth\n", bssid); 1825 1829 goto out_err; 1826 1830 } 1827 1831 mutex_unlock(&sdata->local->sta_mtx); ··· 1855 1859 1856 1860 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); 1857 1861 1858 - pr_debug("%s: deauthenticated from %pM (Reason: %u)\n", 1859 - sdata->name, bssid, reason_code); 1862 + sdata_info(sdata, "deauthenticated from %pM (Reason: %u)\n", 1863 + bssid, reason_code); 1860 1864 1861 1865 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 1862 1866 ··· 1886 1890 1887 1891 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); 1888 1892 1889 - pr_debug("%s: disassociated from %pM (Reason: %u)\n", 1890 - sdata->name, mgmt->sa, reason_code); 1893 + sdata_info(sdata, "disassociated from %pM (Reason: %u)\n", 1894 + mgmt->sa, reason_code); 1891 1895 1892 1896 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 1893 1897 ··· 1979 1983 capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info); 1980 1984 1981 1985 if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14))) 1982 - pr_debug("%s: invalid AID value 0x%x; bits 15:14 not set\n", 1983 - sdata->name, aid); 1986 + sdata_info(sdata, "invalid AID value 0x%x; bits 15:14 not set\n", 1987 + aid); 1984 1988 aid &= ~(BIT(15) | BIT(14)); 1985 1989 1986 1990 ifmgd->broken_ap = false; 1987 1991 1988 1992 if (aid == 0 || aid > IEEE80211_MAX_AID) { 1989 - pr_debug("%s: invalid AID value %d (out of range), turn off PS\n", 1990 - sdata->name, aid); 1993 + sdata_info(sdata, "invalid AID value %d (out of range), turn off PS\n", 1994 + aid); 1991 1995 aid = 0; 1992 1996 ifmgd->broken_ap = true; 1993 1997 } ··· 1996 2000 ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems); 1997 2001 1998 2002 if (!elems.supp_rates) { 1999 - pr_debug("%s: no SuppRates element in AssocResp\n", 2000 - sdata->name); 2003 + sdata_info(sdata, "no SuppRates element in AssocResp\n"); 2001 2004 return false; 2002 2005 } 2003 2006 ··· 2036 2041 if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT)) 2037 2042 err = sta_info_move_state(sta, IEEE80211_STA_AUTHORIZED); 2038 2043 if (err) { 2039 - pr_debug("%s: failed to move station %pM to desired state\n", 2040 - sdata->name, sta->sta.addr); 2044 + sdata_info(sdata, 2045 + "failed to move station %pM to desired state\n", 2046 + sta->sta.addr); 2041 2047 WARN_ON(__sta_info_destroy(sta)); 2042 2048 mutex_unlock(&sdata->local->sta_mtx); 2043 2049 return false; ··· 2121 2125 status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code); 2122 2126 aid = le16_to_cpu(mgmt->u.assoc_resp.aid); 2123 2127 2124 - pr_debug("%s: RX %sssocResp from %pM (capab=0x%x status=%d aid=%d)\n", 2125 - sdata->name, reassoc ? "Rea" : "A", mgmt->sa, 2126 - capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14)))); 2128 + sdata_info(sdata, 2129 + "RX %sssocResp from %pM (capab=0x%x status=%d aid=%d)\n", 2130 + reassoc ? "Rea" : "A", mgmt->sa, 2131 + capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14)))); 2127 2132 2128 2133 pos = mgmt->u.assoc_resp.variable; 2129 2134 ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems); ··· 2135 2138 u32 tu, ms; 2136 2139 tu = get_unaligned_le32(elems.timeout_int + 1); 2137 2140 ms = tu * 1024 / 1000; 2138 - pr_debug("%s: %pM rejected association temporarily; comeback duration %u TU (%u ms)\n", 2139 - sdata->name, mgmt->sa, tu, ms); 2141 + sdata_info(sdata, 2142 + "%pM rejected association temporarily; comeback duration %u TU (%u ms)\n", 2143 + mgmt->sa, tu, ms); 2140 2144 assoc_data->timeout = jiffies + msecs_to_jiffies(ms); 2141 2145 if (ms > IEEE80211_ASSOC_TIMEOUT) 2142 2146 run_again(ifmgd, assoc_data->timeout); ··· 2147 2149 *bss = assoc_data->bss; 2148 2150 2149 2151 if (status_code != WLAN_STATUS_SUCCESS) { 2150 - pr_debug("%s: %pM denied association (code=%d)\n", 2151 - sdata->name, mgmt->sa, status_code); 2152 + sdata_info(sdata, "%pM denied association (code=%d)\n", 2153 + mgmt->sa, status_code); 2152 2154 ieee80211_destroy_assoc_data(sdata, false); 2153 2155 } else { 2154 - pr_debug("%s: associated\n", sdata->name); 2156 + sdata_info(sdata, "associated\n"); 2155 2157 2156 2158 if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { 2157 2159 /* oops -- internal error -- send timeout for now */ ··· 2259 2261 if (ifmgd->auth_data && !ifmgd->auth_data->bss->proberesp_ies && 2260 2262 ether_addr_equal(mgmt->bssid, ifmgd->auth_data->bss->bssid)) { 2261 2263 /* got probe response, continue with auth */ 2262 - pr_debug("%s: direct probe responded\n", sdata->name); 2264 + sdata_info(sdata, "direct probe responded\n"); 2263 2265 ifmgd->auth_data->tries = 0; 2264 2266 ifmgd->auth_data->timeout = jiffies; 2265 2267 run_again(ifmgd, ifmgd->auth_data->timeout); ··· 2395 2397 } 2396 2398 2397 2399 if (ifmgd->flags & IEEE80211_STA_BEACON_POLL) { 2398 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2399 - net_dbg_ratelimited("%s: cancelling probereq poll due to a received beacon\n", 2400 - sdata->name); 2401 - #endif 2400 + mlme_dbg_ratelimited(sdata, 2401 + "cancelling probereq poll due to a received beacon\n"); 2402 2402 mutex_lock(&local->mtx); 2403 2403 ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL; 2404 2404 ieee80211_run_deferred_scan(local); ··· 2621 2625 auth_data->tries++; 2622 2626 2623 2627 if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { 2624 - pr_debug("%s: authentication with %pM timed out\n", 2625 - sdata->name, auth_data->bss->bssid); 2628 + sdata_info(sdata, "authentication with %pM timed out\n", 2629 + auth_data->bss->bssid); 2626 2630 2627 2631 /* 2628 2632 * Most likely AP is not in the range so remove the ··· 2634 2638 } 2635 2639 2636 2640 if (auth_data->bss->proberesp_ies) { 2637 - pr_debug("%s: send auth to %pM (try %d/%d)\n", 2638 - sdata->name, auth_data->bss->bssid, auth_data->tries, 2639 - IEEE80211_AUTH_MAX_TRIES); 2641 + sdata_info(sdata, "send auth to %pM (try %d/%d)\n", 2642 + auth_data->bss->bssid, auth_data->tries, 2643 + IEEE80211_AUTH_MAX_TRIES); 2640 2644 2641 2645 auth_data->expected_transaction = 2; 2642 2646 ieee80211_send_auth(sdata, 1, auth_data->algorithm, ··· 2646 2650 } else { 2647 2651 const u8 *ssidie; 2648 2652 2649 - pr_debug("%s: direct probe to %pM (try %d/%i)\n", 2650 - sdata->name, auth_data->bss->bssid, auth_data->tries, 2651 - IEEE80211_AUTH_MAX_TRIES); 2653 + sdata_info(sdata, "direct probe to %pM (try %d/%i)\n", 2654 + auth_data->bss->bssid, auth_data->tries, 2655 + IEEE80211_AUTH_MAX_TRIES); 2652 2656 2653 2657 ssidie = ieee80211_bss_get_ie(auth_data->bss, WLAN_EID_SSID); 2654 2658 if (!ssidie) ··· 2676 2680 2677 2681 assoc_data->tries++; 2678 2682 if (assoc_data->tries > IEEE80211_ASSOC_MAX_TRIES) { 2679 - pr_debug("%s: association with %pM timed out\n", 2680 - sdata->name, assoc_data->bss->bssid); 2683 + sdata_info(sdata, "association with %pM timed out\n", 2684 + assoc_data->bss->bssid); 2681 2685 2682 2686 /* 2683 2687 * Most likely AP is not in the range so remove the ··· 2688 2692 return -ETIMEDOUT; 2689 2693 } 2690 2694 2691 - pr_debug("%s: associate with %pM (try %d/%d)\n", 2692 - sdata->name, assoc_data->bss->bssid, assoc_data->tries, 2693 - IEEE80211_ASSOC_MAX_TRIES); 2695 + sdata_info(sdata, "associate with %pM (try %d/%d)\n", 2696 + assoc_data->bss->bssid, assoc_data->tries, 2697 + IEEE80211_ASSOC_MAX_TRIES); 2694 2698 ieee80211_send_assoc(sdata); 2695 2699 2696 2700 assoc_data->timeout = jiffies + IEEE80211_ASSOC_TIMEOUT; ··· 2763 2767 ieee80211_reset_ap_probe(sdata); 2764 2768 else if (ifmgd->nullfunc_failed) { 2765 2769 if (ifmgd->probe_send_count < max_tries) { 2766 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2767 - wiphy_debug(local->hw.wiphy, 2768 - "%s: No ack for nullfunc frame to" 2769 - " AP %pM, try %d/%i\n", 2770 - sdata->name, bssid, 2771 - ifmgd->probe_send_count, max_tries); 2772 - #endif 2770 + mlme_dbg(sdata, 2771 + "No ack for nullfunc frame to AP %pM, try %d/%i\n", 2772 + bssid, ifmgd->probe_send_count, 2773 + max_tries); 2773 2774 ieee80211_mgd_probe_ap_send(sdata); 2774 2775 } else { 2775 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2776 - wiphy_debug(local->hw.wiphy, 2777 - "%s: No ack for nullfunc frame to" 2778 - " AP %pM, disconnecting.\n", 2779 - sdata->name, bssid); 2780 - #endif 2776 + mlme_dbg(sdata, 2777 + "No ack for nullfunc frame to AP %pM, disconnecting.\n", 2778 + bssid); 2781 2779 ieee80211_sta_connection_lost(sdata, bssid, 2782 2780 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); 2783 2781 } 2784 2782 } else if (time_is_after_jiffies(ifmgd->probe_timeout)) 2785 2783 run_again(ifmgd, ifmgd->probe_timeout); 2786 2784 else if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) { 2787 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2788 - wiphy_debug(local->hw.wiphy, 2789 - "%s: Failed to send nullfunc to AP %pM" 2790 - " after %dms, disconnecting.\n", 2791 - sdata->name, 2792 - bssid, probe_wait_ms); 2793 - #endif 2785 + mlme_dbg(sdata, 2786 + "Failed to send nullfunc to AP %pM after %dms, disconnecting\n", 2787 + bssid, probe_wait_ms); 2794 2788 ieee80211_sta_connection_lost(sdata, bssid, 2795 2789 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); 2796 2790 } else if (ifmgd->probe_send_count < max_tries) { 2797 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2798 - wiphy_debug(local->hw.wiphy, 2799 - "%s: No probe response from AP %pM" 2800 - " after %dms, try %d/%i\n", 2801 - sdata->name, 2802 - bssid, probe_wait_ms, 2803 - ifmgd->probe_send_count, max_tries); 2804 - #endif 2791 + mlme_dbg(sdata, 2792 + "No probe response from AP %pM after %dms, try %d/%i\n", 2793 + bssid, probe_wait_ms, 2794 + ifmgd->probe_send_count, max_tries); 2805 2795 ieee80211_mgd_probe_ap_send(sdata); 2806 2796 } else { 2807 2797 /* ··· 2902 2920 sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME; 2903 2921 mutex_lock(&ifmgd->mtx); 2904 2922 if (ifmgd->associated) { 2905 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2906 - wiphy_debug(sdata->local->hw.wiphy, 2907 - "%s: driver requested disconnect after resume.\n", 2908 - sdata->name); 2909 - #endif 2923 + mlme_dbg(sdata, 2924 + "driver requested disconnect after resume\n"); 2910 2925 ieee80211_sta_connection_lost(sdata, 2911 2926 ifmgd->associated->bssid, 2912 2927 WLAN_REASON_UNSPECIFIED); ··· 3044 3065 * since we look at probe response/beacon data here 3045 3066 * it should be OK. 3046 3067 */ 3047 - pr_debug("%s: Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n", 3048 - sdata->name, cbss->channel->center_freq, 3049 - ht_cfreq, ht_oper->primary_chan, 3050 - cbss->channel->band); 3068 + sdata_info(sdata, 3069 + "Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n", 3070 + cbss->channel->center_freq, 3071 + ht_cfreq, ht_oper->primary_chan, 3072 + cbss->channel->band); 3051 3073 ht_oper = NULL; 3052 3074 } 3053 3075 } ··· 3072 3092 if (!ieee80211_set_channel_type(local, sdata, channel_type)) { 3073 3093 /* can only fail due to HT40+/- mismatch */ 3074 3094 channel_type = NL80211_CHAN_HT20; 3075 - pr_debug("%s: disabling 40 MHz due to multi-vif mismatch\n", 3076 - sdata->name); 3095 + sdata_info(sdata, 3096 + "disabling 40 MHz due to multi-vif mismatch\n"); 3077 3097 ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ; 3078 3098 WARN_ON(!ieee80211_set_channel_type(local, sdata, 3079 3099 channel_type)); ··· 3102 3122 * we can connect -- with a warning. 3103 3123 */ 3104 3124 if (!basic_rates && min_rate_index >= 0) { 3105 - pr_debug("%s: No basic rates, using min rate instead\n", 3106 - sdata->name); 3125 + sdata_info(sdata, 3126 + "No basic rates, using min rate instead\n"); 3107 3127 basic_rates = BIT(min_rate_index); 3108 3128 } 3109 3129 ··· 3129 3149 err = sta_info_insert(sta); 3130 3150 sta = NULL; 3131 3151 if (err) { 3132 - pr_debug("%s: failed to insert STA entry for the AP (error %d)\n", 3133 - sdata->name, err); 3152 + sdata_info(sdata, 3153 + "failed to insert STA entry for the AP (error %d)\n", 3154 + err); 3134 3155 return err; 3135 3156 } 3136 3157 } else ··· 3209 3228 if (ifmgd->associated) 3210 3229 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 3211 3230 3212 - pr_debug("%s: authenticate with %pM\n", sdata->name, req->bss->bssid); 3231 + sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid); 3213 3232 3214 3233 err = ieee80211_prep_connection(sdata, req->bss, false); 3215 3234 if (err) ··· 3391 3410 * Wait up to one beacon interval ... 3392 3411 * should this be more if we miss one? 3393 3412 */ 3394 - pr_debug("%s: waiting for beacon from %pM\n", 3395 - sdata->name, ifmgd->bssid); 3413 + sdata_info(sdata, "waiting for beacon from %pM\n", 3414 + ifmgd->bssid); 3396 3415 assoc_data->timeout = TU_TO_EXP_TIME(req->bss->beacon_interval); 3397 3416 } else { 3398 3417 assoc_data->have_beacon = true; ··· 3411 3430 corrupt_type = "beacon"; 3412 3431 } else if (bss->corrupt_data & IEEE80211_BSS_CORRUPT_PROBE_RESP) 3413 3432 corrupt_type = "probe response"; 3414 - pr_debug("%s: associating with AP with corrupt %s\n", 3415 - sdata->name, corrupt_type); 3433 + sdata_info(sdata, "associating with AP with corrupt %s\n", 3434 + corrupt_type); 3416 3435 } 3417 3436 3418 3437 err = 0; ··· 3441 3460 return 0; 3442 3461 } 3443 3462 3444 - pr_debug("%s: deauthenticating from %pM by local choice (reason=%d)\n", 3445 - sdata->name, req->bssid, req->reason_code); 3463 + sdata_info(sdata, 3464 + "deauthenticating from %pM by local choice (reason=%d)\n", 3465 + req->bssid, req->reason_code); 3446 3466 3447 3467 if (ifmgd->associated && 3448 3468 ether_addr_equal(ifmgd->associated->bssid, req->bssid)) ··· 3485 3503 return -ENOLINK; 3486 3504 } 3487 3505 3488 - pr_debug("%s: disassociating from %pM by local choice (reason=%d)\n", 3489 - sdata->name, req->bss->bssid, req->reason_code); 3506 + sdata_info(sdata, 3507 + "disassociating from %pM by local choice (reason=%d)\n", 3508 + req->bss->bssid, req->reason_code); 3490 3509 3491 3510 memcpy(bssid, req->bss->bssid, ETH_ALEN); 3492 3511 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DISASSOC,
+11 -29
net/mac80211/rx.c
··· 632 632 HT_RX_REORDER_BUF_TIMEOUT)) 633 633 goto set_release_timer; 634 634 635 - #ifdef CONFIG_MAC80211_HT_DEBUG 636 - if (net_ratelimit()) 637 - wiphy_debug(sdata->local->hw.wiphy, 638 - "release an RX reorder frame due to timeout on earlier frames\n"); 639 - #endif 635 + ht_dbg_ratelimited(sdata, 636 + "release an RX reorder frame due to timeout on earlier frames\n"); 640 637 ieee80211_release_reorder_frame(sdata, tid_agg_rx, j); 641 638 642 639 /* ··· 1133 1136 set_sta_flag(sta, WLAN_STA_PS_STA); 1134 1137 if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) 1135 1138 drv_sta_notify(local, sdata, STA_NOTIFY_SLEEP, &sta->sta); 1136 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 1137 - pr_debug("%s: STA %pM aid %d enters power save mode\n", 1138 - sdata->name, sta->sta.addr, sta->sta.aid); 1139 - #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 1139 + ps_dbg(sdata, "STA %pM aid %d enters power save mode\n", 1140 + sta->sta.addr, sta->sta.aid); 1140 1141 } 1141 1142 1142 1143 static void ap_sta_ps_end(struct sta_info *sta) 1143 1144 { 1144 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 1145 - pr_debug("%s: STA %pM aid %d exits power save mode\n", 1146 - sta->sdata->name, sta->sta.addr, sta->sta.aid); 1147 - #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 1145 + ps_dbg(sta->sdata, "STA %pM aid %d exits power save mode\n", 1146 + sta->sta.addr, sta->sta.aid); 1148 1147 1149 1148 if (test_sta_flag(sta, WLAN_STA_PS_DRIVER)) { 1150 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 1151 - pr_debug("%s: STA %pM aid %d driver-ps-blocked\n", 1152 - sta->sdata->name, sta->sta.addr, sta->sta.aid); 1153 - #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 1149 + ps_dbg(sta->sdata, "STA %pM aid %d driver-ps-blocked\n", 1150 + sta->sta.addr, sta->sta.aid); 1154 1151 return; 1155 1152 } 1156 1153 ··· 1374 1383 if (sdata->fragment_next >= IEEE80211_FRAGMENT_MAX) 1375 1384 sdata->fragment_next = 0; 1376 1385 1377 - if (!skb_queue_empty(&entry->skb_list)) { 1378 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1379 - struct ieee80211_hdr *hdr = 1380 - (struct ieee80211_hdr *) entry->skb_list.next->data; 1381 - pr_debug("%s: RX reassembly removed oldest fragment entry (idx=%d age=%lu seq=%d last_frag=%d addr1=%pM addr2=%pM\n", 1382 - sdata->name, idx, 1383 - jiffies - entry->first_frag_time, entry->seq, 1384 - entry->last_frag, hdr->addr1, hdr->addr2); 1385 - #endif 1386 + if (!skb_queue_empty(&entry->skb_list)) 1386 1387 __skb_queue_purge(&entry->skb_list); 1387 - } 1388 1388 1389 1389 __skb_queue_tail(&entry->skb_list, *skb); /* no need for locking */ 1390 1390 *skb = NULL; ··· 1733 1751 */ 1734 1752 xmit_skb = skb_copy(skb, GFP_ATOMIC); 1735 1753 if (!xmit_skb) 1736 - net_dbg_ratelimited("%s: failed to clone multicast frame\n", 1754 + net_info_ratelimited("%s: failed to clone multicast frame\n", 1737 1755 dev->name); 1738 1756 } else { 1739 1757 dsta = sta_info_get(sdata, skb->data); ··· 1937 1955 1938 1956 fwd_skb = skb_copy(skb, GFP_ATOMIC); 1939 1957 if (!fwd_skb) { 1940 - net_dbg_ratelimited("%s: failed to clone mesh frame\n", 1958 + net_info_ratelimited("%s: failed to clone mesh frame\n", 1941 1959 sdata->name); 1942 1960 goto out; 1943 1961 }
+17 -27
net/mac80211/sta_info.c
··· 169 169 if (sta->rate_ctrl) 170 170 rate_control_free_sta(sta); 171 171 172 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 173 - wiphy_debug(local->hw.wiphy, "Destroyed STA %pM\n", sta->sta.addr); 174 - #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 172 + sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); 175 173 176 174 kfree(sta); 177 175 } ··· 276 278 for (i = 0; i < NUM_RX_DATA_QUEUES; i++) 277 279 sta->last_seq_ctrl[i] = cpu_to_le16(USHRT_MAX); 278 280 279 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 280 - wiphy_debug(local->hw.wiphy, "Allocated STA %pM\n", sta->sta.addr); 281 - #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 281 + sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); 282 282 283 283 #ifdef CONFIG_MAC80211_MESH 284 284 sta->plink_state = NL80211_PLINK_LISTEN; ··· 329 333 } 330 334 331 335 if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { 332 - pr_debug("%s: failed to move IBSS STA %pM to state %d (%d) - keeping it anyway\n", 333 - sdata->name, sta->sta.addr, state + 1, err); 336 + sdata_info(sdata, 337 + "failed to move IBSS STA %pM to state %d (%d) - keeping it anyway\n", 338 + sta->sta.addr, state + 1, err); 334 339 err = 0; 335 340 } 336 341 ··· 386 389 sinfo.generation = local->sta_generation; 387 390 cfg80211_new_sta(sdata->dev, sta->sta.addr, &sinfo, GFP_KERNEL); 388 391 389 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 390 - wiphy_debug(local->hw.wiphy, "Inserted STA %pM\n", sta->sta.addr); 391 - #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 392 + sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr); 392 393 393 394 /* move reference to rcu-protected */ 394 395 rcu_read_lock(); ··· 612 617 break; 613 618 614 619 local->total_ps_buffered--; 615 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 616 - pr_debug("Buffered frame expired (STA %pM)\n", sta->sta.addr); 617 - #endif 620 + ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n", 621 + sta->sta.addr); 618 622 dev_kfree_skb(skb); 619 623 } 620 624 ··· 739 745 mesh_accept_plinks_update(sdata); 740 746 #endif 741 747 742 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 743 - wiphy_debug(local->hw.wiphy, "Removed STA %pM\n", sta->sta.addr); 744 - #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 748 + sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr); 749 + 745 750 cancel_work_sync(&sta->drv_unblock_wk); 746 751 747 752 cfg80211_del_sta(sdata->dev, sta->sta.addr, GFP_KERNEL); ··· 880 887 continue; 881 888 882 889 if (time_after(jiffies, sta->last_rx + exp_time)) { 883 - ibss_vdbg("%s: expiring inactive STA %pM\n", 884 - sdata->name, sta->sta.addr); 890 + ibss_dbg(sdata, "expiring inactive STA %pM\n", 891 + sta->sta.addr); 885 892 WARN_ON(__sta_info_destroy(sta)); 886 893 } 887 894 } ··· 979 986 980 987 sta_info_recalc_tim(sta); 981 988 982 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 983 - pr_debug("%s: STA %pM aid %d sending %d filtered/%d PS frames since STA not sleeping anymore\n", 984 - sdata->name, sta->sta.addr, sta->sta.aid, filtered, buffered); 985 - #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 989 + ps_dbg(sdata, 990 + "STA %pM aid %d sending %d filtered/%d PS frames since STA not sleeping anymore\n", 991 + sta->sta.addr, sta->sta.aid, filtered, buffered); 986 992 } 987 993 988 994 static void ieee80211_send_null_response(struct ieee80211_sub_if_data *sdata, ··· 1371 1379 return -EINVAL; 1372 1380 } 1373 1381 1374 - #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1375 - pr_debug("%s: moving STA %pM to state %d\n", 1376 - sta->sdata->name, sta->sta.addr, new_state); 1377 - #endif 1382 + sta_dbg(sta->sdata, "moving STA %pM to state %d\n", 1383 + sta->sta.addr, new_state); 1378 1384 1379 1385 /* 1380 1386 * notify the driver before the actual changes so it can
+4 -7
net/mac80211/status.c
··· 155 155 return; 156 156 } 157 157 158 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 159 - if (net_ratelimit()) 160 - wiphy_debug(local->hw.wiphy, 161 - "dropped TX filtered frame, queue_len=%d PS=%d @%lu\n", 162 - skb_queue_len(&sta->tx_filtered[ac]), 163 - !!test_sta_flag(sta, WLAN_STA_PS_STA), jiffies); 164 - #endif 158 + ps_dbg_ratelimited(sta->sdata, 159 + "dropped TX filtered frame, queue_len=%d PS=%d @%lu\n", 160 + skb_queue_len(&sta->tx_filtered[ac]), 161 + !!test_sta_flag(sta, WLAN_STA_PS_STA), jiffies); 165 162 dev_kfree_skb(skb); 166 163 } 167 164
+17 -26
net/mac80211/tx.c
··· 297 297 if (unlikely(!assoc && 298 298 ieee80211_is_data(hdr->frame_control))) { 299 299 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 300 - pr_debug("%s: dropped data frame to not associated station %pM\n", 301 - tx->sdata->name, hdr->addr1); 302 - #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 300 + sdata_info(tx->sdata, 301 + "dropped data frame to not associated station %pM\n", 302 + hdr->addr1); 303 + #endif 303 304 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); 304 305 return TX_DROP; 305 306 } ··· 367 366 rcu_read_unlock(); 368 367 369 368 local->total_ps_buffered = total; 370 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 371 - wiphy_debug(local->hw.wiphy, "PS buffers full - purged %d frames\n", 372 - purged); 373 - #endif 369 + ps_dbg_hw(&local->hw, "PS buffers full - purged %d frames\n", purged); 374 370 } 375 371 376 372 static ieee80211_tx_result ··· 409 411 purge_old_ps_buffers(tx->local); 410 412 411 413 if (skb_queue_len(&tx->sdata->bss->ps_bc_buf) >= AP_MAX_BC_BUFFER) { 412 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 413 - net_dbg_ratelimited("%s: BC TX buffer full - dropping the oldest frame\n", 414 - tx->sdata->name); 415 - #endif 414 + ps_dbg(tx->sdata, 415 + "BC TX buffer full - dropping the oldest frame\n"); 416 416 dev_kfree_skb(skb_dequeue(&tx->sdata->bss->ps_bc_buf)); 417 417 } else 418 418 tx->local->total_ps_buffered++; ··· 461 465 return TX_CONTINUE; 462 466 } 463 467 464 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 465 - pr_debug("STA %pM aid %d: PS buffer for AC %d\n", 466 - sta->sta.addr, sta->sta.aid, ac); 467 - #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 468 + ps_dbg(sta->sdata, "STA %pM aid %d: PS buffer for AC %d\n", 469 + sta->sta.addr, sta->sta.aid, ac); 468 470 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) 469 471 purge_old_ps_buffers(tx->local); 470 472 if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) { 471 473 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]); 472 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 473 - net_dbg_ratelimited("%s: STA %pM TX buffer for AC %d full - dropping oldest frame\n", 474 - tx->sdata->name, sta->sta.addr, ac); 475 - #endif 474 + ps_dbg(tx->sdata, 475 + "STA %pM TX buffer for AC %d full - dropping oldest frame\n", 476 + sta->sta.addr, ac); 476 477 dev_kfree_skb(old); 477 478 } else 478 479 tx->local->total_ps_buffered++; ··· 491 498 sta_info_recalc_tim(sta); 492 499 493 500 return TX_QUEUED; 501 + } else if (unlikely(test_sta_flag(sta, WLAN_STA_PS_STA))) { 502 + ps_dbg(tx->sdata, 503 + "STA %pM in PS mode, but polling/in SP -> send frame\n", 504 + sta->sta.addr); 494 505 } 495 - #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 496 - else if (unlikely(test_sta_flag(sta, WLAN_STA_PS_STA))) { 497 - pr_debug("%s: STA %pM in PS mode, but polling/in SP -> send frame\n", 498 - tx->sdata->name, sta->sta.addr); 499 - } 500 - #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 501 506 502 507 return TX_CONTINUE; 503 508 } ··· 1954 1963 (cpu_to_be16(ethertype) != sdata->control_port_protocol || 1955 1964 !ether_addr_equal(sdata->vif.addr, skb->data + ETH_ALEN)))) { 1956 1965 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1957 - net_dbg_ratelimited("%s: dropped frame to %pM (unauthorized port)\n", 1966 + net_info_ratelimited("%s: dropped frame to %pM (unauthorized port)\n", 1958 1967 dev->name, hdr.addr1); 1959 1968 #endif 1960 1969