1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3 @@ -624,8 +624,6 @@ struct ath_softc {
6 struct ath_beacon beacon;
7 - const struct ath_rate_table *cur_rate_table;
8 - enum wireless_mode cur_rate_mode;
9 struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
11 struct ath_led radio_led;
12 --- a/drivers/net/wireless/ath/ath9k/main.c
13 +++ b/drivers/net/wireless/ath/ath9k/main.c
18 -static void ath_cache_conf_rate(struct ath_softc *sc,
19 - struct ieee80211_conf *conf)
21 - switch (conf->channel->band) {
22 - case IEEE80211_BAND_2GHZ:
23 - if (conf_is_ht20(conf))
24 - sc->cur_rate_mode = ATH9K_MODE_11NG_HT20;
25 - else if (conf_is_ht40_minus(conf))
26 - sc->cur_rate_mode = ATH9K_MODE_11NG_HT40MINUS;
27 - else if (conf_is_ht40_plus(conf))
28 - sc->cur_rate_mode = ATH9K_MODE_11NG_HT40PLUS;
30 - sc->cur_rate_mode = ATH9K_MODE_11G;
32 - case IEEE80211_BAND_5GHZ:
33 - if (conf_is_ht20(conf))
34 - sc->cur_rate_mode = ATH9K_MODE_11NA_HT20;
35 - else if (conf_is_ht40_minus(conf))
36 - sc->cur_rate_mode = ATH9K_MODE_11NA_HT40MINUS;
37 - else if (conf_is_ht40_plus(conf))
38 - sc->cur_rate_mode = ATH9K_MODE_11NA_HT40PLUS;
40 - sc->cur_rate_mode = ATH9K_MODE_11A;
48 static void ath_update_txpow(struct ath_softc *sc)
50 struct ath_hw *ah = sc->sc_ah;
51 @@ -307,7 +277,6 @@ int ath_set_channel(struct ath_softc *sc
55 - ath_cache_conf_rate(sc, &hw->conf);
57 ath9k_hw_set_interrupts(ah, ah->imask);
59 @@ -1014,8 +983,6 @@ int ath_reset(struct ath_softc *sc, bool
60 * that changes the channel so update any state that
61 * might change as a result.
63 - ath_cache_conf_rate(sc, &hw->conf);
67 if ((sc->sc_flags & SC_OP_BEACONS) || !(sc->sc_flags & (SC_OP_OFFCHANNEL)))
68 @@ -1222,8 +1189,6 @@ static int ath9k_start(struct ieee80211_
69 if (ah->caps.hw_caps & ATH9K_HW_CAP_HT)
70 ah->imask |= ATH9K_INT_CST;
72 - ath_cache_conf_rate(sc, &hw->conf);
74 sc->sc_flags &= ~SC_OP_INVALID;
76 /* Disable BMISS interrupt when we're not associated */
77 --- a/drivers/net/wireless/ath/ath9k/rc.c
78 +++ b/drivers/net/wireless/ath/ath9k/rc.c
79 @@ -791,7 +791,7 @@ static void ath_get_rate(void *priv, str
83 - rate_table = sc->cur_rate_table;
84 + rate_table = ath_rc_priv->rate_table;
85 rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe);
88 @@ -1048,7 +1048,7 @@ static void ath_rc_update_ht(struct ath_
91 bool state_change = false;
92 - const struct ath_rate_table *rate_table = sc->cur_rate_table;
93 + const struct ath_rate_table *rate_table = ath_rc_priv->rate_table;
94 int size = ath_rc_priv->rate_table_size;
96 if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt))
97 @@ -1150,7 +1150,7 @@ static void ath_rc_tx_status(struct ath_
101 - rate_table = sc->cur_rate_table;
102 + rate_table = ath_rc_priv->rate_table;
105 * If the first rate is not the final index, there
106 @@ -1231,7 +1231,6 @@ struct ath_rate_table *ath_choose_rate_t
107 ath_print(common, ATH_DBG_CONFIG,
108 "Choosing rate table for mode: %d\n", mode);
110 - sc->cur_rate_mode = mode;
111 return hw_rate_table[mode];
114 @@ -1303,7 +1302,6 @@ static void ath_rc_init(struct ath_softc
115 ath_rc_priv->max_valid_rate = k;
116 ath_rc_sort_validrates(rate_table, ath_rc_priv);
117 ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4];
118 - sc->cur_rate_table = rate_table;
119 ath_rc_priv->rate_table = rate_table;
121 ath_print(common, ATH_DBG_CONFIG,
122 @@ -1439,8 +1437,9 @@ static void ath_tx_status(void *priv, st
126 - ath_debug_stat_rc(ath_rc_priv, ath_rc_get_rateindex(sc->cur_rate_table,
127 - &tx_info->status.rates[final_ts_idx]));
128 + ath_debug_stat_rc(ath_rc_priv,
129 + ath_rc_get_rateindex(ath_rc_priv->rate_table,
130 + &tx_info->status.rates[final_ts_idx]));
133 static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
134 @@ -1480,14 +1479,8 @@ static void ath_rate_init(void *priv, st
136 /* Choose rate table first */
138 - if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) ||
139 - (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT) ||
140 - (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC)) {
141 - rate_table = ath_choose_rate_table(sc, sband->band,
142 - sta->ht_cap.ht_supported, is_cw40);
144 - rate_table = hw_rate_table[sc->cur_rate_mode];
146 + rate_table = ath_choose_rate_table(sc, sband->band,
147 + sta->ht_cap.ht_supported, is_cw40);
149 ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, is_cw40, is_sgi);
150 ath_rc_init(sc, priv_sta, sband, sta, rate_table);
151 @@ -1536,7 +1529,6 @@ static void ath_rate_update(void *priv,
152 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG,
153 "Operating HT Bandwidth changed to: %d\n",
154 sc->hw->conf.channel_type);
155 - sc->cur_rate_table = hw_rate_table[sc->cur_rate_mode];