EVT_UCX_ROOTHUB_CONTROL_URB fonction de rappel (ucxroothub.h)

Le pilote client utilise ce type de rappel pour implémenter les gestionnaires qu’UCX appelle lorsqu’il reçoit des demandes de contrôle des fonctionnalités sur le hub USB.

Syntaxe

EVT_UCX_ROOTHUB_CONTROL_URB EvtUcxRoothubControlUrb;

void EvtUcxRoothubControlUrb(
  [in] UCXROOTHUB UcxRootHub,
  [in] WDFREQUEST Request
)
{...}

Paramètres

[in] UcxRootHub

Handle d’un objet UCX qui représente le hub racine.

[in] Request

Contient l’URB pour la demande de fonctionnalité.

Valeur de retour

None

Remarques

Le pilote client inscrit cette fonction de rappel avec l’extension du contrôleur hôte USB (UCX) 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 qu’UCX appelle pour tous les transferts de contrôle hub et port.

Le pilote client retourne status d’achèvement dans La requête et dans le USBD_STATUS dans l’en-tête URB. Le pilote peut effectuer le WDFREQUEST de manière asynchrone.

Exemples

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);
}

Configuration requise

Condition requise Valeur
Plateforme cible Windows
Version KMDF minimale 1.0
Version UMDF minimale 2.0
En-tête ucxroothub.h (inclure Ucxclass.h)
IRQL DISPATCH_LEVEL

Voir aussi

UcxRootHubCréer