diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-10-14 10:02:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-15 15:48:45 -0400 |
commit | d4659912b557e9f68c0ad8be14e2cafd3210dd16 (patch) | |
tree | 5bd3dbc2b7ba736ff1dc0717154e7b592a22c32f /drivers/net/wireless/ath/ath9k/rc.c | |
parent | 4e9900180eb72b3b22fc9742999045b11607eb24 (diff) |
ath9k_hw: remove enum wireless_mode and its users
The wireless mode bitfield was only used to detect 2.4 and 5 GHz support,
which can be simplified by using ATH9K_HW_CAP_* capabilities.
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/rc.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 2d3a67fc9bbf..0cee90cf8dc9 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -378,17 +378,6 @@ static const struct ath_rate_table ar5416_11g_ratetable = { | |||
378 | 0, /* Phy rates allowed initially */ | 378 | 0, /* Phy rates allowed initially */ |
379 | }; | 379 | }; |
380 | 380 | ||
381 | static const struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX] = { | ||
382 | [ATH9K_MODE_11A] = &ar5416_11a_ratetable, | ||
383 | [ATH9K_MODE_11G] = &ar5416_11g_ratetable, | ||
384 | [ATH9K_MODE_11NA_HT20] = &ar5416_11na_ratetable, | ||
385 | [ATH9K_MODE_11NG_HT20] = &ar5416_11ng_ratetable, | ||
386 | [ATH9K_MODE_11NA_HT40PLUS] = &ar5416_11na_ratetable, | ||
387 | [ATH9K_MODE_11NA_HT40MINUS] = &ar5416_11na_ratetable, | ||
388 | [ATH9K_MODE_11NG_HT40PLUS] = &ar5416_11ng_ratetable, | ||
389 | [ATH9K_MODE_11NG_HT40MINUS] = &ar5416_11ng_ratetable, | ||
390 | }; | ||
391 | |||
392 | static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table, | 381 | static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table, |
393 | struct ieee80211_tx_rate *rate); | 382 | struct ieee80211_tx_rate *rate); |
394 | 383 | ||
@@ -1200,38 +1189,23 @@ static void ath_rc_tx_status(struct ath_softc *sc, | |||
1200 | static const | 1189 | static const |
1201 | struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc, | 1190 | struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc, |
1202 | enum ieee80211_band band, | 1191 | enum ieee80211_band band, |
1203 | bool is_ht, | 1192 | bool is_ht) |
1204 | bool is_cw_40) | ||
1205 | { | 1193 | { |
1206 | int mode = 0; | ||
1207 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1194 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
1208 | 1195 | ||
1209 | switch(band) { | 1196 | switch(band) { |
1210 | case IEEE80211_BAND_2GHZ: | 1197 | case IEEE80211_BAND_2GHZ: |
1211 | mode = ATH9K_MODE_11G; | ||
1212 | if (is_ht) | 1198 | if (is_ht) |
1213 | mode = ATH9K_MODE_11NG_HT20; | 1199 | return &ar5416_11ng_ratetable; |
1214 | if (is_cw_40) | 1200 | return &ar5416_11g_ratetable; |
1215 | mode = ATH9K_MODE_11NG_HT40PLUS; | ||
1216 | break; | ||
1217 | case IEEE80211_BAND_5GHZ: | 1201 | case IEEE80211_BAND_5GHZ: |
1218 | mode = ATH9K_MODE_11A; | ||
1219 | if (is_ht) | 1202 | if (is_ht) |
1220 | mode = ATH9K_MODE_11NA_HT20; | 1203 | return &ar5416_11na_ratetable; |
1221 | if (is_cw_40) | 1204 | return &ar5416_11a_ratetable; |
1222 | mode = ATH9K_MODE_11NA_HT40PLUS; | ||
1223 | break; | ||
1224 | default: | 1205 | default: |
1225 | ath_print(common, ATH_DBG_CONFIG, "Invalid band\n"); | 1206 | ath_print(common, ATH_DBG_CONFIG, "Invalid band\n"); |
1226 | return NULL; | 1207 | return NULL; |
1227 | } | 1208 | } |
1228 | |||
1229 | BUG_ON(mode >= ATH9K_MODE_MAX); | ||
1230 | |||
1231 | ath_print(common, ATH_DBG_CONFIG, | ||
1232 | "Choosing rate table for mode: %d\n", mode); | ||
1233 | |||
1234 | return hw_rate_table[mode]; | ||
1235 | } | 1209 | } |
1236 | 1210 | ||
1237 | static void ath_rc_init(struct ath_softc *sc, | 1211 | static void ath_rc_init(struct ath_softc *sc, |
@@ -1480,7 +1454,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
1480 | /* Choose rate table first */ | 1454 | /* Choose rate table first */ |
1481 | 1455 | ||
1482 | rate_table = ath_choose_rate_table(sc, sband->band, | 1456 | rate_table = ath_choose_rate_table(sc, sband->band, |
1483 | sta->ht_cap.ht_supported, is_cw40); | 1457 | sta->ht_cap.ht_supported); |
1484 | 1458 | ||
1485 | ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, is_cw40, is_sgi); | 1459 | ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, is_cw40, is_sgi); |
1486 | ath_rc_init(sc, priv_sta, sband, sta, rate_table); | 1460 | ath_rc_init(sc, priv_sta, sband, sta, rate_table); |
@@ -1520,8 +1494,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, | |||
1520 | 1494 | ||
1521 | if ((local_cw40 != oper_cw40) || (local_sgi != oper_sgi)) { | 1495 | if ((local_cw40 != oper_cw40) || (local_sgi != oper_sgi)) { |
1522 | rate_table = ath_choose_rate_table(sc, sband->band, | 1496 | rate_table = ath_choose_rate_table(sc, sband->band, |
1523 | sta->ht_cap.ht_supported, | 1497 | sta->ht_cap.ht_supported); |
1524 | oper_cw40); | ||
1525 | ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, | 1498 | ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, |
1526 | oper_cw40, oper_sgi); | 1499 | oper_cw40, oper_sgi); |
1527 | ath_rc_init(sc, priv_sta, sband, sta, rate_table); | 1500 | ath_rc_init(sc, priv_sta, sband, sta, rate_table); |