• Home
  • Raw
  • Download

Lines Matching +full:tx +full:- +full:device

3  * USB specific TX handling
6 * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
35 * Intel Corporation <linux-wimax@intel.com>
37 * - Initial implementation
38 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
39 * - Split transport/device specific
42 * Takes the TX messages in the i2400m's driver TX FIFO and sends them
43 * to the device until there are no more.
52 * USB bulk out, tell the TX FIFO code we have sent it; query for
56 * usb_autopm_disable() for each transaction; this way when the device
65 * i2400mu_bus_tx_kick() - Called by the tx.c code when there
71 #include "i2400m-usb.h"
74 #define D_SUBMODULE tx
75 #include "usb-debug-levels.h"
79 * Get the next TX message in the TX FIFO and send it to the device
91 struct i2400m *i2400m = &i2400mu->i2400m; in i2400mu_tx()
92 struct device *dev = &i2400mu->usb_iface->dev; in i2400mu_tx()
97 do_autopm = atomic_read(&i2400mu->do_autopm); in i2400mu_tx()
99 usb_autopm_get_interface(i2400mu->usb_iface) : 0; in i2400mu_tx()
101 dev_err(dev, "TX: can't get autopm: %d\n", result); in i2400mu_tx()
104 epd = usb_get_epd(i2400mu->usb_iface, i2400mu->endpoint_cfg.bulk_out); in i2400mu_tx()
105 usb_pipe = usb_sndbulkpipe(i2400mu->usb_dev, epd->bEndpointAddress); in i2400mu_tx()
107 result = usb_bulk_msg(i2400mu->usb_dev, usb_pipe, in i2400mu_tx()
109 usb_mark_last_busy(i2400mu->usb_dev); in i2400mu_tx()
113 dev_err(dev, "TX: short write (%d B vs %zu " in i2400mu_tx()
115 result = -EIO; in i2400mu_tx()
118 case -EPIPE: in i2400mu_tx()
120 * Stall -- maybe the device is choking with our in i2400mu_tx()
129 if (edc_inc(&i2400mu->urb_edc, in i2400mu_tx()
131 dev_err(dev, "BM-CMD: too many stalls in " in i2400mu_tx()
132 "URB; resetting device\n"); in i2400mu_tx()
133 usb_queue_reset_device(i2400mu->usb_iface); in i2400mu_tx()
135 usb_clear_halt(i2400mu->usb_dev, usb_pipe); in i2400mu_tx()
136 msleep(10); /* give the device some time */ in i2400mu_tx()
140 case -EINVAL: /* while removing driver */ in i2400mu_tx()
141 case -ENODEV: /* dev disconnect ... */ in i2400mu_tx()
142 case -ENOENT: /* just ignore it */ in i2400mu_tx()
143 case -ESHUTDOWN: /* and exit */ in i2400mu_tx()
144 case -ECONNRESET: in i2400mu_tx()
145 result = -ESHUTDOWN; in i2400mu_tx()
148 if (edc_inc(&i2400mu->urb_edc, in i2400mu_tx()
150 dev_err(dev, "TX: maximum errors in URB " in i2400mu_tx()
151 "exceeded; resetting device\n"); in i2400mu_tx()
152 usb_queue_reset_device(i2400mu->usb_iface); in i2400mu_tx()
154 dev_err(dev, "TX: cannot send URB; retrying. " in i2400mu_tx()
156 (void *) tx_msg - i2400m->tx_buf, in i2400mu_tx()
162 usb_autopm_put_interface(i2400mu->usb_iface); in i2400mu_tx()
169 * Get the next TX message in the TX FIFO and send it to the device
172 * fails on hard error (failing to tx a buffer not being one of them,
181 struct i2400m *i2400m = &i2400mu->i2400m; in i2400mu_txd()
182 struct device *dev = &i2400mu->usb_iface->dev; in i2400mu_txd()
189 spin_lock_irqsave(&i2400m->tx_lock, flags); in i2400mu_txd()
190 BUG_ON(i2400mu->tx_kthread != NULL); in i2400mu_txd()
191 i2400mu->tx_kthread = current; in i2400mu_txd()
192 spin_unlock_irqrestore(&i2400m->tx_lock, flags); in i2400mu_txd()
195 d_printf(2, dev, "TX: waiting for messages\n"); in i2400mu_txd()
198 i2400mu->tx_wq, in i2400mu_txd()
205 d_printf(2, dev, "TX: submitting %zu bytes\n", tx_msg_size); in i2400mu_txd()
212 spin_lock_irqsave(&i2400m->tx_lock, flags); in i2400mu_txd()
213 i2400mu->tx_kthread = NULL; in i2400mu_txd()
214 spin_unlock_irqrestore(&i2400m->tx_lock, flags); in i2400mu_txd()
222 * i2400m TX engine notifies us that there is data in the FIFO ready
223 * for TX
232 struct device *dev = &i2400mu->usb_iface->dev; in i2400mu_bus_tx_kick()
235 wake_up_all(&i2400mu->tx_wq); in i2400mu_bus_tx_kick()
243 struct i2400m *i2400m = &i2400mu->i2400m; in i2400mu_tx_setup()
244 struct device *dev = &i2400mu->usb_iface->dev; in i2400mu_tx_setup()
245 struct wimax_dev *wimax_dev = &i2400m->wimax_dev; in i2400mu_tx_setup()
248 kthread = kthread_run(i2400mu_txd, i2400mu, "%s-tx", in i2400mu_tx_setup()
249 wimax_dev->name); in i2400mu_tx_setup()
250 /* the kthread function sets i2400mu->tx_thread */ in i2400mu_tx_setup()
253 dev_err(dev, "TX: cannot start thread: %d\n", result); in i2400mu_tx_setup()
261 struct i2400m *i2400m = &i2400mu->i2400m; in i2400mu_tx_release()
262 struct device *dev = i2400m_dev(i2400m); in i2400mu_tx_release()
265 spin_lock_irqsave(&i2400m->tx_lock, flags); in i2400mu_tx_release()
266 kthread = i2400mu->tx_kthread; in i2400mu_tx_release()
267 i2400mu->tx_kthread = NULL; in i2400mu_tx_release()
268 spin_unlock_irqrestore(&i2400m->tx_lock, flags); in i2400mu_tx_release()
272 d_printf(1, dev, "TX: kthread had already exited\n"); in i2400mu_tx_release()