diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 3 |
4 files changed, 23 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 22a1a8fc6e02..7bef66def10c 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -514,9 +514,9 @@ EXPORT_SYMBOL_GPL(rt2800_write_tx_data); | |||
514 | 514 | ||
515 | static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2) | 515 | static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2) |
516 | { | 516 | { |
517 | int rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); | 517 | s8 rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); |
518 | int rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); | 518 | s8 rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); |
519 | int rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); | 519 | s8 rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); |
520 | u16 eeprom; | 520 | u16 eeprom; |
521 | u8 offset0; | 521 | u8 offset0; |
522 | u8 offset1; | 522 | u8 offset1; |
@@ -552,7 +552,7 @@ static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2) | |||
552 | * which gives less energy... | 552 | * which gives less energy... |
553 | */ | 553 | */ |
554 | rssi0 = max(rssi0, rssi1); | 554 | rssi0 = max(rssi0, rssi1); |
555 | return max(rssi0, rssi2); | 555 | return (int)max(rssi0, rssi2); |
556 | } | 556 | } |
557 | 557 | ||
558 | void rt2800_process_rxwi(struct queue_entry *entry, | 558 | void rt2800_process_rxwi(struct queue_entry *entry, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index c3e1aa7c1a80..fd356b7c0476 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -426,10 +426,14 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
426 | /* | 426 | /* |
427 | * If the data queue was below the threshold before the txdone | 427 | * If the data queue was below the threshold before the txdone |
428 | * handler we must make sure the packet queue in the mac80211 stack | 428 | * handler we must make sure the packet queue in the mac80211 stack |
429 | * is reenabled when the txdone handler has finished. | 429 | * is reenabled when the txdone handler has finished. This has to be |
430 | * serialized with rt2x00mac_tx(), otherwise we can wake up queue | ||
431 | * before it was stopped. | ||
430 | */ | 432 | */ |
433 | spin_lock_bh(&entry->queue->tx_lock); | ||
431 | if (!rt2x00queue_threshold(entry->queue)) | 434 | if (!rt2x00queue_threshold(entry->queue)) |
432 | rt2x00queue_unpause_queue(entry->queue); | 435 | rt2x00queue_unpause_queue(entry->queue); |
436 | spin_unlock_bh(&entry->queue->tx_lock); | ||
433 | } | 437 | } |
434 | EXPORT_SYMBOL_GPL(rt2x00lib_txdone); | 438 | EXPORT_SYMBOL_GPL(rt2x00lib_txdone); |
435 | 439 | ||
@@ -1220,7 +1224,8 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) | |||
1220 | cancel_work_sync(&rt2x00dev->rxdone_work); | 1224 | cancel_work_sync(&rt2x00dev->rxdone_work); |
1221 | cancel_work_sync(&rt2x00dev->txdone_work); | 1225 | cancel_work_sync(&rt2x00dev->txdone_work); |
1222 | } | 1226 | } |
1223 | destroy_workqueue(rt2x00dev->workqueue); | 1227 | if (rt2x00dev->workqueue) |
1228 | destroy_workqueue(rt2x00dev->workqueue); | ||
1224 | 1229 | ||
1225 | /* | 1230 | /* |
1226 | * Free the tx status fifo. | 1231 | * Free the tx status fifo. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index ede3c58e6783..2df2eb6d3e06 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -152,13 +152,22 @@ void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
152 | if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false))) | 152 | if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false))) |
153 | goto exit_fail; | 153 | goto exit_fail; |
154 | 154 | ||
155 | /* | ||
156 | * Pausing queue has to be serialized with rt2x00lib_txdone(). Note | ||
157 | * we should not use spin_lock_bh variant as bottom halve was already | ||
158 | * disabled before ieee80211_xmit() call. | ||
159 | */ | ||
160 | spin_lock(&queue->tx_lock); | ||
155 | if (rt2x00queue_threshold(queue)) | 161 | if (rt2x00queue_threshold(queue)) |
156 | rt2x00queue_pause_queue(queue); | 162 | rt2x00queue_pause_queue(queue); |
163 | spin_unlock(&queue->tx_lock); | ||
157 | 164 | ||
158 | return; | 165 | return; |
159 | 166 | ||
160 | exit_fail: | 167 | exit_fail: |
168 | spin_lock(&queue->tx_lock); | ||
161 | rt2x00queue_pause_queue(queue); | 169 | rt2x00queue_pause_queue(queue); |
170 | spin_unlock(&queue->tx_lock); | ||
162 | exit_free_skb: | 171 | exit_free_skb: |
163 | ieee80211_free_txskb(hw, skb); | 172 | ieee80211_free_txskb(hw, skb); |
164 | } | 173 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 5adfb3eab9cd..9b1b2b7a7807 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -619,6 +619,9 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb, | |||
619 | else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags)) | 619 | else if (test_bit(REQUIRE_DMA, &queue->rt2x00dev->cap_flags)) |
620 | rt2x00queue_align_frame(skb); | 620 | rt2x00queue_align_frame(skb); |
621 | 621 | ||
622 | /* | ||
623 | * That function must be called with bh disabled. | ||
624 | */ | ||
622 | spin_lock(&queue->tx_lock); | 625 | spin_lock(&queue->tx_lock); |
623 | 626 | ||
624 | if (unlikely(rt2x00queue_full(queue))) { | 627 | if (unlikely(rt2x00queue_full(queue))) { |