diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2009-03-16 23:20:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-27 20:12:55 -0400 |
commit | 722f069a6dc95d7c6c2cdfbe3413899a3b768f9c (patch) | |
tree | 3f9ccbd9e2fdf75bd27675c48b238adc911ae626 /net/mac80211 | |
parent | e23a9014fd4d502a419255a83e2479ab804c6f16 (diff) |
mac80211: Tear down aggregation sessions for suspend/resume
When the driver has been notified with a STA_REMOVE, it tears down
the internal ADDBA state. On resume, trying to initiate aggregation would
fail because mac80211 has not cleared the operational state for that <TID,STA>.
This can be fixed by tearing down the existing sessions on a suspend.
Also, the driver can initiate a new BA session when suspend is in progress.
This is fixed by marking the station as being in suspend state and
denying ADDBA requests for such STAs.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/agg-rx.c | 8 | ||||
-rw-r--r-- | net/mac80211/agg-tx.c | 9 | ||||
-rw-r--r-- | net/mac80211/pm.c | 25 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 3 |
4 files changed, 45 insertions, 0 deletions
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index a95affc94629..07656d830bc4 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c | |||
@@ -197,6 +197,14 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, | |||
197 | 197 | ||
198 | status = WLAN_STATUS_REQUEST_DECLINED; | 198 | status = WLAN_STATUS_REQUEST_DECLINED; |
199 | 199 | ||
200 | if (test_sta_flags(sta, WLAN_STA_SUSPEND)) { | ||
201 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
202 | printk(KERN_DEBUG "Suspend in progress. " | ||
203 | "Denying ADDBA request\n"); | ||
204 | #endif | ||
205 | goto end_no_lock; | ||
206 | } | ||
207 | |||
200 | /* sanity check for incoming parameters: | 208 | /* sanity check for incoming parameters: |
201 | * check if configuration can support the BA policy | 209 | * check if configuration can support the BA policy |
202 | * and if buffer size does not exceeds max value */ | 210 | * and if buffer size does not exceeds max value */ |
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 1df116d4d6e7..e5776ef1717a 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -257,6 +257,15 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
257 | goto unlock; | 257 | goto unlock; |
258 | } | 258 | } |
259 | 259 | ||
260 | if (test_sta_flags(sta, WLAN_STA_SUSPEND)) { | ||
261 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
262 | printk(KERN_DEBUG "Suspend in progress. " | ||
263 | "Denying BA session request\n"); | ||
264 | #endif | ||
265 | ret = -EINVAL; | ||
266 | goto unlock; | ||
267 | } | ||
268 | |||
260 | spin_lock_bh(&sta->lock); | 269 | spin_lock_bh(&sta->lock); |
261 | 270 | ||
262 | sdata = sta->sdata; | 271 | sdata = sta->sdata; |
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c index ef7be1ce2c87..1e6152ac6778 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c | |||
@@ -21,6 +21,19 @@ int __ieee80211_suspend(struct ieee80211_hw *hw) | |||
21 | list_for_each_entry(sdata, &local->interfaces, list) | 21 | list_for_each_entry(sdata, &local->interfaces, list) |
22 | ieee80211_disable_keys(sdata); | 22 | ieee80211_disable_keys(sdata); |
23 | 23 | ||
24 | /* Tear down aggregation sessions */ | ||
25 | |||
26 | rcu_read_lock(); | ||
27 | |||
28 | if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) { | ||
29 | list_for_each_entry_rcu(sta, &local->sta_list, list) { | ||
30 | set_sta_flags(sta, WLAN_STA_SUSPEND); | ||
31 | ieee80211_sta_tear_down_BA_sessions(sta); | ||
32 | } | ||
33 | } | ||
34 | |||
35 | rcu_read_unlock(); | ||
36 | |||
24 | /* remove STAs */ | 37 | /* remove STAs */ |
25 | if (local->ops->sta_notify) { | 38 | if (local->ops->sta_notify) { |
26 | spin_lock_irqsave(&local->sta_lock, flags); | 39 | spin_lock_irqsave(&local->sta_lock, flags); |
@@ -102,6 +115,18 @@ int __ieee80211_resume(struct ieee80211_hw *hw) | |||
102 | spin_unlock_irqrestore(&local->sta_lock, flags); | 115 | spin_unlock_irqrestore(&local->sta_lock, flags); |
103 | } | 116 | } |
104 | 117 | ||
118 | /* Clear Suspend state so that ADDBA requests can be processed */ | ||
119 | |||
120 | rcu_read_lock(); | ||
121 | |||
122 | if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) { | ||
123 | list_for_each_entry_rcu(sta, &local->sta_list, list) { | ||
124 | clear_sta_flags(sta, WLAN_STA_SUSPEND); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | rcu_read_unlock(); | ||
129 | |||
105 | /* add back keys */ | 130 | /* add back keys */ |
106 | list_for_each_entry(sdata, &local->interfaces, list) | 131 | list_for_each_entry(sdata, &local->interfaces, list) |
107 | if (netif_running(sdata->dev)) | 132 | if (netif_running(sdata->dev)) |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 1f45573c580c..5b223b216e5a 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -35,6 +35,8 @@ | |||
35 | * IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next | 35 | * IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next |
36 | * frame to this station is transmitted. | 36 | * frame to this station is transmitted. |
37 | * @WLAN_STA_MFP: Management frame protection is used with this STA. | 37 | * @WLAN_STA_MFP: Management frame protection is used with this STA. |
38 | * @WLAN_STA_SUSPEND: Set/cleared during a suspend/resume cycle. | ||
39 | * Used to deny ADDBA requests (both TX and RX). | ||
38 | */ | 40 | */ |
39 | enum ieee80211_sta_info_flags { | 41 | enum ieee80211_sta_info_flags { |
40 | WLAN_STA_AUTH = 1<<0, | 42 | WLAN_STA_AUTH = 1<<0, |
@@ -48,6 +50,7 @@ enum ieee80211_sta_info_flags { | |||
48 | WLAN_STA_PSPOLL = 1<<8, | 50 | WLAN_STA_PSPOLL = 1<<8, |
49 | WLAN_STA_CLEAR_PS_FILT = 1<<9, | 51 | WLAN_STA_CLEAR_PS_FILT = 1<<9, |
50 | WLAN_STA_MFP = 1<<10, | 52 | WLAN_STA_MFP = 1<<10, |
53 | WLAN_STA_SUSPEND = 1<<11 | ||
51 | }; | 54 | }; |
52 | 55 | ||
53 | #define STA_TID_NUM 16 | 56 | #define STA_TID_NUM 16 |