summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rt2x00/rt2x00lib.h
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-03 15:50:40 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:38 -0500
commit70e2fed4ec14df84ed72554d573794714b15a078 (patch)
tree6e8d63a357fb1c45d950f292bf330e8af718b85a /drivers/net/wireless/rt2x00/rt2x00lib.h
parente71c9fac316221a4594f3bd58c2d30ada0cabaf6 (diff)
rt2x00: Rate structure overhaul
Recent changes to the rate structure registration broke rt2x00, the hw_value was reduced from 32bits to 16bits while rt2x00 used the full 32bits. However the way rt2x00 used the value was inflexible and needed to be changed anyway. This patch creates a array containing information for each rate, the hw_value passed to mac80211 is the index value for that array including a field to indicate if short preamble should be enabled. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00lib.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index f6789fdaaf6e..ca9630c75520 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -34,6 +34,51 @@
#define RFKILL_POLL_INTERVAL ( 1000 )
/*
+ * rt2x00_rate: Per rate device information
+ */
+struct rt2x00_rate {
+ unsigned short flags;
+#define DEV_RATE_OFDM 0x0001
+#define DEV_RATE_SHORT_PREAMBLE 0x0002
+
+ unsigned short bitrate; /* In 100kbit/s */
+
+ unsigned short ratemask;
+#define DEV_RATEMASK_1MB ( (1 << 1) - 1 )
+#define DEV_RATEMASK_2MB ( (1 << 2) - 1 )
+#define DEV_RATEMASK_5_5MB ( (1 << 3) - 1 )
+#define DEV_RATEMASK_11MB ( (1 << 4) - 1 )
+#define DEV_RATEMASK_6MB ( (1 << 5) - 1 )
+#define DEV_RATEMASK_9MB ( (1 << 6) - 1 )
+#define DEV_RATEMASK_12MB ( (1 << 7) - 1 )
+#define DEV_RATEMASK_18MB ( (1 << 8) - 1 )
+#define DEV_RATEMASK_24MB ( (1 << 9) - 1 )
+#define DEV_RATEMASK_36MB ( (1 << 10) - 1 )
+#define DEV_RATEMASK_48MB ( (1 << 11) - 1 )
+#define DEV_RATEMASK_54MB ( (1 << 12) - 1 )
+
+ unsigned short plcp;
+};
+
+extern const struct rt2x00_rate rt2x00_supported_rates[12];
+
+static inline u16 rt2x00_create_rate_hw_value(const u16 index,
+ const u16 short_preamble)
+{
+ return (short_preamble << 8) | (index & 0xff);
+}
+
+static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value)
+{
+ return &rt2x00_supported_rates[hw_value & 0xff];
+}
+
+static inline int rt2x00_get_rate_preamble(const u16 hw_value)
+{
+ return (hw_value & 0xff00);
+}
+
+/*
* Radio control handlers.
*/
int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev);