diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-02-10 15:25:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-13 13:45:32 -0500 |
commit | 20ad19d0ac7389b04b566ebf3e0e497974f63ffa (patch) | |
tree | af1a3d93f6f16f20f514fb940003dd0a85aef196 | |
parent | 8b1c814d65ae3219ee19d39ad6097f3d5249c23d (diff) |
mac80211: fix RX aggregation timeouts
The values are in TUs (1.024ms), not ms.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/mesh_hwmp.c | 1 | ||||
-rw-r--r-- | net/mac80211/rx.c | 16 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 2 |
4 files changed, 9 insertions, 12 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 67bd5220cf40..5b230015f938 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -57,6 +57,8 @@ struct ieee80211_local; | |||
57 | */ | 57 | */ |
58 | #define IEEE80211_SCAN_RESULT_EXPIRE (10 * HZ) | 58 | #define IEEE80211_SCAN_RESULT_EXPIRE (10 * HZ) |
59 | 59 | ||
60 | #define TU_TO_EXP_TIME(x) (jiffies + usecs_to_jiffies((x) * 1024)) | ||
61 | |||
60 | struct ieee80211_fragment_entry { | 62 | struct ieee80211_fragment_entry { |
61 | unsigned long first_frag_time; | 63 | unsigned long first_frag_time; |
62 | unsigned int seq; | 64 | unsigned int seq; |
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 4f862b2a0041..60b35accda91 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
@@ -58,7 +58,6 @@ static inline u32 u32_field_get(u8 *preq_elem, int offset, bool ae) | |||
58 | #define PERR_IE_DST_ADDR(x) (x + 2) | 58 | #define PERR_IE_DST_ADDR(x) (x + 2) |
59 | #define PERR_IE_DST_DSN(x) u32_field_get(x, 8, 0); | 59 | #define PERR_IE_DST_DSN(x) u32_field_get(x, 8, 0); |
60 | 60 | ||
61 | #define TU_TO_EXP_TIME(x) (jiffies + msecs_to_jiffies(x * 1024 / 1000)) | ||
62 | #define MSEC_TO_TU(x) (x*1000/1024) | 61 | #define MSEC_TO_TU(x) (x*1000/1024) |
63 | #define DSN_GT(x, y) ((long) (y) - (long) (x) < 0) | 62 | #define DSN_GT(x, y) ((long) (y) - (long) (x) < 0) |
64 | #define DSN_LT(x, y) ((long) (x) - (long) (y) < 0) | 63 | #define DSN_LT(x, y) ((long) (x) - (long) (y) < 0) |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 5a733c52f889..f34cc66d3f4b 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1673,11 +1673,9 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx) | |||
1673 | start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4; | 1673 | start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4; |
1674 | 1674 | ||
1675 | /* reset session timer */ | 1675 | /* reset session timer */ |
1676 | if (tid_agg_rx->timeout) { | 1676 | if (tid_agg_rx->timeout) |
1677 | unsigned long expires = | 1677 | mod_timer(&tid_agg_rx->session_timer, |
1678 | jiffies + (tid_agg_rx->timeout / 1000) * HZ; | 1678 | TU_TO_EXP_TIME(tid_agg_rx->timeout)); |
1679 | mod_timer(&tid_agg_rx->session_timer, expires); | ||
1680 | } | ||
1681 | 1679 | ||
1682 | /* manage reordering buffer according to requested */ | 1680 | /* manage reordering buffer according to requested */ |
1683 | /* sequence number */ | 1681 | /* sequence number */ |
@@ -2414,11 +2412,9 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local, | |||
2414 | /* new un-ordered ampdu frame - process it */ | 2412 | /* new un-ordered ampdu frame - process it */ |
2415 | 2413 | ||
2416 | /* reset session timer */ | 2414 | /* reset session timer */ |
2417 | if (tid_agg_rx->timeout) { | 2415 | if (tid_agg_rx->timeout) |
2418 | unsigned long expires = | 2416 | mod_timer(&tid_agg_rx->session_timer, |
2419 | jiffies + (tid_agg_rx->timeout / 1000) * HZ; | 2417 | TU_TO_EXP_TIME(tid_agg_rx->timeout)); |
2420 | mod_timer(&tid_agg_rx->session_timer, expires); | ||
2421 | } | ||
2422 | 2418 | ||
2423 | /* if this mpdu is fragmented - terminate rx aggregation session */ | 2419 | /* if this mpdu is fragmented - terminate rx aggregation session */ |
2424 | sc = le16_to_cpu(hdr->seq_ctrl); | 2420 | sc = le16_to_cpu(hdr->seq_ctrl); |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index d75c870fae65..a070bd929e00 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -88,7 +88,7 @@ struct tid_ampdu_tx { | |||
88 | * @stored_mpdu_num: number of MPDUs in reordering buffer | 88 | * @stored_mpdu_num: number of MPDUs in reordering buffer |
89 | * @ssn: Starting Sequence Number expected to be aggregated. | 89 | * @ssn: Starting Sequence Number expected to be aggregated. |
90 | * @buf_size: buffer size for incoming A-MPDUs | 90 | * @buf_size: buffer size for incoming A-MPDUs |
91 | * @timeout: reset timer value. | 91 | * @timeout: reset timer value (in TUs). |
92 | * @dialog_token: dialog token for aggregation session | 92 | * @dialog_token: dialog token for aggregation session |
93 | */ | 93 | */ |
94 | struct tid_ampdu_rx { | 94 | struct tid_ampdu_rx { |