summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/virtual.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-03-03 18:23:33 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 20:39:46 +0100
commit9580a222b8a371c145d7439c1a289b9e77f8fe31 (patch)
tree6dd8ba41fe920e029c107bf249b9bb7ff89b03cd /drivers/net/wireless/ath9k/virtual.c
parentath9k: Add routines for switching between active virtual wiphys (diff)
downloadlinux-9580a222b8a371c145d7439c1a289b9e77f8fe31.tar.xz
linux-9580a222b8a371c145d7439c1a289b9e77f8fe31.zip
ath9k: Make start/stop operations aware of virtual wiphys
Instead of always going through initialization/deinitialization steps, do this only for the first/last wiphy to not break the other wiphys. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/virtual.c')
-rw-r--r--drivers/net/wireless/ath9k/virtual.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath9k/virtual.c b/drivers/net/wireless/ath9k/virtual.c
index 76ffdfa860ed..b66aa24d3186 100644
--- a/drivers/net/wireless/ath9k/virtual.c
+++ b/drivers/net/wireless/ath9k/virtual.c
@@ -477,3 +477,22 @@ int ath9k_wiphy_select(struct ath_wiphy *aphy)
return 0;
}
+
+bool ath9k_wiphy_started(struct ath_softc *sc)
+{
+ int i;
+ spin_lock_bh(&sc->wiphy_lock);
+ if (sc->pri_wiphy->state != ATH_WIPHY_INACTIVE) {
+ spin_unlock_bh(&sc->wiphy_lock);
+ return true;
+ }
+ for (i = 0; i < sc->num_sec_wiphy; i++) {
+ if (sc->sec_wiphy[i] &&
+ sc->sec_wiphy[i]->state != ATH_WIPHY_INACTIVE) {
+ spin_unlock_bh(&sc->wiphy_lock);
+ return true;
+ }
+ }
+ spin_unlock_bh(&sc->wiphy_lock);
+ return false;
+}