Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Nov 2008 17:28:35 +0100
From:      Rink Springer <rink@FreeBSD.org>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        usb@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: Patch to convert usb2 to use cdev
Message-ID:  <20081109162835.GE78524@rink.nu>
In-Reply-To: <200811091700.06932.hselasky@c2i.net>
References:  <20081109120257.GA78524@rink.nu> <200811091515.26123.hselasky@c2i.net> <20081109154722.GC78524@rink.nu> <200811091700.06932.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Hans,

On Sun, Nov 09, 2008 at 05:00:05PM +0100, Hans Petter Selasky wrote:
> It is not the same endpoint, but multiple different endpoints on the same 
> device through the same file handle. Instead of one endpoint per file, you 
> have one file handle for each set of endpoints you need for your USB userland 
> driver, like LibUSB. Then there is only one file-handle to poll. Actually 
> there are two modes in UGEN now. Maybe you were not aware. Let me quickly 
> explain:
> 
> 1) Simple read/write mode that works with cat & dd.
> 
> 2) Special USB FS mode which exposes the full USB features to userland. This 
> mode does not use read/write, but rather copyin, copyout and a set of 
> software USB descriptors.

Hmm, I think I see what you mean. Basically, you just
open("/dev/ugenX.Y") and you can use the USB_FS_xxx ioctl's to have
fine-grained control. However, if you open("/dev/ugen.X.Y.Z"), you'd
talk with endpoint Z on USB device X.Y..  this is actually quite cool,
guess I should have studied usb2_generic.c more :-)

I think it makes sense to say that if /dev/ugenX.Y is opened, you
shouldn't be able to open /dev/ugenX.Y.Z, right? However, what happends
if /dev/ugenX.Y.Z is opened? I'd think that opening /dev/ugenX.Y would
be fine, but any ioctl() dealing with the corresponding endpoint Z
should be denied.

Does this make sense to you?

-- 
Rink P.W. Springer                                - http://rink.nu
"Anyway boys, this is America. Just because you get more votes doesn't
 mean you win." - Fox Mulder



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081109162835.GE78524>