Device Driver Services and Messages

A device driver controls and manages the device hardware. Device drivers are responsible for identifying the specific resource requirements of the given device and for setting the device to operate with the configuration assigned by the Configuration Manager. The Configuration Manager provides services and messages that a device driver can use to carry out its tasks. In particular, a device driver can register a configuration handler function by using the CONFIGMG_Register_Device_Driver service. Once the handler is registered, the Configuration Manager sends it configuration messages whenever it needs the device driver to carry out a configuration task.

These are the device driver services:

Service

Description

CONFIGMG_CallBack_Device_Driver

Calls back to the device driver, once per devnode, with CONFIGMG_Register_Device_Driver.

CONFIGMG_Get_Device_Driver_Private_DWord

Retrieves the private value for a device driver in a device node.

CONFIGMG_Register_Device_Driver

Registers a configuration handler for a device node.

CONFIGMG_Set_Device_Driver_Private_DWord

Sets the private value for a device driver in a device node.


These are the configuration messages:

Message

Description

CONFIG_ENUMERATE

Directs a driver to enumerate its immediate children. This message is sent when a device is inserted or removed.

CONFIG_FILTER

Directs a driver to process a new device or changes to the configuration of a device.

CONFIG_REMOVE

Notifies the driver that the associated device node is being removed from the hardware tree.

CONFIG_START

Notifies the driver that a configuration has been allocated for the device node; the driver can retrieve the configuration and begin to use it.

CONFIG_STOP

Directs the driver to stop using its currently allocated configuration.

CONFIG_TEST

Requests permission from the driver to invalidate the assigned configuration or remove the given device node; the driver should not grant permission if it cannot stop using the current configuration or is not prepared for the device to be removed from the system.


The device driver must return CR_DEFAULT for any configuration messages it does not process.