NDIS issues an object identifier (OID) method request of OID_NIC_SWITCH_CREATE_SWITCH to create a NIC switch on a network adapter. When it handles this OID request, the miniport driver allocates the resources for the NIC switch on the adapter.

NDIS issues this OID method request to the miniport driver of the network adapter's PCI Express (PCIe) Physical Function (PF). This OID method request is required for PF miniport drivers that support the single root I/O virtualization (SR-IOV) interface.

Note  Overlying drivers, such as protocol or filter drivers, cannot issue OID method requests of OID_NIC_SWITCH_CREATE_SWITCH to the PF miniport driver.

The InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to an NDIS_NIC_SWITCH_PARAMETERS structure.


When it receives the OID method request of OID_NIC_SWITCH_CREATE_SWITCH, the PF miniport driver must do the following:

  1. If the PF miniport driver supports static switch creation and configuration, it creates the NIC switch when NDIS calls MiniportInitializeEx. When the driver handles this OID request, it must verify the configuration parameters in the NDIS_NIC_SWITCH_PARAMETERS structure. The parameters must be the same as those used by the driver to create the switch during the call to MiniportInitializeEx. If this is not true, the driver must fail the OID request.

    For more information, see Static Creation of a NIC Switch.

  2. If the PF miniport driver supports dynamic switch creation and configuration, the driver must validate the configuration values of the NDIS_NIC_SWITCH_PARAMETERS structure and create the NIC switch based on these values.

    For more information, see Dynamic Creation of a NIC Switch.

  3. The PF miniport driver must allocate the necessary hardware and software resources for the default VPort on the NIC switch.

    Note  The default VPort is always created through an OID request of OID_NIC_SWITCH_CREATE_SWITCH and deleted through an OID request of OID_NIC_SWITCH_DELETE_SWITCH. OID requests of OID_NIC_SWITCH_CREATE_VPORT and OID_NIC_SWITCH_DELETE_VPORT are used for the creation and deletion of nondefault VPorts on the NIC switch.
  4. The PF miniport driver that supports dynamic switch creation and configuration must enable SR-IOV virtualization on the switch by calling NdisMEnableVirtualization. This call configures the NumVFs member and the VF Enable bit in the SR-IOV Extended Capability structure of the adapter's PCI Express (PCIe) configuration space.

    For more information about the SR-IOV configuration space, see the PCI-SIG Single Root I/O Virtualization and Sharing 1.1 specification.

    Note  If the PF miniport driver supports static switch creation, it enables SR-IOV virtualization after it creates the switch when MiniportInitializeEx is called.

If the PF miniport driver successfully completes the OID method request of OID_NIC_SWITCH_CREATE_SWITCH, it allows the following to occur:

For more information on how to handle this OID request, see Handling the OID_NIC_SWITCH_CREATE_SWITCH Request.

Return Status Codes

The PF miniport driver returns one of the following status codes for the OID method request of OID_NIC_SWITCH_CREATE_SWITCH.

Status CodeDescription


The OID request completed successfully.


The PF miniport driver either does not support the SR-IOV interface or is not enabled to use the interface.


One or more of the members of the NDIS_NIC_SWITCH_PARAMETERS structure have invalid values.


The length of the information buffer is less than sizeof(NDIS_NIC_SWITCH_PARAMETERS). The PF miniport driver must set the DATA.METHOD_INFORMATION.BytesNeeded member in the NDIS_OID_REQUEST structure to the minimum buffer size that is required.


The request failed for other reasons.




Supported in NDIS 6.30 and later.


Ntddndis.h (include Ndis.h)

See also




Send comments about this topic to Microsoft