aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-11-02 17:35:42 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-11 17:09:01 -0500
commit68a89116157d9d479a854db6d79a9116be79cd99 (patch)
tree27102822d346694d3cfb56572eff1fcb40766790 /drivers/net/wireless/ath
parentcee71d6c1471953239ea4c13306888cf2b36426e (diff)
ath9k: pass the ieee80211_hw on radio enable/disable
We use the ieee80211_hw for radio enable/disable but the wrong structure hw was being used in consideration for virtual wiphys as each virtual wiphy has its own ieee80211_hw struct. Just pass the hw struct to ensure we use the right one. This should fix the hw used and passed for radio enable/disable. This includes the stoping / starting of the software TX queues so mac80211 doesn't send us data for a specific virtual wiphy. ath9k already takes care of pausing virtual wiphys and stopping the respective queues on its own, but this should handle the idle mac80211 conf calls as well. Cc: Jouni.Malinen <Jouni.Malinen@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h5
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/virtual.c5
3 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index da5357838dda..59ce7ec5b224 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -655,8 +655,9 @@ void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw,
655void ath_update_chainmask(struct ath_softc *sc, int is_ht); 655void ath_update_chainmask(struct ath_softc *sc, int is_ht);
656int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, 656int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
657 struct ath9k_channel *hchan); 657 struct ath9k_channel *hchan);
658void ath_radio_enable(struct ath_softc *sc); 658
659void ath_radio_disable(struct ath_softc *sc); 659void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw);
660void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw);
660 661
661#ifdef CONFIG_PCI 662#ifdef CONFIG_PCI
662int ath_pci_init(void); 663int ath_pci_init(void);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index bdce0ab99ded..11aaa7d69a1f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1200,11 +1200,11 @@ fail:
1200 ath_deinit_leds(sc); 1200 ath_deinit_leds(sc);
1201} 1201}
1202 1202
1203void ath_radio_enable(struct ath_softc *sc) 1203void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw)
1204{ 1204{
1205 struct ath_hw *ah = sc->sc_ah; 1205 struct ath_hw *ah = sc->sc_ah;
1206 struct ath_common *common = ath9k_hw_common(ah); 1206 struct ath_common *common = ath9k_hw_common(ah);
1207 struct ieee80211_channel *channel = sc->hw->conf.channel; 1207 struct ieee80211_channel *channel = hw->conf.channel;
1208 int r; 1208 int r;
1209 1209
1210 ath9k_ps_wakeup(sc); 1210 ath9k_ps_wakeup(sc);
@@ -1241,18 +1241,18 @@ void ath_radio_enable(struct ath_softc *sc)
1241 AR_GPIO_OUTPUT_MUX_AS_OUTPUT); 1241 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
1242 ath9k_hw_set_gpio(ah, ah->led_pin, 0); 1242 ath9k_hw_set_gpio(ah, ah->led_pin, 0);
1243 1243
1244 ieee80211_wake_queues(sc->hw); 1244 ieee80211_wake_queues(hw);
1245 ath9k_ps_restore(sc); 1245 ath9k_ps_restore(sc);
1246} 1246}
1247 1247
1248void ath_radio_disable(struct ath_softc *sc) 1248void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
1249{ 1249{
1250 struct ath_hw *ah = sc->sc_ah; 1250 struct ath_hw *ah = sc->sc_ah;
1251 struct ieee80211_channel *channel = sc->hw->conf.channel; 1251 struct ieee80211_channel *channel = hw->conf.channel;
1252 int r; 1252 int r;
1253 1253
1254 ath9k_ps_wakeup(sc); 1254 ath9k_ps_wakeup(sc);
1255 ieee80211_stop_queues(sc->hw); 1255 ieee80211_stop_queues(hw);
1256 1256
1257 /* Disable LED */ 1257 /* Disable LED */
1258 ath9k_hw_set_gpio(ah, ah->led_pin, 1); 1258 ath9k_hw_set_gpio(ah, ah->led_pin, 1);
@@ -1266,7 +1266,7 @@ void ath_radio_disable(struct ath_softc *sc)
1266 ath_flushrecv(sc); /* flush recv queue */ 1266 ath_flushrecv(sc); /* flush recv queue */
1267 1267
1268 if (!ah->curchan) 1268 if (!ah->curchan)
1269 ah->curchan = ath_get_curchannel(sc, sc->hw); 1269 ah->curchan = ath_get_curchannel(sc, hw);
1270 1270
1271 spin_lock_bh(&sc->sc_resetlock); 1271 spin_lock_bh(&sc->sc_resetlock);
1272 r = ath9k_hw_reset(ah, ah->curchan, false); 1272 r = ath9k_hw_reset(ah, ah->curchan, false);
@@ -2719,7 +2719,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2719 spin_unlock_bh(&sc->wiphy_lock); 2719 spin_unlock_bh(&sc->wiphy_lock);
2720 2720
2721 if (enable_radio) { 2721 if (enable_radio) {
2722 ath_radio_enable(sc); 2722 ath_radio_enable(sc, hw);
2723 ath_print(common, ATH_DBG_CONFIG, 2723 ath_print(common, ATH_DBG_CONFIG,
2724 "not-idle: enabling radio\n"); 2724 "not-idle: enabling radio\n");
2725 } 2725 }
@@ -2800,7 +2800,7 @@ skip_chan_change:
2800 2800
2801 if (disable_radio) { 2801 if (disable_radio) {
2802 ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n"); 2802 ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n");
2803 ath_radio_disable(sc); 2803 ath_radio_disable(sc, hw);
2804 } 2804 }
2805 2805
2806 mutex_unlock(&sc->mutex); 2806 mutex_unlock(&sc->mutex);
diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c
index 7678c4a2ca6f..69a871ba051f 100644
--- a/drivers/net/wireless/ath/ath9k/virtual.c
+++ b/drivers/net/wireless/ath/ath9k/virtual.c
@@ -526,8 +526,9 @@ int ath9k_wiphy_select(struct ath_wiphy *aphy)
526 * frame being completed) 526 * frame being completed)
527 */ 527 */
528 spin_unlock_bh(&sc->wiphy_lock); 528 spin_unlock_bh(&sc->wiphy_lock);
529 ath_radio_disable(sc); 529 ath_radio_disable(sc, aphy->hw);
530 ath_radio_enable(sc); 530 ath_radio_enable(sc, aphy->hw);
531 /* Only the primary wiphy hw is used for queuing work */
531 ieee80211_queue_work(aphy->sc->hw, 532 ieee80211_queue_work(aphy->sc->hw,
532 &aphy->sc->chan_work); 533 &aphy->sc->chan_work);
533 return -EBUSY; /* previous select still in progress */ 534 return -EBUSY; /* previous select still in progress */