From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 24 05:54:51 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 640CE16A4CE for ; Mon, 24 Nov 2003 05:54:51 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6688243FD7 for ; Mon, 24 Nov 2003 05:54:49 -0800 (PST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) hAODsgvq012880 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 24 Nov 2003 14:54:45 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id hAODsfER070878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Nov 2003 14:54:41 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.10/8.12.10) with ESMTP id hAODse2u026504; Mon, 24 Nov 2003 14:54:40 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.10/8.12.10/Submit) id hAODsd0a026503; Mon, 24 Nov 2003 14:54:39 +0100 (CET) (envelope-from ticso) Date: Mon, 24 Nov 2003 14:54:39 +0100 From: Bernd Walter To: "Michael E. Mercer" Message-ID: <20031124135438.GP74178@cicely12.cicely.de> References: <1069638644.355.9.camel@dual.mmercer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1069638644.355.9.camel@dual.mmercer.com> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org Subject: Re: USB Question: unable to open /dev/ugen0 more than once X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2003 13:54:51 -0000 On Sun, Nov 23, 2003 at 08:50:45PM -0500, Michael E. Mercer wrote: > Hello peoples, > > I posted this to questions with no reply, I was hoping > someone here may be able to give some insight. > > > Question: Should I be able to open /dev/ugen0 more than once? > > I am using FreeBSD 4.9-Stable, libusb-0.1.7. > >From reading the libusb docs, you must open the device for each > interface you want to acquire. However, once it is opened once, it can't > be opened again. > > Furthermore, calls to usb_find_devices() shows that /dev/ugen0 has > disappeared. Investigation on how they(libusb) finds devices, shows they > are trying to open the device read only... this is where it tries to > open it the second time. This second try fails and therefore libusb > thinks the device was removed. > > Question: Is this the correct behavior? Yes - this is correct. A client using ugen on a multiple interface only need to open /dev/ugen? for probing only - the work should be done using the interface specific endpoints /dev/ugen?.? Opening /dev/ugen? read-only makes no sense, because there is no read only access possible - /dev/ugen? is for the control endpoint which always means sending commands to the device. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de