aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-09-10 00:10:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:24 -0400
commit9ecdef4be864fede4e5964abc82c8d7451288539 (patch)
tree4b1b4e2f9ffc1e833839abb6b8b5612143170c2b /drivers
parent8c77a5694cd31eb2291948dd1bfe700a199be8e7 (diff)
ath9k: rename driver core and hw power save helpers
ath9k_hw_setpower_nolock --> ath9k_hw_setpower() ath9k_hw_setpower() --> ath9k_setpower() Also change the param for ath9k_setpower() to pass the ath_softc. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c12
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c22
3 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index e71fe24cd3d8..cb352daf2dc7 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -919,7 +919,7 @@ int ath9k_hw_init(struct ath_hw *ah)
919 return -EIO; 919 return -EIO;
920 } 920 }
921 921
922 if (!ath9k_hw_setpower_nolock(ah, ATH9K_PM_AWAKE)) { 922 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {
923 DPRINTF(ah, ATH_DBG_FATAL, "Couldn't wakeup chip\n"); 923 DPRINTF(ah, ATH_DBG_FATAL, "Couldn't wakeup chip\n");
924 return -EIO; 924 return -EIO;
925 } 925 }
@@ -1234,7 +1234,7 @@ void ath9k_hw_detach(struct ath_hw *ah)
1234 ath9k_hw_ani_disable(ah); 1234 ath9k_hw_ani_disable(ah);
1235 1235
1236 ath9k_hw_rf_free(ah); 1236 ath9k_hw_rf_free(ah);
1237 ath9k_hw_setpower_nolock(ah, ATH9K_PM_FULL_SLEEP); 1237 ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP);
1238 kfree(ah); 1238 kfree(ah);
1239 ah = NULL; 1239 ah = NULL;
1240} 1240}
@@ -1800,7 +1800,7 @@ static bool ath9k_hw_chip_reset(struct ath_hw *ah,
1800 } else if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_WARM)) 1800 } else if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_WARM))
1801 return false; 1801 return false;
1802 1802
1803 if (!ath9k_hw_setpower_nolock(ah, ATH9K_PM_AWAKE)) 1803 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
1804 return false; 1804 return false;
1805 1805
1806 ah->chip_fullsleep = false; 1806 ah->chip_fullsleep = false;
@@ -2355,7 +2355,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
2355 ah->txchainmask = sc->tx_chainmask; 2355 ah->txchainmask = sc->tx_chainmask;
2356 ah->rxchainmask = sc->rx_chainmask; 2356 ah->rxchainmask = sc->rx_chainmask;
2357 2357
2358 if (!ath9k_hw_setpower_nolock(ah, ATH9K_PM_AWAKE)) 2358 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
2359 return -EIO; 2359 return -EIO;
2360 2360
2361 if (curchan && !ah->chip_fullsleep) 2361 if (curchan && !ah->chip_fullsleep)
@@ -2932,7 +2932,7 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
2932 return true; 2932 return true;
2933} 2933}
2934 2934
2935bool ath9k_hw_setpower_nolock(struct ath_hw *ah, enum ath9k_power_mode mode) 2935bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
2936{ 2936{
2937 int status = true, setChip = true; 2937 int status = true, setChip = true;
2938 static const char *modes[] = { 2938 static const char *modes[] = {
@@ -3986,7 +3986,7 @@ bool ath9k_hw_phy_disable(struct ath_hw *ah)
3986 3986
3987bool ath9k_hw_disable(struct ath_hw *ah) 3987bool ath9k_hw_disable(struct ath_hw *ah)
3988{ 3988{
3989 if (!ath9k_hw_setpower_nolock(ah, ATH9K_PM_AWAKE)) 3989 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
3990 return false; 3990 return false;
3991 3991
3992 return ath9k_hw_set_reset_reg(ah, ATH9K_RESET_COLD); 3992 return ath9k_hw_set_reset_reg(ah, ATH9K_RESET_COLD);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 05e4f8bc566b..2432edcabafb 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -653,7 +653,7 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period);
653void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah, 653void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
654 const struct ath9k_beacon_state *bs); 654 const struct ath9k_beacon_state *bs);
655 655
656bool ath9k_hw_setpower_nolock(struct ath_hw *ah, enum ath9k_power_mode mode); 656bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
657 657
658void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off); 658void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off);
659 659
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index d0637a65f9a9..216b72f9c85c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -243,14 +243,14 @@ static struct ath9k_channel *ath_get_curchannel(struct ath_softc *sc,
243 return channel; 243 return channel;
244} 244}
245 245
246static bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode) 246static bool ath9k_setpower(struct ath_softc *sc, enum ath9k_power_mode mode)
247{ 247{
248 unsigned long flags; 248 unsigned long flags;
249 bool ret; 249 bool ret;
250 250
251 spin_lock_irqsave(&ah->ah_sc->sc_pm_lock, flags); 251 spin_lock_irqsave(&sc->sc_pm_lock, flags);
252 ret = ath9k_hw_setpower_nolock(ah, mode); 252 ret = ath9k_hw_setpower(sc->sc_ah, mode);
253 spin_unlock_irqrestore(&ah->ah_sc->sc_pm_lock, flags); 253 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
254 254
255 return ret; 255 return ret;
256} 256}
@@ -263,7 +263,7 @@ void ath9k_ps_wakeup(struct ath_softc *sc)
263 if (++sc->ps_usecount != 1) 263 if (++sc->ps_usecount != 1)
264 goto unlock; 264 goto unlock;
265 265
266 ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_AWAKE); 266 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
267 267
268 unlock: 268 unlock:
269 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); 269 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
@@ -282,7 +282,7 @@ void ath9k_ps_restore(struct ath_softc *sc)
282 SC_OP_WAIT_FOR_CAB | 282 SC_OP_WAIT_FOR_CAB |
283 SC_OP_WAIT_FOR_PSPOLL_DATA | 283 SC_OP_WAIT_FOR_PSPOLL_DATA |
284 SC_OP_WAIT_FOR_TX_ACK))) 284 SC_OP_WAIT_FOR_TX_ACK)))
285 ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP); 285 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
286 286
287 unlock: 287 unlock:
288 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); 288 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
@@ -652,7 +652,7 @@ irqreturn_t ath_isr(int irq, void *dev)
652 if (status & ATH9K_INT_TIM_TIMER) { 652 if (status & ATH9K_INT_TIM_TIMER) {
653 /* Clear RxAbort bit so that we can 653 /* Clear RxAbort bit so that we can
654 * receive frames */ 654 * receive frames */
655 ath9k_hw_setpower(ah, ATH9K_PM_AWAKE); 655 ath9k_setpower(sc, ATH9K_PM_AWAKE);
656 ath9k_hw_setrxabort(sc->sc_ah, 0); 656 ath9k_hw_setrxabort(sc->sc_ah, 0);
657 sc->sc_flags |= SC_OP_WAIT_FOR_BEACON; 657 sc->sc_flags |= SC_OP_WAIT_FOR_BEACON;
658 } 658 }
@@ -1254,7 +1254,7 @@ void ath_radio_disable(struct ath_softc *sc)
1254 ath9k_hw_phy_disable(ah); 1254 ath9k_hw_phy_disable(ah);
1255 ath9k_hw_configpcipowersave(ah, 1, 1); 1255 ath9k_hw_configpcipowersave(ah, 1, 1);
1256 ath9k_ps_restore(sc); 1256 ath9k_ps_restore(sc);
1257 ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP); 1257 ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
1258} 1258}
1259 1259
1260/*******************/ 1260/*******************/
@@ -1324,7 +1324,7 @@ void ath_detach(struct ath_softc *sc)
1324 tasklet_kill(&sc->bcon_tasklet); 1324 tasklet_kill(&sc->bcon_tasklet);
1325 1325
1326 if (!(sc->sc_flags & SC_OP_INVALID)) 1326 if (!(sc->sc_flags & SC_OP_INVALID))
1327 ath9k_hw_setpower(ah, ATH9K_PM_AWAKE); 1327 ath9k_setpower(sc, ATH9K_PM_AWAKE);
1328 1328
1329 /* cleanup tx queues */ 1329 /* cleanup tx queues */
1330 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) 1330 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
@@ -2409,7 +2409,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
2409 /* disable HAL and put h/w to sleep */ 2409 /* disable HAL and put h/w to sleep */
2410 ath9k_hw_disable(ah); 2410 ath9k_hw_disable(ah);
2411 ath9k_hw_configpcipowersave(ah, 1, 1); 2411 ath9k_hw_configpcipowersave(ah, 1, 1);
2412 ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP); 2412 ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
2413 2413
2414 sc->sc_flags |= SC_OP_INVALID; 2414 sc->sc_flags |= SC_OP_INVALID;
2415 2415
@@ -2581,7 +2581,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2581 sc->ps_enabled = true; 2581 sc->ps_enabled = true;
2582 } else { 2582 } else {
2583 sc->ps_enabled = false; 2583 sc->ps_enabled = false;
2584 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); 2584 ath9k_setpower(sc, ATH9K_PM_AWAKE);
2585 if (!(ah->caps.hw_caps & 2585 if (!(ah->caps.hw_caps &
2586 ATH9K_HW_CAP_AUTOSLEEP)) { 2586 ATH9K_HW_CAP_AUTOSLEEP)) {
2587 ath9k_hw_setrxabort(sc->sc_ah, 0); 2587 ath9k_hw_setrxabort(sc->sc_ah, 0);