Share via


Converting a Legacy PCMCIA Driver to a Bus-Agnostic Driver (Windows Embedded CE 6.0)

1/6/2010

Although the PC Card bus driver supports all legacy PCMCIA drivers. Microsoft recommends that you convert legacy PCMCIA drivers to bus-agnostic PC Card drivers. A bus-agnostic driver is a standard driver that is relatively simple to implement and can be shared by various bus implementations for the same hardware chipset. For example, the bus-agnostic PCI NE2000 driver works correctly for the NE2000 PCMCIA card. The NE2000 PCMCIA card functions the same with the PCI NE2000 driver as it would with the PCMCIA NE2000 driver.

Although the legacy PCMCIA driver is still supported, Microsoft recommends that you migrate a PCMCIA driver to the bus-agnostic driver model. For information on the bus-agnostic driver model, see PC Card Bus-Agnostic Client Drivers.

Unlike the legacy PCMCIA driver, the PC Card bus driver does not use the Detect function for a class-specific driver, such as an NE2000 driver. Instead, it uses a registry template to implement a match mechanism introduced by PCI. Unlike PCI, which uses Class ID to locate an entry, the PC Card bus driver uses a deprecated ISA address to locate an entry. For example, an NE2000 driver supports the deprecated PCMCIA address on 0x300, 0x320, and 0x340. Another example is the COM16550 driver, which supports the deprecated address 0x3f8, 0x2f8, 0x3e8, and 0x2e8. Also, an additional value, such as the function ID number, is used for matching. If a card-specific driver uses the same address as a PCMCIA-class driver, it can implement the Plug and Play ID to load a specified driver.

The 16-bit PC Card match template is located at HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE. The 32-bit PC Card match template is located at HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template. A 32-bit PC Card has the same match template as a PCI bus driver.

The 16-bit Plug and Play D entry is located at HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\PNP. The 32-bit Plug and Play ID entry is located at HKEY_LOCAL_MACHINE\Drivers\PCCARD\CARDBUS\PNP.

A Plug and Play registry entry appears in a search before a template registry entry. If a device has a PCMCIA ISA address that conflicts with an existing template, use the Plug and Play ID registry entry instead of the template registry entry. If you develop a driver for a specific PCMCIA card, use the Plug and Play ID registry entry to prevent future conflicts.

The following registry entry must be created to support a deprecated PC Card driver. Pcc_pcm.dll is renamed to Pcmcia.dll during the make image process.

[HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE\PCMCIA]
  "Dll"="pcmcia.dll"
  "NoConfig"=dword:1
  "IClass"=multi_sz:"{6BEAB08A-8914-42fd-B33F-61968B9AAB32}=PCMCIA Card Services"

The following registry example shows the implementation of a bus-agnostic driver for a NE2000 PCMCIA driver.

[HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE\NE2000A]
  "Dll"="ndis.dll"
  "Prefix"="NDS"
  "Miniport"="NE2000"
  "FUNCTION_ID"=dword:6
  "INTERRUPT_MASK"=dword:ffff
  "IoBase"=dword:300
  "IoLen"=dword:20
[HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE\NE2000B]
  "Dll"="ndis.dll"
  "Prefix"="NDS"
  "Miniport"="NE2000"
  "FUNCTION_ID"=dword:6
  "INTERRUPT_MASK"=dword:ffff
  "IoBase"=dword:320
  "IoLen"=dword:20
[HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE\NE2000C]
  "Dll"="ndis.dll"
  "Prefix"="NDS"
  "Miniport"="NE2000"
  "FUNCTION_ID"=dword:6
  "INTERRUPT_MASK"=dword:ffff
  "IoBase"=dword:340
  "IoLen"=dword:20

The following registry example shows the implementation of a bus-agnostic driver for a COM 16550 driver.

[HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE\COM_CARDA]
  "FUNCTION_ID"=dword:2
  "IoBase"=dword:3f8
  "IoLen"=dword:8
  "INTERRUPT_MASK"=dword:ffff
  "DeviceArrayIndex"=dword:0
  "Prefix"="COM"
  "Dll"="com16550.dll"
; Turn on follows for Installable ISR (isr16550 supporting SOFTWARE FIFO
  "IsrDll"="isr16550.dll"
  "IsrHandler"="ISRHandler"
[HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE\COM_CARDB]
  "FUNCTION_ID"=dword:2
  "IoBase"=dword:2f8
  "IoLen"=dword:8
  "INTERRUPT_MASK"=dword:ffff
  "DeviceArrayIndex"=dword:0
  "Prefix"="COM"
  "Dll"="com16550.dll"
; Turn on follows for Installable ISR (isr16550 supporting SOFTWARE FIFO
  "IsrDll"="isr16550.dll"
  "IsrHandler"="ISRHandler"
[HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE\COM_CARDC]
  "FUNCTION_ID"=dword:2
  "IoBase"=dword:3e8
  "IoLen"=dword:8
  "INTERRUPT_MASK"=dword:ffff
  "DeviceArrayIndex"=dword:0
  "Prefix"="COM"
  "Dll"="com16550.dll"
; Turn on follows for Installable ISR (isr16550 supporting SOFTWARE FIFO
  "IsrDll"="isr16550.dll"
  "IsrHandler"="ISRHandler"
[HKEY_LOCAL_MACHINE\Drivers\PCCARD\PCMCIA\TEMPLATE\COM_CARDD]
  "FUNCTION_ID"=dword:2
  "IoBase"=dword:2e8
  "IoLen"=dword:8
  "INTERRUPT_MASK"=dword:ffff
  "DeviceArrayIndex"=dword:0
  "Prefix"="COM"
  "Dll"="com16550.dll"
; Turn on follows for Installable ISR (isr16550 supporting SOFTWARE FIFO
  "IsrDll"="isr16550.dll"
  "IsrHandler"="ISRHandler"

If your PC Card requires additional functionality that the default enabler cannot handle, you can insert the following registry value:

"NoConfig" = dword:1

Then, configure the PC Card using card services, which is similar to legacy PCMCIA card services. It has been modified, however, to adapt to current requirements. For more information on card services, see PC Card Bus Driver.

See Also

Concepts

PC Card Bus-Agnostic Client Drivers
PC Card Bus Driver
Legacy PCMCIA Driver Support

Other Resources

PC Card Drivers