FreeBSD kernel usb device Code
ubser.c
Go to the documentation of this file.
1/*-
2 * Copyright (c) 2004 Bernd Walter <ticso@FreeBSD.org>
3 *
4 * $URL: https://devel.bwct.de/svn/projects/ubser/ubser.c $
5 * $Date: 2004-02-29 01:53:10 +0100 (Sun, 29 Feb 2004) $
6 * $Author: ticso $
7 * $Rev: 1127 $
8 */
9
10/*-
11 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND BSD-2-Clause-NetBSD
12 *
13 * Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
14 * All rights reserved.
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 */
37
38/*-
39 * Copyright (c) 2000 The NetBSD Foundation, Inc.
40 * All rights reserved.
41 *
42 * This code is derived from software contributed to The NetBSD Foundation
43 * by Lennart Augustsson (lennart@augustsson.net).
44 *
45 * Redistribution and use in source and binary forms, with or without
46 * modification, are permitted provided that the following conditions
47 * are met:
48 * 1. Redistributions of source code must retain the above copyright
49 * notice, this list of conditions and the following disclaimer.
50 * 2. Redistributions in binary form must reproduce the above copyright
51 * notice, this list of conditions and the following disclaimer in the
52 * documentation and/or other materials provided with the distribution.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
55 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
56 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
57 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
58 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
59 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
60 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
61 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
62 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
63 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
64 * POSSIBILITY OF SUCH DAMAGE.
65 */
66
67#include <sys/cdefs.h>
68__FBSDID("$FreeBSD$");
69
70/*
71 * BWCT serial adapter driver
72 */
73
74#include <sys/stdint.h>
75#include <sys/stddef.h>
76#include <sys/param.h>
77#include <sys/queue.h>
78#include <sys/types.h>
79#include <sys/systm.h>
80#include <sys/kernel.h>
81#include <sys/bus.h>
82#include <sys/module.h>
83#include <sys/lock.h>
84#include <sys/mutex.h>
85#include <sys/condvar.h>
86#include <sys/sysctl.h>
87#include <sys/sx.h>
88#include <sys/unistd.h>
89#include <sys/callout.h>
90#include <sys/malloc.h>
91#include <sys/priv.h>
92
93#include <dev/usb/usb.h>
94#include <dev/usb/usbdi.h>
95#include <dev/usb/usbdi_util.h>
96#include "usbdevs.h"
97
98#define USB_DEBUG_VAR ubser_debug
99#include <dev/usb/usb_debug.h>
100#include <dev/usb/usb_process.h>
101
103
104#define UBSER_UNIT_MAX 32
105
106/* Vendor Interface Requests */
107#define VENDOR_GET_NUMSER 0x01
108#define VENDOR_SET_BREAK 0x02
109#define VENDOR_CLEAR_BREAK 0x03
110
111#ifdef USB_DEBUG
112static int ubser_debug = 0;
113
114static SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
115 "USB ubser");
116SYSCTL_INT(_hw_usb_ubser, OID_AUTO, debug, CTLFLAG_RWTUN,
117 &ubser_debug, 0, "ubser debug level");
118#endif
119
120enum {
124};
125
129
132 struct mtx sc_mtx;
133
134 uint16_t sc_tx_size;
135
136 uint8_t sc_numser;
137 uint8_t sc_iface_no;
140};
141
142/* prototypes */
143
144static device_probe_t ubser_probe;
145static device_attach_t ubser_attach;
146static device_detach_t ubser_detach;
147static void ubser_free_softc(struct ubser_softc *);
148
151
152static void ubser_free(struct ucom_softc *);
153static int ubser_pre_param(struct ucom_softc *, struct termios *);
154static void ubser_cfg_set_break(struct ucom_softc *, uint8_t);
155static void ubser_cfg_get_status(struct ucom_softc *, uint8_t *,
156 uint8_t *);
157static void ubser_start_read(struct ucom_softc *);
158static void ubser_stop_read(struct ucom_softc *);
159static void ubser_start_write(struct ucom_softc *);
160static void ubser_stop_write(struct ucom_softc *);
161static void ubser_poll(struct ucom_softc *ucom);
162
164 [UBSER_BULK_DT_WR] = {
165 .type = UE_BULK,
166 .endpoint = UE_ADDR_ANY,
167 .direction = UE_DIR_OUT,
168 .bufsize = 0, /* use wMaxPacketSize */
169 .flags = {.pipe_bof = 1,.force_short_xfer = 1,},
170 .callback = &ubser_write_callback,
171 },
172
173 [UBSER_BULK_DT_RD] = {
174 .type = UE_BULK,
175 .endpoint = UE_ADDR_ANY,
176 .direction = UE_DIR_IN,
177 .bufsize = 0, /* use wMaxPacketSize */
178 .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
179 .callback = &ubser_read_callback,
180 },
181};
182
183static const struct ucom_callback ubser_callback = {
185 .ucom_cfg_get_status = &ubser_cfg_get_status,
186 .ucom_pre_param = &ubser_pre_param,
187 .ucom_start_read = &ubser_start_read,
188 .ucom_stop_read = &ubser_stop_read,
189 .ucom_start_write = &ubser_start_write,
190 .ucom_stop_write = &ubser_stop_write,
191 .ucom_poll = &ubser_poll,
192 .ucom_free = &ubser_free,
193};
194
195static device_method_t ubser_methods[] = {
196 DEVMETHOD(device_probe, ubser_probe),
197 DEVMETHOD(device_attach, ubser_attach),
198 DEVMETHOD(device_detach, ubser_detach),
199 DEVMETHOD_END
200};
201
202static devclass_t ubser_devclass;
203
204static driver_t ubser_driver = {
205 .name = "ubser",
206 .methods = ubser_methods,
207 .size = sizeof(struct ubser_softc),
208};
209
211MODULE_DEPEND(ubser, ucom, 1, 1, 1);
212MODULE_DEPEND(ubser, usb, 1, 1, 1);
214
215static int
216ubser_probe(device_t dev)
217{
218 struct usb_attach_arg *uaa = device_get_ivars(dev);
219
220 if (uaa->usb_mode != USB_MODE_HOST) {
221 return (ENXIO);
222 }
223 /* check if this is a BWCT vendor specific ubser interface */
224 if ((strcmp(usb_get_manufacturer(uaa->device), "BWCT") == 0) &&
225 (uaa->info.bInterfaceClass == 0xff) &&
226 (uaa->info.bInterfaceSubClass == 0x00))
227 return (0);
228
229 return (ENXIO);
230}
231
232static int
233ubser_attach(device_t dev)
234{
235 struct usb_attach_arg *uaa = device_get_ivars(dev);
236 struct ubser_softc *sc = device_get_softc(dev);
237 struct usb_device_request req;
238 uint8_t n;
239 int error;
240
242 mtx_init(&sc->sc_mtx, "ubser", NULL, MTX_DEF);
244
245 sc->sc_iface_no = uaa->info.bIfaceNum;
247 sc->sc_udev = uaa->device;
248
249 /* get number of serials */
250 req.bmRequestType = UT_READ_VENDOR_INTERFACE;
251 req.bRequest = VENDOR_GET_NUMSER;
252 USETW(req.wValue, 0);
253 req.wIndex[0] = sc->sc_iface_no;
254 req.wIndex[1] = 0;
255 USETW(req.wLength, 1);
257 &req, &sc->sc_numser,
258 0, NULL, USB_DEFAULT_TIMEOUT);
259
260 if (error || (sc->sc_numser == 0)) {
261 device_printf(dev, "failed to get number "
262 "of serial ports: %s\n",
264 goto detach;
265 }
266 if (sc->sc_numser > UBSER_UNIT_MAX)
268
269 device_printf(dev, "found %i serials\n", sc->sc_numser);
270
273 if (error) {
274 goto detach;
275 }
277
278 if (sc->sc_tx_size == 0) {
279 DPRINTFN(0, "invalid tx_size\n");
280 goto detach;
281 }
282 /* initialize port numbers */
283
284 for (n = 0; n < sc->sc_numser; n++) {
285 sc->sc_ucom[n].sc_portno = n;
286 }
287
289 sc->sc_numser, sc, &ubser_callback, &sc->sc_mtx);
290 if (error) {
291 goto detach;
292 }
294
295 mtx_lock(&sc->sc_mtx);
299 mtx_unlock(&sc->sc_mtx);
300
301 return (0); /* success */
302
303detach:
305 return (ENXIO); /* failure */
306}
307
308static int
309ubser_detach(device_t dev)
310{
311 struct ubser_softc *sc = device_get_softc(dev);
312
313 DPRINTF("\n");
314
317
318 device_claim_softc(dev);
319
321
322 return (0);
323}
324
326
327static void
329{
330 if (ucom_unref(&sc->sc_super_ucom)) {
331 mtx_destroy(&sc->sc_mtx);
332 device_free_softc(sc);
333 }
334}
335
336static void
338{
340}
341
342static int
343ubser_pre_param(struct ucom_softc *ucom, struct termios *t)
344{
345 DPRINTF("\n");
346
347 /*
348 * The firmware on our devices can only do 8n1@9600bps
349 * without handshake.
350 * We refuse to accept other configurations.
351 */
352
353 /* ensure 9600bps */
354 switch (t->c_ospeed) {
355 case 9600:
356 break;
357 default:
358 return (EINVAL);
359 }
360
361 /* 2 stop bits not possible */
362 if (t->c_cflag & CSTOPB)
363 return (EINVAL);
364
365 /* XXX parity handling not possible with current firmware */
366 if (t->c_cflag & PARENB)
367 return (EINVAL);
368
369 /* we can only do 8 data bits */
370 switch (t->c_cflag & CSIZE) {
371 case CS8:
372 break;
373 default:
374 return (EINVAL);
375 }
376
377 /* we can't do any kind of hardware handshaking */
378 if ((t->c_cflag &
379 (CRTS_IFLOW | CDTR_IFLOW | CDSR_OFLOW | CCAR_OFLOW)) != 0)
380 return (EINVAL);
381
382 /*
383 * XXX xon/xoff not supported by the firmware!
384 * This is handled within FreeBSD only and may overflow buffers
385 * because of delayed reaction due to device buffering.
386 */
387
388 return (0);
389}
390
391static __inline void
393{
394 sc->sc_curr_tx_unit++;
395 if (sc->sc_curr_tx_unit >= sc->sc_numser) {
396 sc->sc_curr_tx_unit = 0;
397 }
398}
399
400static void
402{
403 struct ubser_softc *sc = usbd_xfer_softc(xfer);
404 struct usb_page_cache *pc;
405 uint8_t buf[1];
406 uint8_t first_unit = sc->sc_curr_tx_unit;
407 uint32_t actlen;
408
409 switch (USB_GET_STATE(xfer)) {
410 case USB_ST_SETUP:
412tr_setup:
413 pc = usbd_xfer_get_frame(xfer, 0);
414 do {
416 pc, 1, sc->sc_tx_size - 1,
417 &actlen)) {
418 buf[0] = sc->sc_curr_tx_unit;
419
420 usbd_copy_in(pc, 0, buf, 1);
421
422 usbd_xfer_set_frame_len(xfer, 0, actlen + 1);
424
425 ubser_inc_tx_unit(sc); /* round robin */
426
427 break;
428 }
430
431 } while (sc->sc_curr_tx_unit != first_unit);
432
433 return;
434
435 default: /* Error */
436 if (error != USB_ERR_CANCELLED) {
437 /* try to clear stall first */
439 goto tr_setup;
440 }
441 return;
442 }
443}
444
445static void
447{
448 struct ubser_softc *sc = usbd_xfer_softc(xfer);
449 struct usb_page_cache *pc;
450 uint8_t buf[1];
451 int actlen;
452
453 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
454
455 switch (USB_GET_STATE(xfer)) {
457 if (actlen < 1) {
458 DPRINTF("invalid actlen=0!\n");
459 goto tr_setup;
460 }
461 pc = usbd_xfer_get_frame(xfer, 0);
462 usbd_copy_out(pc, 0, buf, 1);
463
464 if (buf[0] >= sc->sc_numser) {
465 DPRINTF("invalid serial number!\n");
466 goto tr_setup;
467 }
468 ucom_put_data(sc->sc_ucom + buf[0], pc, 1, actlen - 1);
469
470 case USB_ST_SETUP:
471tr_setup:
474 return;
475
476 default: /* Error */
477 if (error != USB_ERR_CANCELLED) {
478 /* try to clear stall first */
480 goto tr_setup;
481 }
482 return;
483 }
484}
485
486static void
487ubser_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
488{
489 struct ubser_softc *sc = ucom->sc_parent;
490 uint8_t x = ucom->sc_portno;
491 struct usb_device_request req;
492 usb_error_t err;
493
494 if (onoff) {
495 req.bmRequestType = UT_READ_VENDOR_INTERFACE;
496 req.bRequest = VENDOR_SET_BREAK;
497 req.wValue[0] = x;
498 req.wValue[1] = 0;
499 req.wIndex[0] = sc->sc_iface_no;
500 req.wIndex[1] = 0;
501 USETW(req.wLength, 0);
502
503 err = ucom_cfg_do_request(sc->sc_udev, ucom,
504 &req, NULL, 0, 1000);
505 if (err) {
506 DPRINTFN(0, "send break failed, error=%s\n",
507 usbd_errstr(err));
508 }
509 }
510}
511
512static void
513ubser_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
514{
515 /* fake status bits */
516 *lsr = 0;
517 *msr = SER_DCD;
518}
519
520static void
522{
523 struct ubser_softc *sc = ucom->sc_parent;
524
526}
527
528static void
530{
531 struct ubser_softc *sc = ucom->sc_parent;
532
534}
535
536static void
538{
539 struct ubser_softc *sc = ucom->sc_parent;
540
542}
543
544static void
546{
547 struct ubser_softc *sc = ucom->sc_parent;
548
550}
551
552static void
554{
555 struct ubser_softc *sc = ucom->sc_parent;
557}
static int debug
Definition: cfumass.c:73
static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "USB DWC OTG")
SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, phy_type, CTLFLAG_RDTUN, &dwc_otg_phy_type, 0, "DWC OTG PHY TYPE - 0/1/2/3 - ULPI/HSIC/INTERNAL/UTMI+")
uint8_t n
Definition: if_run.c:612
struct @109 error
device_t dev
struct usb_device * sc_udev
Definition: ubser.c:131
uint8_t sc_iface_no
Definition: ubser.c:137
struct mtx sc_mtx
Definition: ubser.c:132
uint16_t sc_tx_size
Definition: ubser.c:134
uint8_t sc_numser
Definition: ubser.c:136
struct ucom_super_softc sc_super_ucom
Definition: ubser.c:127
uint8_t sc_iface_index
Definition: ubser.c:138
struct ucom_softc sc_ucom[UBSER_UNIT_MAX]
Definition: ubser.c:128
uint8_t sc_curr_tx_unit
Definition: ubser.c:139
struct usb_xfer * sc_xfer[UBSER_N_TRANSFER]
Definition: ubser.c:130
void(* ucom_cfg_set_break)(struct ucom_softc *, uint8_t)
Definition: usb_serial.h:93
uint16_t sc_portno
Definition: usb_serial.h:174
void * sc_parent
Definition: usb_serial.h:170
enum usb_hc_mode usb_mode
Definition: usbdi.h:432
struct usbd_lookup_info info
Definition: usbdi.h:426
struct usb_device * device
Definition: usbdi.h:430
uint8_t type
Definition: usbdi.h:238
uint8_t bIfaceNum
Definition: usbdi.h:418
uint8_t bIfaceIndex
Definition: usbdi.h:417
uint8_t bInterfaceSubClass
Definition: usbdi.h:415
uint8_t bInterfaceClass
Definition: usbdi.h:414
DRIVER_MODULE(ubser, uhub, ubser_driver, ubser_devclass, NULL, 0)
MODULE_VERSION(ubser, 1)
#define VENDOR_GET_NUMSER
Definition: ubser.c:107
static void ubser_stop_read(struct ucom_softc *)
Definition: ubser.c:529
static device_probe_t ubser_probe
Definition: ubser.c:144
static void ubser_cfg_set_break(struct ucom_softc *, uint8_t)
Definition: ubser.c:487
static const struct ucom_callback ubser_callback
Definition: ubser.c:183
static device_method_t ubser_methods[]
Definition: ubser.c:195
static void ubser_free_softc(struct ubser_softc *)
Definition: ubser.c:328
static __inline void ubser_inc_tx_unit(struct ubser_softc *sc)
Definition: ubser.c:392
static void ubser_free(struct ucom_softc *)
Definition: ubser.c:337
static void ubser_start_write(struct ucom_softc *)
Definition: ubser.c:537
#define UBSER_UNIT_MAX
Definition: ubser.c:104
static int ubser_pre_param(struct ucom_softc *, struct termios *)
Definition: ubser.c:343
#define VENDOR_SET_BREAK
Definition: ubser.c:108
static void ubser_stop_write(struct ucom_softc *)
Definition: ubser.c:545
static const struct usb_config ubser_config[UBSER_N_TRANSFER]
Definition: ubser.c:163
__FBSDID("$FreeBSD$")
static void ubser_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *)
Definition: ubser.c:513
UCOM_UNLOAD_DRAIN(ubser)
MODULE_DEPEND(ubser, ucom, 1, 1, 1)
static void ubser_start_read(struct ucom_softc *)
Definition: ubser.c:521
static device_attach_t ubser_attach
Definition: ubser.c:145
static device_detach_t ubser_detach
Definition: ubser.c:146
static usb_callback_t ubser_write_callback
Definition: ubser.c:149
static void ubser_poll(struct ucom_softc *ucom)
Definition: ubser.c:553
static devclass_t ubser_devclass
Definition: ubser.c:202
static driver_t ubser_driver
Definition: ubser.c:204
static usb_callback_t ubser_read_callback
Definition: ubser.c:150
@ UBSER_BULK_DT_WR
Definition: ubser.c:121
@ UBSER_N_TRANSFER
Definition: ubser.c:123
@ UBSER_BULK_DT_RD
Definition: ubser.c:122
#define DPRINTF(...)
Definition: umass.c:179
#define UE_ADDR_ANY
Definition: usb.h:537
#define UE_BULK
Definition: usb.h:543
#define UT_READ_VENDOR_INTERFACE
Definition: usb.h:181
#define UE_DIR_IN
Definition: usb.h:531
#define UE_DIR_OUT
Definition: usb.h:532
@ USB_MODE_HOST
Definition: usb.h:778
void usbd_copy_in(struct usb_page_cache *cache, usb_frlength_t offset, const void *ptr, usb_frlength_t len)
Definition: usb_busdma.c:166
void usbd_copy_out(struct usb_page_cache *cache, usb_frlength_t offset, void *ptr, usb_frlength_t len)
Definition: usb_busdma.c:283
const char * usb_get_manufacturer(struct usb_device *udev)
Definition: usb_device.c:281
#define USETW(w, v)
Definition: usb_endian.h:77
const char * usbd_errstr(usb_error_t err)
Definition: usb_error.c:93
const void * req
Definition: usb_if.m:51
INTERFACE usb
Definition: usb_if.m:35
usb_error_t usbd_do_request_flags(struct usb_device *udev, struct mtx *mtx, struct usb_device_request *req, void *data, uint16_t flags, uint16_t *actlen, usb_timeout_t timeout)
Definition: usb_request.c:405
uint8_t ucom_get_data(struct ucom_softc *sc, struct usb_page_cache *pc, uint32_t offset, uint32_t len, uint32_t *actlen)
Definition: usb_serial.c:1384
int ucom_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc, int subunits, void *parent, const struct ucom_callback *callback, struct mtx *mtx)
Definition: usb_serial.c:267
int ucom_unref(struct ucom_super_softc *ssc)
Definition: usb_serial.c:1730
void ucom_ref(struct ucom_super_softc *ssc)
Definition: usb_serial.c:1695
void ucom_set_pnpinfo_usb(struct ucom_super_softc *ssc, device_t dev)
Definition: usb_serial.c:549
void ucom_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc)
Definition: usb_serial.c:336
void ucom_put_data(struct ucom_softc *sc, struct usb_page_cache *pc, uint32_t offset, uint32_t len)
Definition: usb_serial.c:1462
#define ucom_cfg_do_request(udev, com, req, ptr, flags, timo)
Definition: usb_serial.h:208
void usbd_transfer_submit(struct usb_xfer *xfer)
void usbd_transfer_unsetup(struct usb_xfer **pxfer, uint16_t n_setup)
void usbd_xfer_set_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex, usb_frlength_t len)
struct usb_page_cache * usbd_xfer_get_frame(struct usb_xfer *xfer, usb_frcount_t frindex)
usb_error_t usbd_transfer_setup(struct usb_device *udev, const uint8_t *ifaces, struct usb_xfer **ppxfer, const struct usb_config *setup_start, uint16_t n_setup, void *priv_sc, struct mtx *xfer_mtx)
Definition: usb_transfer.c:987
void usbd_transfer_start(struct usb_xfer *xfer)
void usbd_transfer_poll(struct usb_xfer **ppxfer, uint16_t max)
void * usbd_xfer_softc(struct usb_xfer *xfer)
void usbd_xfer_set_stall(struct usb_xfer *xfer)
void usbd_transfer_stop(struct usb_xfer *xfer)
void usbd_xfer_status(struct usb_xfer *xfer, int *actlen, int *sumlen, int *aframes, int *nframes)
usb_frlength_t usbd_xfer_max_len(struct usb_xfer *xfer)
void device_set_usb_desc(device_t dev)
Definition: usb_util.c:73
#define USB_DEFAULT_TIMEOUT
Definition: usbdi.h:89
#define USB_ST_SETUP
Definition: usbdi.h:502
usb_error_t
Definition: usbdi.h:45
@ USB_ERR_CANCELLED
Definition: usbdi.h:51
#define USB_ST_TRANSFERRED
Definition: usbdi.h:503
void() usb_callback_t(struct usb_xfer *, usb_error_t)
Definition: usbdi.h:94
#define USB_GET_STATE(xfer)
Definition: usbdi.h:515