diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-03-14 05:11:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-15 13:40:29 -0400 |
commit | d47a61aa228709fe1704e18a2f444661c10b81c0 (patch) | |
tree | ec05c107b4ceddcb203453004d9002f1d40723cb /drivers/net/wireless/ath/ath9k | |
parent | 3d4e20f2d1e720c63887aee6a985e7870baf4ba1 (diff) |
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>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 16 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 4 |
5 files changed, 14 insertions, 34 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 5ecec83117d6..8c84049682ab 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -584,16 +584,12 @@ struct ath_ant_comb { | |||
584 | #define SC_OP_INVALID BIT(0) | 584 | #define SC_OP_INVALID BIT(0) |
585 | #define SC_OP_BEACONS BIT(1) | 585 | #define SC_OP_BEACONS BIT(1) |
586 | #define SC_OP_OFFCHANNEL BIT(2) | 586 | #define SC_OP_OFFCHANNEL BIT(2) |
587 | #define SC_OP_PREAMBLE_SHORT BIT(3) | 587 | #define SC_OP_RXFLUSH BIT(3) |
588 | #define SC_OP_PROTECT_ENABLE BIT(4) | 588 | #define SC_OP_TSF_RESET BIT(4) |
589 | #define SC_OP_RXFLUSH BIT(5) | 589 | #define SC_OP_BT_PRIORITY_DETECTED BIT(5) |
590 | #define SC_OP_LED_ASSOCIATED BIT(6) | 590 | #define SC_OP_BT_SCAN BIT(6) |
591 | #define SC_OP_LED_ON BIT(7) | 591 | #define SC_OP_ANI_RUN BIT(7) |
592 | #define SC_OP_TSF_RESET BIT(8) | 592 | #define SC_OP_PRIM_STA_VIF BIT(8) |
593 | #define SC_OP_BT_PRIORITY_DETECTED BIT(9) | ||
594 | #define SC_OP_BT_SCAN BIT(10) | ||
595 | #define SC_OP_ANI_RUN BIT(11) | ||
596 | #define SC_OP_PRIM_STA_VIF BIT(12) | ||
597 | 593 | ||
598 | /* Powersave flags */ | 594 | /* Powersave flags */ |
599 | #define PS_WAIT_FOR_BEACON BIT(0) | 595 | #define PS_WAIT_FOR_BEACON BIT(0) |
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index 43882f9e25c4..626418222c85 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -67,7 +67,7 @@ int ath_beaconq_config(struct ath_softc *sc) | |||
67 | * up rate codes, and channel flags. Beacons are always sent out at the | 67 | * up rate codes, and channel flags. Beacons are always sent out at the |
68 | * lowest rate, and are not retried. | 68 | * lowest rate, and are not retried. |
69 | */ | 69 | */ |
70 | static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, | 70 | static void ath_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif, |
71 | struct ath_buf *bf, int rateidx) | 71 | struct ath_buf *bf, int rateidx) |
72 | { | 72 | { |
73 | struct sk_buff *skb = bf->bf_mpdu; | 73 | struct sk_buff *skb = bf->bf_mpdu; |
@@ -82,7 +82,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, | |||
82 | 82 | ||
83 | sband = &sc->sbands[common->hw->conf.channel->band]; | 83 | sband = &sc->sbands[common->hw->conf.channel->band]; |
84 | rate = sband->bitrates[rateidx].hw_value; | 84 | rate = sband->bitrates[rateidx].hw_value; |
85 | if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) | 85 | if (vif->bss_conf.use_short_preamble) |
86 | rate |= sband->bitrates[rateidx].hw_value_short; | 86 | rate |= sband->bitrates[rateidx].hw_value_short; |
87 | 87 | ||
88 | memset(&info, 0, sizeof(info)); | 88 | memset(&info, 0, sizeof(info)); |
@@ -209,7 +209,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, | |||
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
212 | ath_beacon_setup(sc, avp, bf, info->control.rates[0].idx); | 212 | ath_beacon_setup(sc, vif, bf, info->control.rates[0].idx); |
213 | 213 | ||
214 | while (skb) { | 214 | while (skb) { |
215 | ath_tx_cabq(hw, skb); | 215 | ath_tx_cabq(hw, skb); |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 3f00daa0ea06..38794850f005 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -2044,25 +2044,6 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, | |||
2044 | ath_beacon_config(sc, vif); | 2044 | ath_beacon_config(sc, vif); |
2045 | } | 2045 | } |
2046 | 2046 | ||
2047 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { | ||
2048 | ath_dbg(common, CONFIG, "BSS Changed PREAMBLE %d\n", | ||
2049 | bss_conf->use_short_preamble); | ||
2050 | if (bss_conf->use_short_preamble) | ||
2051 | sc->sc_flags |= SC_OP_PREAMBLE_SHORT; | ||
2052 | else | ||
2053 | sc->sc_flags &= ~SC_OP_PREAMBLE_SHORT; | ||
2054 | } | ||
2055 | |||
2056 | if (changed & BSS_CHANGED_ERP_CTS_PROT) { | ||
2057 | ath_dbg(common, CONFIG, "BSS Changed CTS PROT %d\n", | ||
2058 | bss_conf->use_cts_prot); | ||
2059 | if (bss_conf->use_cts_prot && | ||
2060 | hw->conf.channel->band != IEEE80211_BAND_5GHZ) | ||
2061 | sc->sc_flags |= SC_OP_PROTECT_ENABLE; | ||
2062 | else | ||
2063 | sc->sc_flags &= ~SC_OP_PROTECT_ENABLE; | ||
2064 | } | ||
2065 | |||
2066 | mutex_unlock(&sc->mutex); | 2047 | mutex_unlock(&sc->mutex); |
2067 | ath9k_ps_restore(sc); | 2048 | ath9k_ps_restore(sc); |
2068 | } | 2049 | } |
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index f26e9847bb2e..4f848493fece 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -748,7 +748,8 @@ static void ath_rc_rate_set_rtscts(struct ath_softc *sc, | |||
748 | * If 802.11g protection is enabled, determine whether to use RTS/CTS or | 748 | * If 802.11g protection is enabled, determine whether to use RTS/CTS or |
749 | * just CTS. Note that this is only done for OFDM/HT unicast frames. | 749 | * just CTS. Note that this is only done for OFDM/HT unicast frames. |
750 | */ | 750 | */ |
751 | if ((sc->sc_flags & SC_OP_PROTECT_ENABLE) && | 751 | if ((tx_info->control.vif && |
752 | tx_info->control.vif->bss_conf.use_cts_prot) && | ||
752 | (rate_table->info[rix].phy == WLAN_RC_PHY_OFDM || | 753 | (rate_table->info[rix].phy == WLAN_RC_PHY_OFDM || |
753 | WLAN_RC_PHY_HT(rate_table->info[rix].phy))) { | 754 | WLAN_RC_PHY_HT(rate_table->info[rix].phy))) { |
754 | rates[0].flags |= IEEE80211_TX_RC_USE_CTS_PROTECT; | 755 | rates[0].flags |= IEEE80211_TX_RC_USE_CTS_PROTECT; |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index d2c635d84fbc..5faec1e04d65 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -955,7 +955,9 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
955 | */ | 955 | */ |
956 | rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info); | 956 | rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info); |
957 | info->rtscts_rate = rate->hw_value; | 957 | info->rtscts_rate = rate->hw_value; |
958 | if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) | 958 | |
959 | if (tx_info->control.vif && | ||
960 | tx_info->control.vif->bss_conf.use_short_preamble) | ||
959 | info->rtscts_rate |= rate->hw_value_short; | 961 | info->rtscts_rate |= rate->hw_value_short; |
960 | 962 | ||
961 | for (i = 0; i < 4; i++) { | 963 | for (i = 0; i < 4; i++) { |