Jungo WinDriver  
Official Documentation

◆ WDC_PciSriovEnable()

DWORD DLLCALLCONV WDC_PciSriovEnable ( _In_ WDC_DEVICE_HANDLE  hDev,
_In_ DWORD  dwNumVFs 
)

SR-IOV API functions are not part of the standard WinDriver API, and not included in the standard version of WinDriver.


Control device's SR-IOV capability (PCIe)

"WinDriver for Server" API and require "WinDriver for Server" license. Note that "WinDriver for Server" APIs are included in WinDriver evaluation version. Enables SR-IOV for a supported device.

Parameters
[in]hDevHandle to a Plug-and-Play WDC device, returned by WDC_PciDeviceOpen()
[in]dwNumVFsThe number of virtual functions (VFs) to be assigned to hDev
Returns
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise
void SriovExample(WDC_DEVICE_HANDLE hDev)
{
DWORD dwStatus, dwNumVFs = 3;
dwStatus = WDC_PciSriovEnable(hDev, dwNumVFs);
if (dwStatus)
{
printf("Error! Could not enable SRIOV\n");
return;
}
dwNumVFs = 0;
dwStatus = WDC_PciSriovGetNumVFs(hDev, &dwNumVFs);
if (dwStatus)
{
printf("Error! Could not get number of virtual functions\n");
goto Error;
}
// Should be 3
printf("Number of virtual functions: %ld\n", dwNumVFs);
/*
More code...
*/
Error:
dwStatus = WDC_PciSriovDisable(hDev);
if (dwStatus)
{
printf("Error! Could not disable SRIOV\n");
}
}
DWORD DLLCALLCONV WDC_PciSriovDisable(_In_ WDC_DEVICE_HANDLE hDev)
Disables SR-IOV for a supported device and removes all the assigned VFs.
DWORD DLLCALLCONV WDC_PciSriovGetNumVFs(_In_ WDC_DEVICE_HANDLE hDev, _Outptr_ DWORD *pdwNumVFs)
Gets the number of virtual functions assigned to a supported device.
DWORD DLLCALLCONV WDC_PciSriovEnable(_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwNumVFs)
SR-IOV API functions are not part of the standard WinDriver API, and not included in the standard ver...
void * WDC_DEVICE_HANDLE
Handle to device information struct.
Definition: wdc_lib.h:33