IOCTL_SRIOV_DETACH IOCTL (pcivirt.h)
A solicitação indica que a pilha de virtualização deseja cancelar o registro de eventos Plug and Play (registrados anteriormente por meio da solicitação IOCTL_SRIOV_ATTACH).
Código principal
Bloco de status
Irp->IoStatus.Status será definido como STATUS_SUCCESS se a solicitação for bem-sucedida. Caso contrário, status indica a condição de erro apropriada como um código de NTSTATUS.
Observações
Essa solicitação IOCTL é enviada pela pilha de virtualização para o driver PF (PCI Express SR-IOV Physical Function) que expõe GUID_DEVINTERFACE_VIRTUALIZABLE_DEVICE.
Daqui em diante, o PF não deve esperar receber solicitações de IOCTL_SRIOV_EVENT_COMPLETE e IOCTL_SRIOV_NOTIFICATION.
O driver que deve parar de esperar por IOCTL_SRIOV_EVENT_COMPLETE. Se o driver estiver aguardando no momento, ele deve parar de esperar e continuar processando IRPs plug and play.
Neste exemplo de tratamento da solicitação IOCTL_SRIOV_DETACH, o driver PF mantém estados PnP em seu contexto de dispositivo. O deviceContext->PnpRebalancing é definido como TRUE, quando o driver recebe IRP_MN_QUERY_STOP_DEVICE e definido como FALSE quando recebe 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;
Requisitos
Requisito | Valor |
---|---|
cabeçalho | pcivirt.h |
IRQL | PASSIVE_LEVEL |
Consulte também
WdfIoTargetSendInternalIoctlSynchronously
WdfIoTargetSendInternalIoctlOthersSynchronously