aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00reg.h
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-03 09:50:40 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:38 -0500
commit70e2fed4ec14df84ed72554d573794714b15a078 (patch)
tree6e8d63a357fb1c45d950f292bf330e8af718b85a /drivers/net/wireless/rt2x00/rt2x00reg.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/rt2x00reg.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00reg.h71
1 files changed, 0 insertions, 71 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h
index e0ebe51c082f..0325bed2fbf5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00reg.h
+++ b/drivers/net/wireless/rt2x00/rt2x00reg.h
@@ -220,75 +220,4 @@ static inline u8 rt2x00_get_field8(const u8 reg,
220 return (reg & field.bit_mask) >> field.bit_offset; 220 return (reg & field.bit_mask) >> field.bit_offset;
221} 221}
222 222
223/*
224 * Device specific rate value.
225 * We will have to create the device specific rate value
226 * passed to the ieee80211 kernel. We need to make it a consist of
227 * multiple fields because we want to store more then 1 device specific
228 * values inside the value.
229 * 1 - rate, stored as 100 kbit/s.
230 * 2 - preamble, short_preamble enabled flag.
231 * 3 - MASK_RATE, which rates are enabled in this mode, this mask
232 * corresponds with the TX register format for the current device.
233 * 4 - plcp, 802.11b rates are device specific,
234 * 802.11g rates are set according to the ieee802.11a-1999 p.14.
235 * The bit to enable preamble is set in a seperate define.
236 */
237#define DEV_RATE FIELD32(0x000007ff)
238#define DEV_PREAMBLE FIELD32(0x00000800)
239#define DEV_RATEMASK FIELD32(0x00fff000)
240#define DEV_PLCP FIELD32(0xff000000)
241
242/*
243 * Bitfields
244 */
245#define DEV_RATEBIT_1MB ( 1 << 0 )
246#define DEV_RATEBIT_2MB ( 1 << 1 )
247#define DEV_RATEBIT_5_5MB ( 1 << 2 )
248#define DEV_RATEBIT_11MB ( 1 << 3 )
249#define DEV_RATEBIT_6MB ( 1 << 4 )
250#define DEV_RATEBIT_9MB ( 1 << 5 )
251#define DEV_RATEBIT_12MB ( 1 << 6 )
252#define DEV_RATEBIT_18MB ( 1 << 7 )
253#define DEV_RATEBIT_24MB ( 1 << 8 )
254#define DEV_RATEBIT_36MB ( 1 << 9 )
255#define DEV_RATEBIT_48MB ( 1 << 10 )
256#define DEV_RATEBIT_54MB ( 1 << 11 )
257
258/*
259 * Bitmasks for DEV_RATEMASK
260 */
261#define DEV_RATEMASK_1MB ( (DEV_RATEBIT_1MB << 1) -1 )
262#define DEV_RATEMASK_2MB ( (DEV_RATEBIT_2MB << 1) -1 )
263#define DEV_RATEMASK_5_5MB ( (DEV_RATEBIT_5_5MB << 1) -1 )
264#define DEV_RATEMASK_11MB ( (DEV_RATEBIT_11MB << 1) -1 )
265#define DEV_RATEMASK_6MB ( (DEV_RATEBIT_6MB << 1) -1 )
266#define DEV_RATEMASK_9MB ( (DEV_RATEBIT_9MB << 1) -1 )
267#define DEV_RATEMASK_12MB ( (DEV_RATEBIT_12MB << 1) -1 )
268#define DEV_RATEMASK_18MB ( (DEV_RATEBIT_18MB << 1) -1 )
269#define DEV_RATEMASK_24MB ( (DEV_RATEBIT_24MB << 1) -1 )
270#define DEV_RATEMASK_36MB ( (DEV_RATEBIT_36MB << 1) -1 )
271#define DEV_RATEMASK_48MB ( (DEV_RATEBIT_48MB << 1) -1 )
272#define DEV_RATEMASK_54MB ( (DEV_RATEBIT_54MB << 1) -1 )
273
274/*
275 * Bitmask groups of bitrates
276 */
277#define DEV_BASIC_RATEMASK \
278 ( DEV_RATEMASK_11MB | \
279 DEV_RATEBIT_6MB | DEV_RATEBIT_12MB | DEV_RATEBIT_24MB )
280
281#define DEV_CCK_RATEMASK ( DEV_RATEMASK_11MB )
282#define DEV_OFDM_RATEMASK ( DEV_RATEMASK_54MB & ~DEV_CCK_RATEMASK )
283
284/*
285 * Macro's to set and get specific fields from the device specific val and val2
286 * fields inside the ieee80211_rate entry.
287 */
288#define DEVICE_SET_RATE_FIELD(__value, __mask) \
289 (int)( ((__value) << DEV_##__mask.bit_offset) & DEV_##__mask.bit_mask )
290
291#define DEVICE_GET_RATE_FIELD(__value, __mask) \
292 (int)( ((__value) & DEV_##__mask.bit_mask) >> DEV_##__mask.bit_offset )
293
294#endif /* RT2X00REG_H */ 223#endif /* RT2X00REG_H */