aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ht.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-10-24 00:25:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:02:14 -0400
commit8b30b1fe368ab03049435884c11c5c50e4c4ef0b (patch)
tree02b27b36cf90267d59584b493ad652e3a4cc6a7e /net/mac80211/ht.c
parent4393dce9402c58744433c7a4f3931e17ddde4fb4 (diff)
mac80211: Re-enable aggregation
Wireless HW without any dedicated queues for aggregation do not need the ampdu_queues mechanism present right now in mac80211. Since mac80211 is still incomplete wrt TX MQ changes, do not allow aggregation sessions for drivers that set ampdu_queues. This is only an interim hack until Intel fixes the requeue issue. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Luis Rodriguez <Luis.Rodriguez@Atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ht.c')
-rw-r--r--net/mac80211/ht.c60
1 files changed, 35 insertions, 25 deletions
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 42c3e590df98..08009d4b7d6e 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -458,7 +458,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
458 u8 *state; 458 u8 *state;
459 int ret; 459 int ret;
460 460
461 if (tid >= STA_TID_NUM) 461 if ((tid >= STA_TID_NUM) || !(hw->flags & IEEE80211_HW_AMPDU_AGGREGATION))
462 return -EINVAL; 462 return -EINVAL;
463 463
464#ifdef CONFIG_MAC80211_HT_DEBUG 464#ifdef CONFIG_MAC80211_HT_DEBUG
@@ -515,17 +515,19 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
515 (unsigned long)&sta->timer_to_tid[tid]; 515 (unsigned long)&sta->timer_to_tid[tid];
516 init_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); 516 init_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
517 517
518 /* create a new queue for this aggregation */ 518 if (hw->ampdu_queues) {
519 ret = ieee80211_ht_agg_queue_add(local, sta, tid); 519 /* create a new queue for this aggregation */
520 ret = ieee80211_ht_agg_queue_add(local, sta, tid);
520 521
521 /* case no queue is available to aggregation 522 /* case no queue is available to aggregation
522 * don't switch to aggregation */ 523 * don't switch to aggregation */
523 if (ret) { 524 if (ret) {
524#ifdef CONFIG_MAC80211_HT_DEBUG 525#ifdef CONFIG_MAC80211_HT_DEBUG
525 printk(KERN_DEBUG "BA request denied - queue unavailable for" 526 printk(KERN_DEBUG "BA request denied - "
526 " tid %d\n", tid); 527 "queue unavailable for tid %d\n", tid);
527#endif /* CONFIG_MAC80211_HT_DEBUG */ 528#endif /* CONFIG_MAC80211_HT_DEBUG */
528 goto err_unlock_queue; 529 goto err_unlock_queue;
530 }
529 } 531 }
530 sdata = sta->sdata; 532 sdata = sta->sdata;
531 533
@@ -544,7 +546,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
544 /* No need to requeue the packets in the agg queue, since we 546 /* No need to requeue the packets in the agg queue, since we
545 * held the tx lock: no packet could be enqueued to the newly 547 * held the tx lock: no packet could be enqueued to the newly
546 * allocated queue */ 548 * allocated queue */
547 ieee80211_ht_agg_queue_remove(local, sta, tid, 0); 549 if (hw->ampdu_queues)
550 ieee80211_ht_agg_queue_remove(local, sta, tid, 0);
548#ifdef CONFIG_MAC80211_HT_DEBUG 551#ifdef CONFIG_MAC80211_HT_DEBUG
549 printk(KERN_DEBUG "BA request denied - HW unavailable for" 552 printk(KERN_DEBUG "BA request denied - HW unavailable for"
550 " tid %d\n", tid); 553 " tid %d\n", tid);
@@ -554,7 +557,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
554 } 557 }
555 558
556 /* Will put all the packets in the new SW queue */ 559 /* Will put all the packets in the new SW queue */
557 ieee80211_requeue(local, ieee802_1d_to_ac[tid]); 560 if (hw->ampdu_queues)
561 ieee80211_requeue(local, ieee802_1d_to_ac[tid]);
558 spin_unlock_bh(&sta->lock); 562 spin_unlock_bh(&sta->lock);
559 563
560 /* send an addBA request */ 564 /* send an addBA request */
@@ -622,7 +626,8 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
622 ra, tid); 626 ra, tid);
623#endif /* CONFIG_MAC80211_HT_DEBUG */ 627#endif /* CONFIG_MAC80211_HT_DEBUG */
624 628
625 ieee80211_stop_queue(hw, sta->tid_to_tx_q[tid]); 629 if (hw->ampdu_queues)
630 ieee80211_stop_queue(hw, sta->tid_to_tx_q[tid]);
626 631
627 *state = HT_AGG_STATE_REQ_STOP_BA_MSK | 632 *state = HT_AGG_STATE_REQ_STOP_BA_MSK |
628 (initiator << HT_AGG_STATE_INITIATOR_SHIFT); 633 (initiator << HT_AGG_STATE_INITIATOR_SHIFT);
@@ -635,7 +640,8 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
635 if (ret) { 640 if (ret) {
636 WARN_ON(ret != -EBUSY); 641 WARN_ON(ret != -EBUSY);
637 *state = HT_AGG_STATE_OPERATIONAL; 642 *state = HT_AGG_STATE_OPERATIONAL;
638 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); 643 if (hw->ampdu_queues)
644 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]);
639 goto stop_BA_exit; 645 goto stop_BA_exit;
640 } 646 }
641 647
@@ -691,7 +697,8 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
691#ifdef CONFIG_MAC80211_HT_DEBUG 697#ifdef CONFIG_MAC80211_HT_DEBUG
692 printk(KERN_DEBUG "Aggregation is on for tid %d \n", tid); 698 printk(KERN_DEBUG "Aggregation is on for tid %d \n", tid);
693#endif 699#endif
694 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); 700 if (hw->ampdu_queues)
701 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]);
695 } 702 }
696 spin_unlock_bh(&sta->lock); 703 spin_unlock_bh(&sta->lock);
697 rcu_read_unlock(); 704 rcu_read_unlock();
@@ -745,16 +752,18 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid)
745 ieee80211_send_delba(sta->sdata, ra, tid, 752 ieee80211_send_delba(sta->sdata, ra, tid,
746 WLAN_BACK_INITIATOR, WLAN_REASON_QSTA_NOT_USE); 753 WLAN_BACK_INITIATOR, WLAN_REASON_QSTA_NOT_USE);
747 754
748 agg_queue = sta->tid_to_tx_q[tid]; 755 if (hw->ampdu_queues) {
749 756 agg_queue = sta->tid_to_tx_q[tid];
750 ieee80211_ht_agg_queue_remove(local, sta, tid, 1); 757 ieee80211_ht_agg_queue_remove(local, sta, tid, 1);
751 758
752 /* We just requeued the all the frames that were in the 759 /* We just requeued the all the frames that were in the
753 * removed queue, and since we might miss a softirq we do 760 * removed queue, and since we might miss a softirq we do
754 * netif_schedule_queue. ieee80211_wake_queue is not used 761 * netif_schedule_queue. ieee80211_wake_queue is not used
755 * here as this queue is not necessarily stopped 762 * here as this queue is not necessarily stopped
756 */ 763 */
757 netif_schedule_queue(netdev_get_tx_queue(local->mdev, agg_queue)); 764 netif_schedule_queue(netdev_get_tx_queue(local->mdev,
765 agg_queue));
766 }
758 spin_lock_bh(&sta->lock); 767 spin_lock_bh(&sta->lock);
759 *state = HT_AGG_STATE_IDLE; 768 *state = HT_AGG_STATE_IDLE;
760 sta->ampdu_mlme.addba_req_num[tid] = 0; 769 sta->ampdu_mlme.addba_req_num[tid] = 0;
@@ -1011,7 +1020,8 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
1011 *state |= HT_ADDBA_RECEIVED_MSK; 1020 *state |= HT_ADDBA_RECEIVED_MSK;
1012 sta->ampdu_mlme.addba_req_num[tid] = 0; 1021 sta->ampdu_mlme.addba_req_num[tid] = 0;
1013 1022
1014 if (*state == HT_AGG_STATE_OPERATIONAL) 1023 if (*state == HT_AGG_STATE_OPERATIONAL &&
1024 local->hw.ampdu_queues)
1015 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); 1025 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]);
1016 1026
1017 spin_unlock_bh(&sta->lock); 1027 spin_unlock_bh(&sta->lock);