From owner-freebsd-usb@FreeBSD.ORG Sun Nov 9 16:28:33 2008 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1C7A1065686; Sun, 9 Nov 2008 16:28:33 +0000 (UTC) (envelope-from rink@rink.nu) Received: from mx1.rink.nu (gloom.rink.nu [213.34.49.2]) by mx1.freebsd.org (Postfix) with ESMTP id 9E4778FC2C; Sun, 9 Nov 2008 16:28:32 +0000 (UTC) (envelope-from rink@rink.nu) Received: from localhost (localhost [127.0.0.1]) by mx1.rink.nu (Postfix) with ESMTP id 5C0296D42B; Sun, 9 Nov 2008 17:28:39 +0100 (CET) X-Virus-Scanned: amavisd-new at rink.nu Received: from mx1.rink.nu ([213.34.49.2]) by localhost (gloom.rink.nu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GWA7jWtlbfH2; Sun, 9 Nov 2008 17:28:35 +0100 (CET) Received: by mx1.rink.nu (Postfix, from userid 1000) id 7A48E6D423; Sun, 9 Nov 2008 17:28:35 +0100 (CET) Date: Sun, 9 Nov 2008 17:28:35 +0100 From: Rink Springer To: Hans Petter Selasky Message-ID: <20081109162835.GE78524@rink.nu> References: <20081109120257.GA78524@rink.nu> <200811091515.26123.hselasky@c2i.net> <20081109154722.GC78524@rink.nu> <200811091700.06932.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200811091700.06932.hselasky@c2i.net> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: usb@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Patch to convert usb2 to use cdev X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2008 16:28:34 -0000 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