hcdDevAlloc
Purpose
Requests to allocate the xHCI adapter driver resources for the newly detected USB device.
Syntax
#include <hcdi.h>
USBstatus hcdDevAlloc(pHCDI, devhdl )
PHCDI pHCDI;
USBhandle *devhdlParameter
| Item | Description |
|---|---|
| pHCDI | Pointer to HCDI structure. |
| devhdl | Pointer to the location the USB logical device handle is placed. Maps to the _DEVINFO structure defined in /usr/include/sys/hcdi.h file. |
Description
This call vector is specific only for the xHCI host controllers, that support the USB 3.0 protocol. This call vector is started by the USBD when it detects the attachment of a USB logical device. The call is started to inform the xHCI adapter driver about the presence of a new device and to request it to allocate and initialize its internal resources to configure and communicate with this device. Upon invocation, the HCD sends an ENABLE SLOT command to the xHCI to allocate a slot ID for this device and wait for its completion. If the command is successful, it populates an entry corresponding to the slot ID in the Device Context Base Address Array. It initializes the default control endpoint of this device by issuing the Address Device command to the xHCI to allocate a device address for this device and wait for its completion. Upon successful completion, it copies the device address for this device into the _DEVINFO data structure.
Execution Environment
This function can only be called from within the process environment.
Return Values
| Value | Description |
|---|---|
| USBD_SUCCESS | Success |
| All others | Failure |