All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 02/11] mac80211: fix RX aggregation timeouts
Date: Thu, 05 Feb 2009 17:07:40 +0100	[thread overview]
Message-ID: <20090205161131.860202572@sipsolutions.net> (raw)
In-Reply-To: 20090205160738.990564487@sipsolutions.net

The values are in TUs (1.024ms), not ms.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/ieee80211_i.h |    2 ++
 net/mac80211/mesh_hwmp.c   |    1 -
 net/mac80211/rx.c          |   16 ++++++----------
 net/mac80211/sta_info.h    |    2 +-
 4 files changed, 9 insertions(+), 12 deletions(-)

--- wireless-testing.orig/net/mac80211/rx.c	2009-02-04 16:02:49.000000000 +0100
+++ wireless-testing/net/mac80211/rx.c	2009-02-04 16:03:29.000000000 +0100
@@ -1640,11 +1640,9 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_
 		start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4;
 
 		/* reset session timer */
-		if (tid_agg_rx->timeout) {
-			unsigned long expires =
-				jiffies + (tid_agg_rx->timeout / 1000) * HZ;
-			mod_timer(&tid_agg_rx->session_timer, expires);
-		}
+		if (tid_agg_rx->timeout)
+			mod_timer(&tid_agg_rx->session_timer,
+				  TU_TO_EXP_TIME(tid_agg_rx->timeout));
 
 		/* manage reordering buffer according to requested */
 		/* sequence number */
@@ -2381,11 +2379,9 @@ static u8 ieee80211_rx_reorder_ampdu(str
 	/* new un-ordered ampdu frame - process it */
 
 	/* reset session timer */
-	if (tid_agg_rx->timeout) {
-		unsigned long expires =
-			jiffies + (tid_agg_rx->timeout / 1000) * HZ;
-		mod_timer(&tid_agg_rx->session_timer, expires);
-	}
+	if (tid_agg_rx->timeout)
+		mod_timer(&tid_agg_rx->session_timer,
+			  TU_TO_EXP_TIME(tid_agg_rx->timeout));
 
 	/* if this mpdu is fragmented - terminate rx aggregation session */
 	sc = le16_to_cpu(hdr->seq_ctrl);
--- wireless-testing.orig/net/mac80211/sta_info.h	2009-02-04 16:03:28.000000000 +0100
+++ wireless-testing/net/mac80211/sta_info.h	2009-02-04 16:03:29.000000000 +0100
@@ -88,7 +88,7 @@ struct tid_ampdu_tx {
  * @stored_mpdu_num: number of MPDUs in reordering buffer
  * @ssn: Starting Sequence Number expected to be aggregated.
  * @buf_size: buffer size for incoming A-MPDUs
- * @timeout: reset timer value.
+ * @timeout: reset timer value (in TUs).
  * @dialog_token: dialog token for aggregation session
  */
 struct tid_ampdu_rx {
--- wireless-testing.orig/net/mac80211/ieee80211_i.h	2009-02-04 16:01:37.000000000 +0100
+++ wireless-testing/net/mac80211/ieee80211_i.h	2009-02-04 16:03:29.000000000 +0100
@@ -57,6 +57,8 @@ struct ieee80211_local;
  */
 #define IEEE80211_SCAN_RESULT_EXPIRE (10 * HZ)
 
+#define TU_TO_EXP_TIME(x)	(jiffies + usecs_to_jiffies((x) * 1024))
+
 struct ieee80211_fragment_entry {
 	unsigned long first_frag_time;
 	unsigned int seq;
--- wireless-testing.orig/net/mac80211/mesh_hwmp.c	2009-02-04 16:01:37.000000000 +0100
+++ wireless-testing/net/mac80211/mesh_hwmp.c	2009-02-04 16:03:29.000000000 +0100
@@ -58,7 +58,6 @@ static inline u32 u32_field_get(u8 *preq
 #define PERR_IE_DST_ADDR(x)	(x + 2)
 #define PERR_IE_DST_DSN(x)	u32_field_get(x, 8, 0);
 
-#define TU_TO_EXP_TIME(x) (jiffies + msecs_to_jiffies(x * 1024 / 1000))
 #define MSEC_TO_TU(x) (x*1000/1024)
 #define DSN_GT(x, y) ((long) (y) - (long) (x) < 0)
 #define DSN_LT(x, y) ((long) (x) - (long) (y) < 0)

-- 


  parent reply	other threads:[~2009-02-05 16:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05 16:07 [PATCH 00/11] mac80211 aggregation cleanups/fixes Johannes Berg
2009-02-05 16:07 ` [PATCH 01/11] mac80211: remove stray aggregation debugfs definition Johannes Berg
2009-02-05 16:07 ` Johannes Berg [this message]
2009-02-05 16:07 ` [PATCH 03/11] mac80211: restructure HT code Johannes Berg
2009-02-05 16:07 ` [PATCH 04/11] mac80211: restrict aggregation to supported interface modes Johannes Berg
2009-02-05 16:07 ` [PATCH 05/11] mac80211: hardware should not deny going back to legacy Johannes Berg
2009-02-05 16:07 ` [PATCH 06/11] mac80211: document TX aggregation (and small cleanup) Johannes Berg
2009-02-05 16:07 ` [PATCH 07/11] mac80211: fix race in TX aggregation Johannes Berg
2009-02-06 19:13   ` Luis R. Rodriguez
2009-02-06 20:37     ` Johannes Berg
2009-02-05 16:07 ` [PATCH 08/11] mac80211: fix aggregation timer lockups Johannes Berg
2009-02-05 16:07 ` [PATCH 09/11] mac80211: clean up BA session teardown Johannes Berg
2009-02-05 16:07 ` [PATCH 10/11] mac80211: RX aggregation: clean up stop session Johannes Berg
2009-02-05 16:07 ` [PATCH 11/11] mac80211: further cleanups to stopping BA sessions Johannes Berg
2009-02-06 22:32 ` [PATCH 00/11] mac80211 aggregation cleanups/fixes Luis R. Rodriguez

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=20090205161131.860202572@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.