Bewerken

Delen via


NdisMWriteConfigBlock function (ndis.h)

A miniport driver for a PCI Express (PCIe) Virtual Function (VF) calls the NdisMWriteConfigBlock function to write data to a VF configuration block. Write operations on a VF configuration block are handled by the miniport driver of the network adapter's PCIe Physical Function (PF).

Note  NdisMWriteConfigBlock must only be called by the miniport driver for a network adapter's VF.
 

Syntax

NDIS_STATUS NdisMWriteConfigBlock(
  [in] NDIS_HANDLE NdisMiniportHandle,
  [in] ULONG       BlockId,
  [in] PVOID       Buffer,
  [in] ULONG       Length
);

Parameters

[in] NdisMiniportHandle

The network adapter handle that NDIS passed to the MiniportAdapterHandle parameter of MiniportInitializeEx.

[in] BlockId

A ULONG value that specifies the identifier of the configuration block to be written to. This identifier is proprietary to the independent hardware vendor (IHV) and is used only by the miniport drivers for the PF and VF on the network adapter.

[in] Buffer

A pointer to a caller-allocated buffer that contains the configuration data to be written.

[in] Length

The number of bytes to write to the configuration block.

Return value

NdisMWriteConfigBlock can return one of the following status values.

Return code Description
NDIS_STATUS_SUCCESS
The write operation completed successfully.
NDIS_STATUS_FAILURE
The write operation failed.

Remarks

The VF miniport driver calls NdisMWriteConfigBlock to initiate a backchannel write request of VF configuration data by the PF miniport driver. Once notified of this request, the PF driver writes the data to the specified VF configuration block.

A VF configuration block is used for backchannel communication between the PF and VF miniport drivers. The IHV can define one or more VF configuration blocks for the device. Each VF configuration block has an IHV-defined format, length, and block ID.

Note  Data from each VF configuration block is used only by the PF and VF miniport drivers.
 
For more information about backchannel communication within the single root I/O virtualization (SR-IOV) interface, see SR-IOV PF/VF Backchannel Communication.

Interfacing to a Virtual Bus Driver

If an independent hardware vendor (IHV) provides a virtual bus driver (VBD) as part of its SR-IOV driver package, its miniport driver must not call NdisMWriteConfigBlock. Instead, the driver must interface with the VBD through a private communication channel, and request that the VBD call WriteVfConfigBlock. This function is exposed from the GUID_VPCI_INTERFACE_STANDARD interface that is supported by the underlying virtual PCI (VPCI) bus driver.

The VBD that runs in a Hyper-V child partition's guest operating system can query the GUID_VPCI_INTERFACE_STANDARD interface by issuing an IRP_MN_QUERY_INTERFACE request to its physical device object (PDO) on the VPCI bus. This request must be made from IRQL = PASSIVE_LEVEL. In this request, the driver must set the InterfaceType parameter to GUID_VPCI_INTERFACE_STANDARD.

Requirements

Requirement Value
Minimum supported client None supported,Supported in NDIS 6.30 and later.
Minimum supported server Windows Server 2012
Target Platform Universal
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL <= APC_LEVEL

See also

GUID_VPCI_INTERFACE_STANDARD

WriteVfConfigBlock