From 5795e694ec722decd6f60974ae5fae90f4cbf60a Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 26 Nov 2008 15:02:58 +0100 Subject: [PATCH] --- yaml --- r: 122469 b: refs/heads/master c: 72eaa43a532b4156966444779829a986a4432f11 h: refs/heads/master i: 122467: 53a6c36b5549bb592bea557d810a3fa0f513145d v: v3 --- [refs] | 2 +- trunk/net/mac80211/rx.c | 28 ++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index c2456057e140..3e07fdc1efa0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0d950d84d9d16f7d4edf380a238c5b534ff00d11 +refs/heads/master: 72eaa43a532b4156966444779829a986a4432f11 diff --git a/trunk/net/mac80211/rx.c b/trunk/net/mac80211/rx.c index 648a1d0e6c82..68a6e973c72c 100644 --- a/trunk/net/mac80211/rx.c +++ b/trunk/net/mac80211/rx.c @@ -741,17 +741,29 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) sta->last_qual = rx->status->qual; 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) && (rx->sdata->vif.type == NL80211_IFTYPE_AP || rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) { - /* Change STA power saving mode only in the end of a frame - * exchange sequence */ - if (test_sta_flags(sta, WLAN_STA_PS) && - !ieee80211_has_pm(hdr->frame_control)) - rx->sent_ps_buffered += ap_sta_ps_end(sta); - else if (!test_sta_flags(sta, WLAN_STA_PS) && - ieee80211_has_pm(hdr->frame_control)) - ap_sta_ps_start(sta); + if (test_sta_flags(sta, WLAN_STA_PS)) { + /* + * Ignore doze->wake transitions that are + * indicated by non-data frames, the standard + * is unclear here, but for example going to + * PS mode and then scanning would cause a + * doze->wake transition for the probe request, + * 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