diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-07-14 20:22:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:19 -0400 |
commit | 64839170be296e6348fbaf83fd103711978669b9 (patch) | |
tree | efc597e35a98417fd6910eacf92a36b8d206e2ae /drivers/net/wireless/ath/ath9k/virtual.c | |
parent | 709ade9eb8ef06e03526115408e2fc93a9feabbd (diff) |
ath9k: disable radio when all devices are marked idle
This uses the new configuration changes indicated up by
mac80211 when all interfaces are marked idle. We need to do
a little more work as we have our own set of virtual
wiphys within ath9k.
Only when all virtual wiphys are inactive do we allow an idle
state change for a wiphy to trigger disabling the radio.
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/ath9k/virtual.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/virtual.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c index 1ff429b027d..e1d419e02b4 100644 --- a/drivers/net/wireless/ath/ath9k/virtual.c +++ b/drivers/net/wireless/ath/ath9k/virtual.c | |||
@@ -660,3 +660,20 @@ void ath9k_wiphy_set_scheduler(struct ath_softc *sc, unsigned int msec_int) | |||
660 | queue_delayed_work(sc->hw->workqueue, &sc->wiphy_work, | 660 | queue_delayed_work(sc->hw->workqueue, &sc->wiphy_work, |
661 | sc->wiphy_scheduler_int); | 661 | sc->wiphy_scheduler_int); |
662 | } | 662 | } |
663 | |||
664 | /* caller must hold wiphy_lock */ | ||
665 | bool ath9k_all_wiphys_idle(struct ath_softc *sc) | ||
666 | { | ||
667 | unsigned int i; | ||
668 | if (sc->pri_wiphy->state != ATH_WIPHY_INACTIVE) { | ||
669 | return false; | ||
670 | } | ||
671 | for (i = 0; i < sc->num_sec_wiphy; i++) { | ||
672 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; | ||
673 | if (!aphy) | ||
674 | continue; | ||
675 | if (aphy->state != ATH_WIPHY_INACTIVE) | ||
676 | return false; | ||
677 | } | ||
678 | return true; | ||
679 | } | ||