PC Card Bus Driver (Windows CE 5.0)
The PC Card bus driver consists of several technologies: the card manager, the bus-agnostic interface, and the auto-enabler.
The card manager keeps track of each card object. Card function objects are created for each instance of a card insertion and are destroyed when the card is removed. A card function object controls memory and I/O window allocation and destruction. Each card function object reads the configuration information space (CIS) of the card to determine the number of supported functions. It then creates one card function object for each supported function.
Card function objects control the configuration of a function and handle client callbacks from card status change events. A tuple object provides an interface for reading tuples from the configuration information space of the card. It then uses window allocation routines for a card function object to gain access to the configuration information space of the card and handle the parsing of the tuples.
The bus-agnostic interface allows the PC Card bus driver to support a bus-agnostic PC Card driver, which includes PC Card client drivers. The PC Card bus driver also supports legacy PCMCIA drivers developed prior to Windows CE 5.0, allowing legacy PCMCIA drivers to function correctly. The PC Card bus driver can also handle multiple PC Card readers and allows installable interrupt service routines (ISRs) for client drivers.
The PC Card bus driver also supports a CardBus driver. CardBus is a hardware standard that facilitates streamlined configuration and automatic, dynamic recognition and of busses. CardBus cards, bridges, drivers, and so on, adhere to the CardBus hardware standard. Because Windows CE supports this standard, devices that are combined legacy PCMCIA card readers and CardBus bridges can use a single device driver.
The auto-enabler is the default handler for PC Card configuration, if the enabler is not disabled in the registry. PC Card card services is initialized only once. It is then ready to accept platform dependent driver (PDD) binding and PC Card card services from the client driver.
After the PC Card card service receives a card-insertion notification from the socket driver, the following tasks must be completed by the PC Card bus driver:
- Create a card service object for function zero.
- Call SS_ResetSocket to reset the card to its initial power-on voltage.
- Send a CE_CARD_INSERTION event code to the default card enabler.
- Scan for a multi-function PC Card and, if one is found, create a child card service for the remaining function cards.
When a card event occurs, all registered clients that have matched interface types and the same event mask are notified. The notification sequence is first in, last called. Because the default card enabler client is registered first in the PC Card bus driver, it should be called last.
The default card enabler is registered as a standard client. When it receives a CE_CARD_INSERTION notification, it attempts to call CardRequestExclusive to receive exclusive access to the card. After it succeeds, the following processes occur:
The default enabler reads the Plug and Play identification value from the tuple.
The default enabler reads and parses each configuration entry.
If a Plug and Play entry exists, the default enabler attempts to match it to the correct configuration entries.
The configuration entry is pre-qualified by a successful return on a call to CardRequestConfiguration. For 16-bit legacy PCMCIA cards, the Plug and Play entry is
HKLM\Drivers\PCCARD\PCMCIA\PNP\[PNP-ID]
.HKLM\Drivers\PCCARD\CARDBUS\PNP\[PNP-ID]
.If a Plug and Play entry does not exist, for a 16-bit PCMCIA card, the default enabler attempts to match all pre-qualified configuration entries with the registry keys under
HKLM\Drivers\PCCARD\PCMCIA\TEMPLATE
.For 32-bit CardBus cards, the configuration space is used to find a match on any registry entry under
HKLM\Drivers\BuiltIn\PCI\TEMPLATE
.If an entry is found, the default enabler configures the card if the
NoConfig
registry entry is not set.Configuration sets voltage, memory or I/O windows, and IRQ requested by the configuration entry.
An instance registry is created and any registry keys that are found are copied to the instance registry.
For 16-bit PCMCIA cards, the instance key is located under
HKLM\Drivers\PCCARD\PCMCIA\INSTANCE
. For 32-bit CardBus cards, the instance key is located underHKLM\Drivers\PCCARD\CARDBUS\INSTANCE
.The client driver is loaded using the ActivateDeviceEx function.
If no match is found, the default enabler attempts to force the socket to perform an eject operation.
If the
NoConfig
registry value is set, the default enabler assumes that the driver will configure the card by itself. It then releases the configuration and then performs steps 6 and 7.The default enabler calls the configuration routine from the configuration DLL, if the configuration routine and the DLL are specified in the registry.
See Also
PC Card Drivers | SS_ResetSocket | CardRequestExclusive | CardRequestConfiguration | ActivateDeviceEx
Send Feedback on this topic to the authors