Export (0) Print
Expand All
IRP
MDL
Expand Minimize

IO_RESOURCE_DESCRIPTOR Structure

The IO_RESOURCE_DESCRIPTOR structure describes a range of raw hardware resources, of one type, that can be used by a device. An array of IO_RESOURCE_DESCRIPTOR structures is contained within each IO_RESOURCE_LIST structure.

typedef struct _IO_RESOURCE_DESCRIPTOR {
  UCHAR  Option;
  UCHAR  Type;
  UCHAR ShareDisposition;
  UCHAR  Spare1;
  USHORT  Flags;
  USHORT  Spare2;
  union {
    struct {
      ULONG  Length;
      ULONG  Alignment;
      PHYSICAL_ADDRESS  MinimumAddress;
      PHYSICAL_ADDRESS  MaximumAddress;
    } Port;
    struct {
      ULONG  Length;
      ULONG  Alignment;
      PHYSICAL_ADDRESS  MinimumAddress;
      PHYSICAL_ADDRESS  MaximumAddress;
    } Memory;
    struct {
      ULONG  MinimumVector;
      ULONG  MaximumVector;
      // The following only exist on Windows Vista and later.
#if defined(NT_PROCESSOR_GROUPS)
      IRQ_DEVICE_POLICY  AffinityPolicy;
      USHORT  Group;
#else
      IRQ_DEVICE_POLICY  AffinityPolicy;
#endif
      IRQ_PRIORITY  PriorityPolicy;
      KAFFINITY  TargetedProcessors;
    } Interrupt;
    struct {
      ULONG  MinimumChannel;
      ULONG  MaximumChannel;
    } Dma;
    struct {
      ULONG RequestLine;
      ULONG Reserved;
      ULONG Channel;
      ULONG TransferWidth;
    } DmaV3;
    struct {
      ULONG  Length;
      ULONG  Alignment;
      PHYSICAL_ADDRESS  MinimumAddress;
      PHYSICAL_ADDRESS  MaximumAddress;
    } Generic;
    struct {
      ULONG  Data[3];
    } DevicePrivate;
    struct {
      ULONG  Length;
      ULONG  MinBusNumber;
      ULONG  MaxBusNumber;
      ULONG  Reserved;
    } BusNumber;
    struct {
      ULONG  Priority;
      ULONG  Reserved1;
      ULONG  Reserved2;
    } ConfigData;
    struct {
      ULONG  Length40;
      ULONG  Alignment40;
      PHYSICAL_ADDRESS  MinimumAddress;
      PHYSICAL_ADDRESS  MaximumAddress;
    } Memory40;
    struct {
      ULONG  Length48;
      ULONG  Alignment48;
      PHYSICAL_ADDRESS  MinimumAddress;
      PHYSICAL_ADDRESS  MaximumAddress;
    } Memory48;
    struct {
      ULONG  Length64;
      ULONG  Alignment64;
      PHYSICAL_ADDRESS  MinimumAddress;
      PHYSICAL_ADDRESS  MaximumAddress;
    } Memory64;
    struct {
      UCHAR Class;
      UCHAR Type;
      UCHAR Reserved1;
      UCHAR Reserved2;
      ULONG IdLowPart;
      ULONG IdHighPart;
    } Connection;
  } u;
} IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR;
	

Members

Option

Specifies whether this resource description is required, preferred, or alternative. One of the following values must be used:

0

The specified resource range is required, unless alternative ranges are also specified.

IO_RESOURCE_PREFERRED

The specified resource range is preferred to any alternative ranges.

IO_RESOURCE_ALTERNATIVE

The specified resource range is an alternative to the range preceding it. For example, if one IO_RESOURCE_DESCRIPTOR structure specifies IRQ 5, with IO_RESOURCE_PREFERRED set, and the next structure specifies IRQ 3, with IO_RESOURCE_ALTERNATIVE set, the PnP manager assigns IRQ 3 to the device only if IRQ 5 is unavailable. (Multiple alternatives can be specified for each resource. Both IO_RESOURCE_ALTERNATIVE and IO_RESOURCE_PREFERRED can be set, indicating a preferred alternative.)

IO_RESOURCE_DEFAULT

Not used.

Type

Identifies the resource type. For a list of valid values, see the Type member of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure.

ShareDisposition

Indicates whether the described resource can be shared. For a list of valid values, see the ShareDisposition member of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure.

Flags

Contains bit flags that are specific to the resource type. The following table shows the flags that are valid if Type = CmResourceTypeInterrupt.

Resource typeFlagDefinition

CmResourceTypeInterrupt

CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE

The IRQ line is level-triggered. (These IRQs are usually sharable.)

CM_RESOURCE_INTERRUPT_LATCHED

