Subject: Re: usb-question
To: Love <>
From: Lennart Augustsson <>
List: current-users
Date: 09/20/2000 10:56:34
Love wrote:

> Lennart Augustsson <> writes:
> > Love wrote:
> >
> > > I'm trying to figure out how usb works in NetBSD, but I'm a little bit
> > > puzzled. If the ioctl(USB_GET_INTERFACE_DESC) returns 2 endpoints,
> > > shouldn't it be possible to open /dev/ugen0.01 and /dev/ugen0.02 ?
> >
> > Not necessarily, you need to find out what the numbers of the endpoints are.
> > If you use the usbgen program in the usbutil package it will dump all the
> > descriptors of the device.
> Ok
> After looking at it a while I and reading the documentation i understod
> that endpoint 1 is a CONTROL endpoint and bidirectional, and endpoint 2 is

A device which has a second CONTROL endpoint?!?  Wow, I've never seen that.
Can you send me the output of `usbgen -D' on the device?

> I tried to make ugen support CONTROL endpoints (at least let me open the
> device RW). If I want to send control message to the pipe, is
> usbd_do_request_flags() the right function (for control-message frameing as
> described in the USB-spec) ? Looks that will do the right thing when I look
> at other drivers, but I only get back EIO from the ioctl(), it goes thru
> the 'if (err = USBD_STALLED)' case in usbd_do_request().

Well, to support additional control pipes you will have to open the pipe in ugenopen()
and then handle it in ugenioctl() in the same way as pipe 0 is handled.

    -- Lennart