IOCTL_SRIOV_ATTACH IOCTL (pcivirt.h)

La solicitud indica que la pila de virtualización quiere registrarse para Plug and Play eventos recibidos por el dispositivo SR-IOV.

Código principal

IRP_MJ_DEVICE_CONTROL

Bloque de estado

Irp->IoStatus.Status se establece en STATUS_SUCCESS si la solicitud se realiza correctamente. De lo contrario, estado de la condición de error adecuada como código NTSTATUS .

Comentarios

Esta solicitud IOCTL se envía mediante la pila de virtualización al controlador pci Express SR-IOV Physical Function (PF) que expone GUID_DEVINTERFACE_VIRTUALIZABLE_DEVICE.

Esta solicitud no es segura si el dispositivo PF está detenido o detenido para volver a equilibrar los recursos. Se considera que un dispositivo se detiene después de recibir IRP_MN_QUERY_STOP_DEVICE y reiniciarse cuando recibe IRP_MN_CANCEL_STOP_DEVICE o cuando los dispositivos inferiores de la pila completan IRP_MN_START_DEVICE . En este caso, el controlador debe retrasar la finalización de esta solicitud hasta que se reinicie el dispositivo.

No es necesario mantener este IRP pendiente porque la solicitud siempre se envía como irP en modo kernel sincrónico, lo que hace que el autor de la llamada bloquee el subproceso en cualquier caso.

Tras la finalización de esta solicitud, EL VSP puede enviar posteriormente IOCTL_SRIOV_NOTIFICATION y IOCTL_SRIOV_EVENT_COMPLETE solicitudes.

Para anular el registro de eventos de Plug and Play, VSP envía la solicitud de IOCTL_SRIOV_DETACH.

Estos eventos (definidos en SRIOV_PF_EVENT) provocan la finalización de IOCTL_SRIOV_NOTIFICATION y una espera de IOCTL_SRIOV_EVENT_COMPLETE:

En este ejemplo, el control de la solicitud de IOCTL_SRIOV_ATTACH, el controlador PF mantiene los estados PnP en su contexto de dispositivo. DeviceContext->PnpRebalancing se establece en TRUE, cuando el controlador recibe IRP_MN_QUERY_STOP_DEVICE y se establece en FALSE cuando recibe IRP_MN_START_DEVICE.
    case IOCTL_SRIOV_ATTACH:
        TraceEvents(TRACE_LEVEL_VERBOSE, DBG_IOCTL, "IOCTL_SRIOV_ATTACH:\n");

        WdfWaitLockAcquire(fdoContext->PnpStateLock, NULL);

        //
        // Block until it is safe for the VSP to attach.  Don't
        // bother with pending this IRP since this is always a sent as
        // a synchronous kernel-mode IRP and the caller would block
        // the thread anyway.  May need to repeat the wait since since
        // waiting for the safe-to-attach event must not be done while
        // holding the state lock.
        //
        while (fdoContext->PnpSafeToAttach == FALSE)
        {
            WdfWaitLockRelease(fdoContext->PnpStateLock);

            KeWaitForSingleObject(&fdoContext->PnpSafeEvent,
                                  Executive,
                                  KernelMode,
                                  FALSE,
                                  NULL);

            WdfWaitLockAcquire(fdoContext->PnpStateLock, NULL);
        }

        //
        // Allow only a single attach at any time.
        //
        if (fdoContext->PnpVspAttached == FALSE)
        {
            fdoContext->PnpVspAttached = TRUE;
            status = STATUS_SUCCESS;
        }
        else
        {
            status = STATUS_SHARING_VIOLATION;
        }
        WdfWaitLockRelease(fdoContext->PnpStateLock);

        break;

Requisitos

Requisito Valor
Header pcivirt.h
IRQL PASSIVE_LEVEL

Consulte también

WdfIoTargetSendInternalIoctlSynchronously

WdfIoTargetSendInternalIoctlOthersSynchronously

Creación de solicitudes IOCTL en controladores

IOCTL_SRIOV_DETACH

WdfIoTargetSendIoctlSynchronously