aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtlwifi/pci.c')
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 82d3afcfecd1..31138fdad1f7 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1273,17 +1273,18 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
1273 *after reset, release previous pending packet, 1273 *after reset, release previous pending packet,
1274 *and force the tx idx to the first one 1274 *and force the tx idx to the first one
1275 */ 1275 */
1276 spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
1277 for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) { 1276 for (i = 0; i < RTL_PCI_MAX_TX_QUEUE_COUNT; i++) {
1278 if (rtlpci->tx_ring[i].desc) { 1277 if (rtlpci->tx_ring[i].desc) {
1279 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[i]; 1278 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[i];
1280 1279
1281 while (skb_queue_len(&ring->queue)) { 1280 while (skb_queue_len(&ring->queue)) {
1282 struct rtl_tx_desc *entry = 1281 struct rtl_tx_desc *entry;
1283 &ring->desc[ring->idx]; 1282 struct sk_buff *skb;
1284 struct sk_buff *skb =
1285 __skb_dequeue(&ring->queue);
1286 1283
1284 spin_lock_irqsave(&rtlpriv->locks.irq_th_lock,
1285 flags);
1286 entry = &ring->desc[ring->idx];
1287 skb = __skb_dequeue(&ring->queue);
1287 pci_unmap_single(rtlpci->pdev, 1288 pci_unmap_single(rtlpci->pdev,
1288 rtlpriv->cfg->ops-> 1289 rtlpriv->cfg->ops->
1289 get_desc((u8 *) 1290 get_desc((u8 *)
@@ -1291,15 +1292,15 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
1291 true, 1292 true,
1292 HW_DESC_TXBUFF_ADDR), 1293 HW_DESC_TXBUFF_ADDR),
1293 skb->len, PCI_DMA_TODEVICE); 1294 skb->len, PCI_DMA_TODEVICE);
1294 kfree_skb(skb);
1295 ring->idx = (ring->idx + 1) % ring->entries; 1295 ring->idx = (ring->idx + 1) % ring->entries;
1296 spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock,
1297 flags);
1298 kfree_skb(skb);
1296 } 1299 }
1297 ring->idx = 0; 1300 ring->idx = 0;
1298 } 1301 }
1299 } 1302 }
1300 1303
1301 spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
1302
1303 return 0; 1304 return 0;
1304} 1305}
1305 1306