Commit c2da50e5 authored by Sujith's avatar Sujith Committed by John W. Linville

ath9k: Fix bug in handling single stream stations

AP mode currently sets up the dual stream capability
for all stations. This patch fixes it by checking if the
associated station supports dual stream MCS rates (8-15).
We would disregard any MCS rates above 15, since Atheros
HW supports only 0..15 rates currently, and can't receive
at rates > 15 anyway.
Signed-off-by: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 95e4acb7
...@@ -1470,16 +1470,18 @@ static void ath_rc_init(struct ath_softc *sc, ...@@ -1470,16 +1470,18 @@ static void ath_rc_init(struct ath_softc *sc,
ath_rc_priv->ht_cap); ath_rc_priv->ht_cap);
} }
static u8 ath_rc_build_ht_caps(struct ath_softc *sc, bool is_ht, bool is_cw40, static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta,
bool is_sgi40) bool is_cw40, bool is_sgi40)
{ {
u8 caps = 0; u8 caps = 0;
if (is_ht) { if (sta->ht_cap.ht_supported) {
caps = WLAN_RC_HT_FLAG; caps = WLAN_RC_HT_FLAG;
if (sc->sc_ah->caps.tx_chainmask != 1 && if (sc->sc_ah->caps.tx_chainmask != 1 &&
ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_DS, 0, NULL)) ath9k_hw_getcapability(sc->sc_ah, ATH9K_CAP_DS, 0, NULL)) {
if (sta->ht_cap.mcs.rx_mask[1])
caps |= WLAN_RC_DS_FLAG; caps |= WLAN_RC_DS_FLAG;
}
if (is_cw40) if (is_cw40)
caps |= WLAN_RC_40_FLAG; caps |= WLAN_RC_40_FLAG;
if (is_sgi40) if (is_sgi40)
...@@ -1626,8 +1628,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, ...@@ -1626,8 +1628,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
rate_table = sc->cur_rate_table; rate_table = sc->cur_rate_table;
} }
ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta->ht_cap.ht_supported, ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, is_cw40, is_sgi40);
is_cw40, is_sgi40);
ath_rc_init(sc, priv_sta, sband, sta, rate_table); ath_rc_init(sc, priv_sta, sband, sta, rate_table);
} }
...@@ -1661,8 +1662,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, ...@@ -1661,8 +1662,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
rate_table = ath_choose_rate_table(sc, sband->band, rate_table = ath_choose_rate_table(sc, sband->band,
sta->ht_cap.ht_supported, sta->ht_cap.ht_supported,
oper_cw40); oper_cw40);
ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta,
sta->ht_cap.ht_supported,
oper_cw40, oper_sgi40); oper_cw40, oper_sgi40);
ath_rc_init(sc, priv_sta, sband, sta, rate_table); ath_rc_init(sc, priv_sta, sband, sta, rate_table);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment