NdisWritePciSlotInformation

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

NdisWritePciSlotInformation writes a specified number of bytes to the PCI configuration space for a NIC on the PCI bus.

Parameters

NdisAdapterHandle

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

SlotNumber

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

Offset

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

Buffer

Points to a caller-allocated buffer containing the PCI configuration information to be written.

Length

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

Return Value

NdisWritePciSlotInformation returns how many bytes of caller-supplied data it wrote.

Comments

NdisWritePciSlotInformation writes PCI configuration information for a NIC. However, drivers of NICs on PCI buses call NdisImmediateReadPciSlotInformation, NdisReadPciSlotInformation, or NdisMPciAssignResources far more frequently than this function.

When NIC driver finds its device on a PCI bus with Ndis(Immediate)ReadPciSlotInformation or by retrieving information from the \DriverName\Parameters key in the registry, that driver can call NdisMPciAssignResources to determine the bus-relative configuration parameters it can use in subsequent calls to other NdisXxx configuration functions. If NdisMPciAssignResources returns values that require the driver to reconfigure its device on the bus, it can call NdisWritePciSlotInformation.

NdisWritePciSlotInformation transfers the same type of bus-relative PCI configuration information as NdisImmediateWritePciSlotInformation. However, callers of NdisWritePciSlotInformation pass the MiniportAdapterHandle passed in to the MiniportInitialize function, rather than the WrapperConfigurationContext handle.

The caller is responsible for releasing the memory at Buffer when NdisWritePciSlotInformation returns control.

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

See Also

MiniportInitialize, NdisFreeMemory, NdisImmediateWritePciSlotInformation, NdisMMapIoSpace, NdisMPciAssignResources, NdisMRegisterInterrupt, NdisMRegisterIoPortRange, NdisMSetAttributes, NdisMSetAttributesEx, NdisReadPciSlotInformation