From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 5/8] mac80211: unify and fix TX aggregation start
Date: Mon, 23 Mar 2009 17:28:39 +0100 [thread overview]
Message-ID: <20090323163052.823346545@sipsolutions.net> (raw)
In-Reply-To: 20090323162834.154525349@sipsolutions.net
When TX aggregation becomes operational, we do a number of steps:
1) print a debug message
2) wake the virtual queue
3) notify the driver
Unfortunately, 1) and 3) are only done if the driver is first to
reply to the aggregation request, it is, however, possible that the
remote station replies before the driver! Thus, unify the code for
this and call the new function ieee80211_agg_tx_operational in both
places where TX aggregation can become operational.
Additionally, rename the driver notification from
IEEE80211_AMPDU_TX_RESUME to IEEE80211_AMPDU_TX_OPERATIONAL.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/ath9k/main.c | 2 -
include/net/mac80211.h | 4 +-
net/mac80211/agg-tx.c | 63 ++++++++++++++++----------------------
3 files changed, 30 insertions(+), 39 deletions(-)
--- wireless-testing.orig/net/mac80211/agg-tx.c 2009-03-23 13:59:19.000000000 +0100
+++ wireless-testing/net/mac80211/agg-tx.c 2009-03-23 14:03:46.000000000 +0100
@@ -404,6 +404,27 @@ int ieee80211_start_tx_ba_session(struct
}
EXPORT_SYMBOL(ieee80211_start_tx_ba_session);
+static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
+ struct sta_info *sta, u16 tid)
+{
+#ifdef CONFIG_MAC80211_HT_DEBUG
+ printk(KERN_DEBUG "Aggregation is on for tid %d \n", tid);
+#endif
+
+ if (local->hw.ampdu_queues) {
+ /*
+ * Wake up the A-MPDU queue, we stopped it earlier,
+ * this will in turn wake the entire AC.
+ */
+ ieee80211_wake_queue_by_reason(&local->hw,
+ local->hw.queues + sta->tid_to_tx_q[tid],
+ IEEE80211_QUEUE_STOP_REASON_AGGREGATION);
+ }
+
+ local->ops->ampdu_action(&local->hw, IEEE80211_AMPDU_TX_OPERATIONAL,
+ &sta->sta, tid, NULL);
+}
+
void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
{
struct ieee80211_local *local = hw_to_local(hw);
@@ -446,20 +467,8 @@ void ieee80211_start_tx_ba_cb(struct iee
*state |= HT_ADDBA_DRV_READY_MSK;
- if (*state == HT_AGG_STATE_OPERATIONAL) {
-#ifdef CONFIG_MAC80211_HT_DEBUG
- printk(KERN_DEBUG "Aggregation is on for tid %d \n", tid);
-#endif
- if (hw->ampdu_queues) {
- /*
- * Wake up this queue, we stopped it earlier,
- * this will in turn wake the entire AC.
- */
- ieee80211_wake_queue_by_reason(hw,
- hw->queues + sta->tid_to_tx_q[tid],
- IEEE80211_QUEUE_STOP_REASON_AGGREGATION);
- }
- }
+ if (*state == HT_AGG_STATE_OPERATIONAL)
+ ieee80211_agg_tx_operational(local, sta, tid);
out:
spin_unlock_bh(&sta->lock);
@@ -646,9 +655,7 @@ void ieee80211_process_addba_resp(struct
struct ieee80211_mgmt *mgmt,
size_t len)
{
- struct ieee80211_hw *hw = &local->hw;
- u16 capab;
- u16 tid, start_seq_num;
+ u16 capab, tid;
u8 *state;
capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab);
@@ -682,26 +689,10 @@ void ieee80211_process_addba_resp(struct
*state |= HT_ADDBA_RECEIVED_MSK;
- if (hw->ampdu_queues && *state != curstate &&
- *state == HT_AGG_STATE_OPERATIONAL) {
- /*
- * Wake up this queue, we stopped it earlier,
- * this will in turn wake the entire AC.
- */
- ieee80211_wake_queue_by_reason(hw,
- hw->queues + sta->tid_to_tx_q[tid],
- IEEE80211_QUEUE_STOP_REASON_AGGREGATION);
- }
- sta->ampdu_mlme.addba_req_num[tid] = 0;
+ if (*state != curstate && *state == HT_AGG_STATE_OPERATIONAL)
+ ieee80211_agg_tx_operational(local, sta, tid);
- if (local->ops->ampdu_action) {
- (void)local->ops->ampdu_action(hw,
- IEEE80211_AMPDU_TX_RESUME,
- &sta->sta, tid, &start_seq_num);
- }
-#ifdef CONFIG_MAC80211_HT_DEBUG
- printk(KERN_DEBUG "Resuming TX aggregation for tid %d\n", tid);
-#endif /* CONFIG_MAC80211_HT_DEBUG */
+ sta->ampdu_mlme.addba_req_num[tid] = 0;
} else {
sta->ampdu_mlme.addba_req_num[tid]++;
___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
--- wireless-testing.orig/include/net/mac80211.h 2009-03-23 14:00:12.000000000 +0100
+++ wireless-testing/include/net/mac80211.h 2009-03-23 14:03:46.000000000 +0100
@@ -1213,14 +1213,14 @@ enum ieee80211_filter_flags {
* @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
* @IEEE80211_AMPDU_TX_START: start Tx aggregation
* @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
- * @IEEE80211_AMPDU_TX_RESUME: resume TX aggregation
+ * @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational
*/
enum ieee80211_ampdu_mlme_action {
IEEE80211_AMPDU_RX_START,
IEEE80211_AMPDU_RX_STOP,
IEEE80211_AMPDU_TX_START,
IEEE80211_AMPDU_TX_STOP,
- IEEE80211_AMPDU_TX_RESUME,
+ IEEE80211_AMPDU_TX_OPERATIONAL,
};
/**
--- wireless-testing.orig/drivers/net/wireless/ath9k/main.c 2009-03-23 13:59:19.000000000 +0100
+++ wireless-testing/drivers/net/wireless/ath9k/main.c 2009-03-23 14:03:46.000000000 +0100
@@ -2730,7 +2730,7 @@ static int ath9k_ampdu_action(struct iee
ieee80211_stop_tx_ba_cb_irqsafe(hw, sta->addr, tid);
break;
- case IEEE80211_AMPDU_TX_RESUME:
+ case IEEE80211_AMPDU_TX_OPERATIONAL:
ath_tx_aggr_resume(sc, sta, tid);
break;
default:
--
next prev parent reply other threads:[~2009-03-23 16:32 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 16:28 [PATCH 0/8] mac80211 aggregation improvements Johannes Berg
2009-03-23 16:28 ` [PATCH 1/8] mac80211: rewrite fragmentation Johannes Berg
2009-03-26 1:21 ` Luis R. Rodriguez
2009-03-26 1:26 ` Julian Calaby
2009-03-26 1:34 ` Luis R. Rodriguez
2009-03-26 1:34 ` Luis R. Rodriguez
2009-03-26 8:15 ` Johannes Berg
2009-03-23 16:28 ` [PATCH 2/8] mac80211: fix A-MPDU queue assignment Johannes Berg
2009-03-26 1:41 ` Luis R. Rodriguez
2009-03-23 16:28 ` [PATCH 3/8] mac80211: rework the pending packets code Johannes Berg
2009-03-27 22:22 ` Luis R. Rodriguez
2009-03-27 22:36 ` Johannes Berg
2009-03-23 16:28 ` [PATCH 4/8] mac80211: clean up __ieee80211_tx args Johannes Berg
2009-03-27 22:26 ` Luis R. Rodriguez
2009-03-23 16:28 ` Johannes Berg [this message]
2009-03-28 2:27 ` [PATCH 5/8] mac80211: unify and fix TX aggregation start Luis R. Rodriguez
2009-03-28 3:01 ` Luis R. Rodriguez
2009-03-28 17:28 ` Johannes Berg
2009-03-23 16:28 ` [PATCH 6/8] mac80211: add skb length sanity checking Johannes Berg
2009-03-28 2:40 ` Luis R. Rodriguez
2009-03-28 3:00 ` Luis R. Rodriguez
2009-03-28 17:29 ` Johannes Berg
2009-03-23 16:28 ` [PATCH 7/8] mac80211: fix aggregation to not require queue stop Johannes Berg
2009-03-28 4:55 ` Luis R. Rodriguez
2009-03-28 17:41 ` Johannes Berg
2009-03-28 19:18 ` Luis R. Rodriguez
2009-03-28 19:52 ` Johannes Berg
2009-03-28 20:26 ` Luis R. Rodriguez
2009-03-28 20:42 ` Johannes Berg
2009-03-28 21:06 ` Luis R. Rodriguez
2009-03-28 21:17 ` Johannes Berg
2009-03-28 21:40 ` Luis R. Rodriguez
2009-03-23 16:28 ` [PATCH 8/8] mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi Johannes Berg
2009-03-28 5:04 ` Luis R. Rodriguez
2009-03-24 8:28 ` [PATCH 0/8] mac80211 aggregation improvements Johannes Berg
2009-03-24 16:13 ` Luis R. Rodriguez
2009-03-24 19:48 ` John W. Linville
2009-03-24 20:24 ` 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=20090323163052.823346545@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).