aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2009-01-04 11:33:25 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-12 14:24:50 -0500
commit3ea96463156123cbfd09ac412012a87fef068830 (patch)
tree5396df59c18f39fa42472671eeaac1cbff486a32 /drivers
parent3be36ae223271f9c2cfbe7406846c8fdcd2f50c3 (diff)
rt2x00: Fix TX short preamble detection
The short preamble mode was not correctly detected during TX, rt2x00 used the rate->hw_value_short field but mac80211 is not using this field that way. Instead the flag IEEE80211_TX_RC_USE_SHORT_PREAMBLE should be used to determine if the frame should be send out using short preamble or not. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h11
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c2
3 files changed, 4 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 6d92542fcf0d..87c0f2c83077 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -807,13 +807,11 @@ static void rt2x00lib_rate(struct ieee80211_rate *entry,
807{ 807{
808 entry->flags = 0; 808 entry->flags = 0;
809 entry->bitrate = rate->bitrate; 809 entry->bitrate = rate->bitrate;
810 entry->hw_value = rt2x00_create_rate_hw_value(index, 0); 810 entry->hw_value =index;
811 entry->hw_value_short = entry->hw_value; 811 entry->hw_value_short = index;
812 812
813 if (rate->flags & DEV_RATE_SHORT_PREAMBLE) { 813 if (rate->flags & DEV_RATE_SHORT_PREAMBLE)
814 entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE; 814 entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE;
815 entry->hw_value_short |= rt2x00_create_rate_hw_value(index, 1);
816 }
817} 815}
818 816
819static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, 817static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 03024327767b..86cd26fbf769 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -52,22 +52,11 @@ struct rt2x00_rate {
52 52
53extern const struct rt2x00_rate rt2x00_supported_rates[12]; 53extern const struct rt2x00_rate rt2x00_supported_rates[12];
54 54
55static inline u16 rt2x00_create_rate_hw_value(const u16 index,
56 const u16 short_preamble)
57{
58 return (short_preamble << 8) | (index & 0xff);
59}
60
61static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value) 55static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value)
62{ 56{
63 return &rt2x00_supported_rates[hw_value & 0xff]; 57 return &rt2x00_supported_rates[hw_value & 0xff];
64} 58}
65 59
66static inline int rt2x00_get_rate_preamble(const u16 hw_value)
67{
68 return (hw_value & 0xff00);
69}
70
71/* 60/*
72 * Radio control handlers. 61 * Radio control handlers.
73 */ 62 */
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index eaec6bd93ed5..746a8f36b931 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -313,7 +313,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
313 * When preamble is enabled we should set the 313 * When preamble is enabled we should set the
314 * preamble bit for the signal. 314 * preamble bit for the signal.
315 */ 315 */
316 if (rt2x00_get_rate_preamble(rate->hw_value)) 316 if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
317 txdesc->signal |= 0x08; 317 txdesc->signal |= 0x08;
318 } 318 }
319} 319}