Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dbfd9d4 authored by Vivek Natarajan's avatar Vivek Natarajan Committed by John W. Linville
Browse files

ath9k: Handle full sleep in ps_restore.



IDLE PS (Full Sleep) doesn't work when ifconfig up
is done during Idle unassociated state.
Fix this by restoring FULL SLEEP in ps_restore if CONF_IDLE
is set.

Signed-off-by: default avatarVivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f276586a
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -480,6 +480,7 @@ struct ath_softc {
	u8 nbcnvifs;
	u8 nbcnvifs;
	u16 nvifs;
	u16 nvifs;
	bool ps_enabled;
	bool ps_enabled;
	bool ps_idle;
	unsigned long ps_usecount;
	unsigned long ps_usecount;
	enum ath9k_int imask;
	enum ath9k_int imask;


+6 −2
Original line number Original line Diff line number Diff line
@@ -143,7 +143,9 @@ void ath9k_ps_restore(struct ath_softc *sc)
	if (--sc->ps_usecount != 0)
	if (--sc->ps_usecount != 0)
		goto unlock;
		goto unlock;


	if (sc->ps_enabled &&
	if (sc->ps_idle)
		ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
	else if (sc->ps_enabled &&
		 !(sc->ps_flags & (PS_WAIT_FOR_BEACON |
		 !(sc->ps_flags & (PS_WAIT_FOR_BEACON |
			      PS_WAIT_FOR_CAB |
			      PS_WAIT_FOR_CAB |
			      PS_WAIT_FOR_PSPOLL_DATA |
			      PS_WAIT_FOR_PSPOLL_DATA |
@@ -1528,6 +1530,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
		spin_unlock_bh(&sc->wiphy_lock);
		spin_unlock_bh(&sc->wiphy_lock);


		if (enable_radio) {
		if (enable_radio) {
			sc->ps_idle = false;
			ath_radio_enable(sc, hw);
			ath_radio_enable(sc, hw);
			ath_print(common, ATH_DBG_CONFIG,
			ath_print(common, ATH_DBG_CONFIG,
				  "not-idle: enabling radio\n");
				  "not-idle: enabling radio\n");
@@ -1635,6 +1638,7 @@ skip_chan_change:


	if (disable_radio) {
	if (disable_radio) {
		ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n");
		ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n");
		sc->ps_idle = true;
		ath_radio_disable(sc, hw);
		ath_radio_disable(sc, hw);
	}
	}