1. What is composite device
Composite device is defined in the USB spec as follows (usb_20.pdf 5.2.3),
"A device that has multiple interfaces controlled independently of each other is referred to as a composite device."
Using composite device, multiple functions are combined into a single device.
Ex.
- Keyboard + Mouse
- Video + USB Hard disk
- I/O device (HID + USB_bulk)
Another advantage of composite device is that it eases the device driver development.
OS assigns a separate device driver to each Interface of the composite
device as follows. Therefore, a dedicated monolithic driver is not
required for newly designed device; you can realize it using existing
drivers.
+----------------------------+ +----------------------
| Composite Device | | Host PC
| | |
| Function 0 -- Interface 0 --------- Device driver A <--->
| | |
| Function 1 -- Interface 1 --------- Device driver B <--->
+----------------------------+ +-----------------------
When OS has some required drivers as built-in, they are available for
the composite device. These OS built-in device drivers are called as USB
class driver.
"Approved Class Specification Documents" from USB.org
http://www.usb.org/developers/devclass_docs#approved
Windows have these built-in class drivers.
"USB FAQ: Introductory Level - USB Class Drivers" from MS WHDC
Enumeration of USB Composite Devices
When a new USB device is connected to a host machine, the USB bus
driver creates a physical device object (PDO) for the device and
generates a PnP event to report the new PDO. The operating system then
queries the bus driver for the hardware IDs associated
with the PDO.
For all USB devices, the USB bus driver reports a device ID with the following format:
USB\VID_xxxx&PID_yyyy
Note xxxx and yyyy are taken directly from idVendor and idProduct fields of the device descriptor, respectively.
The bus driver also reports a compatible identifier (ID) of USB\COMPOSITE
, if the device meets the following requirements:
-
The device class field of the device descriptor (bDeviceClass) must contain a value of zero, or the class (bDeviceClass), subclass (bDeviceSubClass), and protocol (bDeviceProtocol) fields
of the device descriptor must have the values 0xEF, 0x02 and 0x01 respectively, as explained in .
If you want the generic parent driver to manage your device, but your
device does not have the characteristics necessary to ensure that the
system will generate a compatible ID of USB\COMPOSITE, you will have to
provide an INF file that loads the generic
parent driver. The INF file should contain a needs/includes section
that references Usb.inf.
If your composite device has multiple configurations, the INF file
you provide must specify which configuration the generic parent should
use in the registry. The necessary registry keys are described in Related Topics
-
Enumeration of Interfaces on USB Composite Devices
Interfaces on a composite USB device can be grouped in collections or
represent one USB function individually. When the interfaces are not
grouped in collections, the generic parent driver creates a PDO for each
interface and generates a set of hardware
IDs for each PDO.
The device ID for an interface PDO has the following form:
USB\VID_v(4)&PID_p(4)&MI_z(2)
In these IDs:
-
v(4) is the four-digit vendor code that the USB standards committee assigns to the vendor.
-
p(4) is the four-digit product code that the vendor assigns to the device.
-
z(2) is the interface number that is extracted from the bInterfaceNumber field of the interface descriptor.
The generic parent driver also generates the following compatible IDs by using the information from the interface descriptor (Related topics
-
-
USB Generic Parent Driver (Usbccgp.sys)
This section describes the Usbccgp.sys driver provided by Microsoft for composite devices.
Many USB devices expose multiple USB interfaces. In USB terminology, these devices are called composite devices. Microsoft Windows 2000 and Windows 98
operating systems include a generic parent facility in the USB bus
driver (Usbhub.sys) that exposes each interface of the composite device
as a separate device. In Microsoft Windows XP and Windows
Me, this facility is streamlined and improved by transferring it to an
independent driver called the USB generic parent driver (Usbccgp.sys). Using the features of
the generic parent driver, device vendors can make selective use of
Microsoft-supplied driver support for some interfaces.
The interfaces of some composite device operate independently. For
example, a composite USB keyboard with power buttons might have one
interface for the keyboard and another interface for the power buttons.
The USB generic parent driver enumerates each of
these interfaces as a separate device. The operating system loads the
Microsoft-supplied keyboard driver to manage the keyboard interface, and
the Microsoft-supplied power keys driver to manage the power keys
interface.
If the composite device has an interface that is not supported by
native Windows drivers, the vendor of the device should provide a driver
for the interfaces and an INF file. The INF file should have an INF DDInstall section that matches the device ID of interface. The
INF file must not match the device ID for the composite device itself,
because this prevents the generic parent driver from loading. For an
explanation of how the operating system loads
the USB generic parent driver, see .
After the operating system loads the client drivers for the
interfaces of a composite device, the generic parent driver multiplexes
the data flow from the client drivers, combining these separate
interactions into a single data stream for the composite device.
The generic parent is power policy owner for the entire composite
device and all of its interfaces. It also manages synchronization and
PnP requests.
The generic parent driver can simplify the task for vendors of
composite hardware, if Microsoft-supplied drivers support some
interfaces but not others. Vendors of such devices need only supply
drivers for the unsupported interfaces, because the generic
parent driver facilitates the use of Microsoft-supplied drivers for the
supported interfaces.
The following sections describe the features and functions of the generic parent driver:
-
-
-
Related topics
-
管理员在2009年8月13日编辑了该文章文章。
-->
阅读(1589) | 评论(0) | 转发(0) |