aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2009-04-24 15:35:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:38 -0400
commit083c4687bc3abc315c73830b9c74ad67e005d8c2 (patch)
tree5e93963446a63f9d7e0537cb6617699c64281dd6 /drivers/net
parent16cf438a1eca2b7206bd7ac7763637c2a87c00c6 (diff)
ar9170: handle otus' A-MPDU density definitions
Otus uses slightly different set of "Minimum MPDU Start Spacing" values than the 802.11n D2.0 specifies. (the whole table is shifted by one and therefore the 16us spacing is not officially available!) And while we're at it, we also initialize our MAC's density register. So, this annoying _feature_ will not break TX A-MPDU later. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ar9170/hw.h2
-rw-r--r--drivers/net/wireless/ath/ar9170/mac.c23
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c4
3 files changed, 27 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ar9170/hw.h b/drivers/net/wireless/ath/ar9170/hw.h
index 95bf812d6fc..3293e0fb24f 100644
--- a/drivers/net/wireless/ath/ar9170/hw.h
+++ b/drivers/net/wireless/ath/ar9170/hw.h
@@ -207,6 +207,8 @@ enum ar9170_cmd {
207#define AR9170_MAC_REG_AC1_AC0_TXOP (AR9170_MAC_REG_BASE + 0xB44) 207#define AR9170_MAC_REG_AC1_AC0_TXOP (AR9170_MAC_REG_BASE + 0xB44)
208#define AR9170_MAC_REG_AC3_AC2_TXOP (AR9170_MAC_REG_BASE + 0xB48) 208#define AR9170_MAC_REG_AC3_AC2_TXOP (AR9170_MAC_REG_BASE + 0xB48)
209 209
210#define AR9170_MAC_REG_AMPDU_SET (AR9170_MAC_REG_BASE + 0xba0)
211
210#define AR9170_MAC_REG_ACK_TABLE (AR9170_MAC_REG_BASE + 0xC00) 212#define AR9170_MAC_REG_ACK_TABLE (AR9170_MAC_REG_BASE + 0xC00)
211#define AR9170_MAC_REG_AMPDU_RX_THRESH (AR9170_MAC_REG_BASE + 0xC50) 213#define AR9170_MAC_REG_AMPDU_RX_THRESH (AR9170_MAC_REG_BASE + 0xC50)
212 214
diff --git a/drivers/net/wireless/ath/ar9170/mac.c b/drivers/net/wireless/ath/ar9170/mac.c
index 0e5967dd119..45986b6eadb 100644
--- a/drivers/net/wireless/ath/ar9170/mac.c
+++ b/drivers/net/wireless/ath/ar9170/mac.c
@@ -72,6 +72,24 @@ int ar9170_set_qos(struct ar9170 *ar)
72 return ar9170_regwrite_result(); 72 return ar9170_regwrite_result();
73} 73}
74 74
75static int ar9170_set_ampdu_density(struct ar9170 *ar, u8 mpdudensity)
76{
77 u32 val;
78
79 /* don't allow AMPDU density > 8us */
80 if (mpdudensity > 6)
81 return -EINVAL;
82
83 /* Watch out! Otus uses slightly different density values. */
84 val = 0x140a00 | (mpdudensity ? (mpdudensity + 1) : 0);
85
86 ar9170_regwrite_begin(ar);
87 ar9170_regwrite(AR9170_MAC_REG_AMPDU_SET, val);
88 ar9170_regwrite_finish();
89
90 return ar9170_regwrite_result();
91}
92
75int ar9170_init_mac(struct ar9170 *ar) 93int ar9170_init_mac(struct ar9170 *ar)
76{ 94{
77 ar9170_regwrite_begin(ar); 95 ar9170_regwrite_begin(ar);
@@ -296,6 +314,11 @@ int ar9170_set_operating_mode(struct ar9170 *ar)
296 if (err) 314 if (err)
297 return err; 315 return err;
298 316
317 /* set AMPDU density to 8us. */
318 err = ar9170_set_ampdu_density(ar, 6);
319 if (err)
320 return err;
321
299 ar9170_regwrite_begin(ar); 322 ar9170_regwrite_begin(ar);
300 323
301 ar9170_regwrite(AR9170_MAC_REG_POWERMANAGEMENT, pm_mode); 324 ar9170_regwrite(AR9170_MAC_REG_POWERMANAGEMENT, pm_mode);
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 3bd3a61225c..4ef1d2fc859 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -151,8 +151,8 @@ static struct ieee80211_channel ar9170_5ghz_chantable[] = {
151 IEEE80211_HT_CAP_SGI_40 | \ 151 IEEE80211_HT_CAP_SGI_40 | \
152 IEEE80211_HT_CAP_DSSSCCK40 | \ 152 IEEE80211_HT_CAP_DSSSCCK40 | \
153 IEEE80211_HT_CAP_SM_PS, \ 153 IEEE80211_HT_CAP_SM_PS, \
154 .ampdu_factor = 3, /* ?? */ \ 154 .ampdu_factor = 3, \
155 .ampdu_density = 7, /* ?? */ \ 155 .ampdu_density = 6, \
156 .mcs = { \ 156 .mcs = { \
157 .rx_mask = { 0xFF, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, }, \ 157 .rx_mask = { 0xFF, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, }, \
158 }, \ 158 }, \