From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 18/27] mac80211: further cleanups to stopping BA sessions
Date: Tue, 10 Feb 2009 21:25:54 +0100 [thread overview]
Message-ID: <20090210202555.979247282@sipsolutions.net> (raw)
In-Reply-To: 20090210202536.425266119@sipsolutions.net
Essentially consisting of passing the sta_info pointer around,
instead of repeatedly doing hash lookups.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/agg-rx.c | 6 ++--
net/mac80211/agg-tx.c | 63 +++++++++++++++++++++++----------------------
net/mac80211/ht.c | 9 ++----
net/mac80211/ieee80211_i.h | 5 +++
4 files changed, 44 insertions(+), 39 deletions(-)
--- wireless-testing.orig/net/mac80211/agg-rx.c 2009-02-10 20:59:35.000000000 +0100
+++ wireless-testing/net/mac80211/agg-rx.c 2009-02-10 20:59:35.000000000 +0100
@@ -17,8 +17,8 @@
#include <net/mac80211.h>
#include "ieee80211_i.h"
-static void __ieee80211_sta_stop_rx_ba_session(struct sta_info *sta, u16 tid,
- u16 initiator, u16 reason)
+void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
+ u16 initiator, u16 reason)
{
struct ieee80211_local *local = sta->local;
struct ieee80211_hw *hw = &local->hw;
@@ -96,7 +96,7 @@ void ieee80211_sta_stop_rx_ba_session(st
return;
}
- __ieee80211_sta_stop_rx_ba_session(sta, tid, initiator, reason);
+ __ieee80211_stop_rx_ba_session(sta, tid, initiator, reason);
rcu_read_unlock();
}
--- wireless-testing.orig/net/mac80211/ieee80211_i.h 2009-02-10 20:59:34.000000000 +0100
+++ wireless-testing/net/mac80211/ieee80211_i.h 2009-02-10 20:59:35.000000000 +0100
@@ -990,6 +990,8 @@ void ieee80211_send_delba(struct ieee802
void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *da,
u16 tid, u16 initiator, u16 reason);
+void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
+ u16 initiator, u16 reason);
void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta);
void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta,
@@ -1003,6 +1005,9 @@ void ieee80211_process_addba_request(str
struct ieee80211_mgmt *mgmt,
size_t len);
+int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
+ enum ieee80211_back_parties initiator);
+
/* Spectrum management */
void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt,
--- wireless-testing.orig/net/mac80211/agg-tx.c 2009-02-10 20:59:34.000000000 +0100
+++ wireless-testing/net/mac80211/agg-tx.c 2009-02-10 20:59:35.000000000 +0100
@@ -123,10 +123,10 @@ void ieee80211_send_bar(struct ieee80211
ieee80211_tx_skb(sdata, skb, 0);
}
-static int __ieee80211_stop_tx_ba_session(struct ieee80211_local *local,
- struct sta_info *sta, u16 tid,
- enum ieee80211_back_parties initiator)
+static int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
+ enum ieee80211_back_parties initiator)
{
+ struct ieee80211_local *local = sta->local;
int ret;
u8 *state;
@@ -165,7 +165,6 @@ static void sta_addba_resp_timer_expired
u16 tid = *(u8 *)data;
struct sta_info *sta = container_of((void *)data,
struct sta_info, timer_to_tid[tid]);
- struct ieee80211_local *local = sta->local;
u8 *state;
state = &sta->ampdu_mlme.tid_state_tx[tid];
@@ -186,7 +185,7 @@ static void sta_addba_resp_timer_expired
printk(KERN_DEBUG "addBA response timer expired on tid %d\n", tid);
#endif
- __ieee80211_stop_tx_ba_session(local, sta, tid, WLAN_BACK_INITIATOR);
+ ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
spin_unlock_bh(&sta->lock);
}
@@ -427,6 +426,32 @@ void ieee80211_start_tx_ba_cb_irqsafe(st
}
EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe);
+int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
+ enum ieee80211_back_parties initiator)
+{
+ u8 *state;
+ int ret;
+
+ /* check if the TID is in aggregation */
+ state = &sta->ampdu_mlme.tid_state_tx[tid];
+ spin_lock_bh(&sta->lock);
+
+ if (*state != HT_AGG_STATE_OPERATIONAL) {
+ ret = -ENOENT;
+ goto unlock;
+ }
+
+#ifdef CONFIG_MAC80211_HT_DEBUG
+ printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
+ sta->sta.addr, tid);
+#endif /* CONFIG_MAC80211_HT_DEBUG */
+
+ ret = ___ieee80211_stop_tx_ba_session(sta, tid, initiator);
+
+ unlock:
+ spin_unlock_bh(&sta->lock);
+ return ret;
+}
int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
u8 *ra, u16 tid,
@@ -434,7 +459,6 @@ int ieee80211_stop_tx_ba_session(struct
{
struct ieee80211_local *local = hw_to_local(hw);
struct sta_info *sta;
- u8 *state;
int ret = 0;
if (WARN_ON(!local->ops->ampdu_action))
@@ -450,27 +474,8 @@ int ieee80211_stop_tx_ba_session(struct
return -ENOENT;
}
- /* check if the TID is in aggregation */
- state = &sta->ampdu_mlme.tid_state_tx[tid];
- spin_lock_bh(&sta->lock);
-
- if (*state != HT_AGG_STATE_OPERATIONAL) {
- ret = -ENOENT;
- goto unlock;
- }
-
-#ifdef CONFIG_MAC80211_HT_DEBUG
- printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
- ra, tid);
-#endif /* CONFIG_MAC80211_HT_DEBUG */
-
- ret = __ieee80211_stop_tx_ba_session(local, sta, tid, initiator);
-
- unlock:
- spin_unlock_bh(&sta->lock);
-
+ ret = __ieee80211_stop_tx_ba_session(sta, tid, initiator);
rcu_read_unlock();
-
return ret;
}
EXPORT_SYMBOL(ieee80211_stop_tx_ba_session);
@@ -623,11 +628,9 @@ void ieee80211_process_addba_resp(struct
#ifdef CONFIG_MAC80211_HT_DEBUG
printk(KERN_DEBUG "Resuming TX aggregation for tid %d\n", tid);
#endif /* CONFIG_MAC80211_HT_DEBUG */
- spin_unlock_bh(&sta->lock);
} else {
sta->ampdu_mlme.addba_req_num[tid]++;
- __ieee80211_stop_tx_ba_session(local, sta, tid,
- WLAN_BACK_INITIATOR);
- spin_unlock_bh(&sta->lock);
+ ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
}
+ spin_unlock_bh(&sta->lock);
}
--- wireless-testing.orig/net/mac80211/ht.c 2009-02-10 20:59:34.000000000 +0100
+++ wireless-testing/net/mac80211/ht.c 2009-02-10 20:59:35.000000000 +0100
@@ -155,15 +155,12 @@ u32 ieee80211_enable_ht(struct ieee80211
void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta)
{
- struct ieee80211_local *local = sta->local;
int i;
for (i = 0; i < STA_TID_NUM; i++) {
- ieee80211_stop_tx_ba_session(&local->hw, sta->sta.addr, i,
- WLAN_BACK_INITIATOR);
- ieee80211_sta_stop_rx_ba_session(sta->sdata, sta->sta.addr, i,
- WLAN_BACK_RECIPIENT,
- WLAN_REASON_QSTA_LEAVE_QBSS);
+ __ieee80211_stop_tx_ba_session(sta, i, WLAN_BACK_INITIATOR);
+ __ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT,
+ WLAN_REASON_QSTA_LEAVE_QBSS);
}
}
--
next prev parent reply other threads:[~2009-02-10 20:39 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-10 20:25 [PATCH 00/27] mac80211 updates Johannes Berg
2009-02-10 20:25 ` [PATCH 01/27] zd1211rw: do not ratelimit no-ops Johannes Berg
2009-02-10 20:25 ` [PATCH 02/27] mac80211: disable IBSS beacon before join Johannes Berg
2009-02-10 20:25 ` [PATCH 03/27] zd1211rw: honour enable_beacon conf Johannes Berg
2009-02-10 20:25 ` [PATCH 04/27] mac80211: properly validate/translate IW_AUTH_MFP values Johannes Berg
2009-02-10 20:25 ` [PATCH 05/27] mac80211: reject extra IEs for probe request when hw_scan Johannes Berg
2009-02-10 20:25 ` [PATCH 06/27] mac80211: fix beacon enable more Johannes Berg
2009-02-10 20:25 ` [PATCH 07/27] mac80211: remove bssid argument from prepare_for_handlers Johannes Berg
2009-02-10 20:25 ` [PATCH 08/27] mac80211: remove stray aggregation debugfs definition Johannes Berg
2009-02-10 20:25 ` [PATCH 09/27] mac80211: fix RX aggregation timeouts Johannes Berg
2009-02-10 20:25 ` [PATCH 10/27] mac80211: restructure HT code Johannes Berg
2009-02-10 20:25 ` [PATCH 11/27] mac80211: restrict aggregation to supported interface modes Johannes Berg
2009-02-10 20:25 ` [PATCH 12/27] mac80211: hardware should not deny going back to legacy Johannes Berg
2009-02-10 20:25 ` [PATCH 13/27] mac80211: document TX aggregation (and small cleanup) Johannes Berg
2009-02-10 20:25 ` [PATCH 14/27] mac80211: fix race in TX aggregation Johannes Berg
2009-02-10 20:25 ` [PATCH 15/27] mac80211: fix aggregation timer lockups Johannes Berg
2009-02-10 20:25 ` [PATCH 16/27] mac80211: clean up BA session teardown Johannes Berg
2009-02-10 20:25 ` [PATCH 17/27] mac80211: RX aggregation: clean up stop session Johannes Berg
2009-02-10 20:25 ` Johannes Berg [this message]
2009-02-10 20:25 ` [PATCH 19/27] cfg80211/nl80211: scanning (and mac80211 update to use it) Johannes Berg
2009-02-10 20:25 ` [PATCH 20/27] mac80211: dont add BSS when creating IBSS Johannes Berg
2009-02-10 20:25 ` [PATCH 21/27] cfg80211: free_priv for BSS info Johannes Berg
2009-02-10 20:25 ` [PATCH 22/27] cfg80211: allow users to request removing a BSS Johannes Berg
2009-02-10 20:25 ` [PATCH 23/27] cfg80211: add more flexible BSS lookup Johannes Berg
2009-02-10 20:26 ` [PATCH 24/27] mac80211: use cfg80211s BSS infrastructure Johannes Berg
2009-02-10 20:26 ` [PATCH 25/27] mac80211: calculate wstats_flags on the fly Johannes Berg
2009-02-10 20:26 ` [PATCH 26/27] mac80211: fix IBSS auth Johannes Berg
2009-02-10 20:26 ` [PATCH 27/27] mac80211: split managed/ibss code a little more Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090210202555.979247282@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.