diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.h | 82 |
1 files changed, 72 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index ff78e52ce43c..9dbf04f0f04c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -87,10 +87,13 @@ enum data_queue_qid { | |||
87 | * | 87 | * |
88 | * @SKBDESC_DMA_MAPPED_RX: &skb_dma field has been mapped for RX | 88 | * @SKBDESC_DMA_MAPPED_RX: &skb_dma field has been mapped for RX |
89 | * @SKBDESC_DMA_MAPPED_TX: &skb_dma field has been mapped for TX | 89 | * @SKBDESC_DMA_MAPPED_TX: &skb_dma field has been mapped for TX |
90 | * @FRAME_DESC_IV_STRIPPED: Frame contained a IV/EIV provided by | ||
91 | * mac80211 but was stripped for processing by the driver. | ||
90 | */ | 92 | */ |
91 | enum skb_frame_desc_flags { | 93 | enum skb_frame_desc_flags { |
92 | SKBDESC_DMA_MAPPED_RX = (1 << 0), | 94 | SKBDESC_DMA_MAPPED_RX = 1 << 0, |
93 | SKBDESC_DMA_MAPPED_TX = (1 << 1), | 95 | SKBDESC_DMA_MAPPED_TX = 1 << 1, |
96 | FRAME_DESC_IV_STRIPPED = 1 << 2, | ||
94 | }; | 97 | }; |
95 | 98 | ||
96 | /** | 99 | /** |
@@ -104,6 +107,8 @@ enum skb_frame_desc_flags { | |||
104 | * @desc: Pointer to descriptor part of the frame. | 107 | * @desc: Pointer to descriptor part of the frame. |
105 | * Note that this pointer could point to something outside | 108 | * Note that this pointer could point to something outside |
106 | * of the scope of the skb->data pointer. | 109 | * of the scope of the skb->data pointer. |
110 | * @iv: IV data used during encryption/decryption. | ||
111 | * @eiv: EIV data used during encryption/decryption. | ||
107 | * @skb_dma: (PCI-only) the DMA address associated with the sk buffer. | 112 | * @skb_dma: (PCI-only) the DMA address associated with the sk buffer. |
108 | * @entry: The entry to which this sk buffer belongs. | 113 | * @entry: The entry to which this sk buffer belongs. |
109 | */ | 114 | */ |
@@ -113,6 +118,9 @@ struct skb_frame_desc { | |||
113 | unsigned int desc_len; | 118 | unsigned int desc_len; |
114 | void *desc; | 119 | void *desc; |
115 | 120 | ||
121 | __le32 iv; | ||
122 | __le32 eiv; | ||
123 | |||
116 | dma_addr_t skb_dma; | 124 | dma_addr_t skb_dma; |
117 | 125 | ||
118 | struct queue_entry *entry; | 126 | struct queue_entry *entry; |
@@ -132,13 +140,14 @@ static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb) | |||
132 | /** | 140 | /** |
133 | * enum rxdone_entry_desc_flags: Flags for &struct rxdone_entry_desc | 141 | * enum rxdone_entry_desc_flags: Flags for &struct rxdone_entry_desc |
134 | * | 142 | * |
135 | * @RXDONE_SIGNAL_PLCP: Does the signal field contain the plcp value, | 143 | * @RXDONE_SIGNAL_PLCP: Signal field contains the plcp value. |
136 | * or does it contain the bitrate itself. | 144 | * @RXDONE_SIGNAL_BITRATE: Signal field contains the bitrate value. |
137 | * @RXDONE_MY_BSS: Does this frame originate from device's BSS. | 145 | * @RXDONE_MY_BSS: Does this frame originate from device's BSS. |
138 | */ | 146 | */ |
139 | enum rxdone_entry_desc_flags { | 147 | enum rxdone_entry_desc_flags { |
140 | RXDONE_SIGNAL_PLCP = 1 << 0, | 148 | RXDONE_SIGNAL_PLCP = 1 << 0, |
141 | RXDONE_MY_BSS = 1 << 1, | 149 | RXDONE_SIGNAL_BITRATE = 1 << 1, |
150 | RXDONE_MY_BSS = 1 << 2, | ||
142 | }; | 151 | }; |
143 | 152 | ||
144 | /** | 153 | /** |
@@ -152,7 +161,11 @@ enum rxdone_entry_desc_flags { | |||
152 | * @size: Data size of the received frame. | 161 | * @size: Data size of the received frame. |
153 | * @flags: MAC80211 receive flags (See &enum mac80211_rx_flags). | 162 | * @flags: MAC80211 receive flags (See &enum mac80211_rx_flags). |
154 | * @dev_flags: Ralink receive flags (See &enum rxdone_entry_desc_flags). | 163 | * @dev_flags: Ralink receive flags (See &enum rxdone_entry_desc_flags). |
155 | 164 | * @cipher: Cipher type used during decryption. | |
165 | * @cipher_status: Decryption status. | ||
166 | * @iv: IV data used during decryption. | ||
167 | * @eiv: EIV data used during decryption. | ||
168 | * @icv: ICV data used during decryption. | ||
156 | */ | 169 | */ |
157 | struct rxdone_entry_desc { | 170 | struct rxdone_entry_desc { |
158 | u64 timestamp; | 171 | u64 timestamp; |
@@ -161,6 +174,12 @@ struct rxdone_entry_desc { | |||
161 | int size; | 174 | int size; |
162 | int flags; | 175 | int flags; |
163 | int dev_flags; | 176 | int dev_flags; |
177 | u8 cipher; | ||
178 | u8 cipher_status; | ||
179 | |||
180 | __le32 iv; | ||
181 | __le32 eiv; | ||
182 | __le32 icv; | ||
164 | }; | 183 | }; |
165 | 184 | ||
166 | /** | 185 | /** |
@@ -206,6 +225,10 @@ struct txdone_entry_desc { | |||
206 | * @ENTRY_TXD_BURST: This frame belongs to the same burst event. | 225 | * @ENTRY_TXD_BURST: This frame belongs to the same burst event. |
207 | * @ENTRY_TXD_ACK: An ACK is required for this frame. | 226 | * @ENTRY_TXD_ACK: An ACK is required for this frame. |
208 | * @ENTRY_TXD_RETRY_MODE: When set, the long retry count is used. | 227 | * @ENTRY_TXD_RETRY_MODE: When set, the long retry count is used. |
228 | * @ENTRY_TXD_ENCRYPT: This frame should be encrypted. | ||
229 | * @ENTRY_TXD_ENCRYPT_PAIRWISE: Use pairwise key table (instead of shared). | ||
230 | * @ENTRY_TXD_ENCRYPT_IV: Generate IV/EIV in hardware. | ||
231 | * @ENTRY_TXD_ENCRYPT_MMIC: Generate MIC in hardware. | ||
209 | */ | 232 | */ |
210 | enum txentry_desc_flags { | 233 | enum txentry_desc_flags { |
211 | ENTRY_TXD_RTS_FRAME, | 234 | ENTRY_TXD_RTS_FRAME, |
@@ -218,6 +241,10 @@ enum txentry_desc_flags { | |||
218 | ENTRY_TXD_BURST, | 241 | ENTRY_TXD_BURST, |
219 | ENTRY_TXD_ACK, | 242 | ENTRY_TXD_ACK, |
220 | ENTRY_TXD_RETRY_MODE, | 243 | ENTRY_TXD_RETRY_MODE, |
244 | ENTRY_TXD_ENCRYPT, | ||
245 | ENTRY_TXD_ENCRYPT_PAIRWISE, | ||
246 | ENTRY_TXD_ENCRYPT_IV, | ||
247 | ENTRY_TXD_ENCRYPT_MMIC, | ||
221 | }; | 248 | }; |
222 | 249 | ||
223 | /** | 250 | /** |
@@ -236,6 +263,9 @@ enum txentry_desc_flags { | |||
236 | * @ifs: IFS value. | 263 | * @ifs: IFS value. |
237 | * @cw_min: cwmin value. | 264 | * @cw_min: cwmin value. |
238 | * @cw_max: cwmax value. | 265 | * @cw_max: cwmax value. |
266 | * @cipher: Cipher type used for encryption. | ||
267 | * @key_idx: Key index used for encryption. | ||
268 | * @iv_offset: Position where IV should be inserted by hardware. | ||
239 | */ | 269 | */ |
240 | struct txentry_desc { | 270 | struct txentry_desc { |
241 | unsigned long flags; | 271 | unsigned long flags; |
@@ -252,6 +282,10 @@ struct txentry_desc { | |||
252 | short ifs; | 282 | short ifs; |
253 | short cw_min; | 283 | short cw_min; |
254 | short cw_max; | 284 | short cw_max; |
285 | |||
286 | enum cipher cipher; | ||
287 | u16 key_idx; | ||
288 | u16 iv_offset; | ||
255 | }; | 289 | }; |
256 | 290 | ||
257 | /** | 291 | /** |
@@ -335,6 +369,7 @@ enum queue_index { | |||
335 | * @length: Number of frames in queue. | 369 | * @length: Number of frames in queue. |
336 | * @index: Index pointers to entry positions in the queue, | 370 | * @index: Index pointers to entry positions in the queue, |
337 | * use &enum queue_index to get a specific index field. | 371 | * use &enum queue_index to get a specific index field. |
372 | * @txop: maximum burst time. | ||
338 | * @aifs: The aifs value for outgoing frames (field ignored in RX queue). | 373 | * @aifs: The aifs value for outgoing frames (field ignored in RX queue). |
339 | * @cw_min: The cw min value for outgoing frames (field ignored in RX queue). | 374 | * @cw_min: The cw min value for outgoing frames (field ignored in RX queue). |
340 | * @cw_max: The cw max value for outgoing frames (field ignored in RX queue). | 375 | * @cw_max: The cw max value for outgoing frames (field ignored in RX queue). |
@@ -354,6 +389,7 @@ struct data_queue { | |||
354 | unsigned short length; | 389 | unsigned short length; |
355 | unsigned short index[Q_INDEX_MAX]; | 390 | unsigned short index[Q_INDEX_MAX]; |
356 | 391 | ||
392 | unsigned short txop; | ||
357 | unsigned short aifs; | 393 | unsigned short aifs; |
358 | unsigned short cw_min; | 394 | unsigned short cw_min; |
359 | unsigned short cw_max; | 395 | unsigned short cw_max; |
@@ -484,25 +520,51 @@ static inline int rt2x00queue_threshold(struct data_queue *queue) | |||
484 | } | 520 | } |
485 | 521 | ||
486 | /** | 522 | /** |
487 | * rt2x00_desc_read - Read a word from the hardware descriptor. | 523 | * _rt2x00_desc_read - Read a word from the hardware descriptor. |
524 | * @desc: Base descriptor address | ||
525 | * @word: Word index from where the descriptor should be read. | ||
526 | * @value: Address where the descriptor value should be written into. | ||
527 | */ | ||
528 | static inline void _rt2x00_desc_read(__le32 *desc, const u8 word, __le32 *value) | ||
529 | { | ||
530 | *value = desc[word]; | ||
531 | } | ||
532 | |||
533 | /** | ||
534 | * rt2x00_desc_read - Read a word from the hardware descriptor, this | ||
535 | * function will take care of the byte ordering. | ||
488 | * @desc: Base descriptor address | 536 | * @desc: Base descriptor address |
489 | * @word: Word index from where the descriptor should be read. | 537 | * @word: Word index from where the descriptor should be read. |
490 | * @value: Address where the descriptor value should be written into. | 538 | * @value: Address where the descriptor value should be written into. |
491 | */ | 539 | */ |
492 | static inline void rt2x00_desc_read(__le32 *desc, const u8 word, u32 *value) | 540 | static inline void rt2x00_desc_read(__le32 *desc, const u8 word, u32 *value) |
493 | { | 541 | { |
494 | *value = le32_to_cpu(desc[word]); | 542 | __le32 tmp; |
543 | _rt2x00_desc_read(desc, word, &tmp); | ||
544 | *value = le32_to_cpu(tmp); | ||
545 | } | ||
546 | |||
547 | /** | ||
548 | * rt2x00_desc_write - write a word to the hardware descriptor, this | ||
549 | * function will take care of the byte ordering. | ||
550 | * @desc: Base descriptor address | ||
551 | * @word: Word index from where the descriptor should be written. | ||
552 | * @value: Value that should be written into the descriptor. | ||
553 | */ | ||
554 | static inline void _rt2x00_desc_write(__le32 *desc, const u8 word, __le32 value) | ||
555 | { | ||
556 | desc[word] = value; | ||
495 | } | 557 | } |
496 | 558 | ||
497 | /** | 559 | /** |
498 | * rt2x00_desc_write - wrote a word to the hardware descriptor. | 560 | * rt2x00_desc_write - write a word to the hardware descriptor. |
499 | * @desc: Base descriptor address | 561 | * @desc: Base descriptor address |
500 | * @word: Word index from where the descriptor should be written. | 562 | * @word: Word index from where the descriptor should be written. |
501 | * @value: Value that should be written into the descriptor. | 563 | * @value: Value that should be written into the descriptor. |
502 | */ | 564 | */ |
503 | static inline void rt2x00_desc_write(__le32 *desc, const u8 word, u32 value) | 565 | static inline void rt2x00_desc_write(__le32 *desc, const u8 word, u32 value) |
504 | { | 566 | { |
505 | desc[word] = cpu_to_le32(value); | 567 | _rt2x00_desc_write(desc, word, cpu_to_le32(value)); |
506 | } | 568 | } |
507 | 569 | ||
508 | #endif /* RT2X00QUEUE_H */ | 570 | #endif /* RT2X00QUEUE_H */ |