mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-21 10:05:00 +08:00
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>
This commit is contained in:
parent
6b3aa6ab78
commit
40990ec01f
@ -702,6 +702,7 @@ struct ath_softc {
|
|||||||
/* Rate */
|
/* Rate */
|
||||||
struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX];
|
struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX];
|
||||||
struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX];
|
struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX];
|
||||||
|
struct ath_rate_table *cur_rate_table;
|
||||||
u8 sc_protrix;
|
u8 sc_protrix;
|
||||||
|
|
||||||
/* Channel, Band */
|
/* Channel, Band */
|
||||||
|
@ -817,7 +817,7 @@ static void ath_rc_ratefind(struct ath_softc *sc,
|
|||||||
struct ath_rate_table *rate_table;
|
struct ath_rate_table *rate_table;
|
||||||
struct ieee80211_tx_rate *rates = tx_info->control.rates;
|
struct ieee80211_tx_rate *rates = tx_info->control.rates;
|
||||||
|
|
||||||
rate_table = sc->hw_rate_table[sc->sc_curmode];
|
rate_table = sc->cur_rate_table;
|
||||||
rix = ath_rc_ratefind_ht(sc, ath_rc_priv, rate_table, 1,
|
rix = ath_rc_ratefind_ht(sc, ath_rc_priv, rate_table, 1,
|
||||||
is_probe, is_retry);
|
is_probe, is_retry);
|
||||||
nrix = rix;
|
nrix = rix;
|
||||||
@ -877,7 +877,7 @@ static void ath_rc_ratefind(struct ath_softc *sc,
|
|||||||
if ((sc->sc_curmode == ATH9K_MODE_11NG_HT20) ||
|
if ((sc->sc_curmode == ATH9K_MODE_11NG_HT20) ||
|
||||||
(sc->sc_curmode == ATH9K_MODE_11NG_HT40PLUS) ||
|
(sc->sc_curmode == ATH9K_MODE_11NG_HT40PLUS) ||
|
||||||
(sc->sc_curmode == ATH9K_MODE_11NG_HT40MINUS)) {
|
(sc->sc_curmode == ATH9K_MODE_11NG_HT40MINUS)) {
|
||||||
u8 dot11rate = rate_table->info[rix].dot11rate;
|
u8 dot11rate = rate_table->info[rix].dot11rate;
|
||||||
u8 phy = rate_table->info[rix].phy;
|
u8 phy = rate_table->info[rix].phy;
|
||||||
if (i == 4 &&
|
if (i == 4 &&
|
||||||
((dot11rate == 2 && phy == WLAN_RC_PHY_HT_40_SS) ||
|
((dot11rate == 2 && phy == WLAN_RC_PHY_HT_40_SS) ||
|
||||||
@ -1094,7 +1094,7 @@ static void ath_rc_update_ht(struct ath_softc *sc,
|
|||||||
int rate;
|
int rate;
|
||||||
u8 last_per;
|
u8 last_per;
|
||||||
bool state_change = false;
|
bool state_change = false;
|
||||||
struct ath_rate_table *rate_table = sc->hw_rate_table[sc->sc_curmode];
|
struct ath_rate_table *rate_table = sc->cur_rate_table;
|
||||||
int size = ath_rc_priv->rate_table_size;
|
int size = ath_rc_priv->rate_table_size;
|
||||||
|
|
||||||
if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt))
|
if ((tx_rate < 0) || (tx_rate > rate_table->rate_cnt))
|
||||||
@ -1254,7 +1254,7 @@ static void ath_rc_tx_status(struct ath_softc *sc,
|
|||||||
u8 flags;
|
u8 flags;
|
||||||
u32 i = 0, rix;
|
u32 i = 0, rix;
|
||||||
|
|
||||||
rate_table = sc->hw_rate_table[sc->sc_curmode];
|
rate_table = sc->cur_rate_table;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the first rate is not the final index, there
|
* If the first rate is not the final index, there
|
||||||
@ -1432,6 +1432,7 @@ static void ath_rc_init(struct ath_softc *sc,
|
|||||||
ath_rc_priv->max_valid_rate = k;
|
ath_rc_priv->max_valid_rate = k;
|
||||||
ath_rc_sort_validrates(rate_table, ath_rc_priv);
|
ath_rc_sort_validrates(rate_table, ath_rc_priv);
|
||||||
ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4];
|
ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4];
|
||||||
|
sc->cur_rate_table = rate_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rate Control callbacks */
|
/* Rate Control callbacks */
|
||||||
|
Loading…
Reference in New Issue
Block a user