The IRQ line is edge-triggered.

CM_RESOURCE_INTERRUPT_MESSAGE

If this flag is set, the interrupt is a message-signaled interrupt. Otherwise, the interrupt is a line-based interrupt. This flag can be set starting with Windows Vista.

CM_RESOURCE_INTERRUPT_POLICY_INCLUDED

If this flag is set, the u.Interrupt member includes data that describes the device's interrupt policy. This flag can be set starting with Windows Vista.

CM_RESOURCE_INTERRUPT_SECONDARY_INTERRUPT

The interrupt is a secondary interrupt. This flag can be set starting with Windows 8. For more information about secondary interrupts, see GPIO Interrupts.

CM_RESOURCE_INTERRUPT_WAKE_HINT

The interrupt is capable of waking the operating system from a low-power idle state or a system sleep state. This flag can be set starting with Windows 8. For more information about wake capabilities, see Enabling Device Wake-Up.

 

For a list of valid flags for other resource types, see the description of the Flags member of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure.

u.Port

Specifies a range of I/O port addresses, using the following members:

Length

The length, in bytes, of the range of assignable I/O port addresses.

Alignment

The alignment, in bytes, that the assigned starting address must adhere to. The assigned starting address must be an integer multiple of Alignment.

MinimumAddress

The minimum bus-relative I/O port address that can be assigned to the device.

MaximumAddress

The maximum bus-relative I/O port address that can be assigned to the device.

Drivers for Windows Vista and later versions of the Windows operating system must use RtlIoDecodeMemIoResource and RtlIoEncodeMemIoResource to read and update this member, rather than updating it directly.

u.Memory

Specifies a range of memory addresses, using the following members:

Length

The length, in bytes, of the range of assignable memory addresses.

Alignment

The alignment, in bytes, that the assigned starting address must adhere to. The assigned starting address must be an integer multiple of Alignment.

MinimumAddress

The minimum bus-relative memory address that can be assigned to the device.

MaximumAddress

The maximum bus-relative memory address that can be assigned to the device.

Drivers for Windows Vista and later versions of the Windows operating system must use RtlIoDecodeMemIoResource and RtlIoEncodeMemIoResource to read and update this member, rather than updating it directly.

u.Interrupt

Specifies an interrupt vector range, using the following members:

MinimumVector

The minimum bus-relative vector that can be assigned to the device.

MaximumVector

The maximum bus-relative vector that can be assigned to the device.

If the CM_RESOURCE_INTERRUPT_MESSAGE flag bit is set, the values of the MinimumVector and MaximumVector members have special meanings. For more information, see Using Interrupt Resource Descriptors.

The system supplies the following additional members on Windows Vista and later versions of the Windows operating system:

AffinityPolicy

Specifies an IRQ_DEVICE_POLICY value that indicates how the system should distribute a device's interrupts between processors.

PriorityPolicy

Specifies an IRQ_PRIORITY value that indicates the priority with which the system should dispatch the device's interrupts.

TargetedProcessors

Specifies a KAFFINITY value that indicates which processors should handle the device's interrupts. This value is used only if AffinityPolicy is IrqPolicySpecifiedProcessors.

The operating system supports the following additional member only on Windows 7 and later versions of Windows:

Group

Specifies a processor group number. Group is a valid (but optional) member of u.Interrupt only in Windows 7 and later versions of Windows. This member exists only if NT_PROCESSOR_GROUPS is defined at compile time. If the Group member exists, the Group and TargetedProcessors members together specify a group affinity that identifies the set of processors that should handle the device's interrupts. To specify an affinity for a particular group, set AffinityPolicy to IrqPolicySpecifiedProcessors and set Group to the appropriate group number. In addition, TargetedProcessors must specify the target processors in the group. If you set AffinityPolicy to a value other than IrqPolicySpecifiedProcessors, set Group to ALL_PROCESSOR_GROUPS to indicate that the driver is group-aware (that is, designed to handle information about processor groups). A driver cannot specify target processors if Group equals ALL_PROCESSOR_GROUPS; such target specifications are ignored.

u.Dma

Specifies a DMA setting, using one of the following members:

MinimumChannel

The minimum bus-relative DMA channel that can be assigned to the device.

MaximumChannel

The maximum bus-relative DMA channel that can be assigned to the device.

u.DmaV3

Specifies the DMA settings for a driver that uses version 3 of the DMA_OPERATIONS structure:

RequestLine

The number of the request line on the system DMA controller that is allocated to the device.

Reserved

Not used.

Channel

The number of the DMA channel on the system DMA controller that is allocated to the device.

TransferWidth

Specifies the width, in bits, of the data bus that the system DMA controller that is allocated to the device uses to transfer data to or from the device.

