old mode 100644new mode 100755.. | .. |
---|
14 | 14 | #include "rwnx_defs.h" |
---|
15 | 15 | #include "usb_host.h" |
---|
16 | 16 | #include "rwnx_platform.h" |
---|
| 17 | +#include "rwnx_wakelock.h" |
---|
17 | 18 | |
---|
18 | 19 | void aicwf_usb_tx_flowctrl(struct rwnx_hw *rwnx_hw, bool state) |
---|
19 | 20 | { |
---|
20 | 21 | struct rwnx_vif *rwnx_vif; |
---|
21 | 22 | list_for_each_entry(rwnx_vif, &rwnx_hw->vifs, list) { |
---|
22 | 23 | if (!rwnx_vif->up) |
---|
| 24 | + continue; |
---|
| 25 | + if (!rwnx_vif->ndev) |
---|
23 | 26 | continue; |
---|
24 | 27 | if (state) |
---|
25 | 28 | netif_stop_queue(rwnx_vif->ndev); |
---|
.. | .. |
---|
151 | 154 | spin_unlock_irqrestore(&rx_priv->rxqlock, flags); |
---|
152 | 155 | usb_err("rx_priv->rxq is over flow!!!\n"); |
---|
153 | 156 | aicwf_dev_skb_free(skb); |
---|
| 157 | + aicwf_usb_rx_buf_put(usb_dev, usb_buf); |
---|
154 | 158 | return; |
---|
155 | 159 | } |
---|
156 | 160 | spin_unlock_irqrestore(&rx_priv->rxqlock, flags); |
---|
.. | .. |
---|
294 | 298 | } |
---|
295 | 299 | if (!wait_for_completion_interruptible(&bus->bustx_trgg)) { |
---|
296 | 300 | if (usbdev->bus_if->state == BUS_DOWN_ST) |
---|
297 | | - break; |
---|
| 301 | + continue; |
---|
| 302 | + rwnx_wakeup_lock(usbdev->rwnx_hw->ws_tx); |
---|
298 | 303 | if (usbdev->tx_post_count > 0) |
---|
299 | 304 | aicwf_usb_tx_process(usbdev); |
---|
| 305 | + rwnx_wakeup_unlock(usbdev->rwnx_hw->ws_tx); |
---|
300 | 306 | } |
---|
301 | 307 | } |
---|
302 | 308 | |
---|
.. | .. |
---|
307 | 313 | { |
---|
308 | 314 | struct aicwf_rx_priv *rx_priv = (struct aicwf_rx_priv *)data; |
---|
309 | 315 | struct aicwf_bus *bus_if = rx_priv->usbdev->bus_if; |
---|
| 316 | + struct aic_usb_dev *usbdev = rx_priv->usbdev; |
---|
310 | 317 | |
---|
311 | 318 | while (1) { |
---|
312 | 319 | if (kthread_should_stop()) { |
---|
.. | .. |
---|
315 | 322 | } |
---|
316 | 323 | if (!wait_for_completion_interruptible(&bus_if->busrx_trgg)) { |
---|
317 | 324 | if (bus_if->state == BUS_DOWN_ST) |
---|
318 | | - break; |
---|
| 325 | + continue; |
---|
| 326 | + rwnx_wakeup_lock(usbdev->rwnx_hw->ws_rx); |
---|
319 | 327 | aicwf_process_rxframes(rx_priv); |
---|
| 328 | + rwnx_wakeup_unlock(usbdev->rwnx_hw->ws_rx); |
---|
320 | 329 | } |
---|
321 | 330 | } |
---|
322 | 331 | |
---|
.. | .. |
---|
554 | 563 | complete(&bus_if->bustx_trgg); |
---|
555 | 564 | ret = 0; |
---|
556 | 565 | |
---|
557 | | - flow_ctrl: |
---|
| 566 | +flow_ctrl: |
---|
558 | 567 | spin_lock_irqsave(&usb_dev->tx_flow_lock, flags); |
---|
559 | 568 | if (usb_dev->tx_free_count < AICWF_USB_TX_LOW_WATER) { |
---|
560 | 569 | usb_dev->tbusy = true; |
---|
.. | .. |
---|
778 | 787 | exit: |
---|
779 | 788 | return ret; |
---|
780 | 789 | } |
---|
781 | | - |
---|
782 | | - |
---|
783 | 790 | |
---|
784 | 791 | static struct aicwf_bus_ops aicwf_usb_bus_ops = { |
---|
785 | 792 | .start = aicwf_usb_bus_start, |
---|