usbd_urb_status()

Return status information on a URB

Synopsis:

#include <sys/usbdi.h>

int usbd_urb_status( struct usbd_urb *urb, 
                     uint32_t *status, 
                     uint32_t *len )

Arguments:

urb
An opaque handle (from usbd_alloc_urb()).
status
Completion status (see below).
len
The actual length (in bytes) of the data transfer.

Library:

libusbdi

Description:

You use the usbd_urb_status() function to extract completion status and data-transfer length from a URB.

Completion status

The status field contains the completion status information, which includes the following flags:

USBD_STATUS_INPROG
The operation is in progress.
USBD_STATUS_CMP
The operation is complete.
USBD_STATUS_CMP_ERR
The operation is complete, but an error occurred.
USBD_STATUS_TIMEOUT
The operation timed out.
USBD_STATUS_ABORTED
The operation aborted.
USBD_STATUS_CRC_ERR
The last packet from the endpoint contained a CRC error.
USBD_STATUS_BITSTUFFING
The last packet from the endpoint contained a bit-stuffing violation.
USBD_STATUS_TOGGLE_MISMATCH
The last packet from the endpoint had the wrong data-toggle PID.
USBD_STATUS_STALL
The endpoint returned a STALL PID.
USBD_STATUS_DEV_NOANSWER
Device didn't respond to token (IN) or didn't provide a handshake (OUT).
USBD_STATUS_PID_FAILURE
Check bits on PID from endpoint failed on data PID (IN) or handshake (OUT).
USBD_STATUS_BAD_PID
Receive PID was invalid or undefined.
USBD_STATUS_DATA_OVERRUN
The endpoint returned more data than the allowable maximum.
USBD_STATUS_DATA_UNDERRUN
The endpoint didn't return enough data to fill the specified buffer.
USBD_STATUS_BUFFER_OVERRUN
During an IN, the host controller received data from the endpoint faster than it could be written to system memory.
USBD_STATUS_BUFFER_UNDERRUN
During an OUT, the host controller couldn't retrieve data fast enough.
USBD_STATUS_NOT_ACCESSED
Controller didn't execute request.

Returns:

EOK
Success.
EBUSY
URB I/O still active.
ETIMEDOUT
Timeout occurred.
EINTR
Operation aborted/interrupted.
ENODEV
Device removed.
EIO
I/O error.

Classification:

QNX Neutrino, QNX 4

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

usbd_args_lookup(), usbd_configuration_descriptor(), usbd_device_lookup(), usbd_device_extra(), usbd_device_descriptor(), usbd_endpoint_descriptor(), usbd_hcd_info(), usbd_hub_descriptor(), usbd_interface_descriptor(), usbd_languages_descriptor(), usbd_parse_descriptors(), usbd_string()