Commit 9c35d7d2 authored by Seth Forshee's avatar Seth Forshee Committed by Johannes Berg
Browse files

mac80211: Add flushes before going off-channel

We've got a couple of races when enabling powersave with an AP for
off-channel operation. The first is fairly simple. If we go off-channel
before the nullfunc frame to enable PS is transmitted then it may not be
received by the AP. Add a flush after enabling off-channel PS to prevent
this from happening.

The second race is a bit more subtle. If the driver supports QoS and has
frames queued when the nullfunc frame is queued, those frames may get
transmitted after the nullfunc frame. If PM is not set then the AP is
being told that we've exited PS before we go off-channel and may try to
deliver frames. To prevent this, add a flush after stopping the queues
but before passing the nullfunc frame to the driver.
Signed-off-by: default avatarSeth Forshee <>
Signed-off-by: default avatarJohannes Berg <>
parent 6c17b77b
......@@ -114,8 +114,13 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local)
* STA interfaces.
* Stop queues and transmit all frames queued by the driver
* before sending nullfunc to enable powersave at the AP.
drv_flush(local, false);
list_for_each_entry(sdata, &local->interfaces, list) {
......@@ -334,6 +334,9 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
/* ensure nullfunc is transmitted before leaving operating channel */
drv_flush(local, false);
/* We need to set power level at maximum rate for scanning. */
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