VxWorks API Reference : USB libraries
usbdCoreLib [USB] - USBD core logic
usbdCoreEntry( ) - Primary entry point
This module contains the primary USBD entry point, usbdUrbExec( ) and the individual USBD function execution routines. usbdUrbExec( ) is responsible for interpreting each URB's function code and then fanning-out to the individual function processor.
When the USBD is first initialized it creates an internal "client" which is used by the USBD when performing control pipe transfers to each hub/device. This "client" remains active until the USBD is shut down.
For each client registered with the USBD, including the internal client, the USBD allocates an individual task, and that task inherits the priority of the client task which invokes the usbdClientRegister( ) function. This task is normally inactive, and only wakes up when a client callback is to be executed. Therefore, each client's callbacks are invoked on a task which is unique to that client. Other USBD tasks (see below) are therefore shielded from the behavoir of an individual client's callback routine.
For each USB which is attached to the USBD through the usbdHcdAttach( ) function, the USBD also creates a unique "bus monitor" task. This task is responsible for configuring and monitoring each hub on a given USB. Whenever a hub or device is attached/removed from the USB, the bus monitor thread is responsible for updating internal data structures, configuring/re-configuring hubs, and for triggering "dynamic attach/removal" callbacks - which themselves are performed by each individual client's callback task.
All USBD internal data structures, e.g., client lists, HCD lists and releated node structures, are protected by a single mutex, structMutex. All threads which rely on the stability of internal data structures or which can modify internal data structures take this mutex. usbdCoreEntry( ) is the single entry point responsible for taking this mutex when clients invoke the USBD. Each "bus monitor" thread also takes this mutex each time it may update bus structures. IRP callback, however, do not take the mutex. While certain IRP "userPtr" fields may point to other USBD structures, the organization of the code guarantees that IRPs will be completed or canceled prior to dismantling the USBD structures with which they are associated.
usbdCoreEntry( ) - Primary entry point
STATUS usbdCoreEntry ( pURB_HEADER pUrb /* URB to be executed */ )
usbdCoreEntry is the primary entry point to the USBD through which callers invoke individual URBs (USB Request Blocks).
This function is intended exclusively for the use of functions in usbdLib. Clients should not construct URBs manually and invoke this function directly.
OK or ERROR
S_usbdLib_BAD_PARAM