Skip to Content
FreeBSD Device Drivers
book

FreeBSD Device Drivers

by Joseph Kong
April 2012
Intermediate to advanced
352 pages
8h
English
No Starch Press
Content preview from FreeBSD Device Drivers

USB Transfers (in FreeBSD)

Recall that callback is executed before and after the endpoint specified by type, endpoint, and direction transfers data. Below is its function prototype:

typedef void (usb_callback_t)(struct usb_xfer *, usb_error_t);

Here, struct usb_xfer * contains the transfer state:

struct usb_xfer { ... uint8_t usb_state; /* Set when callback is executed before a data transfer. */ #define USB_ST_SETUP 0 /* Set when callback is executed after a data transfer. */ #define USB_ST_TRANSFERRED 1 /* Set when a transfer error occurs. */ #define ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Embedded Linux

Embedded Linux

John Lombardo
Essential Linux Device Drivers

Essential Linux Device Drivers

Sreekrishnan Venkateswaran

Publisher Resources

ISBN: 9781457166716Errata