ath9k: Fix multi-VIF BSS handling

mac80211 provides short preamble information and ERP protection
information on a per-BSS basis, which can be used. Remove flags
stored in the driver, which was incorrect since they were being used
in a global manner.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Sujith Manoharan 2012-03-14 14:41:05 +05:30 committed by John W. Linville
parent 3d4e20f2d1
commit d47a61aa22
5 changed files with 14 additions and 34 deletions

View File

@ -584,16 +584,12 @@ struct ath_ant_comb {
#define SC_OP_INVALID BIT(0) #define SC_OP_INVALID BIT(0)
#define SC_OP_BEACONS BIT(1) #define SC_OP_BEACONS BIT(1)
#define SC_OP_OFFCHANNEL BIT(2) #define SC_OP_OFFCHANNEL BIT(2)
#define SC_OP_PREAMBLE_SHORT BIT(3) #define SC_OP_RXFLUSH BIT(3)
#define SC_OP_PROTECT_ENABLE BIT(4) #define SC_OP_TSF_RESET BIT(4)
#define SC_OP_RXFLUSH BIT(5) #define SC_OP_BT_PRIORITY_DETECTED BIT(5)
#define SC_OP_LED_ASSOCIATED BIT(6) #define SC_OP_BT_SCAN BIT(6)
#define SC_OP_LED_ON BIT(7) #define SC_OP_ANI_RUN BIT(7)
#define SC_OP_TSF_RESET BIT(8) #define SC_OP_PRIM_STA_VIF BIT(8)
#define SC_OP_BT_PRIORITY_DETECTED BIT(9)
#define SC_OP_BT_SCAN BIT(10)
#define SC_OP_ANI_RUN BIT(11)
#define SC_OP_PRIM_STA_VIF BIT(12)
/* Powersave flags */ /* Powersave flags */
#define PS_WAIT_FOR_BEACON BIT(0) #define PS_WAIT_FOR_BEACON BIT(0)

View File

@ -67,7 +67,7 @@ int ath_beaconq_config(struct ath_softc *sc)
* up rate codes, and channel flags. Beacons are always sent out at the * up rate codes, and channel flags. Beacons are always sent out at the
* lowest rate, and are not retried. * lowest rate, and are not retried.
*/ */
static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, static void ath_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif,
struct ath_buf *bf, int rateidx) struct ath_buf *bf, int rateidx)
{ {
struct sk_buff *skb = bf->bf_mpdu; struct sk_buff *skb = bf->bf_mpdu;
@ -82,7 +82,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
sband = &sc->sbands[common->hw->conf.channel->band]; sband = &sc->sbands[common->hw->conf.channel->band];
rate = sband->bitrates[rateidx].hw_value; rate = sband->bitrates[rateidx].hw_value;
if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) if (vif->bss_conf.use_short_preamble)
rate |= sband->bitrates[rateidx].hw_value_short; rate |= sband->bitrates[rateidx].hw_value_short;
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
@ -209,7 +209,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
} }
} }
ath_beacon_setup(sc, avp, bf, info->control.rates[0].idx); ath_beacon_setup(sc, vif, bf, info->control.rates[0].idx);
while (skb) { while (skb) {
ath_tx_cabq(hw, skb); ath_tx_cabq(hw, skb);

View File

@ -2044,25 +2044,6 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
ath_beacon_config(sc, vif); ath_beacon_config(sc, vif);
} }
if (changed & BSS_CHANGED_ERP_PREAMBLE) {
ath_dbg(common, CONFIG, "BSS Changed PREAMBLE %d\n",
bss_conf->use_short_preamble);
if (bss_conf->use_short_preamble)
sc->sc_flags |= SC_OP_PREAMBLE_SHORT;
else
sc->sc_flags &= ~SC_OP_PREAMBLE_SHORT;
}
if (changed & BSS_CHANGED_ERP_CTS_PROT) {
ath_dbg(common, CONFIG, "BSS Changed CTS PROT %d\n",
bss_conf->use_cts_prot);
if (bss_conf->use_cts_prot &&
hw->conf.channel->band != IEEE80211_BAND_5GHZ)
sc->sc_flags |= SC_OP_PROTECT_ENABLE;
else
sc->sc_flags &= ~SC_OP_PROTECT_ENABLE;
}
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
} }

View File

@ -748,7 +748,8 @@ static void ath_rc_rate_set_rtscts(struct ath_softc *sc,
* If 802.11g protection is enabled, determine whether to use RTS/CTS or * If 802.11g protection is enabled, determine whether to use RTS/CTS or
* just CTS. Note that this is only done for OFDM/HT unicast frames. * just CTS. Note that this is only done for OFDM/HT unicast frames.
*/ */
if ((sc->sc_flags & SC_OP_PROTECT_ENABLE) && if ((tx_info->control.vif &&
tx_info->control.vif->bss_conf.use_cts_prot) &&
(rate_table->info[rix].phy == WLAN_RC_PHY_OFDM || (rate_table->info[rix].phy == WLAN_RC_PHY_OFDM ||
WLAN_RC_PHY_HT(rate_table->info[rix].phy))) { WLAN_RC_PHY_HT(rate_table->info[rix].phy))) {
rates[0].flags |= IEEE80211_TX_RC_USE_CTS_PROTECT; rates[0].flags |= IEEE80211_TX_RC_USE_CTS_PROTECT;

View File

@ -955,7 +955,9 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
*/ */
rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info); rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info);
info->rtscts_rate = rate->hw_value; info->rtscts_rate = rate->hw_value;
if (sc->sc_flags & SC_OP_PREAMBLE_SHORT)
if (tx_info->control.vif &&
tx_info->control.vif->bss_conf.use_short_preamble)
info->rtscts_rate |= rate->hw_value_short; info->rtscts_rate |= rate->hw_value_short;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {