diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800lib.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 28d82ce05527..7410ac1acaff 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -335,6 +335,50 @@ void rt2800_write_txwi(struct sk_buff *skb, struct txentry_desc *txdesc) | |||
335 | } | 335 | } |
336 | EXPORT_SYMBOL_GPL(rt2800_write_txwi); | 336 | EXPORT_SYMBOL_GPL(rt2800_write_txwi); |
337 | 337 | ||
338 | void rt2800_process_rxwi(struct sk_buff *skb, struct rxdone_entry_desc *rxdesc) | ||
339 | { | ||
340 | __le32 *rxwi = (__le32 *) skb->data; | ||
341 | u32 word; | ||
342 | |||
343 | rt2x00_desc_read(rxwi, 0, &word); | ||
344 | |||
345 | rxdesc->cipher = rt2x00_get_field32(word, RXWI_W0_UDF); | ||
346 | rxdesc->size = rt2x00_get_field32(word, RXWI_W0_MPDU_TOTAL_BYTE_COUNT); | ||
347 | |||
348 | rt2x00_desc_read(rxwi, 1, &word); | ||
349 | |||
350 | if (rt2x00_get_field32(word, RXWI_W1_SHORT_GI)) | ||
351 | rxdesc->flags |= RX_FLAG_SHORT_GI; | ||
352 | |||
353 | if (rt2x00_get_field32(word, RXWI_W1_BW)) | ||
354 | rxdesc->flags |= RX_FLAG_40MHZ; | ||
355 | |||
356 | /* | ||
357 | * Detect RX rate, always use MCS as signal type. | ||
358 | */ | ||
359 | rxdesc->dev_flags |= RXDONE_SIGNAL_MCS; | ||
360 | rxdesc->signal = rt2x00_get_field32(word, RXWI_W1_MCS); | ||
361 | rxdesc->rate_mode = rt2x00_get_field32(word, RXWI_W1_PHYMODE); | ||
362 | |||
363 | /* | ||
364 | * Mask of 0x8 bit to remove the short preamble flag. | ||
365 | */ | ||
366 | if (rxdesc->rate_mode == RATE_MODE_CCK) | ||
367 | rxdesc->signal &= ~0x8; | ||
368 | |||
369 | rt2x00_desc_read(rxwi, 2, &word); | ||
370 | |||
371 | rxdesc->rssi = | ||
372 | (rt2x00_get_field32(word, RXWI_W2_RSSI0) + | ||
373 | rt2x00_get_field32(word, RXWI_W2_RSSI1)) / 2; | ||
374 | |||
375 | /* | ||
376 | * Remove RXWI descriptor from start of buffer. | ||
377 | */ | ||
378 | skb_pull(skb, RXWI_DESC_SIZE); | ||
379 | } | ||
380 | EXPORT_SYMBOL_GPL(rt2800_process_rxwi); | ||
381 | |||
338 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS | 382 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS |
339 | const struct rt2x00debug rt2800_rt2x00debug = { | 383 | const struct rt2x00debug rt2800_rt2x00debug = { |
340 | .owner = THIS_MODULE, | 384 | .owner = THIS_MODULE, |