diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-07-18 07:31:31 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:41 -0500 |
commit | c82c4a80bbb9c8ffa1d783070a8caa37f2db45b6 (patch) | |
tree | efafa9bdbba034bf4012dc4d2c727d7bd903fd28 /net | |
parent | d582cffbcd04eae0bd8a83b05648bfd54bfd21c9 (diff) |
mac80211: split aggregation stop by reason
The initiator/tx doesn't really identify why an
aggregation session is stopped, give a reason
for stopping that more clearly identifies what's
going on. This will help tell the driver clearly
what is expected of it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/agg-tx.c | 17 | ||||
-rw-r--r-- | net/mac80211/ht.c | 15 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 9 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 2 | ||||
-rw-r--r-- | net/mac80211/pm.c | 3 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 2 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 7 | ||||
-rw-r--r-- | net/mac80211/util.c | 3 |
8 files changed, 33 insertions, 25 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index eb9df22418f0..e0656d77b313 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -150,8 +150,7 @@ void ieee80211_assign_tid_tx(struct sta_info *sta, int tid, | |||
150 | } | 150 | } |
151 | 151 | ||
152 | int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | 152 | int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, |
153 | enum ieee80211_back_parties initiator, | 153 | enum ieee80211_agg_stop_reason reason) |
154 | bool tx) | ||
155 | { | 154 | { |
156 | struct ieee80211_local *local = sta->local; | 155 | struct ieee80211_local *local = sta->local; |
157 | struct tid_ampdu_tx *tid_tx; | 156 | struct tid_ampdu_tx *tid_tx; |
@@ -212,8 +211,10 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
212 | */ | 211 | */ |
213 | synchronize_net(); | 212 | synchronize_net(); |
214 | 213 | ||
215 | tid_tx->stop_initiator = initiator; | 214 | tid_tx->stop_initiator = reason == AGG_STOP_PEER_REQUEST ? |
216 | tid_tx->tx_stop = tx; | 215 | WLAN_BACK_RECIPIENT : |
216 | WLAN_BACK_INITIATOR; | ||
217 | tid_tx->tx_stop = reason == AGG_STOP_LOCAL_REQUEST; | ||
217 | 218 | ||
218 | ret = drv_ampdu_action(local, sta->sdata, | 219 | ret = drv_ampdu_action(local, sta->sdata, |
219 | IEEE80211_AMPDU_TX_STOP, | 220 | IEEE80211_AMPDU_TX_STOP, |
@@ -660,14 +661,13 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, | |||
660 | EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe); | 661 | EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe); |
661 | 662 | ||
662 | int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | 663 | int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, |
663 | enum ieee80211_back_parties initiator, | 664 | enum ieee80211_agg_stop_reason reason) |
664 | bool tx) | ||
665 | { | 665 | { |
666 | int ret; | 666 | int ret; |
667 | 667 | ||
668 | mutex_lock(&sta->ampdu_mlme.mtx); | 668 | mutex_lock(&sta->ampdu_mlme.mtx); |
669 | 669 | ||
670 | ret = ___ieee80211_stop_tx_ba_session(sta, tid, initiator, tx); | 670 | ret = ___ieee80211_stop_tx_ba_session(sta, tid, reason); |
671 | 671 | ||
672 | mutex_unlock(&sta->ampdu_mlme.mtx); | 672 | mutex_unlock(&sta->ampdu_mlme.mtx); |
673 | 673 | ||
@@ -868,8 +868,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
868 | } | 868 | } |
869 | 869 | ||
870 | } else { | 870 | } else { |
871 | ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR, | 871 | ___ieee80211_stop_tx_ba_session(sta, tid, AGG_STOP_DECLINED); |
872 | false); | ||
873 | } | 872 | } |
874 | 873 | ||
875 | out: | 874 | out: |
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index 8a6d68f1f404..df46cd8e55f5 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c | |||
@@ -182,16 +182,19 @@ void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, | |||
182 | ieee80211_apply_htcap_overrides(sdata, ht_cap); | 182 | ieee80211_apply_htcap_overrides(sdata, ht_cap); |
183 | } | 183 | } |
184 | 184 | ||
185 | void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, bool tx) | 185 | void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, |
186 | enum ieee80211_agg_stop_reason reason) | ||
186 | { | 187 | { |
187 | int i; | 188 | int i; |
188 | 189 | ||
189 | cancel_work_sync(&sta->ampdu_mlme.work); | 190 | cancel_work_sync(&sta->ampdu_mlme.work); |
190 | 191 | ||
191 | for (i = 0; i < IEEE80211_NUM_TIDS; i++) { | 192 | for (i = 0; i < IEEE80211_NUM_TIDS; i++) { |
192 | __ieee80211_stop_tx_ba_session(sta, i, WLAN_BACK_INITIATOR, tx); | 193 | __ieee80211_stop_tx_ba_session(sta, i, reason); |
193 | __ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT, | 194 | __ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT, |
194 | WLAN_REASON_QSTA_LEAVE_QBSS, tx); | 195 | WLAN_REASON_QSTA_LEAVE_QBSS, |
196 | reason != AGG_STOP_DESTROY_STA && | ||
197 | reason != AGG_STOP_PEER_REQUEST); | ||
195 | } | 198 | } |
196 | } | 199 | } |
197 | 200 | ||
@@ -248,8 +251,7 @@ void ieee80211_ba_session_work(struct work_struct *work) | |||
248 | if (tid_tx && test_and_clear_bit(HT_AGG_STATE_WANT_STOP, | 251 | if (tid_tx && test_and_clear_bit(HT_AGG_STATE_WANT_STOP, |
249 | &tid_tx->state)) | 252 | &tid_tx->state)) |
250 | ___ieee80211_stop_tx_ba_session(sta, tid, | 253 | ___ieee80211_stop_tx_ba_session(sta, tid, |
251 | WLAN_BACK_INITIATOR, | 254 | AGG_STOP_LOCAL_REQUEST); |
252 | true); | ||
253 | } | 255 | } |
254 | mutex_unlock(&sta->ampdu_mlme.mtx); | 256 | mutex_unlock(&sta->ampdu_mlme.mtx); |
255 | } | 257 | } |
@@ -317,8 +319,7 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, | |||
317 | __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_INITIATOR, 0, | 319 | __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_INITIATOR, 0, |
318 | true); | 320 | true); |
319 | else | 321 | else |
320 | __ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_RECIPIENT, | 322 | __ieee80211_stop_tx_ba_session(sta, tid, AGG_STOP_PEER_REQUEST); |
321 | true); | ||
322 | } | 323 | } |
323 | 324 | ||
324 | int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, | 325 | int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 7182907e282a..0fa44a965ad9 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1432,7 +1432,8 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, | |||
1432 | u16 initiator, u16 reason, bool stop); | 1432 | u16 initiator, u16 reason, bool stop); |
1433 | void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, | 1433 | void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, |
1434 | u16 initiator, u16 reason, bool stop); | 1434 | u16 initiator, u16 reason, bool stop); |
1435 | void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, bool tx); | 1435 | void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, |
1436 | enum ieee80211_agg_stop_reason reason); | ||
1436 | void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, | 1437 | void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, |
1437 | struct sta_info *sta, | 1438 | struct sta_info *sta, |
1438 | struct ieee80211_mgmt *mgmt, size_t len); | 1439 | struct ieee80211_mgmt *mgmt, size_t len); |
@@ -1446,11 +1447,9 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, | |||
1446 | size_t len); | 1447 | size_t len); |
1447 | 1448 | ||
1448 | int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | 1449 | int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, |
1449 | enum ieee80211_back_parties initiator, | 1450 | enum ieee80211_agg_stop_reason reason); |
1450 | bool tx); | ||
1451 | int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | 1451 | int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, |
1452 | enum ieee80211_back_parties initiator, | 1452 | enum ieee80211_agg_stop_reason reason); |
1453 | bool tx); | ||
1454 | void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); | 1453 | void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); |
1455 | void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); | 1454 | void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); |
1456 | void ieee80211_ba_session_work(struct work_struct *work); | 1455 | void ieee80211_ba_session_work(struct work_struct *work); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6ffbf701de95..d90c07b1795f 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1525,7 +1525,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1525 | sta = sta_info_get(sdata, ifmgd->bssid); | 1525 | sta = sta_info_get(sdata, ifmgd->bssid); |
1526 | if (sta) { | 1526 | if (sta) { |
1527 | set_sta_flag(sta, WLAN_STA_BLOCK_BA); | 1527 | set_sta_flag(sta, WLAN_STA_BLOCK_BA); |
1528 | ieee80211_sta_tear_down_BA_sessions(sta, false); | 1528 | ieee80211_sta_tear_down_BA_sessions(sta, AGG_STOP_DESTROY_STA); |
1529 | } | 1529 | } |
1530 | mutex_unlock(&local->sta_mtx); | 1530 | mutex_unlock(&local->sta_mtx); |
1531 | 1531 | ||
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c index f81fd30581d9..e45b83610e85 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c | |||
@@ -42,7 +42,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) | |||
42 | mutex_lock(&local->sta_mtx); | 42 | mutex_lock(&local->sta_mtx); |
43 | list_for_each_entry(sta, &local->sta_list, list) { | 43 | list_for_each_entry(sta, &local->sta_list, list) { |
44 | set_sta_flag(sta, WLAN_STA_BLOCK_BA); | 44 | set_sta_flag(sta, WLAN_STA_BLOCK_BA); |
45 | ieee80211_sta_tear_down_BA_sessions(sta, true); | 45 | ieee80211_sta_tear_down_BA_sessions( |
46 | sta, AGG_STOP_LOCAL_REQUEST); | ||
46 | } | 47 | } |
47 | mutex_unlock(&local->sta_mtx); | 48 | mutex_unlock(&local->sta_mtx); |
48 | } | 49 | } |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 738f9349c0a2..9d864ed5f3da 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -784,7 +784,7 @@ int __must_check __sta_info_destroy(struct sta_info *sta) | |||
784 | * will be sufficient. | 784 | * will be sufficient. |
785 | */ | 785 | */ |
786 | set_sta_flag(sta, WLAN_STA_BLOCK_BA); | 786 | set_sta_flag(sta, WLAN_STA_BLOCK_BA); |
787 | ieee80211_sta_tear_down_BA_sessions(sta, false); | 787 | ieee80211_sta_tear_down_BA_sessions(sta, AGG_STOP_DESTROY_STA); |
788 | 788 | ||
789 | ret = sta_info_hash_del(local, sta); | 789 | ret = sta_info_hash_del(local, sta); |
790 | if (ret) | 790 | if (ret) |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 031e4a5bbeca..af7d78aa5523 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -92,6 +92,13 @@ enum ieee80211_sta_info_flags { | |||
92 | #define HT_AGG_STATE_WANT_START 4 | 92 | #define HT_AGG_STATE_WANT_START 4 |
93 | #define HT_AGG_STATE_WANT_STOP 5 | 93 | #define HT_AGG_STATE_WANT_STOP 5 |
94 | 94 | ||
95 | enum ieee80211_agg_stop_reason { | ||
96 | AGG_STOP_DECLINED, | ||
97 | AGG_STOP_LOCAL_REQUEST, | ||
98 | AGG_STOP_PEER_REQUEST, | ||
99 | AGG_STOP_DESTROY_STA, | ||
100 | }; | ||
101 | |||
95 | /** | 102 | /** |
96 | * struct tid_ampdu_tx - TID aggregation information (Tx). | 103 | * struct tid_ampdu_tx - TID aggregation information (Tx). |
97 | * | 104 | * |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index e27c89c27bf4..1b9420730d8c 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -1639,7 +1639,8 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
1639 | mutex_lock(&local->sta_mtx); | 1639 | mutex_lock(&local->sta_mtx); |
1640 | 1640 | ||
1641 | list_for_each_entry(sta, &local->sta_list, list) { | 1641 | list_for_each_entry(sta, &local->sta_list, list) { |
1642 | ieee80211_sta_tear_down_BA_sessions(sta, true); | 1642 | ieee80211_sta_tear_down_BA_sessions( |
1643 | sta, AGG_STOP_LOCAL_REQUEST); | ||
1643 | clear_sta_flag(sta, WLAN_STA_BLOCK_BA); | 1644 | clear_sta_flag(sta, WLAN_STA_BLOCK_BA); |
1644 | } | 1645 | } |
1645 | 1646 | ||