ath9k: Maintain rate table choice after association
A scan run after association would change sc_curmode which is
used to get the current rate table. This patch fixes it
by removing sc_curmode and setting the rate table in usage in cur_rate_table
on association.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c
index 8eec667..0ae5988 100644
--- a/drivers/net/wireless/ath9k/rc.c
+++ b/drivers/net/wireless/ath9k/rc.c
@@ -874,9 +874,8 @@
* So, set fourth rate in series to be same as third one for
* above conditions.
*/
- if ((sc->sc_curmode == ATH9K_MODE_11NG_HT20) ||
- (sc->sc_curmode == ATH9K_MODE_11NG_HT40PLUS) ||
- (sc->sc_curmode == ATH9K_MODE_11NG_HT40MINUS)) {
+ if ((sc->hw->conf.channel->band == IEEE80211_BAND_2GHZ) &&
+ (sc->hw->conf.ht.enabled)) {
u8 dot11rate = rate_table->info[rix].dot11rate;
u8 phy = rate_table->info[rix].phy;
if (i == 4 &&
@@ -1354,8 +1353,8 @@
sta->ht_cap.ht_supported,
is_cw_40);
} else if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) {
- /* sc_curmode would be set on init through config() */
- rate_table = sc->hw_rate_table[sc->sc_curmode];
+ /* cur_rate_table would be set on init through config() */
+ rate_table = sc->cur_rate_table;
}
if (!rate_table) {