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 Configuration Structures

In FreeBSD, usb_config structures are used to find and communicate with individual endpoints. struct usb_config is defined in the <dev/usb/usbdi.h> header as follows:

struct usb_config {
        /* USB Module Private Data */
        enum usb_hc_mode        usb_mode;

        /* Mandatory Fields */
        uint8_t                 type;
        uint8_t                 endpoint;
        uint8_t                 direction;
        usb_callback_t         *callback;
        usb_frlength_t          bufsize;

        /* Optional Fields */
        usb_timeout_t           timeout;
        usb_timeout_t           interval;
        usb_frcount_t           frames;
        uint8_t                 ep_index;
        uint8_t                 if_index;

        /* USB Transfer Flags */
        struct usb_xfer_flags   flags;
};

Many of the fields in struct usb_config must be initialized by a USB driver. These fields are described in the following sections.

Mandatory Fields

The type field specifies the ...

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