aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c35
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c24
3 files changed, 8 insertions, 53 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 4e81fe35aa3f..e435c1d38826 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -623,8 +623,6 @@ struct ath_softc {
623 struct ath_rx rx; 623 struct ath_rx rx;
624 struct ath_tx tx; 624 struct ath_tx tx;
625 struct ath_beacon beacon; 625 struct ath_beacon beacon;
626 const struct ath_rate_table *cur_rate_table;
627 enum wireless_mode cur_rate_mode;
628 struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; 626 struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
629 627
630 struct ath_led radio_led; 628 struct ath_led radio_led;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 2c7f28e022b8..3ff0e476c2b3 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -18,36 +18,6 @@
18#include "ath9k.h" 18#include "ath9k.h"
19#include "btcoex.h" 19#include "btcoex.h"
20 20
21static void ath_cache_conf_rate(struct ath_softc *sc,
22 struct ieee80211_conf *conf)
23{
24 switch (conf->channel->band) {
25 case IEEE80211_BAND_2GHZ:
26 if (conf_is_ht20(conf))
27 sc->cur_rate_mode = ATH9K_MODE_11NG_HT20;
28 else if (conf_is_ht40_minus(conf))
29 sc->cur_rate_mode = ATH9K_MODE_11NG_HT40MINUS;
30 else if (conf_is_ht40_plus(conf))
31 sc->cur_rate_mode = ATH9K_MODE_11NG_HT40PLUS;
32 else
33 sc->cur_rate_mode = ATH9K_MODE_11G;
34 break;
35 case IEEE80211_BAND_5GHZ:
36 if (conf_is_ht20(conf))
37 sc->cur_rate_mode = ATH9K_MODE_11NA_HT20;
38 else if (conf_is_ht40_minus(conf))
39 sc->cur_rate_mode = ATH9K_MODE_11NA_HT40MINUS;
40 else if (conf_is_ht40_plus(conf))
41 sc->cur_rate_mode = ATH9K_MODE_11NA_HT40PLUS;
42 else
43 sc->cur_rate_mode = ATH9K_MODE_11A;
44 break;
45 default:
46 BUG_ON(1);
47 break;
48 }
49}
50
51static void ath_update_txpow(struct ath_softc *sc) 21static void ath_update_txpow(struct ath_softc *sc)
52{ 22{
53 struct ath_hw *ah = sc->sc_ah; 23 struct ath_hw *ah = sc->sc_ah;
@@ -306,7 +276,6 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
306 goto ps_restore; 276 goto ps_restore;
307 } 277 }
308 278
309 ath_cache_conf_rate(sc, &hw->conf);
310 ath_update_txpow(sc); 279 ath_update_txpow(sc);
311 ath9k_hw_set_interrupts(ah, ah->imask); 280 ath9k_hw_set_interrupts(ah, ah->imask);
312 281
@@ -1013,8 +982,6 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
1013 * that changes the channel so update any state that 982 * that changes the channel so update any state that
1014 * might change as a result. 983 * might change as a result.
1015 */ 984 */
1016 ath_cache_conf_rate(sc, &hw->conf);
1017
1018 ath_update_txpow(sc); 985 ath_update_txpow(sc);
1019 986
1020 if ((sc->sc_flags & SC_OP_BEACONS) || !(sc->sc_flags & (SC_OP_OFFCHANNEL))) 987 if ((sc->sc_flags & SC_OP_BEACONS) || !(sc->sc_flags & (SC_OP_OFFCHANNEL)))
@@ -1221,8 +1188,6 @@ static int ath9k_start(struct ieee80211_hw *hw)
1221 if (ah->caps.hw_caps & ATH9K_HW_CAP_HT) 1188 if (ah->caps.hw_caps & ATH9K_HW_CAP_HT)
1222 ah->imask |= ATH9K_INT_CST; 1189 ah->imask |= ATH9K_INT_CST;
1223 1190
1224 ath_cache_conf_rate(sc, &hw->conf);
1225
1226 sc->sc_flags &= ~SC_OP_INVALID; 1191 sc->sc_flags &= ~SC_OP_INVALID;
1227 1192
1228 /* Disable BMISS interrupt when we're not associated */ 1193 /* Disable BMISS interrupt when we're not associated */
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 5db3a12356ec..2d3a67fc9bbf 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -791,7 +791,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
791 */ 791 */
792 try_per_rate = 4; 792 try_per_rate = 4;
793 793
794 rate_table = sc->cur_rate_table; 794 rate_table = ath_rc_priv->rate_table;
795 rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe); 795 rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe);
796 796
797 /* 797 /*
@@ -1048,7 +1048,7 @@ static void ath_rc_update_ht(struct ath_softc *sc,
1048 int rate; 1048 int rate;
1049 u8 last_per; 1049 u8 last_per;
1050 bool state_change = false; 1050 bool state_change = false;
1051 const struct ath_rate_table *rate_table = sc->cur_rate_table; 1051 const struct ath_rate_table *rate_table = ath_rc_priv->rate_table;
1052 int size = ath_rc_priv->rate_table_size; 1052 int size = ath_rc_priv->rate_table_size;
1053 1053
1054 if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt)) 1054 if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt))
@@ -1150,7 +1150,7 @@ static void ath_rc_tx_status(struct ath_softc *sc,
1150 u8 flags; 1150 u8 flags;
1151 u32 i = 0, rix; 1151 u32 i = 0, rix;
1152 1152
1153 rate_table = sc->cur_rate_table; 1153 rate_table = ath_rc_priv->rate_table;
1154 1154
1155 /* 1155 /*
1156 * If the first rate is not the final index, there 1156 * If the first rate is not the final index, there
@@ -1231,7 +1231,6 @@ struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc,
1231 ath_print(common, ATH_DBG_CONFIG, 1231 ath_print(common, ATH_DBG_CONFIG,
1232 "Choosing rate table for mode: %d\n", mode); 1232 "Choosing rate table for mode: %d\n", mode);
1233 1233
1234 sc->cur_rate_mode = mode;
1235 return hw_rate_table[mode]; 1234 return hw_rate_table[mode];
1236} 1235}
1237 1236
@@ -1303,7 +1302,6 @@ static void ath_rc_init(struct ath_softc *sc,
1303 ath_rc_priv->max_valid_rate = k; 1302 ath_rc_priv->max_valid_rate = k;
1304 ath_rc_sort_validrates(rate_table, ath_rc_priv); 1303 ath_rc_sort_validrates(rate_table, ath_rc_priv);
1305 ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4]; 1304 ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4];
1306 sc->cur_rate_table = rate_table;
1307 ath_rc_priv->rate_table = rate_table; 1305 ath_rc_priv->rate_table = rate_table;
1308 1306
1309 ath_print(common, ATH_DBG_CONFIG, 1307 ath_print(common, ATH_DBG_CONFIG,
@@ -1439,8 +1437,9 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
1439 } 1437 }
1440 } 1438 }
1441 1439
1442 ath_debug_stat_rc(ath_rc_priv, ath_rc_get_rateindex(sc->cur_rate_table, 1440 ath_debug_stat_rc(ath_rc_priv,
1443 &tx_info->status.rates[final_ts_idx])); 1441 ath_rc_get_rateindex(ath_rc_priv->rate_table,
1442 &tx_info->status.rates[final_ts_idx]));
1444} 1443}
1445 1444
1446static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, 1445static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
@@ -1480,14 +1479,8 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
1480 1479
1481 /* Choose rate table first */ 1480 /* Choose rate table first */
1482 1481
1483 if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) || 1482 rate_table = ath_choose_rate_table(sc, sband->band,
1484 (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT) || 1483 sta->ht_cap.ht_supported, is_cw40);
1485 (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC)) {
1486 rate_table = ath_choose_rate_table(sc, sband->band,
1487 sta->ht_cap.ht_supported, is_cw40);
1488 } else {
1489 rate_table = hw_rate_table[sc->cur_rate_mode];
1490 }
1491 1484
1492 ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, is_cw40, is_sgi); 1485 ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, is_cw40, is_sgi);
1493 ath_rc_init(sc, priv_sta, sband, sta, rate_table); 1486 ath_rc_init(sc, priv_sta, sband, sta, rate_table);
@@ -1536,7 +1529,6 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1536 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG, 1529 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG,
1537 "Operating HT Bandwidth changed to: %d\n", 1530 "Operating HT Bandwidth changed to: %d\n",
1538 sc->hw->conf.channel_type); 1531 sc->hw->conf.channel_type);
1539 sc->cur_rate_table = hw_rate_table[sc->cur_rate_mode];
1540 } 1532 }
1541 } 1533 }
1542} 1534}