Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

usb_match_id(9) [suse man page]

USB_MATCH_ID(9) 						   USB Core APIs						   USB_MATCH_ID(9)

NAME
usb_match_id - find first usb_device_id matching device or interface SYNOPSIS
const struct usb_device_id * usb_match_id(struct usb_interface * interface, const struct usb_device_id * id); ARGUMENTS
interface the interface of interest id array of usb_device_id structures, terminated by zero entry DESCRIPTION
usb_match_id searches an array of usb_device_id's and returns the first one matching the device or interface, or null. This is used when binding (or rebinding) a driver to an interface. Most USB device drivers will use this indirectly, through the usb core, but some layered driver frameworks use it directly. These device tables are exported with MODULE_DEVICE_TABLE, through modutils, to support the driver loading functionality of USB hotplugging. WHAT MATCHES
The "match_flags" element in a usb_device_id controls which members are used. If the corresponding bit is set, the value in the device_id must match its corresponding member in the device or interface descriptor, or else the device_id does not match. "driver_info" is normally used only by device drivers, but you can create a wildcard "matches anything" usb_device_id as a driver's "modules.usbmap" entry if you provide an id with only a nonzero "driver_info" field. If you do this, the USB device driver's probe routine should use additional intelligence to decide whether to bind to the specified interface. WHAT MAKES GOOD USB_DEVICE_ID TABLES The match algorithm is very simple, so that intelligence in driver selection must come from smart driver id records. Unless you have good reasons to use another selection policy, provide match elements only in related groups, and order match specifiers from specific to general. Use the macros provided for that purpose if you can. The most specific match specifiers use device descriptor data. These are commonly used with product-specific matches; the USB_DEVICE macro lets you provide vendor and product IDs, and you can also match against ranges of product revisions. These are widely used for devices with application or vendor specific bDeviceClass values. Matches based on device class/subclass/protocol specifications are slightly more general; use the USB_DEVICE_INFO macro, or its siblings. These are used with single-function devices where bDeviceClass doesn't specify that each interface has its own class. Matches based on interface class/subclass/protocol are the most general; they let drivers bind to any interface on a multiple-function device. Use the USB_INTERFACE_INFO macro, or its siblings, to match class-per-interface style devices (as recorded in bInterfaceClass). Note that an entry created by USB_INTERFACE_INFO won't match any interface if the device class is set to Vendor-Specific. This is deliberate; according to the USB spec the meanings of the interface class/subclass/protocol for these devices are also vendor-specific, and hence matching against a standard product class wouldn't work anyway. If you really want to use an interface-based match for such a device, create a match record that also specifies the vendor ID. (Unforunately there isn't a standard macro for creating records like this.) Within those groups, remember that not all combinations are meaningful. For example, don't give a product version range without vendor and product IDs; or specify a protocol without its associated class and subclass. COPYRIGHT
Kernel Hackers Manual 2.6. July 2010 USB_MATCH_ID(9)

Check Out this Related Man Page

usb_dev_descr(9S)					    Data Structures for Drivers 					 usb_dev_descr(9S)

NAME
usb_dev_descr - USB device descriptor SYNOPSIS
#include <sys/usb/usba.h> INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) DESCRIPTION
The usb_dev_descr_t device descriptor defines device-wide attributes. Please refer to Section 9.6.1 of the USB 2.0 specification. The USB 2.0 specification is available at www.usb.org. The device descriptor is retrieved from a USB device during device enumeration and can be accessed via usb_get_dev_data(9F). A device descriptor contains the following fields: uint8_t bLength Size of this descriptor, in bytes. uint8_t bDescriptorType Set to USB_DESCR_TYPE_DEV. uint16_t bcdUSB USB specification release number supported, in bcd. uint8_t bDeviceClass Class code (see below). uint8_t bDeviceSubClass Subclass code (see USB 2.0 specification of applicable device class for information.) uint8_t bDeviceProtocol Protocol code (see USB 2.0 specification of applicable device class for information.) uint8_t bMaxPacketSize0 Maximum packet size of endpoint 0. uint16_t idVendor vendor ID value. uint16_t idProduct product ID value. uint16_t bcdDevice Device release number in binary coded decimal. uint8_t iManufacturer Index of optional manufacturer description string. Valid if > 0. uint8_t iProduct Index of optional product description string. Valid if > 0. uint8_t iSerialNumber Index of optional serial number string. Valid if > 0. uint8_t bNumConfigurations Number of available configurations. Device descriptors bDeviceClass values: USB_CLASS_PER_INTERFACE Class information is at interface level. USB_CLASS_COMM CDC control device class. USB_CLASS_DIAG Diagnostic device class. USB_CLASS_HUB HUB device class. USB_CLASS_MISC MISC device class. USB_CLASS_VENDOR_SPEC Vendor-specific class. USB_CLASS_WIRELESS Wireless controller device class. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |PCI-based systems | +-----------------------------+-----------------------------+ |Interface stability |Committed | +-----------------------------+-----------------------------+ |Availability |SUNWusbu | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), usb_get_alt_if(9F), usb_get_cfg(9F), usb_get_dev_data(9F), usb_get_string_descr(9F), usb_parse_data(9F), usb_cfg_descr(9S), usb_ctrl_request(9S), usb_dev_qlf_descr(9S), usb_ep_descr(9S), usb_if_descr(9S), usb_other_speed_cfg_descr(9S), usb_string_descr(9S) SunOS 5.11 5 Jan 2004 usb_dev_descr(9S)
Man Page