Condividi tramite


IOCTL_SRIOV_DETACH IOCTL (pcivirt.h)

La richiesta indica che lo stack di virtualizzazione vuole annullare la registrazione per gli eventi Plug and Play (registrati in precedenza tramite la richiesta di IOCTL_SRIOV_ATTACH).

Codice principale

IRP_MJ_DEVICE_CONTROL

Blocco di stato

Irp-> IoStatus.Status è impostato su STATUS_SUCCESS se la richiesta ha esito positivo. In caso contrario, stato indica la condizione di errore appropriata come codice NTSTATUS.

Osservazioni

Questa richiesta IOCTL viene inviata dallo stack di virtualizzazione al driver PCI Express SR-IOV Physical Function (PF) che espone GUID_DEVINTERFACE_VIRTUALIZABLE_DEVICE.

Da qui in poi, il pf non dovrebbe aspettarsi di ricevere IOCTL_SRIOV_EVENT_COMPLETE e IOCTL_SRIOV_NOTIFICATION richieste.

Driver che deve arrestarsi in attesa di IOCTL_SRIOV_EVENT_COMPLETE. Se il driver è attualmente in attesa, deve smettere di attendere e continuare l'elaborazione di plug and play IRP.

In questo esempio la gestione della richiesta di IOCTL_SRIOV_DETACH, il driver PF mantiene gli stati PnP nel contesto di dispositivo. DeviceContext->PnpRebalancing è impostato su TRUE, quando il driver riceve IRP_MN_QUERY_STOP_DEVICE e impostato su FALSE quando riceve IRP_MN_START_DEVICE.

    case IOCTL_SRIOV_DETACH:

        WdfWaitLockAcquire(deviceContext->PnpStateLock, NULL);

        deviceContext->PnpVspAttached = FALSE;

        if (deviceContext->PnpRebalancing != FALSE)
        {
            //
            // Any new client (VSP state machine) will not know about
            // the current rebalance is it should block attach until
            // rebalance is over.
            //

    								deviceContext>PnpSafeToAttach = FALSE;
    								KeClearEvent(&deviceContext>PnpSafeEvent);

        }

        //
        // Unblock the PnP thread if it waiting for an IO control from the
        // client as the client just detached.
        //
        deviceContext->PnpEventStatus = STATUS_SUCCESS;
        KeSetEvent(&deviceContext->PnpUnblockEvent, IO_NO_INCREMENT, FALSE);

        WdfWaitLockRelease(deviceContext->PnpStateLock);

        status = STATUS_SUCCESS;
        break;



Fabbisogno

Requisito Valore
intestazione pcivirt.h
IRQL PASSIVE_LEVEL

Vedere anche

WdfIoTargetSendInternalIoctlSynchronously

WdfIoTargetSendInternalIoctlOthersSynchronously

creazione di richieste IOCTL nei driver

IOCTL_SRIOV_ATTACH

WdfIoTargetSendIoctlSynchronously