aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/rc.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-12-07 11:11:37 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-12 13:48:23 -0500
commit40990ec01fcca0b86a19c13a5d3deb77da1913a7 (patch)
tree95dd971d3680b1c836e0bab8483833c965041448 /drivers/net/wireless/ath9k/rc.c
parent6b3aa6ab787fe545c58554b7ce5c94de53526b83 (diff)
ath9k: Fix bug in rate table management
The proper rate table wouldn't be used if a disassoc happens and a new attempt is made to associate using wpa_supplicant. This patch fixes it by storing the rate table to be used on association. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/rc.c')
-rw-r--r--drivers/net/wireless/ath9k/rc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c
index 76acd2b75fcd..8eec66756c75 100644
--- a/drivers/net/wireless/ath9k/rc.c
+++ b/drivers/net/wireless/ath9k/rc.c
@@ -817,7 +817,7 @@ static void ath_rc_ratefind(struct ath_softc *sc,
817 struct ath_rate_table *rate_table; 817 struct ath_rate_table *rate_table;
818 struct ieee80211_tx_rate *rates = tx_info->control.rates; 818 struct ieee80211_tx_rate *rates = tx_info->control.rates;
819 819
820 rate_table = sc->hw_rate_table[sc->sc_curmode]; 820 rate_table = sc->cur_rate_table;
821 rix = ath_rc_ratefind_ht(sc, ath_rc_priv, rate_table, 1, 821 rix = ath_rc_ratefind_ht(sc, ath_rc_priv, rate_table, 1,
822 is_probe, is_retry); 822 is_probe, is_retry);
823 nrix = rix; 823 nrix = rix;
@@ -877,7 +877,7 @@ static void ath_rc_ratefind(struct ath_softc *sc,
877 if ((sc->sc_curmode == ATH9K_MODE_11NG_HT20) || 877 if ((sc->sc_curmode == ATH9K_MODE_11NG_HT20) ||
878 (sc->sc_curmode == ATH9K_MODE_11NG_HT40PLUS) || 878 (sc->sc_curmode == ATH9K_MODE_11NG_HT40PLUS) ||
879 (sc->sc_curmode == ATH9K_MODE_11NG_HT40MINUS)) { 879 (sc->sc_curmode == ATH9K_MODE_11NG_HT40MINUS)) {
880 u8 dot11rate = rate_table->info[rix].dot11rate; 880 u8 dot11rate = rate_table->info[rix].dot11rate;
881 u8 phy = rate_table->info[rix].phy; 881 u8 phy = rate_table->info[rix].phy;
882 if (i == 4 && 882 if (i == 4 &&
883 ((dot11rate == 2 && phy == WLAN_RC_PHY_HT_40_SS) || 883 ((dot11rate == 2 && phy == WLAN_RC_PHY_HT_40_SS) ||
@@ -1094,7 +1094,7 @@ static void ath_rc_update_ht(struct ath_softc *sc,
1094 int rate; 1094 int rate;
1095 u8 last_per; 1095 u8 last_per;
1096 bool state_change = false; 1096 bool state_change = false;
1097 struct ath_rate_table *rate_table = sc->hw_rate_table[sc->sc_curmode]; 1097 struct ath_rate_table *rate_table = sc->cur_rate_table;
1098 int size = ath_rc_priv->rate_table_size; 1098 int size = ath_rc_priv->rate_table_size;
1099 1099
1100 if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt)) 1100 if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt))
@@ -1254,7 +1254,7 @@ static void ath_rc_tx_status(struct ath_softc *sc,
1254 u8 flags; 1254 u8 flags;
1255 u32 i = 0, rix; 1255 u32 i = 0, rix;
1256 1256
1257 rate_table = sc->hw_rate_table[sc->sc_curmode]; 1257 rate_table = sc->cur_rate_table;
1258 1258
1259 /* 1259 /*
1260 * If the first rate is not the final index, there 1260 * If the first rate is not the final index, there
@@ -1432,6 +1432,7 @@ static void ath_rc_init(struct ath_softc *sc,
1432 ath_rc_priv->max_valid_rate = k; 1432 ath_rc_priv->max_valid_rate = k;
1433 ath_rc_sort_validrates(rate_table, ath_rc_priv); 1433 ath_rc_sort_validrates(rate_table, ath_rc_priv);
1434 ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4]; 1434 ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4];
1435 sc->cur_rate_table = rate_table;
1435} 1436}
1436 1437
1437/* Rate Control callbacks */ 1438/* Rate Control callbacks */