Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170512
b: refs/heads/master
c: a91d75a
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Oct 7, 2009
1 parent 098c107 commit 99009ef
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 21526d57ad98635fe12dc8efe46a3d992439a443
refs/heads/master: a91d75aec19d8d23c7c543dd4bc0e394e1d46867
36 changes: 1 addition & 35 deletions trunk/drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2932,8 +2932,7 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
return true;
}

static bool ath9k_hw_setpower_nolock(struct ath_hw *ah,
enum ath9k_power_mode mode)
bool ath9k_hw_setpower_nolock(struct ath_hw *ah, enum ath9k_power_mode mode)
{
int status = true, setChip = true;
static const char *modes[] = {
Expand Down Expand Up @@ -2982,39 +2981,6 @@ bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
return ret;
}

void ath9k_ps_wakeup(struct ath_softc *sc)
{
unsigned long flags;

spin_lock_irqsave(&sc->sc_pm_lock, flags);
if (++sc->ps_usecount != 1)
goto unlock;

ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_AWAKE);

unlock:
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
}

void ath9k_ps_restore(struct ath_softc *sc)
{
unsigned long flags;

spin_lock_irqsave(&sc->sc_pm_lock, flags);
if (--sc->ps_usecount != 0)
goto unlock;

if (sc->ps_enabled &&
!(sc->sc_flags & (SC_OP_WAIT_FOR_BEACON |
SC_OP_WAIT_FOR_CAB |
SC_OP_WAIT_FOR_PSPOLL_DATA |
SC_OP_WAIT_FOR_TX_ACK)))
ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);

unlock:
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
}

/*
* Helper for ASPM support.
*
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/wireless/ath/ath9k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,10 @@ void ath9k_hw_set11nmac2040(struct ath_hw *ah, enum ath9k_ht_macmode mode);
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,
const struct ath9k_beacon_state *bs);
bool ath9k_hw_setpower(struct ath_hw *ah,
enum ath9k_power_mode mode);

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);

/* Interrupt Handling */
Expand Down
33 changes: 33 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,39 @@ static struct ath9k_channel *ath_get_curchannel(struct ath_softc *sc,
return channel;
}

void ath9k_ps_wakeup(struct ath_softc *sc)
{
unsigned long flags;

spin_lock_irqsave(&sc->sc_pm_lock, flags);
if (++sc->ps_usecount != 1)
goto unlock;

ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_AWAKE);

unlock:
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
}

void ath9k_ps_restore(struct ath_softc *sc)
{
unsigned long flags;

spin_lock_irqsave(&sc->sc_pm_lock, flags);
if (--sc->ps_usecount != 0)
goto unlock;

if (sc->ps_enabled &&
!(sc->sc_flags & (SC_OP_WAIT_FOR_BEACON |
SC_OP_WAIT_FOR_CAB |
SC_OP_WAIT_FOR_PSPOLL_DATA |
SC_OP_WAIT_FOR_TX_ACK)))
ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);

unlock:
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
}

/*
* Set/change channels. If the channel is really being changed, it's done
* by reseting the chip. To accomplish this we must first cleanup any pending
Expand Down

0 comments on commit 99009ef

Please sign in to comment.