diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-06-22 05:29:50 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-06-24 05:32:29 -0400 |
commit | bdcbd8e0e3ffdad32b14b6373e67bfcf5fd3f002 (patch) | |
tree | b636f2229570dc95edef997272bd0656cf19224d /net/mac80211/agg-tx.c | |
parent | d3b2fb53c7f82903880769d406c11c7e619b11a4 (diff) |
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>
Diffstat (limited to 'net/mac80211/agg-tx.c')
-rw-r--r-- | net/mac80211/agg-tx.c | 72 |
1 files changed, 41 insertions, 31 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index da07f01cfe4d..5cc1bf7d8033 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -184,8 +184,8 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
184 | 184 | ||
185 | spin_unlock_bh(&sta->lock); | 185 | spin_unlock_bh(&sta->lock); |
186 | 186 | ||
187 | ht_vdbg("Tx BA session stop requested for %pM tid %u\n", | 187 | ht_dbg(sta->sdata, "Tx BA session stop requested for %pM tid %u\n", |
188 | sta->sta.addr, tid); | 188 | sta->sta.addr, tid); |
189 | 189 | ||
190 | del_timer_sync(&tid_tx->addba_resp_timer); | 190 | del_timer_sync(&tid_tx->addba_resp_timer); |
191 | del_timer_sync(&tid_tx->session_timer); | 191 | del_timer_sync(&tid_tx->session_timer); |
@@ -251,12 +251,13 @@ static void sta_addba_resp_timer_expired(unsigned long data) | |||
251 | if (!tid_tx || | 251 | if (!tid_tx || |
252 | test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) { | 252 | test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) { |
253 | rcu_read_unlock(); | 253 | rcu_read_unlock(); |
254 | ht_vdbg("timer expired on tid %d but we are not (or no longer) expecting addBA response there\n", | 254 | ht_dbg(sta->sdata, |
255 | tid); | 255 | "timer expired on tid %d but we are not (or no longer) expecting addBA response there\n", |
256 | tid); | ||
256 | return; | 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 | ieee80211_stop_tx_ba_session(&sta->sta, tid); | 262 | ieee80211_stop_tx_ba_session(&sta->sta, tid); |
262 | rcu_read_unlock(); | 263 | rcu_read_unlock(); |
@@ -316,8 +317,9 @@ ieee80211_agg_splice_packets(struct ieee80211_sub_if_data *sdata, | |||
316 | 317 | ||
317 | ieee80211_stop_queue_agg(sdata, tid); | 318 | ieee80211_stop_queue_agg(sdata, tid); |
318 | 319 | ||
319 | if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates" | 320 | if (WARN(!tid_tx, |
320 | " from the pending queue\n", tid)) | 321 | "TID %d gone but expected when splicing aggregates from the pending queue\n", |
322 | tid)) | ||
321 | return; | 323 | return; |
322 | 324 | ||
323 | if (!skb_queue_empty(&tid_tx->pending)) { | 325 | if (!skb_queue_empty(&tid_tx->pending)) { |
@@ -365,7 +367,8 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) | |||
365 | ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START, | 367 | ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START, |
366 | &sta->sta, tid, &start_seq_num, 0); | 368 | &sta->sta, tid, &start_seq_num, 0); |
367 | if (ret) { | 369 | if (ret) { |
368 | ht_vdbg("BA request denied - HW unavailable for tid %d\n", tid); | 370 | ht_dbg(sdata, |
371 | "BA request denied - HW unavailable for tid %d\n", tid); | ||
369 | spin_lock_bh(&sta->lock); | 372 | spin_lock_bh(&sta->lock); |
370 | ieee80211_agg_splice_packets(sdata, tid_tx, tid); | 373 | ieee80211_agg_splice_packets(sdata, tid_tx, tid); |
371 | ieee80211_assign_tid_tx(sta, tid, NULL); | 374 | ieee80211_assign_tid_tx(sta, tid, NULL); |
@@ -378,7 +381,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) | |||
378 | 381 | ||
379 | /* activate the timer for the recipient's addBA response */ | 382 | /* activate the timer for the recipient's addBA response */ |
380 | mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); | 383 | mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); |
381 | ht_vdbg("activated addBA response timer on tid %d\n", tid); | 384 | ht_dbg(sdata, "activated addBA response timer on tid %d\n", tid); |
382 | 385 | ||
383 | spin_lock_bh(&sta->lock); | 386 | spin_lock_bh(&sta->lock); |
384 | sta->ampdu_mlme.last_addba_req_time[tid] = jiffies; | 387 | sta->ampdu_mlme.last_addba_req_time[tid] = jiffies; |
@@ -425,7 +428,7 @@ static void sta_tx_agg_session_timer_expired(unsigned long data) | |||
425 | 428 | ||
426 | rcu_read_unlock(); | 429 | rcu_read_unlock(); |
427 | 430 | ||
428 | ht_vdbg("tx session timer expired on tid %d\n", (u16)*ptid); | 431 | ht_dbg(sta->sdata, "tx session timer expired on tid %d\n", (u16)*ptid); |
429 | 432 | ||
430 | ieee80211_stop_tx_ba_session(&sta->sta, *ptid); | 433 | ieee80211_stop_tx_ba_session(&sta->sta, *ptid); |
431 | } | 434 | } |
@@ -449,8 +452,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
449 | (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW)) | 452 | (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW)) |
450 | return -EINVAL; | 453 | return -EINVAL; |
451 | 454 | ||
452 | ht_vdbg("Open BA session requested for %pM tid %u\n", | 455 | ht_dbg(sdata, "Open BA session requested for %pM tid %u\n", |
453 | pubsta->addr, tid); | 456 | pubsta->addr, tid); |
454 | 457 | ||
455 | if (sdata->vif.type != NL80211_IFTYPE_STATION && | 458 | if (sdata->vif.type != NL80211_IFTYPE_STATION && |
456 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT && | 459 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT && |
@@ -460,7 +463,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
460 | return -EINVAL; | 463 | return -EINVAL; |
461 | 464 | ||
462 | if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) { | 465 | if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) { |
463 | ht_vdbg("BA sessions blocked - Denying BA session request\n"); | 466 | ht_dbg(sdata, |
467 | "BA sessions blocked - Denying BA session request\n"); | ||
464 | return -EINVAL; | 468 | return -EINVAL; |
465 | } | 469 | } |
466 | 470 | ||
@@ -478,8 +482,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
478 | */ | 482 | */ |
479 | if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC && | 483 | if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC && |
480 | !sta->sta.ht_cap.ht_supported) { | 484 | !sta->sta.ht_cap.ht_supported) { |
481 | ht_vdbg("BA request denied - IBSS STA %pM does not advertise HT support\n", | 485 | ht_dbg(sdata, |
482 | pubsta->addr); | 486 | "BA request denied - IBSS STA %pM does not advertise HT support\n", |
487 | pubsta->addr); | ||
483 | return -EINVAL; | 488 | return -EINVAL; |
484 | } | 489 | } |
485 | 490 | ||
@@ -499,8 +504,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
499 | if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES && | 504 | if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES && |
500 | time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] + | 505 | time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] + |
501 | HT_AGG_RETRIES_PERIOD)) { | 506 | HT_AGG_RETRIES_PERIOD)) { |
502 | ht_vdbg("BA request denied - waiting a grace period after %d failed requests on tid %u\n", | 507 | ht_dbg(sdata, |
503 | sta->ampdu_mlme.addba_req_num[tid], tid); | 508 | "BA request denied - waiting a grace period after %d failed requests on tid %u\n", |
509 | sta->ampdu_mlme.addba_req_num[tid], tid); | ||
504 | ret = -EBUSY; | 510 | ret = -EBUSY; |
505 | goto err_unlock_sta; | 511 | goto err_unlock_sta; |
506 | } | 512 | } |
@@ -508,8 +514,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
508 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | 514 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
509 | /* check if the TID is not in aggregation flow already */ | 515 | /* check if the TID is not in aggregation flow already */ |
510 | if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { | 516 | if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { |
511 | ht_vdbg("BA request denied - session is not idle on tid %u\n", | 517 | ht_dbg(sdata, |
512 | tid); | 518 | "BA request denied - session is not idle on tid %u\n", |
519 | tid); | ||
513 | ret = -EAGAIN; | 520 | ret = -EAGAIN; |
514 | goto err_unlock_sta; | 521 | goto err_unlock_sta; |
515 | } | 522 | } |
@@ -564,7 +571,7 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local, | |||
564 | 571 | ||
565 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | 572 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
566 | 573 | ||
567 | ht_vdbg("Aggregation is on for tid %d\n", tid); | 574 | ht_dbg(sta->sdata, "Aggregation is on for tid %d\n", tid); |
568 | 575 | ||
569 | drv_ampdu_action(local, sta->sdata, | 576 | drv_ampdu_action(local, sta->sdata, |
570 | IEEE80211_AMPDU_TX_OPERATIONAL, | 577 | IEEE80211_AMPDU_TX_OPERATIONAL, |
@@ -598,7 +605,8 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) | |||
598 | trace_api_start_tx_ba_cb(sdata, ra, tid); | 605 | trace_api_start_tx_ba_cb(sdata, ra, tid); |
599 | 606 | ||
600 | if (tid >= STA_TID_NUM) { | 607 | if (tid >= STA_TID_NUM) { |
601 | ht_vdbg("Bad TID value: tid = %d (>= %d)\n", tid, STA_TID_NUM); | 608 | ht_dbg(sdata, "Bad TID value: tid = %d (>= %d)\n", |
609 | tid, STA_TID_NUM); | ||
602 | return; | 610 | return; |
603 | } | 611 | } |
604 | 612 | ||
@@ -606,7 +614,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) | |||
606 | sta = sta_info_get_bss(sdata, ra); | 614 | sta = sta_info_get_bss(sdata, ra); |
607 | if (!sta) { | 615 | if (!sta) { |
608 | mutex_unlock(&local->sta_mtx); | 616 | mutex_unlock(&local->sta_mtx); |
609 | ht_vdbg("Could not find station: %pM\n", ra); | 617 | ht_dbg(sdata, "Could not find station: %pM\n", ra); |
610 | return; | 618 | return; |
611 | } | 619 | } |
612 | 620 | ||
@@ -614,7 +622,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) | |||
614 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | 622 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
615 | 623 | ||
616 | if (WARN_ON(!tid_tx)) { | 624 | if (WARN_ON(!tid_tx)) { |
617 | ht_vdbg("addBA was not requested!\n"); | 625 | ht_dbg(sdata, "addBA was not requested!\n"); |
618 | goto unlock; | 626 | goto unlock; |
619 | } | 627 | } |
620 | 628 | ||
@@ -714,17 +722,18 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid) | |||
714 | trace_api_stop_tx_ba_cb(sdata, ra, tid); | 722 | trace_api_stop_tx_ba_cb(sdata, ra, tid); |
715 | 723 | ||
716 | if (tid >= STA_TID_NUM) { | 724 | if (tid >= STA_TID_NUM) { |
717 | ht_vdbg("Bad TID value: tid = %d (>= %d)\n", tid, STA_TID_NUM); | 725 | ht_dbg(sdata, "Bad TID value: tid = %d (>= %d)\n", |
726 | tid, STA_TID_NUM); | ||
718 | return; | 727 | return; |
719 | } | 728 | } |
720 | 729 | ||
721 | ht_vdbg("Stopping Tx BA session for %pM tid %d\n", ra, tid); | 730 | ht_dbg(sdata, "Stopping Tx BA session for %pM tid %d\n", ra, tid); |
722 | 731 | ||
723 | mutex_lock(&local->sta_mtx); | 732 | mutex_lock(&local->sta_mtx); |
724 | 733 | ||
725 | sta = sta_info_get_bss(sdata, ra); | 734 | sta = sta_info_get_bss(sdata, ra); |
726 | if (!sta) { | 735 | if (!sta) { |
727 | ht_vdbg("Could not find station: %pM\n", ra); | 736 | ht_dbg(sdata, "Could not find station: %pM\n", ra); |
728 | goto unlock; | 737 | goto unlock; |
729 | } | 738 | } |
730 | 739 | ||
@@ -733,7 +742,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid) | |||
733 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | 742 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
734 | 743 | ||
735 | if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { | 744 | if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { |
736 | ht_vdbg("unexpected callback to A-MPDU stop\n"); | 745 | ht_dbg(sdata, "unexpected callback to A-MPDU stop\n"); |
737 | goto unlock_sta; | 746 | goto unlock_sta; |
738 | } | 747 | } |
739 | 748 | ||
@@ -809,13 +818,13 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
809 | goto out; | 818 | goto out; |
810 | 819 | ||
811 | if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) { | 820 | if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) { |
812 | ht_vdbg("wrong addBA response token, tid %d\n", tid); | 821 | ht_dbg(sta->sdata, "wrong addBA response token, tid %d\n", tid); |
813 | goto out; | 822 | goto out; |
814 | } | 823 | } |
815 | 824 | ||
816 | del_timer_sync(&tid_tx->addba_resp_timer); | 825 | del_timer_sync(&tid_tx->addba_resp_timer); |
817 | 826 | ||
818 | ht_vdbg("switched off addBA timer for tid %d\n", tid); | 827 | ht_dbg(sta->sdata, "switched off addBA timer for tid %d\n", tid); |
819 | 828 | ||
820 | /* | 829 | /* |
821 | * addba_resp_timer may have fired before we got here, and | 830 | * addba_resp_timer may have fired before we got here, and |
@@ -824,8 +833,9 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
824 | */ | 833 | */ |
825 | if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || | 834 | if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || |
826 | test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { | 835 | test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { |
827 | ht_vdbg("got addBA resp for tid %d but we already gave up\n", | 836 | ht_dbg(sta->sdata, |
828 | tid); | 837 | "got addBA resp for tid %d but we already gave up\n", |
838 | tid); | ||
829 | goto out; | 839 | goto out; |
830 | } | 840 | } |
831 | 841 | ||