USB 2.0 Chapter 9 Types and Constants

struct usb_ctrlrequest — SETUP data for a USB device control request
usb_endpoint_num — get the endpoint's number
usb_endpoint_type — get the endpoint's transfer type
usb_endpoint_dir_in — check if the endpoint has IN direction
usb_endpoint_dir_out — check if the endpoint has OUT direction
usb_endpoint_xfer_bulk — check if the endpoint has bulk transfer type
usb_endpoint_xfer_control — check if the endpoint has control transfer type
usb_endpoint_xfer_int — check if the endpoint has interrupt transfer type
usb_endpoint_xfer_isoc — check if the endpoint has isochronous transfer type
usb_endpoint_is_bulk_in — check if the endpoint is bulk IN
usb_endpoint_is_bulk_out — check if the endpoint is bulk OUT
usb_endpoint_is_int_in — check if the endpoint is interrupt IN
usb_endpoint_is_int_out — check if the endpoint is interrupt OUT
usb_endpoint_is_isoc_in — check if the endpoint is isochronous IN
usb_endpoint_is_isoc_out — check if the endpoint is isochronous OUT

Gadget drivers rely on common USB structures and constants defined in the <linux/usb/ch9.h> header file, which is standard in Linux 2.6 kernels. These are the same types and constants used by host side drivers (and usbcore).