aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/agg-tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/agg-tx.c')
-rw-r--r--net/mac80211/agg-tx.c118
1 files changed, 38 insertions, 80 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index 7cf07158805c..d0deb3edae21 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -135,7 +135,8 @@ void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn)
135 bar->control = cpu_to_le16(bar_control); 135 bar->control = cpu_to_le16(bar_control);
136 bar->start_seq_num = cpu_to_le16(ssn); 136 bar->start_seq_num = cpu_to_le16(ssn);
137 137
138 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 138 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT |
139 IEEE80211_TX_CTL_REQ_TX_STATUS;
139 ieee80211_tx_skb_tid(sdata, skb, tid); 140 ieee80211_tx_skb_tid(sdata, skb, tid);
140} 141}
141EXPORT_SYMBOL(ieee80211_send_bar); 142EXPORT_SYMBOL(ieee80211_send_bar);
@@ -184,10 +185,8 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
184 185
185 spin_unlock_bh(&sta->lock); 186 spin_unlock_bh(&sta->lock);
186 187
187#ifdef CONFIG_MAC80211_HT_DEBUG 188 ht_dbg(sta->sdata, "Tx BA session stop requested for %pM tid %u\n",
188 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
189 sta->sta.addr, tid); 189 sta->sta.addr, tid);
190#endif /* CONFIG_MAC80211_HT_DEBUG */
191 190
192 del_timer_sync(&tid_tx->addba_resp_timer); 191 del_timer_sync(&tid_tx->addba_resp_timer);
193 del_timer_sync(&tid_tx->session_timer); 192 del_timer_sync(&tid_tx->session_timer);
@@ -253,17 +252,13 @@ static void sta_addba_resp_timer_expired(unsigned long data)
253 if (!tid_tx || 252 if (!tid_tx ||
254 test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) { 253 test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) {
255 rcu_read_unlock(); 254 rcu_read_unlock();
256#ifdef CONFIG_MAC80211_HT_DEBUG 255 ht_dbg(sta->sdata,
257 printk(KERN_DEBUG "timer expired on tid %d but we are not " 256 "timer expired on tid %d but we are not (or no longer) expecting addBA response there\n",
258 "(or no longer) expecting addBA response there\n", 257 tid);
259 tid);
260#endif
261 return; 258 return;
262 } 259 }
263 260
264#ifdef CONFIG_MAC80211_HT_DEBUG 261 ht_dbg(sta->sdata, "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 262
268 ieee80211_stop_tx_ba_session(&sta->sta, tid); 263 ieee80211_stop_tx_ba_session(&sta->sta, tid);
269 rcu_read_unlock(); 264 rcu_read_unlock();
@@ -323,8 +318,9 @@ ieee80211_agg_splice_packets(struct ieee80211_sub_if_data *sdata,
323 318
324 ieee80211_stop_queue_agg(sdata, tid); 319 ieee80211_stop_queue_agg(sdata, tid);
325 320
326 if (WARN(!tid_tx, "TID %d gone but expected when splicing aggregates" 321 if (WARN(!tid_tx,
327 " from the pending queue\n", tid)) 322 "TID %d gone but expected when splicing aggregates from the pending queue\n",
323 tid))
328 return; 324 return;
329 325
330 if (!skb_queue_empty(&tid_tx->pending)) { 326 if (!skb_queue_empty(&tid_tx->pending)) {
@@ -372,10 +368,8 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
372 ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START, 368 ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START,
373 &sta->sta, tid, &start_seq_num, 0); 369 &sta->sta, tid, &start_seq_num, 0);
374 if (ret) { 370 if (ret) {
375#ifdef CONFIG_MAC80211_HT_DEBUG 371 ht_dbg(sdata,
376 printk(KERN_DEBUG "BA request denied - HW unavailable for" 372 "BA request denied - HW unavailable for tid %d\n", tid);
377 " tid %d\n", tid);
378#endif
379 spin_lock_bh(&sta->lock); 373 spin_lock_bh(&sta->lock);
380 ieee80211_agg_splice_packets(sdata, tid_tx, tid); 374 ieee80211_agg_splice_packets(sdata, tid_tx, tid);
381 ieee80211_assign_tid_tx(sta, tid, NULL); 375 ieee80211_assign_tid_tx(sta, tid, NULL);
@@ -388,9 +382,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
388 382
389 /* activate the timer for the recipient's addBA response */ 383 /* activate the timer for the recipient's addBA response */
390 mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); 384 mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL);
391#ifdef CONFIG_MAC80211_HT_DEBUG 385 ht_dbg(sdata, "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 386
395 spin_lock_bh(&sta->lock); 387 spin_lock_bh(&sta->lock);
396 sta->ampdu_mlme.last_addba_req_time[tid] = jiffies; 388 sta->ampdu_mlme.last_addba_req_time[tid] = jiffies;
@@ -437,9 +429,7 @@ static void sta_tx_agg_session_timer_expired(unsigned long data)
437 429
438 rcu_read_unlock(); 430 rcu_read_unlock();
439 431
440#ifdef CONFIG_MAC80211_HT_DEBUG 432 ht_dbg(sta->sdata, "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 433
444 ieee80211_stop_tx_ba_session(&sta->sta, *ptid); 434 ieee80211_stop_tx_ba_session(&sta->sta, *ptid);
445} 435}
@@ -463,10 +453,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
463 (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW)) 453 (local->hw.flags & IEEE80211_HW_TX_AMPDU_SETUP_IN_HW))
464 return -EINVAL; 454 return -EINVAL;
465 455
466#ifdef CONFIG_MAC80211_HT_DEBUG 456 ht_dbg(sdata, "Open BA session requested for %pM tid %u\n",
467 printk(KERN_DEBUG "Open BA session requested for %pM tid %u\n",
468 pubsta->addr, tid); 457 pubsta->addr, tid);
469#endif /* CONFIG_MAC80211_HT_DEBUG */
470 458
471 if (sdata->vif.type != NL80211_IFTYPE_STATION && 459 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
472 sdata->vif.type != NL80211_IFTYPE_MESH_POINT && 460 sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
@@ -476,10 +464,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
476 return -EINVAL; 464 return -EINVAL;
477 465
478 if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) { 466 if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) {
479#ifdef CONFIG_MAC80211_HT_DEBUG 467 ht_dbg(sdata,
480 printk(KERN_DEBUG "BA sessions blocked. " 468 "BA sessions blocked - Denying BA session request\n");
481 "Denying BA session request\n");
482#endif
483 return -EINVAL; 469 return -EINVAL;
484 } 470 }
485 471
@@ -497,10 +483,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
497 */ 483 */
498 if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC && 484 if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC &&
499 !sta->sta.ht_cap.ht_supported) { 485 !sta->sta.ht_cap.ht_supported) {
500#ifdef CONFIG_MAC80211_HT_DEBUG 486 ht_dbg(sdata,
501 printk(KERN_DEBUG "BA request denied - IBSS STA %pM" 487 "BA request denied - IBSS STA %pM does not advertise HT support\n",
502 "does not advertise HT support\n", pubsta->addr); 488 pubsta->addr);
503#endif /* CONFIG_MAC80211_HT_DEBUG */
504 return -EINVAL; 489 return -EINVAL;
505 } 490 }
506 491
@@ -520,12 +505,9 @@ 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 && 505 if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES &&
521 time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] + 506 time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] +
522 HT_AGG_RETRIES_PERIOD)) { 507 HT_AGG_RETRIES_PERIOD)) {
523#ifdef CONFIG_MAC80211_HT_DEBUG 508 ht_dbg(sdata,
524 printk(KERN_DEBUG "BA request denied - " 509 "BA request denied - waiting a grace period after %d failed requests on tid %u\n",
525 "waiting a grace period after %d failed requests "
526 "on tid %u\n",
527 sta->ampdu_mlme.addba_req_num[tid], tid); 510 sta->ampdu_mlme.addba_req_num[tid], tid);
528#endif /* CONFIG_MAC80211_HT_DEBUG */
529 ret = -EBUSY; 511 ret = -EBUSY;
530 goto err_unlock_sta; 512 goto err_unlock_sta;
531 } 513 }
@@ -533,10 +515,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
533 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 515 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
534 /* check if the TID is not in aggregation flow already */ 516 /* check if the TID is not in aggregation flow already */
535 if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { 517 if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) {
536#ifdef CONFIG_MAC80211_HT_DEBUG 518 ht_dbg(sdata,
537 printk(KERN_DEBUG "BA request denied - session is not " 519 "BA request denied - session is not idle on tid %u\n",
538 "idle on tid %u\n", tid); 520 tid);
539#endif /* CONFIG_MAC80211_HT_DEBUG */
540 ret = -EAGAIN; 521 ret = -EAGAIN;
541 goto err_unlock_sta; 522 goto err_unlock_sta;
542 } 523 }
@@ -591,9 +572,7 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
591 572
592 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 573 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
593 574
594#ifdef CONFIG_MAC80211_HT_DEBUG 575 ht_dbg(sta->sdata, "Aggregation is on for tid %d\n", tid);
595 printk(KERN_DEBUG "Aggregation is on for tid %d\n", tid);
596#endif
597 576
598 drv_ampdu_action(local, sta->sdata, 577 drv_ampdu_action(local, sta->sdata,
599 IEEE80211_AMPDU_TX_OPERATIONAL, 578 IEEE80211_AMPDU_TX_OPERATIONAL,
@@ -627,10 +606,8 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid)
627 trace_api_start_tx_ba_cb(sdata, ra, tid); 606 trace_api_start_tx_ba_cb(sdata, ra, tid);
628 607
629 if (tid >= STA_TID_NUM) { 608 if (tid >= STA_TID_NUM) {
630#ifdef CONFIG_MAC80211_HT_DEBUG 609 ht_dbg(sdata, "Bad TID value: tid = %d (>= %d)\n",
631 printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", 610 tid, STA_TID_NUM);
632 tid, STA_TID_NUM);
633#endif
634 return; 611 return;
635 } 612 }
636 613
@@ -638,9 +615,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid)
638 sta = sta_info_get_bss(sdata, ra); 615 sta = sta_info_get_bss(sdata, ra);
639 if (!sta) { 616 if (!sta) {
640 mutex_unlock(&local->sta_mtx); 617 mutex_unlock(&local->sta_mtx);
641#ifdef CONFIG_MAC80211_HT_DEBUG 618 ht_dbg(sdata, "Could not find station: %pM\n", ra);
642 printk(KERN_DEBUG "Could not find station: %pM\n", ra);
643#endif
644 return; 619 return;
645 } 620 }
646 621
@@ -648,9 +623,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); 623 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
649 624
650 if (WARN_ON(!tid_tx)) { 625 if (WARN_ON(!tid_tx)) {
651#ifdef CONFIG_MAC80211_HT_DEBUG 626 ht_dbg(sdata, "addBA was not requested!\n");
652 printk(KERN_DEBUG "addBA was not requested!\n");
653#endif
654 goto unlock; 627 goto unlock;
655 } 628 }
656 629
@@ -750,25 +723,18 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid)
750 trace_api_stop_tx_ba_cb(sdata, ra, tid); 723 trace_api_stop_tx_ba_cb(sdata, ra, tid);
751 724
752 if (tid >= STA_TID_NUM) { 725 if (tid >= STA_TID_NUM) {
753#ifdef CONFIG_MAC80211_HT_DEBUG 726 ht_dbg(sdata, "Bad TID value: tid = %d (>= %d)\n",
754 printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", 727 tid, STA_TID_NUM);
755 tid, STA_TID_NUM);
756#endif
757 return; 728 return;
758 } 729 }
759 730
760#ifdef CONFIG_MAC80211_HT_DEBUG 731 ht_dbg(sdata, "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 732
765 mutex_lock(&local->sta_mtx); 733 mutex_lock(&local->sta_mtx);
766 734
767 sta = sta_info_get_bss(sdata, ra); 735 sta = sta_info_get_bss(sdata, ra);
768 if (!sta) { 736 if (!sta) {
769#ifdef CONFIG_MAC80211_HT_DEBUG 737 ht_dbg(sdata, "Could not find station: %pM\n", ra);
770 printk(KERN_DEBUG "Could not find station: %pM\n", ra);
771#endif
772 goto unlock; 738 goto unlock;
773 } 739 }
774 740
@@ -777,9 +743,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); 743 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
778 744
779 if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { 745 if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) {
780#ifdef CONFIG_MAC80211_HT_DEBUG 746 ht_dbg(sdata, "unexpected callback to A-MPDU stop\n");
781 printk(KERN_DEBUG "unexpected callback to A-MPDU stop\n");
782#endif
783 goto unlock_sta; 747 goto unlock_sta;
784 } 748 }
785 749
@@ -855,17 +819,13 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
855 goto out; 819 goto out;
856 820
857 if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) { 821 if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) {
858#ifdef CONFIG_MAC80211_HT_DEBUG 822 ht_dbg(sta->sdata, "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; 823 goto out;
862 } 824 }
863 825
864 del_timer_sync(&tid_tx->addba_resp_timer); 826 del_timer_sync(&tid_tx->addba_resp_timer);
865 827
866#ifdef CONFIG_MAC80211_HT_DEBUG 828 ht_dbg(sta->sdata, "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 829
870 /* 830 /*
871 * addba_resp_timer may have fired before we got here, and 831 * addba_resp_timer may have fired before we got here, and
@@ -874,11 +834,9 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
874 */ 834 */
875 if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || 835 if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) ||
876 test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { 836 test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) {
877#ifdef CONFIG_MAC80211_HT_DEBUG 837 ht_dbg(sta->sdata,
878 printk(KERN_DEBUG
879 "got addBA resp for tid %d but we already gave up\n", 838 "got addBA resp for tid %d but we already gave up\n",
880 tid); 839 tid);
881#endif
882 goto out; 840 goto out;
883 } 841 }
884 842