usb camera driver

I’ve got a few questions about USB related issues for writing a camera
driver

  1. According to the USB DDK there is a usbd_setup_control() function for
    setting up a URB for control transfers. I can’t call it (not defined) and I
    don’t see it in usbdi.h. Does anyone know where it is / if it exists at all?
    (I believe we’re running QNX 6.1).

  2. As far as I can tell, other UNIX OSs’ URB structures have links to their
    associated memory buffers (in Linux I think it’s urb.transfer_buffer or
    something similar). Does the URB structure in QNX have an equivalent that
    I’ve missed?

Additionally, if anyone who has decent experience with usb drivers in QNX
and doesn’t mind being bothered by someone who doesn’t, like me :slight_smile:, would be
willing to send me an email so I can ask some other specific questions, I’d
appreciate it.

Thanks,
Barrett

Barrett Heyneman <heyneman@its.caltech.edu> wrote:
: I’ve got a few questions about USB related issues for writing a camera
: driver

: 1. According to the USB DDK there is a usbd_setup_control() function for
: setting up a URB for control transfers. I can’t call it (not defined) and I
: don’t see it in usbdi.h. Does anyone know where it is / if it exists at all?
: (I believe we’re running QNX 6.1).


use usbd_setup_vendor() instead.


: 2. As far as I can tell, other UNIX OSs’ URB structures have links to their
: associated memory buffers (in Linux I think it’s urb.transfer_buffer or
: something similar). Does the URB structure in QNX have an equivalent that
: I’ve missed?

use usbd_alloc() to allocate memory for your transfers and pass this
pointer for addr in the usbd_setup_vendor() calls.


: Additionally, if anyone who has decent experience with usb drivers in QNX
: and doesn’t mind being bothered by someone who doesn’t, like me :slight_smile:, would be
: willing to send me an email so I can ask some other specific questions, I’d
: appreciate it.

: Thanks,
: Barrett

I’m moving this over to the .usb group after this post.

use usbd_alloc() to allocate memory for your transfers and pass this
pointer for addr in the usbd_setup_vendor() calls.

If the URB struct doesn’t have a pointer to its associated memory, is there
a better way to find which buffer is being used by an URB in the CBF from
usbd_io() when given that URB? Right now we basically loop through the list
of URBs until we find the one that the CBF is dealing with, then find the
matching buffer based on the position in our array.

Thanks,

Barrett

“Henry Van Dyke” <henry@qnx.com> wrote in message
news:bebsvh$s7d$1@nntp.qnx.com

Barrett Heyneman <> heyneman@its.caltech.edu> > wrote:
: I’ve got a few questions about USB related issues for writing a camera
: driver

: 1. According to the USB DDK there is a usbd_setup_control() function for
: setting up a URB for control transfers. I can’t call it (not defined)
and I
: don’t see it in usbdi.h. Does anyone know where it is / if it exists at
all?
: (I believe we’re running QNX 6.1).


use usbd_setup_vendor() instead.


: 2. As far as I can tell, other UNIX OSs’ URB structures have links to
their
: associated memory buffers (in Linux I think it’s urb.transfer_buffer or
: something similar). Does the URB structure in QNX have an equivalent
that
: I’ve missed?

use usbd_alloc() to allocate memory for your transfers and pass this
pointer for addr in the usbd_setup_vendor() calls.


: Additionally, if anyone who has decent experience with usb drivers in
QNX
: and doesn’t mind being bothered by someone who doesn’t, like me > :slight_smile:> ,
would be
: willing to send me an email so I can ask some other specific questions,
I’d
: appreciate it.

: Thanks,
: Barrett

Barrett Heyneman <heyneman@its.caltech.edu> wrote:
: I’m moving this over to the .usb group after this post.

:> use usbd_alloc() to allocate memory for your transfers and pass this
:> pointer for addr in the usbd_setup_vendor() calls.


: If the URB struct doesn’t have a pointer to its associated memory, is there
: a better way to find which buffer is being used by an URB in the CBF from
: usbd_io() when given that URB? Right now we basically loop through the list
: of URBs until we find the one that the CBF is dealing with, then find the
: matching buffer based on the position in our array.


typedef struct _your_urb {
struct usbd_urb *urb;
_uint8 *baddr;
} your_urb_t;

your_urb_t urb_list[];

//allocate all urbs
curr_urb->urb = usbd_alloc_urb()
curr_urb->baddr = usbd_alloc()

usbd_setup_isochronous( curr_urb->urb, URB_DIR_IN | URB_ISOCH_ASAP, 0, curr_urb->baddr, ep_in_size );
if( status = usbd_io( curr_urb->urb, ep_in, your_isoch_cbf, curr_urb, USBD_TIME_INFINITY ) ) {
fprintf( stderr," Error on usbdi_io\n");
}

In the callback function you then get passed “curr_urb” from which you can get
the buffer address.

Henry

: Thanks,

: Barrett

: “Henry Van Dyke” <henry@qnx.com> wrote in message
: news:bebsvh$s7d$1@nntp.qnx.com
:> Barrett Heyneman <heyneman@its.caltech.edu> wrote:
:> : I’ve got a few questions about USB related issues for writing a camera
:> : driver
:>
:> : 1. According to the USB DDK there is a usbd_setup_control() function for
:> : setting up a URB for control transfers. I can’t call it (not defined)
: and I
:> : don’t see it in usbdi.h. Does anyone know where it is / if it exists at
: all?
:> : (I believe we’re running QNX 6.1).
:>
:>
:> use usbd_setup_vendor() instead.
:>
:>
:> : 2. As far as I can tell, other UNIX OSs’ URB structures have links to
: their
:> : associated memory buffers (in Linux I think it’s urb.transfer_buffer or
:> : something similar). Does the URB structure in QNX have an equivalent
: that
:> : I’ve missed?
:>
:> use usbd_alloc() to allocate memory for your transfers and pass this
:> pointer for addr in the usbd_setup_vendor() calls.
:>
:>
:> : Additionally, if anyone who has decent experience with usb drivers in
: QNX
:> : and doesn’t mind being bothered by someone who doesn’t, like me :slight_smile:,
: would be
:> : willing to send me an email so I can ask some other specific questions,
: I’d
:> : appreciate it.
:>
:> : Thanks,
:> : Barrett
:>
:>