diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-11-23 16:21:01 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-28 15:04:24 -0500 |
commit | 545750d36fa78203e28acefb4bab61ebb7c4d197 (patch) | |
tree | c9810428acf0bd673c6cd9ed74e6eb273c923842 /drivers/net/wireless/ath/ath9k/hw.c | |
parent | 04658fba2314d6d70d5fa05c0b5995e6428aacc3 (diff) |
ath9k: properly use the mac80211 rate control api
This patch changes ath9k to pass proper MCS indexes and flags
between the RC and the rest of the driver code.
sc->cur_rate_table remains, as it's used by the RC code internally,
but the rest of the driver code no longer uses it, so a potential
new RC for ath9k would not have to update it.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 53a7b980d8f6..63d84613dc96 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -148,22 +148,19 @@ bool ath9k_get_channel_edges(struct ath_hw *ah, | |||
148 | } | 148 | } |
149 | 149 | ||
150 | u16 ath9k_hw_computetxtime(struct ath_hw *ah, | 150 | u16 ath9k_hw_computetxtime(struct ath_hw *ah, |
151 | const struct ath_rate_table *rates, | 151 | u8 phy, int kbps, |
152 | u32 frameLen, u16 rateix, | 152 | u32 frameLen, u16 rateix, |
153 | bool shortPreamble) | 153 | bool shortPreamble) |
154 | { | 154 | { |
155 | u32 bitsPerSymbol, numBits, numSymbols, phyTime, txTime; | 155 | u32 bitsPerSymbol, numBits, numSymbols, phyTime, txTime; |
156 | u32 kbps; | ||
157 | |||
158 | kbps = rates->info[rateix].ratekbps; | ||
159 | 156 | ||
160 | if (kbps == 0) | 157 | if (kbps == 0) |
161 | return 0; | 158 | return 0; |
162 | 159 | ||
163 | switch (rates->info[rateix].phy) { | 160 | switch (phy) { |
164 | case WLAN_RC_PHY_CCK: | 161 | case WLAN_RC_PHY_CCK: |
165 | phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS; | 162 | phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS; |
166 | if (shortPreamble && rates->info[rateix].short_preamble) | 163 | if (shortPreamble) |
167 | phyTime >>= 1; | 164 | phyTime >>= 1; |
168 | numBits = frameLen << 3; | 165 | numBits = frameLen << 3; |
169 | txTime = CCK_SIFS_TIME + phyTime + ((numBits * 1000) / kbps); | 166 | txTime = CCK_SIFS_TIME + phyTime + ((numBits * 1000) / kbps); |
@@ -194,8 +191,7 @@ u16 ath9k_hw_computetxtime(struct ath_hw *ah, | |||
194 | break; | 191 | break; |
195 | default: | 192 | default: |
196 | ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, | 193 | ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, |
197 | "Unknown phy %u (rate ix %u)\n", | 194 | "Unknown phy %u (rate ix %u)\n", phy, rateix); |
198 | rates->info[rateix].phy, rateix); | ||
199 | txTime = 0; | 195 | txTime = 0; |
200 | break; | 196 | break; |
201 | } | 197 | } |