Commit 72eaa43a authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: only transition STAs ps->wake on data frames

When a station goes to PS mode to scan, it will then send
probe requests without the PS bit set. mac80211 will take
that as indication that the station woke up, but it didn't.
This patch changes mac80211 to only consider doze->wake
transitions on data frames to to fix that issue.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Cc: Jouni Malinen <j@w1.fi>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0d950d84
...@@ -741,17 +741,29 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) ...@@ -741,17 +741,29 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
sta->last_qual = rx->status->qual; sta->last_qual = rx->status->qual;
sta->last_noise = rx->status->noise; sta->last_noise = rx->status->noise;
/*
* Change STA power saving mode only at the end of a frame
* exchange sequence.
*/
if (!ieee80211_has_morefrags(hdr->frame_control) && if (!ieee80211_has_morefrags(hdr->frame_control) &&
(rx->sdata->vif.type == NL80211_IFTYPE_AP || (rx->sdata->vif.type == NL80211_IFTYPE_AP ||
rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) { rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) {
/* Change STA power saving mode only in the end of a frame if (test_sta_flags(sta, WLAN_STA_PS)) {
* exchange sequence */ /*
if (test_sta_flags(sta, WLAN_STA_PS) && * Ignore doze->wake transitions that are
!ieee80211_has_pm(hdr->frame_control)) * indicated by non-data frames, the standard
rx->sent_ps_buffered += ap_sta_ps_end(sta); * is unclear here, but for example going to
else if (!test_sta_flags(sta, WLAN_STA_PS) && * PS mode and then scanning would cause a
ieee80211_has_pm(hdr->frame_control)) * doze->wake transition for the probe request,
ap_sta_ps_start(sta); * and that is clearly undesirable.
*/
if (ieee80211_is_data(hdr->frame_control) &&
!ieee80211_has_pm(hdr->frame_control))
rx->sent_ps_buffered += ap_sta_ps_end(sta);
} else {
if (ieee80211_has_pm(hdr->frame_control))
ap_sta_ps_start(sta);
}
} }
/* Drop data::nullfunc frames silently, since they are used only to /* Drop data::nullfunc frames silently, since they are used only to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment