aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2011-08-13 00:58:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 13:59:44 -0400
commit7a12dfdbf508fed2cbd1a9142c6e19341a55527b (patch)
treea62b62068dc66a39187baaf93ae0d1af6483a677 /drivers/net/wireless
parent16dd7267f460739b3e29d984e73f05c5ffe2b142 (diff)
ath9k_hw: Fix exceed transmission burst-time of 5GHz
The WAR which adds extra delimiters when using RTS/CTS with aggregation and non-enterprise AR9003 chips. This extra padding is done after doing all the 4ms limit checks and hence the total aggregate sizes are exceeding the allowed duration. This patch limits the aggregate sizes appropriately after including these extra delimiters. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mac.c28
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c16
2 files changed, 15 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index 1aadc4757e67..81ccce1faff5 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -415,36 +415,12 @@ static void ar9003_hw_set11n_ratescenario(struct ath_hw *ah, void *ds,
415static void ar9003_hw_set11n_aggr_first(struct ath_hw *ah, void *ds, 415static void ar9003_hw_set11n_aggr_first(struct ath_hw *ah, void *ds,
416 u32 aggrLen) 416 u32 aggrLen)
417{ 417{
418#define FIRST_DESC_NDELIMS 60
419 struct ar9003_txc *ads = (struct ar9003_txc *) ds; 418 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
420 419
421 ads->ctl12 |= (AR_IsAggr | AR_MoreAggr); 420 ads->ctl12 |= (AR_IsAggr | AR_MoreAggr);
422 421
423 if (ah->ent_mode & AR_ENT_OTP_MPSD) { 422 ads->ctl17 &= ~AR_AggrLen;
424 u32 ctl17, ndelim; 423 ads->ctl17 |= SM(aggrLen, AR_AggrLen);
425 /*
426 * Add delimiter when using RTS/CTS with aggregation
427 * and non enterprise AR9003 card
428 */
429 ctl17 = ads->ctl17;
430 ndelim = MS(ctl17, AR_PadDelim);
431
432 if (ndelim < FIRST_DESC_NDELIMS) {
433 aggrLen += (FIRST_DESC_NDELIMS - ndelim) * 4;
434 ndelim = FIRST_DESC_NDELIMS;
435 }
436
437 ctl17 &= ~AR_AggrLen;
438 ctl17 |= SM(aggrLen, AR_AggrLen);
439
440 ctl17 &= ~AR_PadDelim;
441 ctl17 |= SM(ndelim, AR_PadDelim);
442
443 ads->ctl17 = ctl17;
444 } else {
445 ads->ctl17 &= ~AR_AggrLen;
446 ads->ctl17 |= SM(aggrLen, AR_AggrLen);
447 }
448} 424}
449 425
450static void ar9003_hw_set11n_aggr_middle(struct ath_hw *ah, void *ds, 426static void ar9003_hw_set11n_aggr_middle(struct ath_hw *ah, void *ds,
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index e1d1e903229b..feef0135515c 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -644,8 +644,10 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
644 * meet the minimum required mpdudensity. 644 * meet the minimum required mpdudensity.
645 */ 645 */
646static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid, 646static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid,
647 struct ath_buf *bf, u16 frmlen) 647 struct ath_buf *bf, u16 frmlen,
648 bool first_subfrm)
648{ 649{
650#define FIRST_DESC_NDELIMS 60
649 struct sk_buff *skb = bf->bf_mpdu; 651 struct sk_buff *skb = bf->bf_mpdu;
650 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 652 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
651 u32 nsymbits, nsymbols; 653 u32 nsymbits, nsymbols;
@@ -668,6 +670,13 @@ static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid,
668 ndelim += ATH_AGGR_ENCRYPTDELIM; 670 ndelim += ATH_AGGR_ENCRYPTDELIM;
669 671
670 /* 672 /*
673 * Add delimiter when using RTS/CTS with aggregation
674 * and non enterprise AR9003 card
675 */
676 if (first_subfrm)
677 ndelim = max(ndelim, FIRST_DESC_NDELIMS);
678
679 /*
671 * Convert desired mpdu density from microeconds to bytes based 680 * Convert desired mpdu density from microeconds to bytes based
672 * on highest rate in rate series (i.e. first rate) to determine 681 * on highest rate in rate series (i.e. first rate) to determine
673 * required minimum length for subframe. Take into account 682 * required minimum length for subframe. Take into account
@@ -756,7 +765,6 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
756 status = ATH_AGGR_LIMITED; 765 status = ATH_AGGR_LIMITED;
757 break; 766 break;
758 } 767 }
759 nframes++;
760 768
761 /* add padding for previous frame to aggregation length */ 769 /* add padding for previous frame to aggregation length */
762 al += bpad + al_delta; 770 al += bpad + al_delta;
@@ -765,9 +773,11 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
765 * Get the delimiters needed to meet the MPDU 773 * Get the delimiters needed to meet the MPDU
766 * density for this node. 774 * density for this node.
767 */ 775 */
768 ndelim = ath_compute_num_delims(sc, tid, bf_first, fi->framelen); 776 ndelim = ath_compute_num_delims(sc, tid, bf_first, fi->framelen,
777 !nframes);
769 bpad = PADBYTES(al_delta) + (ndelim << 2); 778 bpad = PADBYTES(al_delta) + (ndelim << 2);
770 779
780 nframes++;
771 bf->bf_next = NULL; 781 bf->bf_next = NULL;
772 ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, 0); 782 ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, 0);
773 783