USB Complete by Axelson Jan

USB Complete by Axelson Jan

Author:Axelson, Jan
Language: eng
Format: epub
Publisher: Lakeview Research
Published: 2015-01-09T16:00:00+00:00


Using device identification strings

To identify possible drivers for a device, Windows searches the system’s INF files for a device identification string that matches a string created from information in the device’s descriptors. Types of device identification strings include device ID, hardware ID, and compatible ID.

Device ID

A device ID is a string that identifies a device using information obtained from the device’s bus driver. For USB devices, the information includes the Vendor ID, Product ID, revision number, and other values as appropriate from the device’s descriptors. The PnP manager uses the device ID to create the registry subkey that holds the hardware keys for device instances. A device ID uses the same format as a hardware ID.

Hardware ID

A hardware ID identifies a device, a device interface, or a HID collection using the Vendor ID, Product ID, and revision number or other class-specific information.

When assigning a driver, a hardware ID in an INF file is the best match. A hardware ID for a USB device has this form:

USB\Vid_xxxx&Pid_yyyy&Rev_zzzz

The values in xxxx, yyyy, and zzzz are four characters each, with xxxx = idVendor, yyyy = idProduct, and zzzz = bcdDevice from the device descriptor. The xxxx and yyyy values are hexadecimal, and zzzz is in BCD format.

For example, a device with Vendor ID = 0x0925, Product ID = 0x1234, and bcdDevice = 0x0310 has this device ID:

USB\Vid_0925&Pid_1234&Rev_0310

An INF file may omit the bcdDevice value:

USB\Vid_xxxx&Pid_yyyy

Composite devices can specify a driver for each function so they have a device ID for each interface that represents a function. A device ID for an interface has this format:

USB\Vid_xxxx&Pid_yyyy&Rev_zzzz&MI_ww

The 2-character value in ww equals bInterfaceNumber in the interface descriptor for one of the device’s interfaces.

A HID-class device whose report descriptor contains more than one top-level collection can have a device ID for each collection. (See Chapter 12 for more about HID collections.) A device ID for a collection has this format with bb indicating the collection number:

USB\Vid_xxxx&Pid_yyyy&Rev_zzzz&MI_ww&Colbb

Devices in some classes use other formats.

For CDC devices, the hardware ID can contain a value that specifies the subclass. This device ID specifies CDC subclass 0x08:

USB\Vid_0925&Pid_0902&Rev_0210&Cdc_08

For mass-storage devices, the USB mass-storage driver (usbstor.sys) creates a hardware ID for a drive, for example:

USBSTOR\ST3000DM001-1CH166___CC44

The ID has an 8-character vendor identifier (ST3000DM), a 16-character product identifier (001-1CH166___), and a 4-character revision level (CC44).

For printers, the USB printer driver creates a hardware ID, for example:

USBPRINT\BrotherHL-4150CDN_se922A

The ID contains the manufacturer’s name and model using a maximum of 20 characters (BrotherHL-4150CDN_se) and a 4-character checksum (922A).

For keyboards, mice, game controllers, and other system HIDs, Windows uses special-purpose hardware IDs, for example, HID_DEVICE_SYSTEM_KEYBOARD and HID_DEVICE_SYSTEM_MOUSE. Vendor-provided INF files should not contain these hardware IDs, which begin with HID_DEVICE_SYSTEM_.

To specify a HID Usage Page and Usage, Windows uses device IDs with the format HID_DEVICE_UP:p(4)_U:u(4) where

p(4) is a 4-character hex value specifying the Usage Page and

u(4) is a 4-character hex value specifying the Usage.

For example, this hardware ID applies to devices with a Usage Page of 0x0C (Consumer) and Usage of 0x01 (Consumer Control):

HID_DEVICE_UP:000C_U:0001

Vendor-provided INF files should not contain Usage Page hardware IDs.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.