SRIOV_GET_VENDOR_AND_DEVICE_IDS - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// pcivirt.h

SRIOV_GET_VENDOR_AND_DEVICE_IDS SriovGetVendorAndDeviceIds;

VOID SriovGetVendorAndDeviceIds(
  [in]  PVOID Context,
  [in]  USHORT VfIndex,
  [out] PUSHORT VendorId,
  [out] PUSHORT DeviceId
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-pcivirt-sriov_get_vendor_and_device_ids)

SRIOV_GET_VENDOR_AND_DEVICE_IDS callback

Description

Supplies the Vendor and Device ID for a PCI Express SR-IOV Virtual Function (VF) to be used for generating a more generic Plug and Play ID for the VF. These IDs cannot be read directly from the VF's configuration space.

Parameters

Context [in]

A pointer to a driver-defined context.

VfIndex [in]

A zero-based index of the VF to which this write operation applies.

VendorId [out]

A pointer to a USHORT variable that is filled with the vendor ID of the VF.

DeviceId [out]

A pointer to a USHORT variable that is filled with the device ID of the VF.

Prototype

VOID SRIOV_GET_VENDOR_AND_DEVICE_IDS (
    _In_        PVOID           Context,
    _In_        USHORT          VfIndex,
    _Out_       PUSHORT         VendorId,
    _Out_       PUSHORT         DeviceId
    );

typedef SRIOV_GET_VENDOR_AND_DEVICE_IDS *PSRIOV_GET_VENDOR_AND_DEVICE_IDS;

Remarks

This callback function is implemented by the physical function (PF) driver. It is invoked when the system wants to retrieve the vendor and device identifiers of the specified VF.

The PCI Express SR-IOV Specification requires that all VFs have the same Vendor and Device IDs. This is a requirement of compliant hardware. However, it's possible to provision VFs such that their capabilities differ from each other, and it's often useful to load different drivers on different hardware. So Windows allows the PF driver to supply separate Device and Vendor IDs (with different class codes, through the configuration space interfaces) such that each VF may appear with the Plug and Play IDs that are most appropriate for its use.

The PF driver registers its implementation by setting the GetVendorAndDevice member of the SRIOV_DEVICE_INTERFACE_STANDARD, configuring a WDF_QUERY_INTERFACE_CONFIG structure, and calling WdfDeviceAddQueryInterface.

Here is an example implementation of this callback function.

Virtualization_GetVendorAndDevice (
    _In_    PVOID           Context,
    _In_    USHORT          VfIndex,
    _Out_   PUSHORT         VendorId,
    _Out_   PUSHORT         DeviceId
    )
{
    PDEVICE_CONTEXT deviceContext;

    UNREFERENCED_PARAMETER(VfIndex);
    PAGED_CODE();

    deviceContext = (PDEVICE_CONTEXT)Context;

    *VendorId = deviceContext->VendorId;
    *DeviceId = deviceContext->DeviceId;
}