// ndis.h
VOID NdisMGetVirtualFunctionLocation(
[in] NDIS_HANDLE NdisMiniportHandle,
[in] NDIS_SRIOV_FUNCTION_ID VFId,
[out] PUSHORT SegmentNumber,
[out] PUCHAR BusNumber,
[out] PUCHAR FunctionNumber
);
View the official Windows Driver Kit DDI referenceNo description available.
A miniport driver calls the NdisMGetVirtualFunctionLocation function to query the device location of a PCI Express (PCIe) Virtual Function (VF) on a PCI bus. The driver uses the device location to construct the PCIe Requestor ID (RID) for the VF.
Note NdisMGetVirtualFunctionLocation must only be called by the miniport driver for the network adapter's PCIe Physical Function (PF).
NdisMiniportHandle [in]The network adapter handle that NDIS passed to the MiniportAdapterHandle parameter of MiniportInitializeEx.
VFId [in]The identifier of the VF for which the device location is returned.
SegmentNumber [out]A pointer to a caller-supplied variable in which this function returns a USHORT value for the current PCI segment number. This value specifies the group of PCI buses on which the device is attached.
BusNumber [out]A pointer to a caller-supplied variable in which this function returns a UCHAR value. This value specifies the current PCI bus number on which the device is attached.
FunctionNumber [out]A pointer to a caller-supplied variable in which this function returns a UCHAR value. This value specifies the function number of a logical device on the device.
When it handles a method request of OID_NIC_SWITCH_ALLOCATE_VF, the PF miniport driver must return the RID for the VF that the driver has successfully allocated on the network adapter. The driver generates the RID in the following way:
For more information on how to allocate VF resources, see Virtual Function Initialization Sequence.
For more information about the SR-IOV interface, see Overview of Single Root I/O Virtualization (SR-IOV).
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 NdisMGetVirtualFunctionLocation. Instead, the driver must interface with the VBD through a private communication channel, and request that the VBD call GetLocation. This function is exposed from the GUID_PCI_VIRTUALIZATION_INTERFACE interface supported by the underlying PCI bus driver.
The VBD that runs in the Hyper-V parent partition's management operating system can query the GUID_PCI_VIRTUALIZATION_INTERFACE interface by issuing an IRP_MN_QUERY_INTERFACE request to its physical device object (PDO) on the PCI bus. This request must be made from IRQL = PASSIVE_LEVEL. In this request, the driver must set the InterfaceType parameter to GUID_PCI_VIRTUALIZATION_INTERFACE.
GUID_PCI_VIRTUALIZATION_INTERFACE