NDIS Plug and Play Support (Windows CE 5.0)
Dynamic adapter-binding complies with the requirements for Plug and Play compatibility. Plug and Play enables a computer to recognize hardware configuration changes automatically and configure attached devices with little or no user intervention. You can unbind an adapter from a protocol driver and subsequently rebind without having to remove the adapter.
Windows CE Plug and Play support differs from the Microsoft Windows 2000 Plug and Play support.
The following list shows the Windows CE Plug and Play support functionality:
- Automatic and dynamic recognition of installed hardware. This includes initial system installation and response to run-time hardware events, such as insertion or removal of cards.
- Streamlined hardware configuration in response to automatic and dynamic recognition of hardware, including dynamic hardware activation, resource arbitration, device driver loading, and drive mounting.
- Support for particular buses and other hardware standards that facilitate automatic and dynamic recognition of hardware and streamlined hardware configuration, including Plug and Play PCMCIA, PC Card and CardBus, universal serial bus (USB), and IEEE 1394. This includes promulgation of standards and advice about how hardware should behave.
- An orderly Plug and Play framework in which driver writers can operate. This includes infrastructure, such as APIs, kernel-mode notifications, and executive interfaces.
Note that Plug and Play operation does not require Plug and Play hardware. The second and third bullets above mostly apply to legacy hardware as well as Plug and Play hardware. In some cases, orderly enumeration of legacy devices is not possible because the detection methods are destructive or inordinately time-consuming.
The primary impact that Plug and Play support has on protocol stacks is that network interfaces can connect and disconnect at any time. The Windows CE TCP/IP stack and related technologies have been adapted to support Plug and Play.
Windows CE Plug and Play is transparent to the miniport drivers. When the user attaches a network adapter, a miniport is installed, loaded, and bound automatically. When the network adapter is removed, the miniport is unbound, shut down, and unloaded. To implement Plug and Play on a Windows CE–based system, you must set the DriverEntry function to init. The remaining miniport initialization code should be set to page because it might be used after system initialization.
Miniport drivers for network adapters require an HKEY_LOCAL_MACHINE\Drivers\PCMCIA\Plug and Play ID registry key. This key typically is named after the Plug and Play identifier of the network adapter, but this is not a requirement. The following table shows the subkeys contained in this registry key.
Subkey | Contents |
---|---|
DLL | The literal value Ndis.dll. |
Prefix | The literal value NDS. |
Miniport | The name of the miniport driver for the network adapter, which corresponds with the name of the subkey within the HKEY_LOCAL_MACHINE\Comm registry key for the miniport driver. |
The following code snippet shows how a network adapter can have the additional keys.
[HKEY_LOCAL_MACHINE\Drivers\PCMCIA\Plug and Play ID]
DLL="NDIS.DLL"
Prefix= "NDS"
Miniport="NE2000"
The NDIS interface sets the values for the BusNumber and BusType keys for network adapters. The BusNumber key contains the socket and function pair for the adapter. The BusType key contains the value for the network adapter bus. If the information structure of the network adapter contains a network address value, Ndis.dll will create a HKEY_LOCAL_MACHINE\Comm\<miniport Name>\<miniport Instance>\Network Address registry key to store the network address.
Miniport drivers for a network adapter typically implement an Install_Driver function for installing the appropriate registry settings that will allow dynamic recognition of the network adapter. For example, when a network adapter is inserted into a Windows CE OS, it tries to recognize the appropriate driver for the adapter by matching its Plug and Play identifier with an appropriate key in the registry. If the system fails to find a Plug and Play match, it will prompt the user to enter a driver name. If this user-supplied driver DLL exports Install_Driver, then the system calls this function. The primary purpose of this function is to populate the Windows CE registry with appropriate entries for this miniport driver so that future insertions of the network adapter will lead to dynamic loading of the correct NDIS miniport driver.
See Also
Send Feedback on this topic to the authors