EVT_UCX_ROOTHUB_CONTROL_URB fonction de rappel (ucxroothub.h)
Le pilote client utilise ce type de rappel pour implémenter des gestionnaires qu’UCX appelle lorsqu’il reçoit des demandes de contrôle de fonctionnalité sur le hub USB.
EVT_UCX_ROOTHUB_CONTROL_URB EvtUcxRoothubControlUrb;
void EvtUcxRoothubControlUrb(
[in] UCXROOTHUB UcxRootHub,
[in] WDFREQUEST Request
)
{...}
[in] UcxRootHub
Handle vers un objet UCX qui représente le hub racine.
[in] Request
Contient le URB pour la demande de fonctionnalité.
Aucun
Le pilote client inscrit cette fonction de rappel auprès de l’extension UCX (Host Controller Extension) USB en appelant la méthode UcxRootHubCreate.
Le pilote fournit des rappels pour tous les types de demandes de fonctionnalités individuels, comme indiqué dans le premier exemple, ou il peut fournir un seul gestionnaire de type EVT_UCX_ROOTHUB_CONTROL_URB que UCX appelle pour tous les transferts de contrôle de hub et de port.
Le pilote client retourne l’état d’achèvement dans demande et dans l’USBD_STATUS dans l’en-tête URB. Le pilote peut effectuer l’opération WDFREQUEST de manière asynchrone.
Cet exemple montre comment inscrire des rappels pour des types de demandes de fonctionnalités individuels.
EVT_UCX_ROOTHUB_CONTROL_URB RootHub_EvtRootHubClearHubFeature;
EVT_UCX_ROOTHUB_CONTROL_URB RootHub_EvtRootHubClearPortFeature;
EVT_UCX_ROOTHUB_CONTROL_URB RootHub_EvtRootHubGetHubStatus;
EVT_UCX_ROOTHUB_CONTROL_URB RootHub_EvtRootHubGetPortStatus;
EVT_UCX_ROOTHUB_CONTROL_URB RootHub_EvtRootHubSetHubFeature;
EVT_UCX_ROOTHUB_CONTROL_URB RootHub_EvtRootHubSetPortFeature;
EVT_UCX_ROOTHUB_CONTROL_URB RootHub_EvtRootHubGetPortErrorCount;
...
//
// Create the root hub
//
UCX_ROOTHUB_CONFIG_INIT(&ucxRootHubConfig,
RootHub_EvtRootHubClearHubFeature,
RootHub_EvtRootHubClearPortFeature,
RootHub_EvtRootHubGetHubStatus,
RootHub_EvtRootHubGetPortStatus,
RootHub_EvtRootHubSetHubFeature,
RootHub_EvtRootHubSetPortFeature,
RootHub_EvtRootHubGetPortErrorCount,
RootHub_EvtRootHubInterruptTx,
RootHub_EvtRootHubGetInfo,
RootHub_EvtRootHubGet20PortInfo,
RootHub_EvtRootHubGet30PortInfo);
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&objectAttributes, UCX_ROOTHUB_CONTEXT);
status = UcxRootHubCreate(ucxController,
&ucxRootHubConfig,
&objectAttributes,
&ucxRootHub);
Voici un exemple d’implémentation de l’un des gestionnaires de requêtes spécifiques à URB.
VOID
RootHub_EvtRootHubClearHubFeature(
UCXROOTHUB UcxRootHub,
WDFREQUEST ControlUrb
)
/*++
Routine Description:
UCX calls this routine when it receives a new Clear Hub Feature request.
--*/
{
UNREFERENCED_PARAMETER(UcxRootHub);
DbgTrace(TL_INFO, RootHub, "RootHub_EvtRootHubClearHubFeature");
WDF_REQUEST_PARAMETERS_INIT(&wdfRequestParams);
WdfRequestGetParameters(WdfRequest, &wdfRequestParams);
urb = (PURB)wdfRequestParams.Parameters.Others.Arg1;
setupPacket = (PWDF_USB_CONTROL_SETUP_PACKET)&urb->UrbControlTransferEx.SetupPacket[0];
...
WdfRequestComplete(ControlUrb, STATUS_SUCCESS);
}
Exigence | Valeur |
---|---|
plateforme cible | Windows |
version minimale de KMDF | 1.0 |
version minimale de UMDF | 2.0 |
d’en-tête | ucxroothub.h (include Ucxclass.h) |
IRQL | DISPATCH_LEVEL |