/** * rsi_usb_rx_thread() - This is a kernel thread to receive the packets from * the USB device. * @common: Pointer to the driver private structure. * * Return: None. */ 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; int status; do { rsi_wait_event(&dev->rx_thread.event, EVENT_WAIT_FOREVER); if (atomic_read(&dev->rx_thread.thread_done)) goto out; mutex_lock(&common->rx_lock); status = rsi_read_pkt(common, 0); if (status) { rsi_dbg(ERR_ZONE, "%s: Failed To read data", __func__); mutex_unlock(&common->rx_lock); return; } mutex_unlock(&common->rx_lock); rsi_reset_event(&dev->rx_thread.event); if (adapter->rx_urb_submit(adapter)) { rsi_dbg(ERR_ZONE, "%s: Failed in urb submission", __func__); return; } } while (1); out: rsi_dbg(INFO_ZONE, "%s: Terminated thread\n", __func__); complete_and_exit(&dev->rx_thread.completion, 0); }
static void rsi_coex_scheduler_thread(struct rsi_common *common) { struct rsi_coex_ctrl_block *coex_cb = (struct rsi_coex_ctrl_block *)common->coex_cb; u32 timeout = EVENT_WAIT_FOREVER; do { rsi_wait_event(&coex_cb->coex_tx_thread.event, timeout); rsi_reset_event(&coex_cb->coex_tx_thread.event); rsi_coex_sched_tx_pkts(coex_cb); } while (atomic_read(&coex_cb->coex_tx_thread.thread_done) == 0); complete_and_exit(&coex_cb->coex_tx_thread.completion, 0); }