提交 722f069a 编写于 作者: S Sujith 提交者: John W. Linville

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: NSujith <Sujith.Manoharan@atheros.com>
Acked-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 e23a9014
...@@ -197,6 +197,14 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, ...@@ -197,6 +197,14 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
status = WLAN_STATUS_REQUEST_DECLINED; status = WLAN_STATUS_REQUEST_DECLINED;
if (test_sta_flags(sta, WLAN_STA_SUSPEND)) {
#ifdef CONFIG_MAC80211_HT_DEBUG
printk(KERN_DEBUG "Suspend in progress. "
"Denying ADDBA request\n");
#endif
goto end_no_lock;
}
/* sanity check for incoming parameters: /* sanity check for incoming parameters:
* check if configuration can support the BA policy * check if configuration can support the BA policy
* and if buffer size does not exceeds max value */ * and if buffer size does not exceeds max value */
......
...@@ -257,6 +257,15 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid) ...@@ -257,6 +257,15 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
goto unlock; goto unlock;
} }
if (test_sta_flags(sta, WLAN_STA_SUSPEND)) {
#ifdef CONFIG_MAC80211_HT_DEBUG
printk(KERN_DEBUG "Suspend in progress. "
"Denying BA session request\n");
#endif
ret = -EINVAL;
goto unlock;
}
spin_lock_bh(&sta->lock); spin_lock_bh(&sta->lock);
sdata = sta->sdata; sdata = sta->sdata;
......
...@@ -21,6 +21,19 @@ int __ieee80211_suspend(struct ieee80211_hw *hw) ...@@ -21,6 +21,19 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
list_for_each_entry(sdata, &local->interfaces, list) list_for_each_entry(sdata, &local->interfaces, list)
ieee80211_disable_keys(sdata); ieee80211_disable_keys(sdata);
/* Tear down aggregation sessions */
rcu_read_lock();
if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) {
list_for_each_entry_rcu(sta, &local->sta_list, list) {
set_sta_flags(sta, WLAN_STA_SUSPEND);
ieee80211_sta_tear_down_BA_sessions(sta);
}
}
rcu_read_unlock();
/* remove STAs */ /* remove STAs */
if (local->ops->sta_notify) { if (local->ops->sta_notify) {
spin_lock_irqsave(&local->sta_lock, flags); spin_lock_irqsave(&local->sta_lock, flags);
...@@ -102,6 +115,18 @@ int __ieee80211_resume(struct ieee80211_hw *hw) ...@@ -102,6 +115,18 @@ int __ieee80211_resume(struct ieee80211_hw *hw)
spin_unlock_irqrestore(&local->sta_lock, flags); spin_unlock_irqrestore(&local->sta_lock, flags);
} }
/* Clear Suspend state so that ADDBA requests can be processed */
rcu_read_lock();
if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) {
list_for_each_entry_rcu(sta, &local->sta_list, list) {
clear_sta_flags(sta, WLAN_STA_SUSPEND);
}
}
rcu_read_unlock();
/* add back keys */ /* add back keys */
list_for_each_entry(sdata, &local->interfaces, list) list_for_each_entry(sdata, &local->interfaces, list)
if (netif_running(sdata->dev)) if (netif_running(sdata->dev))
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
* IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next * IEEE80211_TX_CTL_CLEAR_PS_FILT control flag) when the next
* frame to this station is transmitted. * frame to this station is transmitted.
* @WLAN_STA_MFP: Management frame protection is used with this STA. * @WLAN_STA_MFP: Management frame protection is used with this STA.
* @WLAN_STA_SUSPEND: Set/cleared during a suspend/resume cycle.
* Used to deny ADDBA requests (both TX and RX).
*/ */
enum ieee80211_sta_info_flags { enum ieee80211_sta_info_flags {
WLAN_STA_AUTH = 1<<0, WLAN_STA_AUTH = 1<<0,
...@@ -48,6 +50,7 @@ enum ieee80211_sta_info_flags { ...@@ -48,6 +50,7 @@ enum ieee80211_sta_info_flags {
WLAN_STA_PSPOLL = 1<<8, WLAN_STA_PSPOLL = 1<<8,
WLAN_STA_CLEAR_PS_FILT = 1<<9, WLAN_STA_CLEAR_PS_FILT = 1<<9,
WLAN_STA_MFP = 1<<10, WLAN_STA_MFP = 1<<10,
WLAN_STA_SUSPEND = 1<<11
}; };
#define STA_TID_NUM 16 #define STA_TID_NUM 16
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册