diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2009-03-03 12:23:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-05 14:39:46 -0500 |
commit | 18eb62f87a8d1dc6ed8a01a52e6b2b1600802608 (patch) | |
tree | bda7a8dd1e47d8e85311e0e8e033e7deef30350e /drivers | |
parent | 465ca84d95deeab37b7c3b10b2cb96b3fa07a891 (diff) |
ath9k: Pause other virtual wiphys on channel change
For now, allow channel changes immediately and just force the other
virtual wiphys to paused state. This is needed to allow
mac80211-controlled scan to control channel changes.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath9k/ath9k.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/virtual.c | 24 |
3 files changed, 33 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h index cb9cb7232489..24373d395e49 100644 --- a/drivers/net/wireless/ath9k/ath9k.h +++ b/drivers/net/wireless/ath9k/ath9k.h | |||
@@ -710,5 +710,7 @@ int ath9k_wiphy_unpause(struct ath_wiphy *aphy); | |||
710 | int ath9k_wiphy_select(struct ath_wiphy *aphy); | 710 | int ath9k_wiphy_select(struct ath_wiphy *aphy); |
711 | void ath9k_wiphy_chan_work(struct work_struct *work); | 711 | void ath9k_wiphy_chan_work(struct work_struct *work); |
712 | bool ath9k_wiphy_started(struct ath_softc *sc); | 712 | bool ath9k_wiphy_started(struct ath_softc *sc); |
713 | void ath9k_wiphy_pause_all_forced(struct ath_softc *sc, | ||
714 | struct ath_wiphy *selected); | ||
713 | 715 | ||
714 | #endif /* ATH9K_H */ | 716 | #endif /* ATH9K_H */ |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 7c20da3862a6..9b5f21493650 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -2343,7 +2343,13 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
2343 | aphy->chan_is_ht = conf_is_ht(conf); | 2343 | aphy->chan_is_ht = conf_is_ht(conf); |
2344 | 2344 | ||
2345 | /* TODO: do not change operation channel immediately if there | 2345 | /* TODO: do not change operation channel immediately if there |
2346 | * are other virtual wiphys that use another channel */ | 2346 | * are other virtual wiphys that use another channel. For now, |
2347 | * we do the change immediately to allow mac80211-operated scan | ||
2348 | * to work. Once the scan operation is moved into ath9k, we can | ||
2349 | * just move the current aphy in PAUSED state if the channel is | ||
2350 | * changed into something different from the current operation | ||
2351 | * channel. */ | ||
2352 | ath9k_wiphy_pause_all_forced(sc, aphy); | ||
2347 | 2353 | ||
2348 | DPRINTF(sc, ATH_DBG_CONFIG, "Set channel: %d MHz\n", | 2354 | DPRINTF(sc, ATH_DBG_CONFIG, "Set channel: %d MHz\n", |
2349 | curchan->center_freq); | 2355 | curchan->center_freq); |
diff --git a/drivers/net/wireless/ath9k/virtual.c b/drivers/net/wireless/ath9k/virtual.c index b66aa24d3186..6122f48f25fb 100644 --- a/drivers/net/wireless/ath9k/virtual.c +++ b/drivers/net/wireless/ath9k/virtual.c | |||
@@ -496,3 +496,27 @@ bool ath9k_wiphy_started(struct ath_softc *sc) | |||
496 | spin_unlock_bh(&sc->wiphy_lock); | 496 | spin_unlock_bh(&sc->wiphy_lock); |
497 | return false; | 497 | return false; |
498 | } | 498 | } |
499 | |||
500 | static void ath9k_wiphy_pause_chan(struct ath_wiphy *aphy, | ||
501 | struct ath_wiphy *selected) | ||
502 | { | ||
503 | if (aphy->chan_idx == selected->chan_idx) | ||
504 | return; | ||
505 | aphy->state = ATH_WIPHY_PAUSED; | ||
506 | ieee80211_stop_queues(aphy->hw); | ||
507 | } | ||
508 | |||
509 | void ath9k_wiphy_pause_all_forced(struct ath_softc *sc, | ||
510 | struct ath_wiphy *selected) | ||
511 | { | ||
512 | int i; | ||
513 | spin_lock_bh(&sc->wiphy_lock); | ||
514 | if (sc->pri_wiphy->state == ATH_WIPHY_ACTIVE) | ||
515 | ath9k_wiphy_pause_chan(sc->pri_wiphy, selected); | ||
516 | for (i = 0; i < sc->num_sec_wiphy; i++) { | ||
517 | if (sc->sec_wiphy[i] && | ||
518 | sc->sec_wiphy[i]->state == ATH_WIPHY_ACTIVE) | ||
519 | ath9k_wiphy_pause_chan(sc->sec_wiphy[i], selected); | ||
520 | } | ||
521 | spin_unlock_bh(&sc->wiphy_lock); | ||
522 | } | ||