aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00lib.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h65
1 files changed, 54 insertions, 11 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index a631613177d0..39e00b3d7811 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -32,8 +32,8 @@
32 * Interval defines 32 * Interval defines
33 * Both the link tuner as the rfkill will be called once per second. 33 * Both the link tuner as the rfkill will be called once per second.
34 */ 34 */
35#define LINK_TUNE_INTERVAL ( round_jiffies_relative(HZ) ) 35#define LINK_TUNE_INTERVAL round_jiffies_relative(HZ)
36#define RFKILL_POLL_INTERVAL ( 1000 ) 36#define RFKILL_POLL_INTERVAL 1000
37 37
38/* 38/*
39 * rt2x00_rate: Per rate device information 39 * rt2x00_rate: Per rate device information
@@ -48,6 +48,7 @@ struct rt2x00_rate {
48 unsigned short ratemask; 48 unsigned short ratemask;
49 49
50 unsigned short plcp; 50 unsigned short plcp;
51 unsigned short mcs;
51}; 52};
52 53
53extern const struct rt2x00_rate rt2x00_supported_rates[12]; 54extern const struct rt2x00_rate rt2x00_supported_rates[12];
@@ -57,6 +58,14 @@ static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value)
57 return &rt2x00_supported_rates[hw_value & 0xff]; 58 return &rt2x00_supported_rates[hw_value & 0xff];
58} 59}
59 60
61#define RATE_MCS(__mode, __mcs) \
62 ( (((__mode) & 0x00ff) << 8) | ((__mcs) & 0x00ff) )
63
64static inline int rt2x00_get_rate_mcs(const u16 mcs_value)
65{
66 return (mcs_value & 0x00ff);
67}
68
60/* 69/*
61 * Radio control handlers. 70 * Radio control handlers.
62 */ 71 */
@@ -113,6 +122,23 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
113void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb); 122void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
114 123
115/** 124/**
125 * rt2x00queue_payload_align - Align 802.11 payload to 4-byte boundary
126 * @skb: The skb to align
127 * @l2pad: Should L2 padding be used
128 * @header_length: Length of 802.11 header
129 *
130 * This function prepares the @skb to be send to the device or mac80211.
131 * If @l2pad is set to true padding will occur between the 802.11 header
132 * and payload. Otherwise the padding will be done in front of the 802.11
133 * header.
134 * When @l2pad is set the function will check for the &SKBDESC_L2_PADDED
135 * flag in &skb_frame_desc. If that flag is set, the padding is removed
136 * and the flag cleared. Otherwise the padding is added and the flag is set.
137 */
138void rt2x00queue_payload_align(struct sk_buff *skb,
139 bool l2pad, unsigned int header_length);
140
141/**
116 * rt2x00queue_write_tx_frame - Write TX frame to hardware 142 * rt2x00queue_write_tx_frame - Write TX frame to hardware
117 * @queue: Queue over which the frame should be send 143 * @queue: Queue over which the frame should be send
118 * @skb: The skb to send 144 * @skb: The skb to send
@@ -295,10 +321,12 @@ void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry,
295 struct txentry_desc *txdesc); 321 struct txentry_desc *txdesc);
296unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev, 322unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
297 struct sk_buff *skb); 323 struct sk_buff *skb);
298void rt2x00crypto_tx_copy_iv(struct sk_buff *skb, unsigned int iv_len); 324void rt2x00crypto_tx_copy_iv(struct sk_buff *skb,
299void rt2x00crypto_tx_remove_iv(struct sk_buff *skb, unsigned int iv_len); 325 struct txentry_desc *txdesc);
300void rt2x00crypto_tx_insert_iv(struct sk_buff *skb); 326void rt2x00crypto_tx_remove_iv(struct sk_buff *skb,
301void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, unsigned int align, 327 struct txentry_desc *txdesc);
328void rt2x00crypto_tx_insert_iv(struct sk_buff *skb, unsigned int header_length);
329void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, bool l2pad,
302 unsigned int header_length, 330 unsigned int header_length,
303 struct rxdone_entry_desc *rxdesc); 331 struct rxdone_entry_desc *rxdesc);
304#else 332#else
@@ -319,21 +347,21 @@ static inline unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev
319} 347}
320 348
321static inline void rt2x00crypto_tx_copy_iv(struct sk_buff *skb, 349static inline void rt2x00crypto_tx_copy_iv(struct sk_buff *skb,
322 unsigned int iv_len) 350 struct txentry_desc *txdesc)
323{ 351{
324} 352}
325 353
326static inline void rt2x00crypto_tx_remove_iv(struct sk_buff *skb, 354static inline void rt2x00crypto_tx_remove_iv(struct sk_buff *skb,
327 unsigned int iv_len) 355 struct txentry_desc *txdesc)
328{ 356{
329} 357}
330 358
331static inline void rt2x00crypto_tx_insert_iv(struct sk_buff *skb) 359static inline void rt2x00crypto_tx_insert_iv(struct sk_buff *skb,
360 unsigned int header_length)
332{ 361{
333} 362}
334 363
335static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, 364static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, bool l2pad,
336 unsigned int align,
337 unsigned int header_length, 365 unsigned int header_length,
338 struct rxdone_entry_desc *rxdesc) 366 struct rxdone_entry_desc *rxdesc)
339{ 367{
@@ -341,6 +369,21 @@ static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb,
341#endif /* CONFIG_RT2X00_LIB_CRYPTO */ 369#endif /* CONFIG_RT2X00_LIB_CRYPTO */
342 370
343/* 371/*
372 * HT handlers.
373 */
374#ifdef CONFIG_RT2X00_LIB_HT
375void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
376 struct txentry_desc *txdesc,
377 const struct rt2x00_rate *hwrate);
378#else
379static inline void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
380 struct txentry_desc *txdesc,
381 const struct rt2x00_rate *hwrate)
382{
383}
384#endif /* CONFIG_RT2X00_LIB_HT */
385
386/*
344 * RFkill handlers. 387 * RFkill handlers.
345 */ 388 */
346#ifdef CONFIG_RT2X00_LIB_RFKILL 389#ifdef CONFIG_RT2X00_LIB_RFKILL