aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath9k/virtual.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-03-03 19:23:33 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 14:39:46 -0500
commit9580a222b8a371c145d7439c1a289b9e77f8fe31 (patch)
tree6dd8ba41fe920e029c107bf249b9bb7ff89b03cd /drivers/net/wireless/ath9k/virtual.c
parent0e2dedf971f3feefd4d3d3d8cb5c57b1757f1101 (diff)
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 76ffdfa860e..b66aa24d318 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;
+}