mei: me: add cannon point device ids
[linux/fpc-iii.git] / drivers / net / wireless / rsi / rsi_91x_usb_ops.c
blob465692b3c3514e022379654e74032b344c18c49c
1 /**
2 * Copyright (c) 2014 Redpine Signals Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include <linux/firmware.h>
19 #include "rsi_usb.h"
21 /**
22 * rsi_usb_rx_thread() - This is a kernel thread to receive the packets from
23 * the USB device.
24 * @common: Pointer to the driver private structure.
26 * Return: None.
28 void rsi_usb_rx_thread(struct rsi_common *common)
30 struct rsi_hw *adapter = common->priv;
31 struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
32 int status;
34 do {
35 rsi_wait_event(&dev->rx_thread.event, EVENT_WAIT_FOREVER);
37 if (atomic_read(&dev->rx_thread.thread_done))
38 goto out;
40 mutex_lock(&common->rx_lock);
41 status = rsi_read_pkt(common, 0);
42 if (status) {
43 rsi_dbg(ERR_ZONE, "%s: Failed To read data", __func__);
44 mutex_unlock(&common->rx_lock);
45 return;
47 mutex_unlock(&common->rx_lock);
48 rsi_reset_event(&dev->rx_thread.event);
49 if (adapter->rx_urb_submit(adapter)) {
50 rsi_dbg(ERR_ZONE,
51 "%s: Failed in urb submission", __func__);
52 return;
54 } while (1);
56 out:
57 rsi_dbg(INFO_ZONE, "%s: Terminated thread\n", __func__);
58 complete_and_exit(&dev->rx_thread.completion, 0);