diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00dev.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 84eb6ad3637..9bffe8438d1 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/log2.h> | ||
30 | 31 | ||
31 | #include "rt2x00.h" | 32 | #include "rt2x00.h" |
32 | #include "rt2x00lib.h" | 33 | #include "rt2x00lib.h" |
@@ -70,6 +71,7 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev) | |||
70 | */ | 71 | */ |
71 | rt2x00queue_start_queues(rt2x00dev); | 72 | rt2x00queue_start_queues(rt2x00dev); |
72 | rt2x00link_start_tuner(rt2x00dev); | 73 | rt2x00link_start_tuner(rt2x00dev); |
74 | rt2x00link_start_agc(rt2x00dev); | ||
73 | 75 | ||
74 | /* | 76 | /* |
75 | * Start watchdog monitoring. | 77 | * Start watchdog monitoring. |
@@ -92,6 +94,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev) | |||
92 | /* | 94 | /* |
93 | * Stop all queues | 95 | * Stop all queues |
94 | */ | 96 | */ |
97 | rt2x00link_stop_agc(rt2x00dev); | ||
95 | rt2x00link_stop_tuner(rt2x00dev); | 98 | rt2x00link_stop_tuner(rt2x00dev); |
96 | rt2x00queue_stop_queues(rt2x00dev); | 99 | rt2x00queue_stop_queues(rt2x00dev); |
97 | rt2x00queue_flush_queues(rt2x00dev, true); | 100 | rt2x00queue_flush_queues(rt2x00dev, true); |
@@ -350,10 +353,14 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
350 | * which would allow the rc algorithm to better decide on | 353 | * which would allow the rc algorithm to better decide on |
351 | * which rates are suitable. | 354 | * which rates are suitable. |
352 | */ | 355 | */ |
353 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { | 356 | if (test_bit(TXDONE_AMPDU, &txdesc->flags) || |
357 | tx_info->flags & IEEE80211_TX_CTL_AMPDU) { | ||
354 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU; | 358 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU; |
355 | tx_info->status.ampdu_len = 1; | 359 | tx_info->status.ampdu_len = 1; |
356 | tx_info->status.ampdu_ack_len = success ? 1 : 0; | 360 | tx_info->status.ampdu_ack_len = success ? 1 : 0; |
361 | |||
362 | if (!success) | ||
363 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; | ||
357 | } | 364 | } |
358 | 365 | ||
359 | if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) { | 366 | if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) { |
@@ -511,8 +518,6 @@ void rt2x00lib_rxdone(struct queue_entry *entry) | |||
511 | (rxdesc.size > header_length) && | 518 | (rxdesc.size > header_length) && |
512 | (rxdesc.dev_flags & RXDONE_L2PAD)) | 519 | (rxdesc.dev_flags & RXDONE_L2PAD)) |
513 | rt2x00queue_remove_l2pad(entry->skb, header_length); | 520 | rt2x00queue_remove_l2pad(entry->skb, header_length); |
514 | else | ||
515 | rt2x00queue_align_payload(entry->skb, header_length); | ||
516 | 521 | ||
517 | /* Trim buffer to correct size */ | 522 | /* Trim buffer to correct size */ |
518 | skb_trim(entry->skb, rxdesc.size); | 523 | skb_trim(entry->skb, rxdesc.size); |
@@ -811,13 +816,18 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
811 | */ | 816 | */ |
812 | if (test_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags)) { | 817 | if (test_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags)) { |
813 | /* | 818 | /* |
814 | * Allocate txstatus fifo and tasklet, we use a size of 512 | 819 | * Allocate the txstatus fifo. In the worst case the tx |
815 | * for the kfifo which is big enough to store 512/4=128 tx | 820 | * status fifo has to hold the tx status of all entries |
816 | * status reports. In the worst case (tx status for all tx | 821 | * in all tx queues. Hence, calculate the kfifo size as |
817 | * queues gets reported before we've got a chance to handle | 822 | * tx_queues * entry_num and round up to the nearest |
818 | * them) 24*4=384 tx status reports need to be cached. | 823 | * power of 2. |
819 | */ | 824 | */ |
820 | status = kfifo_alloc(&rt2x00dev->txstatus_fifo, 512, | 825 | int kfifo_size = |
826 | roundup_pow_of_two(rt2x00dev->ops->tx_queues * | ||
827 | rt2x00dev->ops->tx->entry_num * | ||
828 | sizeof(u32)); | ||
829 | |||
830 | status = kfifo_alloc(&rt2x00dev->txstatus_fifo, kfifo_size, | ||
821 | GFP_KERNEL); | 831 | GFP_KERNEL); |
822 | if (status) | 832 | if (status) |
823 | return status; | 833 | return status; |