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 Methods Structure

A usb_fifo_methods structure defines a USB driver’s entry points. You can think of struct usb_fifo_methods as struct cdevsw, but for USB drivers.

struct usb_fifo_methods is defined in the <dev/usb/usbdi.h> header as follows:

struct usb_fifo_methods {
        /* Executed Unlocked */
        usb_fifo_open_t         *f_open;
        usb_fifo_close_t        *f_close;
        usb_fifo_ioctl_t        *f_ioctl;
        usb_fifo_ioctl_t        *f_ioctl_post;

        /* Executed With Mutex Locked */
        usb_fifo_cmd_t          *f_start_read;
        usb_fifo_cmd_t          *f_stop_read;
        usb_fifo_cmd_t          *f_start_write;
        usb_fifo_cmd_t          *f_stop_write;
        usb_fifo_filter_t       *f_filter_read;
        usb_fifo_filter_t       *f_filter_write;

        const char              *basename[4];
        const char              *postfix[4];
};

The FreeBSD kernel provides the following functions for working with usb_fifo_methods ...

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