usbd_setup_control()

Set up a URB for a control transfer

Note: This function isn't currently implemented. To set up a URB for a control transfer, use usbd_setup_vendor() instead.

Synopsis:

#include <sys/usbdi.h>

usbd_setup_control( struct usbd_urb *urb, 
                    uint32_t flags,
                    uint16_t request, 
                    uint16_t rtype,
                    uint16_t value, 
                    uint16_t index,
                    void *addr, 
                    uint32_t len );

Arguments:

urb
An opaque handle (from usbd_alloc_urb()).
flags
One of the following:
  • URB_DIR_IN—specify incoming (device-to-PC) transfer.
  • URB_DIR_OUT—specify outgoing (PC-to-device) transfer.
  • URB_DIR_NONE—don't specify the direction.

You can optionally OR in the following:

  • URB_SHORT_XFER_OK—allow short transfers.
request
A device-specific request.
rtype
The type of request; one of the following:
  • USB_RECIPIENT_DEVICE
  • USB_RECIPIENT_INTERFACE
  • USB_RECIPIENT_ENDPOINT
  • USB_RECIPIENT_OTHER

ORed with one of the following:

  • USB_TYPE_STANDARD
  • USB_TYPE_CLASS
  • USB_TYPE_VENDOR
value
This varies, depending on the request. It's used for passing a parameter to the device.
index
This varies, depending on the request. It's used for passing a parameter to the device.
addr
The address for the start of the transfer. You must use the buffer allocated by usbd_alloc().
len
The length (in bytes) of the data transfer.

Library:

libusbdi

Description:

This routine sets up a URB for a control transfer.

Returns:

EOK
Success.

Classification:

QNX Neutrino, QNX 4

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

Caveats:

To ensure that the correct physical address will be used, you must use the buffer allocated by usbd_alloc() for the addr parameter.