Resource Descriptors

A resource descriptor describes the resources in a logical configuration. There are resource descriptors for memory, IO ports, DMA channels, and IRQs. Other resource descriptors can be created as needed to identifies other types of resources available to devices.

Memory resource descriptors identify memory address ranges. The descriptor contains a MEM_DES structure that describes the memory resource and an array of MEM_RANGE structures that identify the possible memory configurations.

I/O port resource descriptors identify IO port address ranges. The descriptor contains an IO_DES structure that describes the IO port resource and and array of IO_RANGE structures that identify the possible port configurations.

DMA channel resource descriptors identify a set of DMA channel alternatives. The descriptor is a DMA_DES structure that identifies the DMA channels that the device can use.

IRQ resource descriptors identify a set of IRQ alternatives. The descriptor is a IRQ_DES structure that identifies the IRQs the device can use and whether the IRQ can be shared.

The Configuration Manager provides services that device drivers and other components can use to examine and modify resource descriptors. There are these services:

Service

Description

CONFIGMG_Add_Res_Des

Adds a resource descriptor to a logical configuration.

CONFIGMG_Free_Res_Des

Destroys a resource descriptor.

CONFIGMG_Get_Next_Res_Des

Retrieves the handle of the next resource descriptor in a logical configuration.

CONFIGMG_Get_Res_Des_Data

Copies the data from a specified resource descriptor into a buffer.

CONFIGMG_Get_Res_Des_Data_Size

Retrieves the size of a resource descriptor, not including the resource-descriptor header.

CONFIGMG_Modify_Res_Des

Modifies a resource descriptor.


When working with IO port resource descriptors, the IOR_Alias and IOR_Decode values specify the port aliases that a device responds to. A port alias is an address that the device responds to as if it were the actual address of an IO port. Additionally, some cards will actually use additional ports for different purposes, but use a decoding scheme that makes it seem as though they were using aliases; for example, an ISA card may decode 10 bits and require port 03C0h. This card would need to specify an IOR_Alias offset of 04h and a IOR_Decode of 3 (no aliases are used as actual ports). For convenience, the alias field can be set to zero indicate no aliases are required; in this case, the decode field is ignored.

If the card were to use the ports at 7C0h, 0BC0h, and 0FC0h, where these ports have different functionality, the IOR_Alias value would be the same and the IOR_Decode value would be 0Fh, indicating that bits 11 and 12 of the port address were significant. Thus, the allocation is for all of the ports (PORT[i] + (n*alias*256)) & (decode*256 | 03FFh), where n is any integer and PORT is the range specified by the IOR_nPorts, IOR_Min, and IOR_Max fields. Note that the minimum alias is 4 and the minimum decode is 3.

Because of the history of the ISA bus, it is assumed that all EISA and ISA cards that use any port where PORT = n*400 + Z (where "Z" is a port in the range 100h - 3ffh, and "N" is greater than or equal to 1) will reserve port Z and treat the other port(s) as aliases. If a port that falls in this set is reserved but the driver does not reserve the "Z" address, it is assumed that the device is on a local bus (such as PCI) where the reserved port address is not presented on the ISA bus.