Commit 463559b7 authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: remove ampdu_mlme.mtx

We now hold the wiphy mutex everywhere that we use or
needed the A-MPDU locking, so we don't need this mutex
any more. Remove it.

Most of this change was done automatically with spatch.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 5435af6e
...@@ -55,8 +55,8 @@ static void ieee80211_free_tid_rx(struct rcu_head *h) ...@@ -55,8 +55,8 @@ static void ieee80211_free_tid_rx(struct rcu_head *h)
kfree(tid_rx); kfree(tid_rx);
} }
void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
u16 initiator, u16 reason, bool tx) u16 initiator, u16 reason, bool tx)
{ {
struct ieee80211_local *local = sta->local; struct ieee80211_local *local = sta->local;
struct tid_ampdu_rx *tid_rx; struct tid_ampdu_rx *tid_rx;
...@@ -69,10 +69,10 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, ...@@ -69,10 +69,10 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
.ssn = 0, .ssn = 0,
}; };
lockdep_assert_held(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
tid_rx = rcu_dereference_protected(sta->ampdu_mlme.tid_rx[tid], tid_rx = rcu_dereference_protected(sta->ampdu_mlme.tid_rx[tid],
lockdep_is_held(&sta->ampdu_mlme.mtx)); lockdep_is_held(&sta->local->hw.wiphy->mtx));
if (!test_bit(tid, sta->ampdu_mlme.agg_session_valid)) if (!test_bit(tid, sta->ampdu_mlme.agg_session_valid))
return; return;
...@@ -114,14 +114,6 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, ...@@ -114,14 +114,6 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx); call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx);
} }
void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
u16 initiator, u16 reason, bool tx)
{
mutex_lock(&sta->ampdu_mlme.mtx);
___ieee80211_stop_rx_ba_session(sta, tid, initiator, reason, tx);
mutex_unlock(&sta->ampdu_mlme.mtx);
}
void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap, void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
const u8 *addr) const u8 *addr)
{ {
...@@ -250,11 +242,11 @@ static void ieee80211_send_addba_resp(struct sta_info *sta, u8 *da, u16 tid, ...@@ -250,11 +242,11 @@ static void ieee80211_send_addba_resp(struct sta_info *sta, u8 *da, u16 tid,
ieee80211_tx_skb(sdata, skb); ieee80211_tx_skb(sdata, skb);
} }
void ___ieee80211_start_rx_ba_session(struct sta_info *sta, void __ieee80211_start_rx_ba_session(struct sta_info *sta,
u8 dialog_token, u16 timeout, u8 dialog_token, u16 timeout,
u16 start_seq_num, u16 ba_policy, u16 tid, u16 start_seq_num, u16 ba_policy, u16 tid,
u16 buf_size, bool tx, bool auto_seq, u16 buf_size, bool tx, bool auto_seq,
const struct ieee80211_addba_ext_ie *addbaext) const struct ieee80211_addba_ext_ie *addbaext)
{ {
struct ieee80211_local *local = sta->sdata->local; struct ieee80211_local *local = sta->sdata->local;
struct tid_ampdu_rx *tid_agg_rx; struct tid_ampdu_rx *tid_agg_rx;
...@@ -270,6 +262,8 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta, ...@@ -270,6 +262,8 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
u16 status = WLAN_STATUS_REQUEST_DECLINED; u16 status = WLAN_STATUS_REQUEST_DECLINED;
u16 max_buf_size; u16 max_buf_size;
lockdep_assert_wiphy(sta->local->hw.wiphy);
if (tid >= IEEE80211_FIRST_TSPEC_TSID) { if (tid >= IEEE80211_FIRST_TSPEC_TSID) {
ht_dbg(sta->sdata, ht_dbg(sta->sdata,
"STA %pM requests BA session on unsupported tid %d\n", "STA %pM requests BA session on unsupported tid %d\n",
...@@ -325,9 +319,6 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta, ...@@ -325,9 +319,6 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
ht_dbg(sta->sdata, "AddBA Req buf_size=%d for %pM\n", ht_dbg(sta->sdata, "AddBA Req buf_size=%d for %pM\n",
buf_size, sta->sta.addr); buf_size, sta->sta.addr);
/* examine state machine */
lockdep_assert_held(&sta->ampdu_mlme.mtx);
if (test_bit(tid, sta->ampdu_mlme.agg_session_valid)) { if (test_bit(tid, sta->ampdu_mlme.agg_session_valid)) {
if (sta->ampdu_mlme.tid_rx_token[tid] == dialog_token) { if (sta->ampdu_mlme.tid_rx_token[tid] == dialog_token) {
struct tid_ampdu_rx *tid_rx; struct tid_ampdu_rx *tid_rx;
...@@ -355,9 +346,9 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta, ...@@ -355,9 +346,9 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
sta->sta.addr, tid); sta->sta.addr, tid);
/* delete existing Rx BA session on the same tid */ /* delete existing Rx BA session on the same tid */
___ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_RECIPIENT, __ieee80211_stop_rx_ba_session(sta, tid, WLAN_BACK_RECIPIENT,
WLAN_STATUS_UNSPECIFIED_QOS, WLAN_STATUS_UNSPECIFIED_QOS,
false); false);
} }
if (ieee80211_hw_check(&local->hw, SUPPORTS_REORDERING_BUFFER)) { if (ieee80211_hw_check(&local->hw, SUPPORTS_REORDERING_BUFFER)) {
...@@ -444,20 +435,6 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta, ...@@ -444,20 +435,6 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
timeout, addbaext); timeout, addbaext);
} }
static void __ieee80211_start_rx_ba_session(struct sta_info *sta,
u8 dialog_token, u16 timeout,
u16 start_seq_num, u16 ba_policy,
u16 tid, u16 buf_size, bool tx,
bool auto_seq,
const struct ieee80211_addba_ext_ie *addbaext)
{
mutex_lock(&sta->ampdu_mlme.mtx);
___ieee80211_start_rx_ba_session(sta, dialog_token, timeout,
start_seq_num, ba_policy, tid,
buf_size, tx, auto_seq, addbaext);
mutex_unlock(&sta->ampdu_mlme.mtx);
}
void ieee80211_process_addba_request(struct ieee80211_local *local, void ieee80211_process_addba_request(struct ieee80211_local *local,
struct sta_info *sta, struct sta_info *sta,
struct ieee80211_mgmt *mgmt, struct ieee80211_mgmt *mgmt,
......
...@@ -142,7 +142,7 @@ EXPORT_SYMBOL(ieee80211_send_bar); ...@@ -142,7 +142,7 @@ EXPORT_SYMBOL(ieee80211_send_bar);
void ieee80211_assign_tid_tx(struct sta_info *sta, int tid, void ieee80211_assign_tid_tx(struct sta_info *sta, int tid,
struct tid_ampdu_tx *tid_tx) struct tid_ampdu_tx *tid_tx)
{ {
lockdep_assert_held(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
lockdep_assert_held(&sta->lock); lockdep_assert_held(&sta->lock);
rcu_assign_pointer(sta->ampdu_mlme.tid_tx[tid], tid_tx); rcu_assign_pointer(sta->ampdu_mlme.tid_tx[tid], tid_tx);
} }
...@@ -213,7 +213,7 @@ ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable) ...@@ -213,7 +213,7 @@ ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable)
struct ieee80211_txq *txq = sta->sta.txq[tid]; struct ieee80211_txq *txq = sta->sta.txq[tid];
struct txq_info *txqi; struct txq_info *txqi;
lockdep_assert_held(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
if (!txq) if (!txq)
return; return;
...@@ -271,7 +271,7 @@ static void ieee80211_remove_tid_tx(struct sta_info *sta, int tid) ...@@ -271,7 +271,7 @@ static void ieee80211_remove_tid_tx(struct sta_info *sta, int tid)
{ {
struct tid_ampdu_tx *tid_tx; struct tid_ampdu_tx *tid_tx;
lockdep_assert_held(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
lockdep_assert_held(&sta->lock); lockdep_assert_held(&sta->lock);
tid_tx = rcu_dereference_protected_tid_tx(sta, tid); tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
...@@ -296,8 +296,8 @@ static void ieee80211_remove_tid_tx(struct sta_info *sta, int tid) ...@@ -296,8 +296,8 @@ static void ieee80211_remove_tid_tx(struct sta_info *sta, int tid)
kfree_rcu(tid_tx, rcu_head); kfree_rcu(tid_tx, rcu_head);
} }
int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
enum ieee80211_agg_stop_reason reason) enum ieee80211_agg_stop_reason reason)
{ {
struct ieee80211_local *local = sta->local; struct ieee80211_local *local = sta->local;
struct tid_ampdu_tx *tid_tx; struct tid_ampdu_tx *tid_tx;
...@@ -311,7 +311,7 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, ...@@ -311,7 +311,7 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
}; };
int ret; int ret;
lockdep_assert_held(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
switch (reason) { switch (reason) {
case AGG_STOP_DECLINED: case AGG_STOP_DECLINED:
...@@ -461,7 +461,7 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta, ...@@ -461,7 +461,7 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta,
test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state))) test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state)))
return; return;
lockdep_assert_held(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
/* activate the timer for the recipient's addBA response */ /* activate the timer for the recipient's addBA response */
mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL);
...@@ -764,7 +764,7 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local, ...@@ -764,7 +764,7 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
.ssn = 0, .ssn = 0,
}; };
lockdep_assert_held(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
tid_tx = rcu_dereference_protected_tid_tx(sta, tid); tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
params.buf_size = tid_tx->buf_size; params.buf_size = tid_tx->buf_size;
...@@ -801,7 +801,7 @@ void ieee80211_start_tx_ba_cb(struct sta_info *sta, int tid, ...@@ -801,7 +801,7 @@ void ieee80211_start_tx_ba_cb(struct sta_info *sta, int tid,
struct ieee80211_sub_if_data *sdata = sta->sdata; struct ieee80211_sub_if_data *sdata = sta->sdata;
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
lockdep_assert_held(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
if (WARN_ON(test_and_set_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state))) if (WARN_ON(test_and_set_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state)))
return; return;
...@@ -868,20 +868,6 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, ...@@ -868,20 +868,6 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
} }
EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe); EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe);
int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
enum ieee80211_agg_stop_reason reason)
{
int ret;
mutex_lock(&sta->ampdu_mlme.mtx);
ret = ___ieee80211_stop_tx_ba_session(sta, tid, reason);
mutex_unlock(&sta->ampdu_mlme.mtx);
return ret;
}
int ieee80211_stop_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid) int ieee80211_stop_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid)
{ {
struct sta_info *sta = container_of(pubsta, struct sta_info, sta); struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
...@@ -993,6 +979,8 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, ...@@ -993,6 +979,8 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
u16 capab, tid, buf_size; u16 capab, tid, buf_size;
bool amsdu; bool amsdu;
lockdep_assert_wiphy(sta->local->hw.wiphy);
capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab); capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab);
amsdu = capab & IEEE80211_ADDBA_PARAM_AMSDU_MASK; amsdu = capab & IEEE80211_ADDBA_PARAM_AMSDU_MASK;
tid = u16_get_bits(capab, IEEE80211_ADDBA_PARAM_TID_MASK); tid = u16_get_bits(capab, IEEE80211_ADDBA_PARAM_TID_MASK);
...@@ -1003,16 +991,14 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, ...@@ -1003,16 +991,14 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
if (!amsdu && txq) if (!amsdu && txq)
set_bit(IEEE80211_TXQ_NO_AMSDU, &to_txq_info(txq)->flags); set_bit(IEEE80211_TXQ_NO_AMSDU, &to_txq_info(txq)->flags);
mutex_lock(&sta->ampdu_mlme.mtx);
tid_tx = rcu_dereference_protected_tid_tx(sta, tid); tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
if (!tid_tx) if (!tid_tx)
goto out; return;
if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) { if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) {
ht_dbg(sta->sdata, "wrong addBA response token, %pM tid %d\n", ht_dbg(sta->sdata, "wrong addBA response token, %pM tid %d\n",
sta->sta.addr, tid); sta->sta.addr, tid);
goto out; return;
} }
del_timer_sync(&tid_tx->addba_resp_timer); del_timer_sync(&tid_tx->addba_resp_timer);
...@@ -1030,7 +1016,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, ...@@ -1030,7 +1016,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
ht_dbg(sta->sdata, ht_dbg(sta->sdata,
"got addBA resp for %pM tid %d but we already gave up\n", "got addBA resp for %pM tid %d but we already gave up\n",
sta->sta.addr, tid); sta->sta.addr, tid);
goto out; return;
} }
/* /*
...@@ -1044,7 +1030,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, ...@@ -1044,7 +1030,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
if (test_and_set_bit(HT_AGG_STATE_RESPONSE_RECEIVED, if (test_and_set_bit(HT_AGG_STATE_RESPONSE_RECEIVED,
&tid_tx->state)) { &tid_tx->state)) {
/* ignore duplicate response */ /* ignore duplicate response */
goto out; return;
} }
tid_tx->buf_size = buf_size; tid_tx->buf_size = buf_size;
...@@ -1065,9 +1051,6 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, ...@@ -1065,9 +1051,6 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
} }
} else { } else {
___ieee80211_stop_tx_ba_session(sta, tid, AGG_STOP_DECLINED); __ieee80211_stop_tx_ba_session(sta, tid, AGG_STOP_DECLINED);
} }
out:
mutex_unlock(&sta->ampdu_mlme.mtx);
} }
...@@ -316,16 +316,16 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, ...@@ -316,16 +316,16 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
{ {
int i; int i;
mutex_lock(&sta->ampdu_mlme.mtx); lockdep_assert_wiphy(sta->local->hw.wiphy);
for (i = 0; i < IEEE80211_NUM_TIDS; i++) for (i = 0; i < IEEE80211_NUM_TIDS; i++)
___ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT, __ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT,
WLAN_REASON_QSTA_LEAVE_QBSS, WLAN_REASON_QSTA_LEAVE_QBSS,
reason != AGG_STOP_DESTROY_STA && reason != AGG_STOP_DESTROY_STA &&
reason != AGG_STOP_PEER_REQUEST); reason != AGG_STOP_PEER_REQUEST);
for (i = 0; i < IEEE80211_NUM_TIDS; i++) for (i = 0; i < IEEE80211_NUM_TIDS; i++)
___ieee80211_stop_tx_ba_session(sta, i, reason); __ieee80211_stop_tx_ba_session(sta, i, reason);
mutex_unlock(&sta->ampdu_mlme.mtx);
/* /*
* In case the tear down is part of a reconfigure due to HW restart * In case the tear down is part of a reconfigure due to HW restart
...@@ -335,7 +335,6 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, ...@@ -335,7 +335,6 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
if(reason == AGG_STOP_DESTROY_STA) { if(reason == AGG_STOP_DESTROY_STA) {
wiphy_work_cancel(sta->local->hw.wiphy, &sta->ampdu_mlme.work); wiphy_work_cancel(sta->local->hw.wiphy, &sta->ampdu_mlme.work);
mutex_lock(&sta->ampdu_mlme.mtx);
for (i = 0; i < IEEE80211_NUM_TIDS; i++) { for (i = 0; i < IEEE80211_NUM_TIDS; i++) {
struct tid_ampdu_tx *tid_tx = struct tid_ampdu_tx *tid_tx =
rcu_dereference_protected_tid_tx(sta, i); rcu_dereference_protected_tid_tx(sta, i);
...@@ -346,7 +345,6 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, ...@@ -346,7 +345,6 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
if (test_and_clear_bit(HT_AGG_STATE_STOP_CB, &tid_tx->state)) if (test_and_clear_bit(HT_AGG_STATE_STOP_CB, &tid_tx->state))
ieee80211_stop_tx_ba_cb(sta, i, tid_tx); ieee80211_stop_tx_ba_cb(sta, i, tid_tx);
} }
mutex_unlock(&sta->ampdu_mlme.mtx);
} }
} }
...@@ -358,32 +356,33 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work) ...@@ -358,32 +356,33 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work)
bool blocked; bool blocked;
int tid; int tid;
lockdep_assert_wiphy(sta->local->hw.wiphy);
/* When this flag is set, new sessions should be blocked. */ /* When this flag is set, new sessions should be blocked. */
blocked = test_sta_flag(sta, WLAN_STA_BLOCK_BA); blocked = test_sta_flag(sta, WLAN_STA_BLOCK_BA);
mutex_lock(&sta->ampdu_mlme.mtx);
for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) { for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) {
if (test_and_clear_bit(tid, sta->ampdu_mlme.tid_rx_timer_expired)) if (test_and_clear_bit(tid, sta->ampdu_mlme.tid_rx_timer_expired))
___ieee80211_stop_rx_ba_session( __ieee80211_stop_rx_ba_session(
sta, tid, WLAN_BACK_RECIPIENT, sta, tid, WLAN_BACK_RECIPIENT,
WLAN_REASON_QSTA_TIMEOUT, true); WLAN_REASON_QSTA_TIMEOUT, true);
if (test_and_clear_bit(tid, if (test_and_clear_bit(tid,
sta->ampdu_mlme.tid_rx_stop_requested)) sta->ampdu_mlme.tid_rx_stop_requested))
___ieee80211_stop_rx_ba_session( __ieee80211_stop_rx_ba_session(
sta, tid, WLAN_BACK_RECIPIENT, sta, tid, WLAN_BACK_RECIPIENT,
WLAN_REASON_UNSPECIFIED, true); WLAN_REASON_UNSPECIFIED, true);
if (!blocked && if (!blocked &&
test_and_clear_bit(tid, test_and_clear_bit(tid,
sta->ampdu_mlme.tid_rx_manage_offl)) sta->ampdu_mlme.tid_rx_manage_offl))
___ieee80211_start_rx_ba_session(sta, 0, 0, 0, 1, tid, __ieee80211_start_rx_ba_session(sta, 0, 0, 0, 1, tid,
IEEE80211_MAX_AMPDU_BUF_HT, IEEE80211_MAX_AMPDU_BUF_HT,
false, true, NULL); false, true, NULL);
if (test_and_clear_bit(tid + IEEE80211_NUM_TIDS, if (test_and_clear_bit(tid + IEEE80211_NUM_TIDS,
sta->ampdu_mlme.tid_rx_manage_offl)) sta->ampdu_mlme.tid_rx_manage_offl))
___ieee80211_stop_rx_ba_session( __ieee80211_stop_rx_ba_session(
sta, tid, WLAN_BACK_RECIPIENT, sta, tid, WLAN_BACK_RECIPIENT,
0, false); 0, false);
...@@ -414,8 +413,6 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work) ...@@ -414,8 +413,6 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work)
*/ */
synchronize_net(); synchronize_net();
mutex_unlock(&sta->ampdu_mlme.mtx);
wiphy_work_queue(sdata->local->hw.wiphy, work); wiphy_work_queue(sdata->local->hw.wiphy, work);
return; return;
} }
...@@ -448,12 +445,11 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work) ...@@ -448,12 +445,11 @@ void ieee80211_ba_session_work(struct wiphy *wiphy, struct wiphy_work *work)
test_and_clear_bit(HT_AGG_STATE_START_CB, &tid_tx->state)) test_and_clear_bit(HT_AGG_STATE_START_CB, &tid_tx->state))
ieee80211_start_tx_ba_cb(sta, tid, tid_tx); ieee80211_start_tx_ba_cb(sta, tid, tid_tx);
if (test_and_clear_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state)) if (test_and_clear_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state))
___ieee80211_stop_tx_ba_session(sta, tid, __ieee80211_stop_tx_ba_session(sta, tid,
AGG_STOP_LOCAL_REQUEST); AGG_STOP_LOCAL_REQUEST);
if (test_and_clear_bit(HT_AGG_STATE_STOP_CB, &tid_tx->state)) if (test_and_clear_bit(HT_AGG_STATE_STOP_CB, &tid_tx->state))
ieee80211_stop_tx_ba_cb(sta, tid, tid_tx); ieee80211_stop_tx_ba_cb(sta, tid, tid_tx);
} }
mutex_unlock(&sta->ampdu_mlme.mtx);
} }
void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
......
...@@ -2097,15 +2097,13 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, ...@@ -2097,15 +2097,13 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old, bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old,
enum ieee80211_smps_mode smps_mode_new); enum ieee80211_smps_mode smps_mode_new);
void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
u16 initiator, u16 reason, bool stop);
void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
u16 initiator, u16 reason, bool stop); u16 initiator, u16 reason, bool stop);
void ___ieee80211_start_rx_ba_session(struct sta_info *sta, void __ieee80211_start_rx_ba_session(struct sta_info *sta,
u8 dialog_token, u16 timeout, u8 dialog_token, u16 timeout,
u16 start_seq_num, u16 ba_policy, u16 tid, u16 start_seq_num, u16 ba_policy, u16 tid,
u16 buf_size, bool tx, bool auto_seq, u16 buf_size, bool tx, bool auto_seq,
const struct ieee80211_addba_ext_ie *addbaext); const struct ieee80211_addba_ext_ie *addbaext);
void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
enum ieee80211_agg_stop_reason reason); enum ieee80211_agg_stop_reason reason);
void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
...@@ -2122,8 +2120,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, ...@@ -2122,8 +2120,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
enum ieee80211_agg_stop_reason reason); enum ieee80211_agg_stop_reason reason);
int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
enum ieee80211_agg_stop_reason reason);
void ieee80211_start_tx_ba_cb(struct sta_info *sta, int tid, void ieee80211_start_tx_ba_cb(struct sta_info *sta, int tid,
struct tid_ampdu_tx *tid_tx); struct tid_ampdu_tx *tid_tx);
void ieee80211_stop_tx_ba_cb(struct sta_info *sta, int tid, void ieee80211_stop_tx_ba_cb(struct sta_info *sta, int tid,
......
...@@ -311,11 +311,9 @@ static void ieee80211_pairwise_rekey(struct ieee80211_key *old, ...@@ -311,11 +311,9 @@ static void ieee80211_pairwise_rekey(struct ieee80211_key *old,
* job done for the few ms we need it.) * job done for the few ms we need it.)
*/ */
set_sta_flag(sta, WLAN_STA_BLOCK_BA); set_sta_flag(sta, WLAN_STA_BLOCK_BA);
mutex_lock(&sta->ampdu_mlme.mtx);
for (i = 0; i < IEEE80211_NUM_TIDS; i++) for (i = 0; i < IEEE80211_NUM_TIDS; i++)
___ieee80211_stop_tx_ba_session(sta, i, __ieee80211_stop_tx_ba_session(sta, i,
AGG_STOP_LOCAL_REQUEST); AGG_STOP_LOCAL_REQUEST);
mutex_unlock(&sta->ampdu_mlme.mtx);
} }
} else if (old) { } else if (old) {
/* Rekey without Extended Key ID. /* Rekey without Extended Key ID.
......
...@@ -554,7 +554,6 @@ __sta_info_alloc(struct ieee80211_sub_if_data *sdata, ...@@ -554,7 +554,6 @@ __sta_info_alloc(struct ieee80211_sub_if_data *sdata,
spin_lock_init(&sta->ps_lock); spin_lock_init(&sta->ps_lock);
INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames); INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
wiphy_work_init(&sta->ampdu_mlme.work, ieee80211_ba_session_work); wiphy_work_init(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
mutex_init(&sta->ampdu_mlme.mtx);
#ifdef CONFIG_MAC80211_MESH #ifdef CONFIG_MAC80211_MESH
if (ieee80211_vif_is_mesh(&sdata->vif)) { if (ieee80211_vif_is_mesh(&sdata->vif)) {
sta->mesh = kzalloc(sizeof(*sta->mesh), gfp); sta->mesh = kzalloc(sizeof(*sta->mesh), gfp);
......
...@@ -259,9 +259,6 @@ struct tid_ampdu_rx { ...@@ -259,9 +259,6 @@ struct tid_ampdu_rx {
/** /**
* struct sta_ampdu_mlme - STA aggregation information. * struct sta_ampdu_mlme - STA aggregation information.
* *
* @mtx: mutex to protect all TX data (except non-NULL assignments
* to tid_tx[idx], which are protected by the sta spinlock)
* tid_start_tx is also protected by sta->lock.
* @tid_rx: aggregation info for Rx per TID -- RCU protected * @tid_rx: aggregation info for Rx per TID -- RCU protected
* @tid_rx_token: dialog tokens for valid aggregation sessions * @tid_rx_token: dialog tokens for valid aggregation sessions
* @tid_rx_timer_expired: bitmap indicating on which TIDs the * @tid_rx_timer_expired: bitmap indicating on which TIDs the
...@@ -275,13 +272,13 @@ struct tid_ampdu_rx { ...@@ -275,13 +272,13 @@ struct tid_ampdu_rx {
* unexpected aggregation related frames outside a session * unexpected aggregation related frames outside a session
* @work: work struct for starting/stopping aggregation * @work: work struct for starting/stopping aggregation
* @tid_tx: aggregation info for Tx per TID * @tid_tx: aggregation info for Tx per TID
* @tid_start_tx: sessions where start was requested * @tid_start_tx: sessions where start was requested, not just protected
* by wiphy mutex but also sta->lock
* @last_addba_req_time: timestamp of the last addBA request. * @last_addba_req_time: timestamp of the last addBA request.
* @addba_req_num: number of times addBA request has been sent. * @addba_req_num: number of times addBA request has been sent.
* @dialog_token_allocator: dialog token enumerator for each new session; * @dialog_token_allocator: dialog token enumerator for each new session;
*/ */
struct sta_ampdu_mlme { struct sta_ampdu_mlme {
struct mutex mtx;
/* rx */ /* rx */
struct tid_ampdu_rx __rcu *tid_rx[IEEE80211_NUM_TIDS]; struct tid_ampdu_rx __rcu *tid_rx[IEEE80211_NUM_TIDS];
u8 tid_rx_token[IEEE80211_NUM_TIDS]; u8 tid_rx_token[IEEE80211_NUM_TIDS];
...@@ -796,13 +793,10 @@ static inline void sta_info_pre_move_state(struct sta_info *sta, ...@@ -796,13 +793,10 @@ static inline void sta_info_pre_move_state(struct sta_info *sta,
void ieee80211_assign_tid_tx(struct sta_info *sta, int tid, void ieee80211_assign_tid_tx(struct sta_info *sta, int tid,
struct tid_ampdu_tx *tid_tx); struct tid_ampdu_tx *tid_tx);
static inline struct tid_ampdu_tx * #define rcu_dereference_protected_tid_tx(sta, tid) \
rcu_dereference_protected_tid_tx(struct sta_info *sta, int tid) rcu_dereference_protected((sta)->ampdu_mlme.tid_tx[tid], \
{ lockdep_is_held(&(sta)->lock) || \
return rcu_dereference_protected(sta->ampdu_mlme.tid_tx[tid], lockdep_is_held(&(sta)->local->hw.wiphy->mtx));
lockdep_is_held(&sta->lock) ||
lockdep_is_held(&sta->ampdu_mlme.mtx));
}
/* Maximum number of frames to buffer per power saving station per AC */ /* Maximum number of frames to buffer per power saving station per AC */
#define STA_MAX_TX_BUFFER 64 #define STA_MAX_TX_BUFFER 64
......
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