The u.DmaV3 member is available starting with Windows 8.

u.Generic

Not used.

u.DevicePrivate

Reserved for system use.

u.BusNumber

Specifies bus numbers, using the following members:

Length

The number of bus numbers required.

MinBusNumber

The minimum bus-relative bus number that can be assigned to the device.

MaxBusNumber

The maximum bus-relative bus number that can be assigned to the device.

Reserved

Not used.

u.ConfigData

Reserved for system use.

u.Memory40

Specifies a range of memory addresses, using the following members:

Length40

The high 32 bits of the 40-bit length, in bytes, of the range of assignable memory addresses. The lower 8 bits are treated as zero.

Alignment40

The high 32 bits of the 40-bit alignment, in bytes, that the assigned starting address must adhere to. The lower 8 bits are treated as zero. The assigned starting address will be a multiple of the alignment.

MinimumAddress

The minimum bus-relative memory address that can be assigned to the device.

MaximumAddress

The maximum bus-relative memory address that can be assigned to the device.

The u.Memory40 member is available only on Windows Vista and later versions of the Windows operating system. Drivers for these versions of Windows must use RtlIoDecodeMemIoResource and RtlIoEncodeMemIoResource to read and update this member, rather than updating it directly.

u.Memory48

Specifies a range of memory addresses, using the following members:

Length48

The high 32 bits of the 48-bit length, in bytes, of the range of assignable memory addresses. The lower 16 bits are treated as zero.

Alignment48

The high 32 bits of the 48-bit alignment, in bytes, that the assigned starting address must adhere to. The lower 16 bits are treated as zero. The assigned starting address will be a multiple of the alignment.

MinimumAddress

The minimum bus-relative memory address that can be assigned to the device.

MaximumAddress

The maximum bus-relative memory address that can be assigned to the device.

The u.Memory48 member is available only on Windows Vista and later versions of the Windows operating system. Drivers for these versions of Windows must use RtlIoDecodeMemIoResource and RtlIoEncodeMemIoResource to read and update this member, rather than updating it directly.

u.Memory64

Specifies a range of memory addresses, using the following members:

Length64

The high 32 bits of the 64-bit length, in bytes, of the range of assignable memory addresses. The lower 32 bits are treated as zero.

Alignment64

The high 32 bits of the 64-bit alignment, in bytes, that the assigned starting address must adhere to. The lower 32 bits are treated as zero. The assigned starting address will be a multiple of the alignment.

MinimumAddress

The minimum bus-relative memory address that can be assigned to the device.

MaximumAddress

The maximum bus-relative memory address that can be assigned to the device.

The u.Memory64 member is available only on Windows Vista and later versions of the Windows operating system. Drivers for Windows Vista and later versions of the Windows operating system must use RtlIoDecodeMemIoResource and RtlIoEncodeMemIoResource to read and update this member, rather than updating it directly.

u.Connection

Specifies a connection to a serial bus or serial port, or to a set of one or more general-purpose I/O (GPIO) pins. The following members describe this connection.

Class

The connection class. This member is set to one of the following values.

Connection classDescription
CM_RESOURCE_CONNECTION_CLASS_GPIOAccess the device through one or more pins on a GPIO controller.
CM_RESOURCE_CONNECTION_CLASS_SERIALAccess the device through a serial bus or serial port.

 

Type

The connection type.

If Class = CM_RESOURCE_CONNECTION_CLASS_GPIO, Type is set to the following value.

Connection typeDescription
CM_RESOURCE_CONNECTION_TYPE_GPIO_IOAccess the device through GPIO pins that are configured for I/O.

 

Note  A GPIO pin that is configured as an interrupt request input is accessed as an ordinary interrupt resource (CmResourceTypeInterrupt).

If Class = CM_RESOURCE_CONNECTION_CLASS_SERIAL, Type is set to one of the following values.

Connection typeDescription
CM_RESOURCE_CONNECTION_TYPE_SERIAL_I2CThe device is connected to an I2C bus.
CM_RESOURCE_CONNECTION_TYPE_SERIAL_SPIThe device is connected to an SPI bus.
CM_RESOURCE_CONNECTION_TYPE_SERIAL_UARTThe device is connected to a serial port.

 

Reserved1

Not used.

Reserved2

Not used.

IdLowPart

The lower 32 bits of the 64-bit connection ID.

IdHighPart

The upper 32 bits of the 64-bit connection ID.

The u.Connection member is available starting with Windows 8.

Requirements

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

See also

CM_PARTIAL_RESOURCE_DESCRIPTOR
IO_RESOURCE_LIST
IO_RESOURCE_REQUIREMENTS_LIST
IoConnectInterrupt

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft