FreeBSD kernel usb device Code
usb_pf.c
Go to the documentation of this file.
1/* $FreeBSD$ */
2/*-
3 * SPDX-License-Identifier: BSD-3-Clause
4 *
5 * Copyright (c) 1990, 1991, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from the Stanford/CMU enet packet filter,
9 * (net/enet.c) distributed as part of 4.3BSD, and code contributed
10 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
11 * Berkeley Laboratory.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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#ifdef USB_GLOBAL_INCLUDE_FILE
39#include USB_GLOBAL_INCLUDE_FILE
40#else
41#include <sys/param.h>
42#include <sys/kernel.h>
43#include <sys/bus.h>
44#include <sys/fcntl.h>
45#include <sys/malloc.h>
46#include <sys/proc.h>
47#include <sys/socket.h>
48#include <sys/sockio.h>
49#include <net/if.h>
50#include <net/if_var.h>
51#include <net/if_types.h>
52#include <net/if_clone.h>
53#include <net/bpf.h>
54#include <sys/sysctl.h>
55#include <net/route.h>
56
57#include <dev/usb/usb.h>
58#include <dev/usb/usbdi.h>
59#include <dev/usb/usb_busdma.h>
61#include <dev/usb/usb_core.h>
62#include <dev/usb/usb_process.h>
63#include <dev/usb/usb_device.h>
64#include <dev/usb/usb_bus.h>
65#include <dev/usb/usb_pf.h>
67#endif /* USB_GLOBAL_INCLUDE_FILE */
68
69static void usbpf_init(void *);
70static void usbpf_uninit(void *);
71static int usbpf_ioctl(struct ifnet *, u_long, caddr_t);
72static int usbpf_clone_match(struct if_clone *, const char *);
73static int usbpf_clone_create(struct if_clone *, char *, size_t, caddr_t);
74static int usbpf_clone_destroy(struct if_clone *, struct ifnet *);
75static struct usb_bus *usbpf_ifname2ubus(const char *);
76static uint32_t usbpf_aggregate_xferflags(struct usb_xfer_flags *);
77static uint32_t usbpf_aggregate_status(struct usb_xfer_flags_int *);
78static int usbpf_xfer_frame_is_read(struct usb_xfer *, uint32_t);
79static uint32_t usbpf_xfer_precompute_size(struct usb_xfer *, int);
80
81static struct if_clone *usbpf_cloner;
82static const char usbusname[] = "usbus";
83
84SYSINIT(usbpf_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_init, NULL);
85SYSUNINIT(usbpf_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_uninit, NULL);
86
87static void
88usbpf_init(void *arg)
89{
90
91 usbpf_cloner = if_clone_advanced(usbusname, 0, usbpf_clone_match,
93}
94
95static void
96usbpf_uninit(void *arg)
97{
98 int devlcnt;
99 device_t *devlp;
100 devclass_t dc;
101 struct usb_bus *ubus;
102 int error;
103 int i;
104
105 if_clone_detach(usbpf_cloner);
106
107 dc = devclass_find(usbusname);
108 if (dc == NULL)
109 return;
110 error = devclass_get_devices(dc, &devlp, &devlcnt);
111 if (error)
112 return;
113 for (i = 0; i < devlcnt; i++) {
114 ubus = device_get_softc(devlp[i]);
115 if (ubus != NULL && ubus->ifp != NULL)
117 }
118 free(devlp, M_TEMP);
119}
120
121static int
122usbpf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
123{
124
125 /* No configuration allowed. */
126 return (EINVAL);
127}
128
129static struct usb_bus *
130usbpf_ifname2ubus(const char *ifname)
131{
132 device_t dev;
133 devclass_t dc;
134 int unit;
135 int error;
136
137 if (strncmp(ifname, usbusname, sizeof(usbusname) - 1) != 0)
138 return (NULL);
139 error = ifc_name2unit(ifname, &unit);
140 if (error || unit < 0)
141 return (NULL);
142 dc = devclass_find(usbusname);
143 if (dc == NULL)
144 return (NULL);
145 dev = devclass_get_device(dc, unit);
146 if (dev == NULL)
147 return (NULL);
148
149 return (device_get_softc(dev));
150}
151
152static int
153usbpf_clone_match(struct if_clone *ifc, const char *name)
154{
155 struct usb_bus *ubus;
156
157 ubus = usbpf_ifname2ubus(name);
158 if (ubus == NULL)
159 return (0);
160 if (ubus->ifp != NULL)
161 return (0);
162
163 return (1);
164}
165
166static int
167usbpf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
168{
169 int error;
170 int unit;
171 struct ifnet *ifp;
172 struct usb_bus *ubus;
173
174 error = ifc_name2unit(name, &unit);
175 if (error)
176 return (error);
177 if (unit < 0)
178 return (EINVAL);
179
180 ubus = usbpf_ifname2ubus(name);
181 if (ubus == NULL)
182 return (1);
183 if (ubus->ifp != NULL)
184 return (1);
185
186 error = ifc_alloc_unit(ifc, &unit);
187 if (error) {
188 device_printf(ubus->parent, "usbpf: Could not allocate "
189 "instance\n");
190 return (error);
191 }
192 ifp = ubus->ifp = if_alloc(IFT_USB);
193 if (ifp == NULL) {
194 ifc_free_unit(ifc, unit);
195 device_printf(ubus->parent, "usbpf: Could not allocate "
196 "instance\n");
197 return (ENOSPC);
198 }
199 strlcpy(ifp->if_xname, name, sizeof(ifp->if_xname));
200 ifp->if_softc = ubus;
201 ifp->if_dname = usbusname;
202 ifp->if_dunit = unit;
203 ifp->if_ioctl = usbpf_ioctl;
204 if_attach(ifp);
205 ifp->if_flags |= IFF_UP;
206 rt_ifmsg(ifp);
207 /*
208 * XXX According to the specification of DLT_USB, it indicates
209 * packets beginning with USB setup header. But not sure all
210 * packets would be.
211 */
212 bpfattach(ifp, DLT_USB, USBPF_HDR_LEN);
213
214 return (0);
215}
216
217static int
218usbpf_clone_destroy(struct if_clone *ifc, struct ifnet *ifp)
219{
220 struct usb_bus *ubus;
221 int unit;
222
223 ubus = ifp->if_softc;
224 unit = ifp->if_dunit;
225
226 /*
227 * Lock USB before clearing the "ifp" pointer, to avoid
228 * clearing the pointer in the middle of a TAP operation:
229 */
230 USB_BUS_LOCK(ubus);
231 ubus->ifp = NULL;
232 USB_BUS_UNLOCK(ubus);
233 bpfdetach(ifp);
234 if_detach(ifp);
235 if_free(ifp);
236 ifc_free_unit(ifc, unit);
237
238 return (0);
239}
240
241void
243{
244
245 if (bootverbose)
246 device_printf(ubus->parent, "usbpf: Attached\n");
247}
248
249void
251{
252
253 if (ubus->ifp != NULL)
255 if (bootverbose)
256 device_printf(ubus->parent, "usbpf: Detached\n");
257}
258
259static uint32_t
261{
262 uint32_t val = 0;
263
264 if (flags->force_short_xfer == 1)
266 if (flags->short_xfer_ok == 1)
268 if (flags->short_frames_ok == 1)
270 if (flags->pipe_bof == 1)
272 if (flags->proxy_buffer == 1)
274 if (flags->ext_buffer == 1)
276 if (flags->manual_status == 1)
278 if (flags->no_pipe_ok == 1)
280 if (flags->stall_pipe == 1)
282 return (val);
283}
284
285static uint32_t
287{
288 uint32_t val = 0;
289
290 if (flags->open == 1)
292 if (flags->transferring == 1)
294 if (flags->did_dma_delay == 1)
296 if (flags->did_close == 1)
298 if (flags->draining == 1)
300 if (flags->started == 1)
302 if (flags->bandwidth_reclaimed == 1)
304 if (flags->control_xfr == 1)
306 if (flags->control_hdr == 1)
308 if (flags->control_act == 1)
310 if (flags->control_stall == 1)
312 if (flags->short_frames_ok == 1)
314 if (flags->short_xfer_ok == 1)
316#if USB_HAVE_BUSDMA
317 if (flags->bdma_enable == 1)
319 if (flags->bdma_no_post_sync == 1)
321 if (flags->bdma_setup == 1)
323#endif
324 if (flags->isochronous_xfr == 1)
326 if (flags->curr_dma_set == 1)
328 if (flags->can_cancel_immed == 1)
330 if (flags->doing_callback == 1)
332
333 return (val);
334}
335
336static int
337usbpf_xfer_frame_is_read(struct usb_xfer *xfer, uint32_t frame)
338{
339 int isread;
340
341 if ((frame == 0) && (xfer->flags_int.control_xfr != 0) &&
342 (xfer->flags_int.control_hdr != 0)) {
343 /* special case */
344 if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) {
345 /* The device controller writes to memory */
346 isread = 1;
347 } else {
348 /* The host controller reads from memory */
349 isread = 0;
350 }
351 } else {
352 isread = USB_GET_DATA_ISREAD(xfer);
353 }
354 return (isread);
355}
356
357static uint32_t
359{
360 uint32_t totlen;
361 uint32_t x;
362 uint32_t nframes;
363
365 nframes = xfer->nframes;
366 else
367 nframes = xfer->aframes;
368
369 totlen = USBPF_HDR_LEN + (USBPF_FRAME_HDR_LEN * nframes);
370
371 /* precompute all trace lengths */
372 for (x = 0; x != nframes; x++) {
373 if (usbpf_xfer_frame_is_read(xfer, x)) {
374 if (type != USBPF_XFERTAP_SUBMIT) {
375 totlen += USBPF_FRAME_ALIGN(
376 xfer->frlengths[x]);
377 }
378 } else {
379 if (type == USBPF_XFERTAP_SUBMIT) {
380 totlen += USBPF_FRAME_ALIGN(
381 xfer->frlengths[x]);
382 }
383 }
384 }
385 return (totlen);
386}
387
388void
389usbpf_xfertap(struct usb_xfer *xfer, int type)
390{
391 struct usb_bus *bus;
392 struct usbpf_pkthdr *up;
393 struct usbpf_framehdr *uf;
395 uint32_t totlen;
396 uint32_t frame;
397 uint32_t temp;
398 uint32_t nframes;
399 uint32_t x;
400 uint8_t *buf;
401 uint8_t *ptr;
402
403 bus = xfer->xroot->bus;
404
405 /* sanity checks */
406 if (bus->ifp == NULL || bus->ifp->if_bpf == NULL)
407 return;
408 if (!bpf_peers_present(bus->ifp->if_bpf))
409 return;
410
411 totlen = usbpf_xfer_precompute_size(xfer, type);
412
414 nframes = xfer->nframes;
415 else
416 nframes = xfer->aframes;
417
418 /*
419 * XXX TODO XXX
420 *
421 * When BPF supports it we could pass a fragmented array of
422 * buffers avoiding the data copy operation here.
423 */
424 buf = ptr = malloc(totlen, M_TEMP, M_NOWAIT);
425 if (buf == NULL) {
426 device_printf(bus->parent, "usbpf: Out of memory\n");
427 return;
428 }
429
430 up = (struct usbpf_pkthdr *)ptr;
431 ptr += USBPF_HDR_LEN;
432
433 /* fill out header */
434 temp = device_get_unit(bus->bdev);
435 up->up_totlen = htole32(totlen);
436 up->up_busunit = htole32(temp);
437 up->up_address = xfer->xroot->udev->device_index;
440 else
442 up->up_type = type;
444 temp = usbpf_aggregate_xferflags(&xfer->flags);
445 up->up_flags = htole32(temp);
446 temp = usbpf_aggregate_status(&xfer->flags_int);
447 up->up_status = htole32(temp);
448 temp = xfer->error;
449 up->up_error = htole32(temp);
450 temp = xfer->interval;
451 up->up_interval = htole32(temp);
452 up->up_frames = htole32(nframes);
453 temp = xfer->max_packet_size;
454 up->up_packet_size = htole32(temp);
455 temp = xfer->max_packet_count;
456 up->up_packet_count = htole32(temp);
457 temp = xfer->endpointno;
458 up->up_endpoint = htole32(temp);
459 up->up_speed = xfer->xroot->udev->speed;
460
461 /* clear reserved area */
462 memset(up->up_reserved, 0, sizeof(up->up_reserved));
463
464 /* init offset and frame */
465 offset = 0;
466 frame = 0;
467
468 /* iterate all the USB frames and copy data, if any */
469 for (x = 0; x != nframes; x++) {
470 uint32_t length;
471 int isread;
472
473 /* get length */
474 length = xfer->frlengths[x];
475
476 /* get frame header pointer */
477 uf = (struct usbpf_framehdr *)ptr;
478 ptr += USBPF_FRAME_HDR_LEN;
479
480 /* fill out packet header */
481 uf->length = htole32(length);
482 uf->flags = 0;
483
484 /* get information about data read/write */
485 isread = usbpf_xfer_frame_is_read(xfer, x);
486
487 /* check if we need to copy any data */
488 if (isread) {
490 length = 0;
491 else {
492 uf->flags |= htole32(
494 }
495 } else {
497 length = 0;
498 else {
499 uf->flags |= htole32(
501 }
502 }
503
504 /* check if data is read direction */
505 if (isread)
506 uf->flags |= htole32(USBPF_FRAMEFLAG_READ);
507
508 /* copy USB data, if any */
509 if (length != 0) {
510 /* copy data */
511 usbd_copy_out(&xfer->frbuffers[frame],
512 offset, ptr, length);
513
514 /* align length */
516
517 /* zero pad */
518 if (temp != length)
519 memset(ptr + length, 0, temp - length);
520
521 ptr += temp;
522 }
523
524 if (xfer->flags_int.isochronous_xfr) {
526 } else {
527 frame ++;
528 }
529 }
530
531 bpf_tap(bus->ifp->if_bpf, buf, totlen);
532
533 free(buf, M_TEMP);
534}
uint16_t len
Definition: ehci.h:41
uint32_t val
Definition: if_rum.c:284
struct @109 error
enum pci_id_type type
const char * name
u_int bus
device_t dev
struct ifnet * ifp
Definition: usb_bus.h:110
device_t parent
Definition: usb_bus.h:100
enum usb_dev_speed speed
Definition: usb_device.h:235
uint8_t device_index
Definition: usb_device.h:244
struct usb_endpoint_descriptor * edesc
Definition: usbdi.h:144
uint8_t transferring
Definition: usb_core.h:95
uint8_t control_hdr
Definition: usb_core.h:104
enum usb_hc_mode usb_mode
Definition: usb_core.h:91
uint8_t control_act
Definition: usb_core.h:106
uint8_t short_frames_ok
Definition: usb_core.h:110
uint8_t draining
Definition: usb_core.h:99
uint8_t doing_callback
Definition: usb_core.h:124
uint8_t isochronous_xfr
Definition: usb_core.h:120
uint8_t control_stall
Definition: usb_core.h:107
uint8_t curr_dma_set
Definition: usb_core.h:121
uint8_t control_xfr
Definition: usb_core.h:103
uint8_t did_dma_delay
Definition: usb_core.h:97
uint8_t can_cancel_immed
Definition: usb_core.h:122
uint8_t short_xfer_ok
Definition: usb_core.h:111
uint8_t bandwidth_reclaimed
Definition: usb_core.h:102
uint8_t did_close
Definition: usb_core.h:98
uint8_t proxy_buffer
Definition: usbdi.h:201
uint8_t pipe_bof
Definition: usbdi.h:200
uint8_t short_xfer_ok
Definition: usbdi.h:198
uint8_t stall_pipe
Definition: usbdi.h:208
uint8_t manual_status
Definition: usbdi.h:204
uint8_t short_frames_ok
Definition: usbdi.h:199
uint8_t force_short_xfer
Definition: usbdi.h:196
uint8_t no_pipe_ok
Definition: usbdi.h:206
uint8_t ext_buffer
Definition: usbdi.h:203
struct usb_bus * bus
Definition: usb_transfer.h:78
struct usb_device * udev
Definition: usb_transfer.h:79
usb_frlength_t * frlengths
Definition: usb_core.h:150
usb_frcount_t nframes
Definition: usb_core.h:162
struct usb_page_cache * frbuffers
Definition: usb_core.h:151
uint8_t max_packet_count
Definition: usb_core.h:175
usb_frcount_t aframes
Definition: usb_core.h:163
usb_error_t error
Definition: usb_core.h:179
struct usb_endpoint * endpoint
Definition: usb_core.h:140
struct usb_xfer_flags_int flags_int
Definition: usb_core.h:182
struct usb_xfer_flags flags
Definition: usb_core.h:181
struct usb_xfer_root * xroot
Definition: usb_core.h:141
usb_timeout_t interval
Definition: usb_core.h:171
uint16_t max_packet_size
Definition: usb_core.h:167
uint8_t endpointno
Definition: usb_core.h:174
uint32_t flags
Definition: usb_pf.h:100
uint32_t length
Definition: usb_pf.h:98
uint32_t up_interval
Definition: usb_pf.h:83
uint8_t up_reserved[83]
Definition: usb_pf.h:90
uint8_t up_mode
Definition: usb_pf.h:46
uint32_t up_busunit
Definition: usb_pf.h:44
uint8_t up_xfertype
Definition: usb_pf.h:50
uint32_t up_totlen
Definition: usb_pf.h:43
uint8_t up_address
Definition: usb_pf.h:45
uint32_t up_frames
Definition: usb_pf.h:84
uint32_t up_packet_count
Definition: usb_pf.h:86
uint32_t up_endpoint
Definition: usb_pf.h:87
uint8_t up_speed
Definition: usb_pf.h:88
uint32_t up_flags
Definition: usb_pf.h:51
uint32_t up_packet_size
Definition: usb_pf.h:85
uint32_t up_error
Definition: usb_pf.h:82
uint8_t up_type
Definition: usb_pf.h:49
uint32_t up_status
Definition: usb_pf.h:61
#define UE_XFERTYPE
Definition: usb.h:540
@ USB_MODE_DEVICE
Definition: usb.h:779
void usbd_copy_out(struct usb_page_cache *cache, usb_frlength_t offset, void *ptr, usb_frlength_t len)
Definition: usb_busdma.c:283
#define USB_GET_DATA_ISREAD(xfer)
Definition: usb_core.h:40
#define USB_BUS_LOCK(_b)
Definition: usb_core.h:45
#define USB_BUS_UNLOCK(_b)
Definition: usb_core.h:46
uint32_t usb_frlength_t
Definition: usb_freebsd.h:100
uint16_t offset
Definition: usb_if.m:54
void usbpf_attach(struct usb_bus *ubus)
Definition: usb_pf.c:242
static struct usb_bus * usbpf_ifname2ubus(const char *)
Definition: usb_pf.c:130
static void usbpf_uninit(void *)
Definition: usb_pf.c:96
static const char usbusname[]
Definition: usb_pf.c:82
void usbpf_xfertap(struct usb_xfer *xfer, int type)
Definition: usb_pf.c:389
static uint32_t usbpf_xfer_precompute_size(struct usb_xfer *, int)
Definition: usb_pf.c:358
static struct if_clone * usbpf_cloner
Definition: usb_pf.c:81
static int usbpf_xfer_frame_is_read(struct usb_xfer *, uint32_t)
Definition: usb_pf.c:337
static uint32_t usbpf_aggregate_xferflags(struct usb_xfer_flags *)
Definition: usb_pf.c:260
SYSUNINIT(usbpf_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_uninit, NULL)
static int usbpf_clone_create(struct if_clone *, char *, size_t, caddr_t)
Definition: usb_pf.c:167
static void usbpf_init(void *)
Definition: usb_pf.c:88
void usbpf_detach(struct usb_bus *ubus)
Definition: usb_pf.c:250
static int usbpf_ioctl(struct ifnet *, u_long, caddr_t)
Definition: usb_pf.c:122
static int usbpf_clone_destroy(struct if_clone *, struct ifnet *)
Definition: usb_pf.c:218
static int usbpf_clone_match(struct if_clone *, const char *)
Definition: usb_pf.c:153
SYSINIT(usbpf_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_init, NULL)
static uint32_t usbpf_aggregate_status(struct usb_xfer_flags_int *)
Definition: usb_pf.c:286
#define USBPF_STATUS_DID_CLOSE
Definition: usb_pf.h:65
#define USBPF_STATUS_CAN_CANCEL_IMMED
Definition: usb_pf.h:80
#define USBPF_FRAME_ALIGN(x)
Definition: usb_pf.h:99
#define USBPF_STATUS_CONTROL_XFR
Definition: usb_pf.h:69
#define USBPF_FLAG_FORCE_SHORT_XFER
Definition: usb_pf.h:52
#define USBPF_STATUS_CONTROL_ACT
Definition: usb_pf.h:71
#define USBPF_STATUS_SHORT_FRAMES_OK
Definition: usb_pf.h:73
#define USBPF_STATUS_DID_DMA_DELAY
Definition: usb_pf.h:64
#define USBPF_STATUS_CURR_DMA_SET
Definition: usb_pf.h:79
#define USBPF_MODE_HOST
Definition: usb_pf.h:47
#define USBPF_STATUS_DRAINING
Definition: usb_pf.h:66
#define USBPF_STATUS_BDMA_ENABLE
Definition: usb_pf.h:75
#define USBPF_STATUS_BW_RECLAIMED
Definition: usb_pf.h:68
#define USBPF_STATUS_CONTROL_STALL
Definition: usb_pf.h:72
#define USBPF_FLAG_SHORT_XFER_OK
Definition: usb_pf.h:53
#define USBPF_MODE_DEVICE
Definition: usb_pf.h:48
#define USBPF_FRAME_HDR_LEN
Definition: usb_pf.h:106
#define USBPF_STATUS_ISOCHRONOUS_XFR
Definition: usb_pf.h:78
#define USBPF_FLAG_PROXY_BUFFER
Definition: usb_pf.h:56
#define USBPF_STATUS_DOING_CALLBACK
Definition: usb_pf.h:81
#define USBPF_FRAMEFLAG_READ
Definition: usb_pf.h:101
#define USBPF_STATUS_SHORT_XFER_OK
Definition: usb_pf.h:74
#define USBPF_FLAG_SHORT_FRAMES_OK
Definition: usb_pf.h:54
#define USBPF_STATUS_BDMA_SETUP
Definition: usb_pf.h:77
#define USBPF_STATUS_BDMA_NO_POST_SYNC
Definition: usb_pf.h:76
#define USBPF_STATUS_STARTED
Definition: usb_pf.h:67
#define USBPF_XFERTAP_SUBMIT
Definition: usb_pf.h:113
#define USBPF_STATUS_CONTROL_HDR
Definition: usb_pf.h:70
#define USBPF_STATUS_TRANSFERRING
Definition: usb_pf.h:63
#define USBPF_FLAG_PIPE_BOF
Definition: usb_pf.h:55
#define USBPF_FLAG_NO_PIPE_OK
Definition: usb_pf.h:59
#define USBPF_FLAG_STALL_PIPE
Definition: usb_pf.h:60
#define USBPF_FRAMEFLAG_DATA_FOLLOWS
Definition: usb_pf.h:102
#define USBPF_FLAG_EXT_BUFFER
Definition: usb_pf.h:57
#define USBPF_HDR_LEN
Definition: usb_pf.h:105
#define USBPF_STATUS_OPEN
Definition: usb_pf.h:62
#define USBPF_FLAG_MANUAL_STATUS
Definition: usb_pf.h:58
usb_frlength_t usbd_xfer_old_frame_length(struct usb_xfer *xfer, usb_frcount_t frindex)