mac80211: update compat-wireless to 2009-01-19
[openwrt/staging/mkresin.git] / package / mac80211 / patches / 323-rt2x00-Fix-TX-rate-short-preamble-detection.patch
1 From 4f9ea5700c714afce77e410d1c0c114c42d5a910 Mon Sep 17 00:00:00 2001
2 From: Ivo van Doorn <IvDoorn@gmail.com>
3 Date: Sun, 18 Jan 2009 20:17:10 +0100
4 Subject: [PATCH] rt2x00: Fix TX rate short preamble detection
5
6 Mac80211 provides 2 structures to handle bitrates, namely
7 ieee80211_rate and ieee80211_tx_rate. To determine the short preamble
8 mode for an outgoing frame, the flag IEEE80211_TX_RC_USE_SHORT_PREAMBLE
9 must be checked on ieee80211_tx_rate and not ieee80211_rate (which rt2x00 did).
10
11 This fixes a regression which was triggered in 2.6.29-rcX as reported by Chris Clayton.
12
13 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
14 ---
15 drivers/net/wireless/rt2x00/rt2x00queue.c | 9 +++++----
16 1 files changed, 5 insertions(+), 4 deletions(-)
17
18 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c
19 +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
20 @@ -186,10 +186,11 @@ static void rt2x00queue_create_tx_descri
21
22 static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry,
23 struct txentry_desc *txdesc,
24 - struct ieee80211_rate *rate)
25 + const struct rt2x00_rate *hwrate)
26 {
27 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
28 - const struct rt2x00_rate *hwrate = rt2x00_get_rate(rate->hw_value);
29 + struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
30 + struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0];
31 unsigned int data_length;
32 unsigned int duration;
33 unsigned int residual;
34 @@ -232,7 +233,7 @@ static void rt2x00queue_create_tx_descri
35 * When preamble is enabled we should set the
36 * preamble bit for the signal.
37 */
38 - if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
39 + if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
40 txdesc->signal |= 0x08;
41 }
42 }
43 @@ -327,7 +328,7 @@ static void rt2x00queue_create_tx_descri
44 rt2x00crypto_create_tx_descriptor(entry, txdesc);
45 rt2x00ht_create_tx_descriptor(entry, txdesc, rate);
46 rt2x00queue_create_tx_descriptor_seq(entry, txdesc);
47 - rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, rate);
48 + rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate);
49 }
50
51 static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,