aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches/324-rt2x00-Fix-preamble-detection-rt2x00ht.patch
blob: 1321232111d3c94f37f35e669dd98e7d964a650f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From ecce227dab27aaf2d1c81a605d3e6e6f6d55908a Mon Sep 17 00:00:00 2001
From: Ivo van Doorn <IvDoorn@gmail.com>
Date: Sun, 18 Jan 2009 20:20:08 +0100
Subject: [PATCH] rt2x00: Fix preamble detection (rt2x00ht)

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2x00ht.c    |   14 +++++++-------
 drivers/net/wireless/rt2x00/rt2x00lib.h   |    4 ++--
 drivers/net/wireless/rt2x00/rt2x00queue.c |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

--- a/drivers/net/wireless/rt2x00/rt2x00ht.c
+++ b/drivers/net/wireless/rt2x00/rt2x00ht.c
@@ -31,10 +31,10 @@
 
 void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
 				   struct txentry_desc *txdesc,
-				   struct ieee80211_rate *rate)
+				   const struct rt2x00_rate *hwrate)
 {
 	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
-	const struct rt2x00_rate *hwrate = rt2x00_get_rate(rate->hw_value);
+	struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0];
 
 	if (tx_info->control.sta)
 		txdesc->mpdu_density =
@@ -46,7 +46,7 @@ void rt2x00ht_create_tx_descriptor(struc
 	txdesc->stbc = 0;	/* FIXME: What value is needed? */
 
 	txdesc->mcs = rt2x00_get_rate_mcs(hwrate->mcs);
-	if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
+	if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
 		txdesc->mcs |= 0x08;
 
 	/*
@@ -58,12 +58,12 @@ void rt2x00ht_create_tx_descriptor(struc
 	/*
 	 * Determine HT Mix/Greenfield rate mode
 	 */
-	if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_MCS)
+	if (txrate->flags & IEEE80211_TX_RC_MCS)
 		txdesc->rate_mode = RATE_MODE_HT_MIX;
-	if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_GREEN_FIELD)
+	if (txrate->flags & IEEE80211_TX_RC_GREEN_FIELD)
 		txdesc->rate_mode = RATE_MODE_HT_GREENFIELD;
-	if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
+	if (txrate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
 		__set_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags);
-	if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
+	if (txrate->flags & IEEE80211_TX_RC_SHORT_GI)
 		__set_bit(ENTRY_TXD_HT_SHORT_GI, &txdesc->flags);
 }
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -344,11 +344,11 @@ static inline void rt2x00crypto_rx_inser
 #ifdef CONFIG_RT2X00_LIB_HT
 void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
 				   struct txentry_desc *txdesc,
-				   struct ieee80211_rate *rate);
+				   const struct rt2x00_rate *hwrate);
 #else
 static inline void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
 						 struct txentry_desc *txdesc,
-						 struct ieee80211_rate *rate)
+						 const struct rt2x00_rate *hwrate)
 {
 }
 #endif /* CONFIG_RT2X00_LIB_HT */
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -326,7 +326,7 @@ static void rt2x00queue_create_tx_descri
 	 * Apply TX descriptor handling by components
 	 */
 	rt2x00crypto_create_tx_descriptor(entry, txdesc);
-	rt2x00ht_create_tx_descriptor(entry, txdesc, rate);
+	rt2x00ht_create_tx_descriptor(entry, txdesc, hwrate);
 	rt2x00queue_create_tx_descriptor_seq(entry, txdesc);
 	rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate);
 }