usbd_io()

Submit a previously set-up URB to the USB stack

Synopsis:

#include <sys/usbdi.h>

int usbd_io( struct usbd_urb *urb, 
             struct usbd_pipe *pipe, 
             void (*func)(struct usbd_urb *,
                          struct usbd_pipe *, void *),
             void *handle,
             uint32_t timeout );

Arguments:

urb
A pointer to a USB Request Block.
pipe
An opaque handle returned by usbd_open_pipe().
func
Callback at I/O completion, given URB, pipe, plus handle.
handle
User data.
timeout
A value (in milliseconds) or USBD_TIME_DEFAULT or USBD_TIME_INFINITY.

Library:

libusbdi

Description:

This routine submits a previously set-up URB to the USB stack. The URB would have been set up from one of these functions:


Note: For this release of the USB DDK, vendor requests are synchronous only. Therefore, the func parameter in usbd_io() must be NULL.

The usbd_io() function is the one that actually makes the data transfer happen; the setup functions simply set up the URB for the data transfer.

Returns:

EAGAIN
The device has been reset.
EBADF
Improper usbd_connect() call.
EMLINK
Too many URB links.
ENODEV
The device was removed.
ENOENT
The requested URB couldn't be found in the stack side. For example, the configuration, interface, or endpoint wasn't present, or it wasn't in the correct state.
ENOSPC
Not enough transmission buffers.
EOK
Success.

Classification:

QNX Neutrino, QNX 4

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

See also:

usbd_descriptor(), usbd_feature(), usbd_setup_control(), usbd_setup_bulk(), usbd_setup_interrupt(), usbd_setup_isochronous(), usbd_setup_vendor(), usbd_status()