NdisReadPciSlotInformation

ULONG
   NdisReadPciSlotInformation(
       IN NDIS_HANDLE
NdisAdapterHandle,
       IN ULONG SlotNumber,
       IN ULONG Offset,
       IN PVOID Buffer,
       IN ULONG Length
       );

NdisReadPciSlotInformation returns bus-specific PCI configuration information from the PCI configuration space for a device at a particular slot on the bus.

Parameters

NdisAdapterHandle

Specifies the MiniportAdapterHandle passed in to MiniportInitialize and to most other MiniportXxx functions.

SlotNumber

Specifies the slot number of a NIC on the I/O bus.

Offset

Specifies the byte offset within the PCI configuration space at which to begin transferring the configuration information.

Buffer

Points to a caller-allocated buffer in which to return the requested configuration information.

Length

Specifies the size in bytes of the buffer at Buffer and, therefore, how many bytes of configuration information to return.

Return Value

NdisReadPciSlotInformation returns how many bytes of configuration information it returned at Buffer.

Comments

NdisReadPciSlotInformation helps a driver find a NIC that it supports on a PCI bus. When it does, the driver can call NdisMPciAssignResources to determine the bus-relative configuration parameters it can use in subsequent calls to other NdisXxx configuration functions, such as NdisMRegisterInterrupt, NdisMMapIoSpace, and/or NdisMRegisterIoPortRange.

NdisReadPciSlotInformation returns the same bus-relative PCI configuration information as NdisImmediateReadPciSlotInformation. However, callers of NdisReadPciSlotInformation pass the MiniportAdapterHandle passed to the MiniportInitialize function, rather than the WrapperConfigurationContext handle.

The caller is responsible for releasing the memory at Buffer when the driver has consumed the configuration information with NdisFreeMemory.

Miniport drivers call this function from their MiniportInitialize functions.

Callers of NdisReadPciSlotInformation can run at IRQL <= DISPATCH_LEVEL. Usually, callers are running at IRQL PASSIVE_LEVEL.

See Also

MiniportInitialize, NdisFreeMemory, NdisMMapIoSpace, NdisMPciAssignResources, NdisMRegisterInterrupt, NdisMRegisterIoPortRange, NdisMSetAttributes, NdisMSetAttributesEx, NdisOpenConfiguration