diff options
Diffstat (limited to 'drivers/net/wireless/rsi/rsi_91x_usb_ops.c')
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_usb_ops.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c index fc25b1b3c8cd..b1687d22f73f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c @@ -29,44 +29,33 @@ void rsi_usb_rx_thread(struct rsi_common *common) { struct rsi_hw *adapter = common->priv; struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev; - struct rx_usb_ctrl_block *rx_cb; - int status, idx, num_rx_cb; + int status; + struct sk_buff *skb; - num_rx_cb = (adapter->priv->coex_mode > 1 ? 2 : 1); do { rsi_wait_event(&dev->rx_thread.event, EVENT_WAIT_FOREVER); + rsi_reset_event(&dev->rx_thread.event); - if (atomic_read(&dev->rx_thread.thread_done)) - goto out; - - for (idx = 0; idx < num_rx_cb; idx++) { - rx_cb = &dev->rx_cb[idx]; - if (!rx_cb->pend) - continue; + while (true) { + if (atomic_read(&dev->rx_thread.thread_done)) + goto out; - mutex_lock(&common->rx_lock); - status = rsi_read_pkt(common, rx_cb->rx_buffer, 0); + skb = skb_dequeue(&dev->rx_q); + if (!skb) + break; + status = rsi_read_pkt(common, skb->data, 0); if (status) { rsi_dbg(ERR_ZONE, "%s: Failed To read data", __func__); - mutex_unlock(&common->rx_lock); break; } - rx_cb->pend = 0; - mutex_unlock(&common->rx_lock); - - if (adapter->rx_urb_submit(adapter, rx_cb->ep_num)) { - rsi_dbg(ERR_ZONE, - "%s: Failed in urb submission", - __func__); - return; - } + dev_kfree_skb(skb); } - rsi_reset_event(&dev->rx_thread.event); } while (1); out: rsi_dbg(INFO_ZONE, "%s: Terminated thread\n", __func__); + skb_queue_purge(&dev->rx_q); complete_and_exit(&dev->rx_thread.completion, 0); } |