Programming the Microsoft Windows Driver Model

Chapter 11

Controller and Multifunction Devices

Two categories of devices don t fit neatly into the PnP framework I described in Chapter 6. These categories are controller devices, which manage a collection of child devices, and multifunction devices, which have several functions on one card. These kinds of devices are similar in that their correct management entails the creation of multiple device objects with independent I/O resources.

It s very easy in Windows XP to support Peripheral Component Interconnect (PCI), Personal Computer Memory Card International Association (PCMCIA), and USB devices that conform to their respective bus standards for multifunction devices. The PCI bus driver automatically recognizes PCI multifunction cards. For PCMCIA multifunction devices, you can follow the detailed instructions in the DDK for designating MF.SYS as the function driver for your multifunction card; MF.SYS will enumerate the functions on your card and thereby cause the PnP Manager to load individual function drivers. The USB Generic Parent driver will normally load separate function drivers for each interface on a one-configuration device.

Except for USB, the original release of Windows 98 lacks the multifunction support that Windows XP provides. In Windows 98/Me, to deal with controller or multifunction devices, or to deal with nonstandard devices, you ll need to resort to more heroic means. You ll supply a function driver for your main device and supply separate function drivers for the child devices that connect to the main device. The main device s function driver will act like a miniature bus driver by enumerating the child devices and providing default handling for PnP and power requests. Writing a full-fledged bus driver is a large undertaking, and I don t intend to attempt a description of the process here. I will, however, describe the basic mechanisms you use for enumerating child devices. This information will allow you to write drivers for controller or multifunction devices that don t fit the standard molds provided by Microsoft.

Категории