Table A.2. Transaction behaviour flags
Bit | Definition | Value | Description |
---|---|---|---|
0 | USB_TRANSACTION_EXACT_SIZE | 0 |
|
1 | The Term "exact buffer size" is used here with a different semantic to that of the USB specification.
| ||
1 | USB_TRANSACTION_FRAME_START | 0 | Transaction will commence as soon as possible. |
1 | Frame start number is given and the transaction will commence processing on or after the specified frame. | ||
2 | USB_TRANSACTION_SETUP_EVAL (Currently Unsupported) | 0 | Setup buffer is not evaluated by the USB system. (currently only valid value). |
1 | Setup buffer is evaluated by the USB system. This is intended for future support so the USB system may track changes to the device configuration and setup. It is currently the drivers responsibility to ensure that any changes modify the relevant system state. | ||
3 | USB_TRANSACTION_STATUS_STAGE | 0 | Normal transaction behaviour. |
1 | This flag must be set for control transactions to enable the use of the second URB. This also enables the second "data" phase of control transactions. This also implicitly sets USB_TRANSACTION_EXACT_SIZE to ensure the correct sequence of transfers occur. | ||
4 | USB_TRANSACTION_TIMEOUT | 0 | Normal transaction behaviour. |
1 | When set this allows the driver to specify the maximum number of centiseconds it is prepared to wait for a transaction, this is not affected by waiting mode. The transaction will be terminated with a USB_TRANSACTION_RESULT_TIMEOUT. | ||
5 - 29 | Reserved | 0 | Reserved must be zero. |
30 | USB_TRANSACTION_REQUEST_FIRST (Internal use only - Must be zero) | 0 | Transaction is not the first in a request. This blocks any other transaction at this endpoint to be notified as pending until it is removed from the pending queue by using a special function. |
1 | Transaction is the first one in a request. | ||
31 | USB_TRANSACTION_CANCELLED (Internal use only - Must be zero) | 0 | All informations inside transaction are valid. |
1 | Transaction has been cancelled. Stop the processing of the transaction and its following transactions belonging to the same request immediately. Note that some information inside the transaction may be invalid. However the validity of the most pointer references is granted by reference chains. |
Table A.3. Request States
Definition | Value | Description |
---|---|---|
USB_TRANSACTION_RESULT_OK | 0 | Request finished without errors. |
USB_TRANSACTION_RESULT_HALTED | -1 | Request finished with error. Pipe has been halted. |
USB_TRANSACTION_RESULT_ABORTED | -2 | Request finished with error. Pipe has been cleared. |
USB_TRANSACTION_RESULT_TRANSMISSION_FAILED | -3 | Request failed, an unrecoverable transmission error occurred. Pipe has been halted. |
USB_TRANSACTION_RESULT_INVALID_SIZE | -4 | Request failed, transfered data was not of the requested size. Pipe has been halted. |
USB_TRANSACTION_RESULT_WORKING | -5 | Request is still ongoing. |
USB_TRANSACTION_RESULT_BUSPROTO_ERR | -6 | The data was corrupted on the bus, for example CRC or data format errors |
USB_TRANSACTION_RESULT_STALL | -7 | Device stalled pipe. Pipe stall must be cleared with usb_clear_pipe_halt see Chapter 7, Transactions for more details. |
USB_TRANSACTION_RESULT_NORESPONSE | -8 | Request was not acknowledged by the device. |
USB_TRANSACTION_RESULT_HC_BUFF_ERR | -9 | The host controller either ran out of buffer space during the transaction, or could not buffer the data fast enough |
USB_TRANSACTION_RESULT_BUS_DATASZ | -10 | The host controller got more data than expected from the transaction. |
USB_TRANSACTION_RESULT_INTERNAL | -11 | the system had an internal failure and could not complete the transaction |
USB_TRANSACTION_RESULT_TIMEOUT | -12 | The transaction did not complete within the specified timeout, and has been aborted. The system does no more clearing up after aborting the transaction and it is up to the initiator of the request to sort out any problems that a partial transaction may have caused. |
Table A.4. Setup transaction request type
Bit | Description | |||||
---|---|---|---|---|---|---|
0-4 | Recipient
| |||||
6-5 | Type
| |||||
7 | Data transfer direction
|
Table A.5. Constants used for type of USB transfer
Definition | Value | Description |
---|---|---|
USB_PIPE_TYPE_CONTROL | 0 | Control Transfer |
USB_PIPE_TYPE_ISOCHRONUS | 1 | Isochronous Transfer |
USB_PIPE_TYPE_BULK | 2 | Bulk Transfer |
USB_PIPE_TYPE_INTERRUPT | 3 | Interrupt Transfer |
USB_PIPE_TYPE_MAX | 4 | Number of supported transfer types is 4 (USB 1.1) |