diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800lib.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 525267d4cc3e..28d82ce05527 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -281,6 +281,60 @@ int rt2800_wait_wpdma_ready(struct rt2x00_dev *rt2x00dev) | |||
281 | } | 281 | } |
282 | EXPORT_SYMBOL_GPL(rt2800_wait_wpdma_ready); | 282 | EXPORT_SYMBOL_GPL(rt2800_wait_wpdma_ready); |
283 | 283 | ||
284 | void rt2800_write_txwi(struct sk_buff *skb, struct txentry_desc *txdesc) | ||
285 | { | ||
286 | __le32 *txwi = (__le32 *)(skb->data - TXWI_DESC_SIZE); | ||
287 | u32 word; | ||
288 | |||
289 | /* | ||
290 | * Initialize TX Info descriptor | ||
291 | */ | ||
292 | rt2x00_desc_read(txwi, 0, &word); | ||
293 | rt2x00_set_field32(&word, TXWI_W0_FRAG, | ||
294 | test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | ||
295 | rt2x00_set_field32(&word, TXWI_W0_MIMO_PS, 0); | ||
296 | rt2x00_set_field32(&word, TXWI_W0_CF_ACK, 0); | ||
297 | rt2x00_set_field32(&word, TXWI_W0_TS, | ||
298 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); | ||
299 | rt2x00_set_field32(&word, TXWI_W0_AMPDU, | ||
300 | test_bit(ENTRY_TXD_HT_AMPDU, &txdesc->flags)); | ||
301 | rt2x00_set_field32(&word, TXWI_W0_MPDU_DENSITY, txdesc->mpdu_density); | ||
302 | rt2x00_set_field32(&word, TXWI_W0_TX_OP, txdesc->txop); | ||
303 | rt2x00_set_field32(&word, TXWI_W0_MCS, txdesc->mcs); | ||
304 | rt2x00_set_field32(&word, TXWI_W0_BW, | ||
305 | test_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags)); | ||
306 | rt2x00_set_field32(&word, TXWI_W0_SHORT_GI, | ||
307 | test_bit(ENTRY_TXD_HT_SHORT_GI, &txdesc->flags)); | ||
308 | rt2x00_set_field32(&word, TXWI_W0_STBC, txdesc->stbc); | ||
309 | rt2x00_set_field32(&word, TXWI_W0_PHYMODE, txdesc->rate_mode); | ||
310 | rt2x00_desc_write(txwi, 0, word); | ||
311 | |||
312 | rt2x00_desc_read(txwi, 1, &word); | ||
313 | rt2x00_set_field32(&word, TXWI_W1_ACK, | ||
314 | test_bit(ENTRY_TXD_ACK, &txdesc->flags)); | ||
315 | rt2x00_set_field32(&word, TXWI_W1_NSEQ, | ||
316 | test_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags)); | ||
317 | rt2x00_set_field32(&word, TXWI_W1_BW_WIN_SIZE, txdesc->ba_size); | ||
318 | rt2x00_set_field32(&word, TXWI_W1_WIRELESS_CLI_ID, | ||
319 | test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags) ? | ||
320 | txdesc->key_idx : 0xff); | ||
321 | rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT, | ||
322 | txdesc->length); | ||
323 | rt2x00_set_field32(&word, TXWI_W1_PACKETID, txdesc->queue + 1); | ||
324 | rt2x00_desc_write(txwi, 1, word); | ||
325 | |||
326 | /* | ||
327 | * Always write 0 to IV/EIV fields, hardware will insert the IV | ||
328 | * from the IVEIV register when TXD_W3_WIV is set to 0. | ||
329 | * When TXD_W3_WIV is set to 1 it will use the IV data | ||
330 | * from the descriptor. The TXWI_W1_WIRELESS_CLI_ID indicates which | ||
331 | * crypto entry in the registers should be used to encrypt the frame. | ||
332 | */ | ||
333 | _rt2x00_desc_write(txwi, 2, 0 /* skbdesc->iv[0] */); | ||
334 | _rt2x00_desc_write(txwi, 3, 0 /* skbdesc->iv[1] */); | ||
335 | } | ||
336 | EXPORT_SYMBOL_GPL(rt2800_write_txwi); | ||
337 | |||
284 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS | 338 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS |
285 | const struct rt2x00debug rt2800_rt2x00debug = { | 339 | const struct rt2x00debug rt2800_rt2x00debug = { |
286 | .owner = THIS_MODULE, | 340 | .owner = THIS_MODULE, |