
Embedded Drivers 157
Listing 5.8 USB Gadget Driver Data Structures
struct usb_gadget_driver {
/* String describing the gadget’s device function */
char *function;
/*
* Highest speed the driver handles. (One of USB_SPEED_HIGH,
* USB_SPEED_FULL, USB_SPEED_LOW)
*/
enum usb_device_speed speed;
/*
* Device attach called from gadget driver during registration
*/
int (*bind)(struct usb_gadget *);
/*
* setup is called for handling ep0 control requests that are
* not handled by the controller driver
*/
int (*setup)(struct usb_gadget *,
const struct usb_ctrlrequest *);
/* Host disconnection of device indicated using this call */
void (*disconnect)(struct ...