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

Commit 2a13052f authored by Juuso Oikarinen's avatar Juuso Oikarinen Committed by John W. Linville
Browse files

mac80211: Fix (dynamic) power save entry



Currently hardware with !IEEE80211_HW_PS_NULLFUNC_STACK and
IEEE80211_HW_REPORTS_TX_ACK_STATUS will never enter PSM due to the
conditions in the power save entry functions.

Fix those conditions.

Signed-off-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Cc: stable@kernel.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 41093167
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -436,12 +436,14 @@ static void ieee80211_enable_ps(struct ieee80211_local *local,
		if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)
		if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)
			ieee80211_send_nullfunc(local, sdata, 1);
			ieee80211_send_nullfunc(local, sdata, 1);


		if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) {
		if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) &&
		    (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS))
			return;

		conf->flags |= IEEE80211_CONF_PS;
		conf->flags |= IEEE80211_CONF_PS;
		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
	}
	}
}
}
}


static void ieee80211_change_ps(struct ieee80211_local *local)
static void ieee80211_change_ps(struct ieee80211_local *local)
{
{
@@ -558,7 +560,8 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
	    (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)))
	    (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)))
		ieee80211_send_nullfunc(local, sdata, 1);
		ieee80211_send_nullfunc(local, sdata, 1);


	if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) ||
	if (!((local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) &&
	      (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)) ||
	    (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) {
	    (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) {
		ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
		ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
		local->hw.conf.flags |= IEEE80211_CONF_PS;
		local->hw.conf.flags |= IEEE80211_CONF_PS;