table of contents
STRUCT USB_DRIVER(9) | Host-Side Data Types and Macro | STRUCT USB_DRIVER(9) |
NAME¶
struct_usb_driver - identifies USB interface driver to usbcore
SYNOPSIS¶
struct usb_driver {
const char * name;
int (* probe) (struct usb_interface *intf,const struct usb_device_id *id);
void (* disconnect) (struct usb_interface *intf);
int (* ioctl) (struct usb_interface *intf, unsigned int code,void *buf);
int (* suspend) (struct usb_interface *intf, pm_message_t message);
int (* resume) (struct usb_interface *intf);
int (* reset_resume) (struct usb_interface *intf);
int (* pre_reset) (struct usb_interface *intf);
int (* post_reset) (struct usb_interface *intf);
const struct usb_device_id * id_table;
struct usb_dynids dynids;
struct usbdrv_wrap drvwrap;
unsigned int no_dynamic_id:1;
unsigned int supports_autosuspend:1;
unsigned int soft_unbind:1; #ifndef __GENKSYMS__
unsigned int disable_hub_initiated_lpm:1; #endif };
MEMBERS¶
name
probe
disconnect
ioctl
suspend
resume
reset_resume
pre_reset
post_reset
id_table
dynids
drvwrap
no_dynamic_id
supports_autosuspend
soft_unbind
disable_hub_initiated_lpm
DESCRIPTION¶
USB interface drivers must provide a name, probe and disconnect methods, and an id_table. Other driver fields are optional.
The id_table is used in hotplugging. It holds a set of descriptors, and specialized data may be associated with each entry. That table is used by both user and kernel mode hotplugging support.
The probe and disconnect methods are called in a context where they can sleep, but they should avoid abusing the privilege. Most work to connect to a device should be done when the device is opened, and undone at the last close. The disconnect code needs to address concurrency issues with respect to open and close methods, as well as forcing all pending I/O requests to complete (by unlinking them as necessary, and blocking until the unlinks complete).
COPYRIGHT¶
May 2024 | Kernel Hackers Manual 2.6. |