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>
This commit is contained in:
parent
8c77a5694c
commit
9ecdef4be8
3 changed files with 18 additions and 18 deletions
|
@ -919,7 +919,7 @@ int ath9k_hw_init(struct ath_hw *ah)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ath9k_hw_setpower_nolock(ah, ATH9K_PM_AWAKE)) {
|
if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {
|
||||||
DPRINTF(ah, ATH_DBG_FATAL, "Couldn't wakeup chip\n");
|
DPRINTF(ah, ATH_DBG_FATAL, "Couldn't wakeup chip\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
@ -1234,7 +1234,7 @@ void ath9k_hw_detach(struct ath_hw *ah)
|
||||||
ath9k_hw_ani_disable(ah);
|
ath9k_hw_ani_disable(ah);
|
||||||
|
|
||||||
ath9k_hw_rf_free(ah);
|
ath9k_hw_rf_free(ah);
|
||||||
ath9k_hw_setpower_nolock(ah, ATH9K_PM_FULL_SLEEP);
|
ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP);
|
||||||
kfree(ah);
|
kfree(ah);
|
||||||
ah = NULL;
|
ah = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1800,7 +1800,7 @@ static bool ath9k_hw_chip_reset(struct ath_hw *ah,
|
||||||
} else if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_WARM))
|
} else if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_WARM))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!ath9k_hw_setpower_nolock(ah, ATH9K_PM_AWAKE))
|
if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ah->chip_fullsleep = false;
|
ah->chip_fullsleep = false;
|
||||||
|
@ -2355,7 +2355,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
|
||||||
ah->txchainmask = sc->tx_chainmask;
|
ah->txchainmask = sc->tx_chainmask;
|
||||||
ah->rxchainmask = sc->rx_chainmask;
|
ah->rxchainmask = sc->rx_chainmask;
|
||||||
|
|
||||||
if (!ath9k_hw_setpower_nolock(ah, ATH9K_PM_AWAKE))
|
if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
if (curchan && !ah->chip_fullsleep)
|
if (curchan && !ah->chip_fullsleep)
|
||||||
|
@ -2932,7 +2932,7 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ath9k_hw_setpower_nolock(struct ath_hw *ah, enum ath9k_power_mode mode)
|
bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
|
||||||
{
|
{
|
||||||
int status = true, setChip = true;
|
int status = true, setChip = true;
|
||||||
static const char *modes[] = {
|
static const char *modes[] = {
|
||||||
|
@ -3986,7 +3986,7 @@ bool ath9k_hw_phy_disable(struct ath_hw *ah)
|
||||||
|
|
||||||
bool ath9k_hw_disable(struct ath_hw *ah)
|
bool ath9k_hw_disable(struct ath_hw *ah)
|
||||||
{
|
{
|
||||||
if (!ath9k_hw_setpower_nolock(ah, ATH9K_PM_AWAKE))
|
if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return ath9k_hw_set_reset_reg(ah, ATH9K_RESET_COLD);
|
return ath9k_hw_set_reset_reg(ah, ATH9K_RESET_COLD);
|
||||||
|
|
|
@ -653,7 +653,7 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period);
|
||||||
void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
|
void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
|
||||||
const struct ath9k_beacon_state *bs);
|
const struct ath9k_beacon_state *bs);
|
||||||
|
|
||||||
bool ath9k_hw_setpower_nolock(struct ath_hw *ah, enum ath9k_power_mode mode);
|
bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
|
||||||
|
|
||||||
void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off);
|
void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off);
|
||||||
|
|
||||||
|
|
|
@ -243,14 +243,14 @@ static struct ath9k_channel *ath_get_curchannel(struct ath_softc *sc,
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
|
static bool ath9k_setpower(struct ath_softc *sc, enum ath9k_power_mode mode)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
spin_lock_irqsave(&ah->ah_sc->sc_pm_lock, flags);
|
spin_lock_irqsave(&sc->sc_pm_lock, flags);
|
||||||
ret = ath9k_hw_setpower_nolock(ah, mode);
|
ret = ath9k_hw_setpower(sc->sc_ah, mode);
|
||||||
spin_unlock_irqrestore(&ah->ah_sc->sc_pm_lock, flags);
|
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ void ath9k_ps_wakeup(struct ath_softc *sc)
|
||||||
if (++sc->ps_usecount != 1)
|
if (++sc->ps_usecount != 1)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
|
|
||||||
ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_AWAKE);
|
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
|
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
|
||||||
|
@ -282,7 +282,7 @@ void ath9k_ps_restore(struct ath_softc *sc)
|
||||||
SC_OP_WAIT_FOR_CAB |
|
SC_OP_WAIT_FOR_CAB |
|
||||||
SC_OP_WAIT_FOR_PSPOLL_DATA |
|
SC_OP_WAIT_FOR_PSPOLL_DATA |
|
||||||
SC_OP_WAIT_FOR_TX_ACK)))
|
SC_OP_WAIT_FOR_TX_ACK)))
|
||||||
ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
|
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
|
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
|
||||||
|
@ -652,7 +652,7 @@ irqreturn_t ath_isr(int irq, void *dev)
|
||||||
if (status & ATH9K_INT_TIM_TIMER) {
|
if (status & ATH9K_INT_TIM_TIMER) {
|
||||||
/* Clear RxAbort bit so that we can
|
/* Clear RxAbort bit so that we can
|
||||||
* receive frames */
|
* receive frames */
|
||||||
ath9k_hw_setpower(ah, ATH9K_PM_AWAKE);
|
ath9k_setpower(sc, ATH9K_PM_AWAKE);
|
||||||
ath9k_hw_setrxabort(sc->sc_ah, 0);
|
ath9k_hw_setrxabort(sc->sc_ah, 0);
|
||||||
sc->sc_flags |= SC_OP_WAIT_FOR_BEACON;
|
sc->sc_flags |= SC_OP_WAIT_FOR_BEACON;
|
||||||
}
|
}
|
||||||
|
@ -1254,7 +1254,7 @@ void ath_radio_disable(struct ath_softc *sc)
|
||||||
ath9k_hw_phy_disable(ah);
|
ath9k_hw_phy_disable(ah);
|
||||||
ath9k_hw_configpcipowersave(ah, 1, 1);
|
ath9k_hw_configpcipowersave(ah, 1, 1);
|
||||||
ath9k_ps_restore(sc);
|
ath9k_ps_restore(sc);
|
||||||
ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP);
|
ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************/
|
/*******************/
|
||||||
|
@ -1324,7 +1324,7 @@ void ath_detach(struct ath_softc *sc)
|
||||||
tasklet_kill(&sc->bcon_tasklet);
|
tasklet_kill(&sc->bcon_tasklet);
|
||||||
|
|
||||||
if (!(sc->sc_flags & SC_OP_INVALID))
|
if (!(sc->sc_flags & SC_OP_INVALID))
|
||||||
ath9k_hw_setpower(ah, ATH9K_PM_AWAKE);
|
ath9k_setpower(sc, ATH9K_PM_AWAKE);
|
||||||
|
|
||||||
/* cleanup tx queues */
|
/* cleanup tx queues */
|
||||||
for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
|
for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
|
||||||
|
@ -2409,7 +2409,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
|
||||||
/* disable HAL and put h/w to sleep */
|
/* disable HAL and put h/w to sleep */
|
||||||
ath9k_hw_disable(ah);
|
ath9k_hw_disable(ah);
|
||||||
ath9k_hw_configpcipowersave(ah, 1, 1);
|
ath9k_hw_configpcipowersave(ah, 1, 1);
|
||||||
ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP);
|
ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP);
|
||||||
|
|
||||||
sc->sc_flags |= SC_OP_INVALID;
|
sc->sc_flags |= SC_OP_INVALID;
|
||||||
|
|
||||||
|
@ -2581,7 +2581,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
|
||||||
sc->ps_enabled = true;
|
sc->ps_enabled = true;
|
||||||
} else {
|
} else {
|
||||||
sc->ps_enabled = false;
|
sc->ps_enabled = false;
|
||||||
ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
|
ath9k_setpower(sc, ATH9K_PM_AWAKE);
|
||||||
if (!(ah->caps.hw_caps &
|
if (!(ah->caps.hw_caps &
|
||||||
ATH9K_HW_CAP_AUTOSLEEP)) {
|
ATH9K_HW_CAP_AUTOSLEEP)) {
|
||||||
ath9k_hw_setrxabort(sc->sc_ah, 0);
|
ath9k_hw_setrxabort(sc->sc_ah, 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue