Commit 20ad19d0 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: fix RX aggregation timeouts

The values are in TUs (1.024ms), not ms.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8b1c814d
...@@ -57,6 +57,8 @@ struct ieee80211_local; ...@@ -57,6 +57,8 @@ struct ieee80211_local;
*/ */
#define IEEE80211_SCAN_RESULT_EXPIRE (10 * HZ) #define IEEE80211_SCAN_RESULT_EXPIRE (10 * HZ)
#define TU_TO_EXP_TIME(x) (jiffies + usecs_to_jiffies((x) * 1024))
struct ieee80211_fragment_entry { struct ieee80211_fragment_entry {
unsigned long first_frag_time; unsigned long first_frag_time;
unsigned int seq; unsigned int seq;
......
...@@ -58,7 +58,6 @@ static inline u32 u32_field_get(u8 *preq_elem, int offset, bool ae) ...@@ -58,7 +58,6 @@ static inline u32 u32_field_get(u8 *preq_elem, int offset, bool ae)
#define PERR_IE_DST_ADDR(x) (x + 2) #define PERR_IE_DST_ADDR(x) (x + 2)
#define PERR_IE_DST_DSN(x) u32_field_get(x, 8, 0); #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 MSEC_TO_TU(x) (x*1000/1024)
#define DSN_GT(x, y) ((long) (y) - (long) (x) < 0) #define DSN_GT(x, y) ((long) (y) - (long) (x) < 0)
#define DSN_LT(x, y) ((long) (x) - (long) (y) < 0) #define DSN_LT(x, y) ((long) (x) - (long) (y) < 0)
......
...@@ -1673,11 +1673,9 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx) ...@@ -1673,11 +1673,9 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx)
start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4; start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4;
/* reset session timer */ /* reset session timer */
if (tid_agg_rx->timeout) { if (tid_agg_rx->timeout)
unsigned long expires = mod_timer(&tid_agg_rx->session_timer,
jiffies + (tid_agg_rx->timeout / 1000) * HZ; TU_TO_EXP_TIME(tid_agg_rx->timeout));
mod_timer(&tid_agg_rx->session_timer, expires);
}
/* manage reordering buffer according to requested */ /* manage reordering buffer according to requested */
/* sequence number */ /* sequence number */
...@@ -2414,11 +2412,9 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local, ...@@ -2414,11 +2412,9 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
/* new un-ordered ampdu frame - process it */ /* new un-ordered ampdu frame - process it */
/* reset session timer */ /* reset session timer */
if (tid_agg_rx->timeout) { if (tid_agg_rx->timeout)
unsigned long expires = mod_timer(&tid_agg_rx->session_timer,
jiffies + (tid_agg_rx->timeout / 1000) * HZ; TU_TO_EXP_TIME(tid_agg_rx->timeout));
mod_timer(&tid_agg_rx->session_timer, expires);
}
/* if this mpdu is fragmented - terminate rx aggregation session */ /* if this mpdu is fragmented - terminate rx aggregation session */
sc = le16_to_cpu(hdr->seq_ctrl); sc = le16_to_cpu(hdr->seq_ctrl);
......
...@@ -88,7 +88,7 @@ struct tid_ampdu_tx { ...@@ -88,7 +88,7 @@ struct tid_ampdu_tx {
* @stored_mpdu_num: number of MPDUs in reordering buffer * @stored_mpdu_num: number of MPDUs in reordering buffer
* @ssn: Starting Sequence Number expected to be aggregated. * @ssn: Starting Sequence Number expected to be aggregated.
* @buf_size: buffer size for incoming A-MPDUs * @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 * @dialog_token: dialog token for aggregation session
*/ */
struct tid_ampdu_rx { struct tid_ampdu_rx {
......
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