diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-11-06 05:35:50 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-06 16:49:10 -0500 |
commit | af81858172cc0f3da81946aab919c26e4b364efc (patch) | |
tree | 8e7a4bf30ff7c23636d810c5a912ff7e3ddb7333 /include | |
parent | 70d9f405d09e334b609702d88ee03b6119c4b45e (diff) |
mac80211: async station powersave handling
Some devices require that all frames to a station
are flushed when that station goes into powersave
mode before being able to send frames to that
station again when it wakes up or polls -- all in
order to avoid reordering and too many or too few
frames being sent to the station when it polls.
Normally, this is the case unless the station
goes to sleep and wakes up very quickly again.
But in that case, frames for it may be pending
on the hardware queues, and thus races could
happen in the case of multiple hardware queues
used for QoS/WMM. Normally this isn't a problem,
but with the iwlwifi mechanism we need to make
sure the race doesn't happen.
This makes mac80211 able to cope with the race
with driver help by a new WLAN_STA_PS_DRIVER
per-station flag that can be controlled by the
driver and tells mac80211 whether it can transmit
frames or not. This flag must be set according to
very specific rules outlined in the documentation
for the function that controls it.
When we buffer new frames for the station, we
normally set the TIM bit right away, but while
the driver has blocked transmission to that sta
we need to avoid that as well since we cannot
respond to the station if it wakes up due to the
TIM bit. Once the driver unblocks, we can set
the TIM bit.
Similarly, when the station just wakes up, we
need to wait until all other frames are flushed
before we can transmit frames to that station,
so the same applies here, we need to wait for
the driver to give the OK.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/mac80211.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 7f035d779db9..2c10eac637d8 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -2137,6 +2137,38 @@ struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, | |||
2137 | const u8 *addr); | 2137 | const u8 *addr); |
2138 | 2138 | ||
2139 | /** | 2139 | /** |
2140 | * ieee80211_sta_block_awake - block station from waking up | ||
2141 | * @hw: the hardware | ||
2142 | * @pubsta: the station | ||
2143 | * @block: whether to block or unblock | ||
2144 | * | ||
2145 | * Some devices require that all frames that are on the queues | ||
2146 | * for a specific station that went to sleep are flushed before | ||
2147 | * a poll response or frames after the station woke up can be | ||
2148 | * delivered to that it. Note that such frames must be rejected | ||
2149 | * by the driver as filtered, with the appropriate status flag. | ||
2150 | * | ||
2151 | * This function allows implementing this mode in a race-free | ||
2152 | * manner. | ||
2153 | * | ||
2154 | * To do this, a driver must keep track of the number of frames | ||
2155 | * still enqueued for a specific station. If this number is not | ||
2156 | * zero when the station goes to sleep, the driver must call | ||
2157 | * this function to force mac80211 to consider the station to | ||
2158 | * be asleep regardless of the station's actual state. Once the | ||
2159 | * number of outstanding frames reaches zero, the driver must | ||
2160 | * call this function again to unblock the station. That will | ||
2161 | * cause mac80211 to be able to send ps-poll responses, and if | ||
2162 | * the station queried in the meantime then frames will also | ||
2163 | * be sent out as a result of this. Additionally, the driver | ||
2164 | * will be notified that the station woke up some time after | ||
2165 | * it is unblocked, regardless of whether the station actually | ||
2166 | * woke up while blocked or not. | ||
2167 | */ | ||
2168 | void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | ||
2169 | struct ieee80211_sta *pubsta, bool block); | ||
2170 | |||
2171 | /** | ||
2140 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2172 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
2141 | * | 2173 | * |
2142 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2174 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |