aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/virtual.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-10-29 13:41:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-11-11 17:08:59 -0500
commit194b7c13b4c516db94db8ee004342f8935922739 (patch)
tree1000344cb5c9fd9eac85bed537ddcd476f64d1aa /drivers/net/wireless/ath/ath9k/virtual.c
parentf14543ee4d0681df1377b976cba704557ba220d3 (diff)
ath9k: fix listening to idle requests
The way idle configuration detection was implemented as busted due to the fact that it assumed the ath9k virtual wiphy, the aphy, would be marked as inactive if it was not used but it turns out an aphy is always active if its the only wiphy present. We need to distinguish between aphy activity and idleness so we now add an idle bool for the aphy and mark it as such based on the passed IEEE80211_CONF_CHANGE_IDLE from mac80211. Previous to all_wiphys_idle would never be true when using only one device so we never really were using IEEE80211_CONF_CHANGE_IDLE -- we never turned the radio off or on upon IEEE80211_CONF_CHANGE_IDLE changes as radio changes depended on all_wiphys_idle being true either to turn the radio on or off. Since it was always false for one device this code was doing nothing. Cc: Jouni.Malinen <Jouni.Malinen@atheros.com> Reported-by: Vasanthakumar Thiagarajan <vasanth@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/ath9k/virtual.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/virtual.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c
index bc7d173b6fa..e6a50f3aa47 100644
--- a/drivers/net/wireless/ath/ath9k/virtual.c
+++ b/drivers/net/wireless/ath/ath9k/virtual.c
@@ -668,15 +668,26 @@ void ath9k_wiphy_set_scheduler(struct ath_softc *sc, unsigned int msec_int)
668bool ath9k_all_wiphys_idle(struct ath_softc *sc) 668bool ath9k_all_wiphys_idle(struct ath_softc *sc)
669{ 669{
670 unsigned int i; 670 unsigned int i;
671 if (sc->pri_wiphy->state != ATH_WIPHY_INACTIVE) { 671 if (!sc->pri_wiphy->idle)
672 return false; 672 return false;
673 }
674 for (i = 0; i < sc->num_sec_wiphy; i++) { 673 for (i = 0; i < sc->num_sec_wiphy; i++) {
675 struct ath_wiphy *aphy = sc->sec_wiphy[i]; 674 struct ath_wiphy *aphy = sc->sec_wiphy[i];
676 if (!aphy) 675 if (!aphy)
677 continue; 676 continue;
678 if (aphy->state != ATH_WIPHY_INACTIVE) 677 if (!aphy->idle)
679 return false; 678 return false;
680 } 679 }
681 return true; 680 return true;
682} 681}
682
683/* caller must hold wiphy_lock */
684void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle)
685{
686 struct ath_softc *sc = aphy->sc;
687
688 aphy->idle = idle;
689 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG,
690 "Marking %s as %s\n",
691 wiphy_name(aphy->hw->wiphy),
692 idle ? "idle" : "not-idle");
693}