aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-04-19 13:57:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-20 11:50:53 -0400
commit0e668cde0d78fb1b5f1f5e9a4bf7f9900269c98e (patch)
tree5651baaf61c0da81b0a9e5baf7ecd701de6ee9bd /drivers/net
parent7817e4ceb64a53c518bc45b02819e0e57a4c4d83 (diff)
ath9k: update the ath_max_4ms_framelen table
Include MCS0-31 and also add SGI for HT20. This makes it possible to support more different rate combinations with newer hardware. Based on a patch by Selvam. T. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 5d3d5635b92f..4078982fb9e9 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -71,24 +71,36 @@ static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
71 int nbad, int txok, bool update_rc); 71 int nbad, int txok, bool update_rc);
72 72
73enum { 73enum {
74 MCS_DEFAULT, 74 MCS_HT20,
75 MCS_HT20_SGI,
75 MCS_HT40, 76 MCS_HT40,
76 MCS_HT40_SGI, 77 MCS_HT40_SGI,
77}; 78};
78 79
79static int ath_max_4ms_framelen[3][16] = { 80static int ath_max_4ms_framelen[4][32] = {
80 [MCS_DEFAULT] = { 81 [MCS_HT20] = {
81 3216, 6434, 9650, 12868, 19304, 25740, 28956, 32180, 82 3212, 6432, 9648, 12864, 19300, 25736, 28952, 32172,
82 6430, 12860, 19300, 25736, 38600, 51472, 57890, 64320, 83 6424, 12852, 19280, 25708, 38568, 51424, 57852, 64280,
84 9628, 19260, 28896, 38528, 57792, 65532, 65532, 65532,
85 12828, 25656, 38488, 51320, 65532, 65532, 65532, 65532,
86 },
87 [MCS_HT20_SGI] = {
88 3572, 7144, 10720, 14296, 21444, 28596, 32172, 35744,
89 7140, 14284, 21428, 28568, 42856, 57144, 64288, 65532,
90 10700, 21408, 32112, 42816, 64228, 65532, 65532, 65532,
91 14256, 28516, 42780, 57040, 65532, 65532, 65532, 65532,
83 }, 92 },
84 [MCS_HT40] = { 93 [MCS_HT40] = {
85 6684, 13368, 20052, 26738, 40104, 53476, 60156, 66840, 94 6680, 13360, 20044, 26724, 40092, 53456, 60140, 65532,
86 13360, 26720, 40080, 53440, 80160, 106880, 120240, 133600, 95 13348, 26700, 40052, 53400, 65532, 65532, 65532, 65532,
96 20004, 40008, 60016, 65532, 65532, 65532, 65532, 65532,
97 26644, 53292, 65532, 65532, 65532, 65532, 65532, 65532,
87 }, 98 },
88 [MCS_HT40_SGI] = { 99 [MCS_HT40_SGI] = {
89 /* TODO: Only MCS 7 and 15 updated, recalculate the rest */ 100 7420, 14844, 22272, 29696, 44544, 59396, 65532, 65532,
90 6684, 13368, 20052, 26738, 40104, 53476, 60156, 74200, 101 14832, 29668, 44504, 59340, 65532, 65532, 65532, 65532,
91 13360, 26720, 40080, 53440, 80160, 106880, 120240, 148400, 102 22232, 44464, 65532, 65532, 65532, 65532, 65532, 65532,
103 29616, 59232, 65532, 65532, 65532, 65532, 65532, 65532,
92 } 104 }
93}; 105};
94 106
@@ -538,12 +550,13 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
538 break; 550 break;
539 } 551 }
540 552
541 if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI) 553 if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
542 modeidx = MCS_HT40_SGI;
543 else if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
544 modeidx = MCS_HT40; 554 modeidx = MCS_HT40;
545 else 555 else
546 modeidx = MCS_DEFAULT; 556 modeidx = MCS_HT20;
557
558 if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
559 modeidx++;
547 560
548 frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx]; 561 frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx];
549 max_4ms_framelen = min(max_4ms_framelen, frmlen); 562 max_4ms_framelen = min(max_4ms_framelen, frmlen);