JustKernel

Ray Of Hope

USB Device Stack

<img id=”joydobj” src=”http://i.msdn.microsoft.com/dynimg/IC103532.png” alt=”Sample WDM Device Object Layers – USB Joystick” />

Starting at the bottom of the figure , the device objects in the sample device stack include:
1. A PDO and an FDO for the PCI Bus: The root bus driver enumerates the internal system bus 9the root bus) and creates a PDO for each device it finds. One of these PDOs is for the PCI bus .

The PnP manager identifies the PCI driver as the function driver for the PCI bus, loads the driver (if it is not already loaded), and passes the PDO to th PCI driver. In its AddDevice routine, the PCI driver creates and FDO for the PCI bus (IoCreateDevice) and attaches the FDO to the devie stack (IoAttachDeviceToDeviceStack) for the PCI bus. The PCI driver creates and attaches this FDO as part of its responsibilities as the function driver for the PCI bus.

2. A PDO and and FDO for the UDB controller : The PNP manager directs the PCI driver to start its device (IRP_MN_START_DEVCE) and then queris the PCI driver for its children (IRP_MAN_QUERY_DEVICE_RELATIONS with relation type of the BusRelations). In response, the PCI driver enumerates the devices on its bus. In this example, the PCI driver finds a USB host controller and creates a PDO for that device.

The PnP manager identifies the USB host controller miniclass/class driver pair as the function driver for the USB host controller and loads the driver pair. The PnP manager calls the driver pair at the appropriate time to create and attach an FDO for the USB host controller.

3.  A PDO and and FDO for the USB hub. The USB host controller enumberates its bus, locates the USB hub in the sole port, and creates a PDO for the hub. The USB  hub driver creates and attaches an FDO for the hub.

4. A PDO, and FDO and two filter DOs for the joystick device. : The USB hub driver enumerates its bus , locates a HID device (the joystick) , and creates a PDO for the joystick.

The PnP manager determines that the function driver for the joystick device is the HID class/miniclass driver pair and loads those drivers. The driver pair consists of a miniclass driver linked to a class driver DLL; together they act as one funciton driver for the device. The class/miniclass driver pair creates one device object, the FDO, and attaches it to the device stack.

Originally Posted On: 2010-05-09 10:27:06

Anshul Makkar, anshul_makkar@justkernel.com

Tags:


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.