diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-11-26 09:02:58 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-05 09:32:11 -0500 |
commit | 72eaa43a532b4156966444779829a986a4432f11 (patch) | |
tree | ca22c7bc823d4746a391cfa37ce31e5751b3a003 /net/mac80211/rx.c | |
parent | 0d950d84d9d16f7d4edf380a238c5b534ff00d11 (diff) |
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: Johannes Berg <johannes@sipsolutions.net>
Cc: Jouni Malinen <j@w1.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 648a1d0e6c82..68a6e973c72c 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -741,17 +741,29 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) | |||
741 | sta->last_qual = rx->status->qual; | 741 | sta->last_qual = rx->status->qual; |
742 | sta->last_noise = rx->status->noise; | 742 | sta->last_noise = rx->status->noise; |
743 | 743 | ||
744 | /* | ||
745 | * Change STA power saving mode only at the end of a frame | ||
746 | * exchange sequence. | ||
747 | */ | ||
744 | if (!ieee80211_has_morefrags(hdr->frame_control) && | 748 | if (!ieee80211_has_morefrags(hdr->frame_control) && |
745 | (rx->sdata->vif.type == NL80211_IFTYPE_AP || | 749 | (rx->sdata->vif.type == NL80211_IFTYPE_AP || |
746 | rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) { | 750 | rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) { |
747 | /* Change STA power saving mode only in the end of a frame | 751 | if (test_sta_flags(sta, WLAN_STA_PS)) { |
748 | * exchange sequence */ | 752 | /* |
749 | if (test_sta_flags(sta, WLAN_STA_PS) && | 753 | * Ignore doze->wake transitions that are |
750 | !ieee80211_has_pm(hdr->frame_control)) | 754 | * indicated by non-data frames, the standard |
751 | rx->sent_ps_buffered += ap_sta_ps_end(sta); | 755 | * is unclear here, but for example going to |
752 | else if (!test_sta_flags(sta, WLAN_STA_PS) && | 756 | * PS mode and then scanning would cause a |
753 | ieee80211_has_pm(hdr->frame_control)) | 757 | * doze->wake transition for the probe request, |
754 | ap_sta_ps_start(sta); | 758 | * and that is clearly undesirable. |
759 | */ | ||
760 | if (ieee80211_is_data(hdr->frame_control) && | ||
761 | !ieee80211_has_pm(hdr->frame_control)) | ||
762 | rx->sent_ps_buffered += ap_sta_ps_end(sta); | ||
763 | } else { | ||
764 | if (ieee80211_has_pm(hdr->frame_control)) | ||
765 | ap_sta_ps_start(sta); | ||
766 | } | ||
755 | } | 767 | } |
756 | 768 | ||
757 | /* Drop data::nullfunc frames silently, since they are used only to | 769 | /* Drop data::nullfunc frames silently, since they are used only to |