hcdPipeIO
Purpose
Initiates I/O operations to and from a logical device.
Syntax
#include <hcdi.h>
USBstatus hcdPipeIO(pHCDI, pIOB)
PHCDI pHCDI;
PIOB pIOB;
Parameter
Item | Description |
---|---|
pHCDI | Pointer to the HCDI structure. |
pIOB | Pointer to an initialized IOB structure. |
Description
This function is an HCD supplied function, which is called by the USBD to initiate device I/O operations. The I/O operations can be any of the following transfer types: control, bulk, isochronous, and interrupt. The USBD presents to the HCD a chain of one or more IOBs with each call to the hcdPipeIO function. The pipe handle in each IOB identifies the pipe that must process the IOB. A chain or sub chain of IOBs that reference the same pipe handle must be enqueued to the pipe by the HCD at the same time so that they are not interrupted by other I/O request. The HCD must enqueue the IOBs even when the pipe is halted. The HCD must return to the USBD after the entire IOB chain is traversed and the IOBs is enqueued to the pipes for processing.
As each IOB is processed by the pipe and is retired, the HCD must update the status and length fields in the IOB and call usbdPostIOB. If the pipe halts due to an error, the pipe must remain halted and all pending IOBs must remain pending. It is the responsibility of the USBD to stop pending IOBs as required and to reactivate the pipe.
Execution Environment
This function can be called from the interrupt (HCD_OFFLEVEL priority or lower) or process environment.
Return Values
Value | Description |
---|---|
USBD_SUCCESS | Success |
All others | Failure |