diff options
Diffstat (limited to 'net/mac80211/agg-tx.c')
-rw-r--r-- | net/mac80211/agg-tx.c | 109 |
1 files changed, 28 insertions, 81 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 7cf07158805c..da07f01cfe4d 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -184,10 +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 | #ifdef CONFIG_MAC80211_HT_DEBUG | 187 | ht_vdbg("Tx BA session stop requested for %pM tid %u\n", |
188 | printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n", | 188 | sta->sta.addr, tid); |
189 | sta->sta.addr, tid); | ||
190 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | ||
191 | 189 | ||
192 | del_timer_sync(&tid_tx->addba_resp_timer); | 190 | del_timer_sync(&tid_tx->addba_resp_timer); |
193 | del_timer_sync(&tid_tx->session_timer); | 191 | del_timer_sync(&tid_tx->session_timer); |
@@ -253,17 +251,12 @@ static void sta_addba_resp_timer_expired(unsigned long data) | |||
253 | if (!tid_tx || | 251 | if (!tid_tx || |
254 | test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) { | 252 | test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) { |
255 | rcu_read_unlock(); | 253 | rcu_read_unlock(); |
256 | #ifdef CONFIG_MAC80211_HT_DEBUG | 254 | ht_vdbg("timer expired on tid %d but we are not (or no longer) expecting addBA response there\n", |
257 | printk(KERN_DEBUG "timer expired on tid %d but we are not " | ||
258 | "(or no longer) expecting addBA response there\n", | ||
259 | tid); | 255 | tid); |
260 | #endif | ||
261 | return; | 256 | return; |
262 | } | 257 | } |
263 | 258 | ||
264 | #ifdef CONFIG_MAC80211_HT_DEBUG | 259 | ht_vdbg("addBA response timer expired on tid %d\n", tid); |
265 | printk(KERN_DEBUG "addBA response timer expired on tid %d\n", tid); | ||
266 | #endif | ||
267 | 260 | ||
268 | ieee80211_stop_tx_ba_session(&sta->sta, tid); | 261 | ieee80211_stop_tx_ba_session(&sta->sta, tid); |
269 | rcu_read_unlock(); | 262 | rcu_read_unlock(); |
@@ -372,10 +365,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) | |||
372 | ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START, | 365 | ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START, |
373 | &sta->sta, tid, &start_seq_num, 0); | 366 | &sta->sta, tid, &start_seq_num, 0); |
374 | if (ret) { | 367 | if (ret) { |
375 | #ifdef CONFIG_MAC80211_HT_DEBUG | 368 | ht_vdbg("BA request denied - HW unavailable for tid %d\n", tid); |
376 | printk(KERN_DEBUG "BA request denied - HW unavailable for" | ||
377 | " tid %d\n", tid); | ||
378 | #endif | ||
379 | spin_lock_bh(&sta->lock); | 369 | spin_lock_bh(&sta->lock); |
380 | ieee80211_agg_splice_packets(sdata, tid_tx, tid); | 370 | ieee80211_agg_splice_packets(sdata, tid_tx, tid); |
381 | ieee80211_assign_tid_tx(sta, tid, NULL); | 371 | ieee80211_assign_tid_tx(sta, tid, NULL); |
@@ -388,9 +378,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) | |||
388 | 378 | ||
389 | /* activate the timer for the recipient's addBA response */ | 379 | /* activate the timer for the recipient's addBA response */ |
390 | mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); | 380 | mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); |
391 | #ifdef CONFIG_MAC80211_HT_DEBUG | 381 | ht_vdbg("activated addBA response timer on tid %d\n", tid); |
392 | printk(KERN_DEBUG "activated addBA response timer on tid %d\n", tid); | ||
393 | #endif | ||
394 | 382 | ||
395 | spin_lock_bh(&sta->lock); | 383 | spin_lock_bh(&sta->lock); |
396 | sta->ampdu_mlme.last_addba_req_time[tid] = jiffies; | 384 | sta->ampdu_mlme.last_addba_req_time[tid] = jiffies; |
@@ -437,9 +425,7 @@ static void sta_tx_agg_session_timer_expired(unsigned long data) | |||
437 | 425 | ||
438 | rcu_read_unlock(); | 426 | rcu_read_unlock(); |
439 | 427 | ||
440 | #ifdef CONFIG_MAC80211_HT_DEBUG | 428 | ht_vdbg("tx session timer expired on tid %d\n", (u16)*ptid); |
441 | printk(KERN_DEBUG "tx session timer expired on tid %d\n", (u16)*ptid); | ||
442 | #endif | ||
443 | 429 | ||
444 | ieee80211_stop_tx_ba_session(&sta->sta, *ptid); | 430 | ieee80211_stop_tx_ba_session(&sta->sta, *ptid); |
445 | } | 431 | } |
@@ -463,10 +449,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
463 | (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW)) | 449 | (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW)) |
464 | return -EINVAL; | 450 | return -EINVAL; |
465 | 451 | ||
466 | #ifdef CONFIG_MAC80211_HT_DEBUG | 452 | ht_vdbg("Open BA session requested for %pM tid %u\n", |
467 | printk(KERN_DEBUG "Open BA session requested for %pM tid %u\n", | 453 | pubsta->addr, tid); |
468 | pubsta->addr, tid); | ||
469 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | ||
470 | 454 | ||
471 | if (sdata->vif.type != NL80211_IFTYPE_STATION && | 455 | if (sdata->vif.type != NL80211_IFTYPE_STATION && |
472 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT && | 456 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT && |
@@ -476,10 +460,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
476 | return -EINVAL; | 460 | return -EINVAL; |
477 | 461 | ||
478 | if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) { | 462 | if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) { |
479 | #ifdef CONFIG_MAC80211_HT_DEBUG | 463 | ht_vdbg("BA sessions blocked - Denying BA session request\n"); |
480 | printk(KERN_DEBUG "BA sessions blocked. " | ||
481 | "Denying BA session request\n"); | ||
482 | #endif | ||
483 | return -EINVAL; | 464 | return -EINVAL; |
484 | } | 465 | } |
485 | 466 | ||
@@ -497,10 +478,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
497 | */ | 478 | */ |
498 | if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC && | 479 | if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC && |
499 | !sta->sta.ht_cap.ht_supported) { | 480 | !sta->sta.ht_cap.ht_supported) { |
500 | #ifdef CONFIG_MAC80211_HT_DEBUG | 481 | ht_vdbg("BA request denied - IBSS STA %pM does not advertise HT support\n", |
501 | printk(KERN_DEBUG "BA request denied - IBSS STA %pM" | 482 | pubsta->addr); |
502 | "does not advertise HT support\n", pubsta->addr); | ||
503 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | ||
504 | return -EINVAL; | 483 | return -EINVAL; |
505 | } | 484 | } |
506 | 485 | ||
@@ -520,12 +499,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
520 | if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES && | 499 | if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES && |
521 | time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] + | 500 | time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] + |
522 | HT_AGG_RETRIES_PERIOD)) { | 501 | HT_AGG_RETRIES_PERIOD)) { |
523 | #ifdef CONFIG_MAC80211_HT_DEBUG | 502 | ht_vdbg("BA request denied - waiting a grace period after %d failed requests on tid %u\n", |
524 | printk(KERN_DEBUG "BA request denied - " | 503 | sta->ampdu_mlme.addba_req_num[tid], tid); |
525 | "waiting a grace period after %d failed requests " | ||
526 | "on tid %u\n", | ||
527 | sta->ampdu_mlme.addba_req_num[tid], tid); | ||
528 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | ||
529 | ret = -EBUSY; | 504 | ret = -EBUSY; |
530 | goto err_unlock_sta; | 505 | goto err_unlock_sta; |
531 | } | 506 | } |
@@ -533,10 +508,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
533 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | 508 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
534 | /* check if the TID is not in aggregation flow already */ | 509 | /* check if the TID is not in aggregation flow already */ |
535 | if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { | 510 | if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { |
536 | #ifdef CONFIG_MAC80211_HT_DEBUG | 511 | ht_vdbg("BA request denied - session is not idle on tid %u\n", |
537 | printk(KERN_DEBUG "BA request denied - session is not " | 512 | tid); |
538 | "idle on tid %u\n", tid); | ||
539 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | ||
540 | ret = -EAGAIN; | 513 | ret = -EAGAIN; |
541 | goto err_unlock_sta; | 514 | goto err_unlock_sta; |
542 | } | 515 | } |
@@ -591,9 +564,7 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local, | |||
591 | 564 | ||
592 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | 565 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
593 | 566 | ||
594 | #ifdef CONFIG_MAC80211_HT_DEBUG | 567 | ht_vdbg("Aggregation is on for tid %d\n", tid); |
595 | printk(KERN_DEBUG "Aggregation is on for tid %d\n", tid); | ||
596 | #endif | ||
597 | 568 | ||
598 | drv_ampdu_action(local, sta->sdata, | 569 | drv_ampdu_action(local, sta->sdata, |
599 | IEEE80211_AMPDU_TX_OPERATIONAL, | 570 | IEEE80211_AMPDU_TX_OPERATIONAL, |
@@ -627,10 +598,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) | |||
627 | trace_api_start_tx_ba_cb(sdata, ra, tid); | 598 | trace_api_start_tx_ba_cb(sdata, ra, tid); |
628 | 599 | ||
629 | if (tid >= STA_TID_NUM) { | 600 | if (tid >= STA_TID_NUM) { |
630 | #ifdef CONFIG_MAC80211_HT_DEBUG | 601 | ht_vdbg("Bad TID value: tid = %d (>= %d)\n", tid, STA_TID_NUM); |
631 | printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", | ||
632 | tid, STA_TID_NUM); | ||
633 | #endif | ||
634 | return; | 602 | return; |
635 | } | 603 | } |
636 | 604 | ||
@@ -638,9 +606,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) | |||
638 | sta = sta_info_get_bss(sdata, ra); | 606 | sta = sta_info_get_bss(sdata, ra); |
639 | if (!sta) { | 607 | if (!sta) { |
640 | mutex_unlock(&local->sta_mtx); | 608 | mutex_unlock(&local->sta_mtx); |
641 | #ifdef CONFIG_MAC80211_HT_DEBUG | 609 | ht_vdbg("Could not find station: %pM\n", ra); |
642 | printk(KERN_DEBUG "Could not find station: %pM\n", ra); | ||
643 | #endif | ||
644 | return; | 610 | return; |
645 | } | 611 | } |
646 | 612 | ||
@@ -648,9 +614,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) | |||
648 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | 614 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
649 | 615 | ||
650 | if (WARN_ON(!tid_tx)) { | 616 | if (WARN_ON(!tid_tx)) { |
651 | #ifdef CONFIG_MAC80211_HT_DEBUG | 617 | ht_vdbg("addBA was not requested!\n"); |
652 | printk(KERN_DEBUG "addBA was not requested!\n"); | ||
653 | #endif | ||
654 | goto unlock; | 618 | goto unlock; |
655 | } | 619 | } |
656 | 620 | ||
@@ -750,25 +714,17 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid) | |||
750 | trace_api_stop_tx_ba_cb(sdata, ra, tid); | 714 | trace_api_stop_tx_ba_cb(sdata, ra, tid); |
751 | 715 | ||
752 | if (tid >= STA_TID_NUM) { | 716 | if (tid >= STA_TID_NUM) { |
753 | #ifdef CONFIG_MAC80211_HT_DEBUG | 717 | ht_vdbg("Bad TID value: tid = %d (>= %d)\n", tid, STA_TID_NUM); |
754 | printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", | ||
755 | tid, STA_TID_NUM); | ||
756 | #endif | ||
757 | return; | 718 | return; |
758 | } | 719 | } |
759 | 720 | ||
760 | #ifdef CONFIG_MAC80211_HT_DEBUG | 721 | ht_vdbg("Stopping Tx BA session for %pM tid %d\n", ra, tid); |
761 | printk(KERN_DEBUG "Stopping Tx BA session for %pM tid %d\n", | ||
762 | ra, tid); | ||
763 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | ||
764 | 722 | ||
765 | mutex_lock(&local->sta_mtx); | 723 | mutex_lock(&local->sta_mtx); |
766 | 724 | ||
767 | sta = sta_info_get_bss(sdata, ra); | 725 | sta = sta_info_get_bss(sdata, ra); |
768 | if (!sta) { | 726 | if (!sta) { |
769 | #ifdef CONFIG_MAC80211_HT_DEBUG | 727 | ht_vdbg("Could not find station: %pM\n", ra); |
770 | printk(KERN_DEBUG "Could not find station: %pM\n", ra); | ||
771 | #endif | ||
772 | goto unlock; | 728 | goto unlock; |
773 | } | 729 | } |
774 | 730 | ||
@@ -777,9 +733,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid) | |||
777 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | 733 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
778 | 734 | ||
779 | if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { | 735 | if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { |
780 | #ifdef CONFIG_MAC80211_HT_DEBUG | 736 | ht_vdbg("unexpected callback to A-MPDU stop\n"); |
781 | printk(KERN_DEBUG "unexpected callback to A-MPDU stop\n"); | ||
782 | #endif | ||
783 | goto unlock_sta; | 737 | goto unlock_sta; |
784 | } | 738 | } |
785 | 739 | ||
@@ -855,17 +809,13 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
855 | goto out; | 809 | goto out; |
856 | 810 | ||
857 | if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) { | 811 | if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) { |
858 | #ifdef CONFIG_MAC80211_HT_DEBUG | 812 | ht_vdbg("wrong addBA response token, tid %d\n", tid); |
859 | printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid); | ||
860 | #endif | ||
861 | goto out; | 813 | goto out; |
862 | } | 814 | } |
863 | 815 | ||
864 | del_timer_sync(&tid_tx->addba_resp_timer); | 816 | del_timer_sync(&tid_tx->addba_resp_timer); |
865 | 817 | ||
866 | #ifdef CONFIG_MAC80211_HT_DEBUG | 818 | ht_vdbg("switched off addBA timer for tid %d\n", tid); |
867 | printk(KERN_DEBUG "switched off addBA timer for tid %d\n", tid); | ||
868 | #endif | ||
869 | 819 | ||
870 | /* | 820 | /* |
871 | * addba_resp_timer may have fired before we got here, and | 821 | * addba_resp_timer may have fired before we got here, and |
@@ -874,11 +824,8 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
874 | */ | 824 | */ |
875 | if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || | 825 | if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || |
876 | test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { | 826 | test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { |
877 | #ifdef CONFIG_MAC80211_HT_DEBUG | 827 | ht_vdbg("got addBA resp for tid %d but we already gave up\n", |
878 | printk(KERN_DEBUG | 828 | tid); |
879 | "got addBA resp for tid %d but we already gave up\n", | ||
880 | tid); | ||
881 | #endif | ||
882 | goto out; | 829 | goto out; |
883 | } | 830 | } |
884 | 831 | ||