From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 19 13:35:25 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 40CAE16A475 for ; Wed, 19 Oct 2005 13:35:25 +0000 (GMT) (envelope-from dr2867@pacbell.net) Received: from smtp102.sbc.mail.mud.yahoo.com (smtp102.sbc.mail.mud.yahoo.com [68.142.198.201]) by mx1.FreeBSD.org (Postfix) with SMTP id 4948043D5A for ; Wed, 19 Oct 2005 13:35:14 +0000 (GMT) (envelope-from dr2867@pacbell.net) Received: (qmail 18597 invoked from network); 19 Oct 2005 13:35:13 -0000 Received: from unknown (HELO ?192.168.0.190?) (dr2867.business@pacbell.net@68.126.216.127 with plain) by smtp102.sbc.mail.mud.yahoo.com with SMTP; 19 Oct 2005 13:35:13 -0000 Message-ID: <43564B98.9000803@pacbell.net> Date: Wed, 19 Oct 2005 06:35:20 -0700 From: Daniel Rudy User-Agent: Mozilla/5.0 (X11R6; UNIX; FreeBSD/i386 5.4-RELEASE-p7; en-US; ja-JP; rv:1.7.12) Gecko/20050915 MultiZilla/1.6.2.0c Mnenhy/0.7.2.0 X-Accept-Language: en-us, en, ja MIME-Version: 1.0 To: "M. Warner Losh" References: <43553287.4030907@pacbell.net> <20051018.223845.67882192.imp@bsdimp.com> In-Reply-To: <20051018.223845.67882192.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Accessing USB Mass Storage Device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2005 13:35:25 -0000 At about the time of 10/18/2005 9:38 PM, M. Warner Losh stated the following: > In message: <43553287.4030907@pacbell.net> > Daniel Rudy writes: > : > : When the umass driver is compiled into the kernel, and one inserts a USB > : mass storage device, how does one access the device descriptors (serial > : number) while the device is listed as a da device? I would perfer to > : have the OS do all the work of accessing the hardware. > > The serial number can be obtained with devifo. However, since cam > doesn't hook into the device tree, mapping da number to umass number > can be tricky in the arbitrary case. > > devinfo -v | grep umass > umass0 pnpinfo vendor=0x054c product=0x014d devclass=0x00 devsubclass=0x00 release=0x0110 sernum="0052450548137984" intclass=0x08 intsubclass= at port=0 interface=0 > > : How does one read and write data to the device using /dev/ugen? > > One can't. You can't have multiple drivers attach to the same > hardware. They would interfere with each other unless there was some > sort of time domain sharing of the device. Even that would be, ummm, > challanging in the arbitrary general case (but I want to get the > serial number of my disk that's mounted, why can't I do that?). > Arbitrary sharing is tough to do. Since ugen is so arbitrary in what > you can do with it, I don't imagine it would ever be implemented. > > Another option would be to do what we do with pci already, and have a > small set of information that we can query the device in a > non-distruptive (mostly) way and expand that to usb. The usb bus > (well uhub, since it is the usb bus) would create device nodes that > could be querried for standard information. We've started doing this > with pccard and cardbus, so you can now get, eg, the CIS, the power > states (well, that's in my mind/tree right now), etc. > > Warner > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > Looking at the man page for devinfo(8), it also contains a reference to devinfo(3). When examining the information for devinfo(3), I have come to the conclusion that this is exactly what I was looking for. I noticed a blurb in the man page for devinfo(3) that the interface is subject to refinement? Are there any plans to alter this interface in future versions? Thank You. -- Daniel Rudy