Standard Plug and Play Device Driver

A Plug and Play device driver may be any driver that follows the Plug and Play architecture. These drivers handle dynamic configuration and removal. They receive their configuration from Configuration Manager and have no direct interaction with the PCMCIA components. Therefore, they may be run as the device drivers for a PC card without any knowledge of the card existing in a PCMCIA bus. These are the preferred drivers for PCMCIA devices. Once Plug and Play assigns IRQ, memory and I/O, access and operation of the card will be done using the assigned resources.

This approach is recommended if the device driver does not require the Card Services functions. All resource allocation for the driver will be done by Configuration Manager, based on the table of required resources supplied by the device. The actual configuration of the card will be done by Config Manager through the PCMCIA bus enumerator after the resources have been allocated. This will allow the same device driver to support ISA/EISA/PCI and PCMCIA implementations of the same device. Note that this approach cannot be used for PC cards which do not contain the tuples required to identify the PC card and allow a device ID to be created. Cards with invalid or missing configuration tuples can still benefit through the CIS override mechanism, whereby the INF file lists the correct logical configuration possibilities for the device. See the section on Windows INF files for further information on the override mechanism.

A device driver that supports a card that uses the correct tuples (as defined in "PC Card Tuples" earlier in this chapter) but needs to access the Card Services memory functions should choose a mixed approach: it can be both a Plug and Play and a Card Services device driver. The structure of the driver is the same, except that it calls Card Services functions when necessary. If the driver needs a client handle, it may register with Card Services as a Card Services client.The card would still be automatically configured at insertion time by the PCMCIA bus enumerator, but any access to the PC card's tuples or memory window manipulation would be performed by the driver calling Card Services functions.

Details on writing a standard Plug and Play device driver are found in other sections of the Device Driver Kit (DDK). Note that existing driver architectures such as NDIS3 for network adapters, and NT miniports for SCSI devices are already Plug & Play, as the underlying subsystems handle the PnP requirements for their client drivers.