From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 24 02:55:51 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 79CD916A41F for ; Mon, 24 Oct 2005 02:55:51 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from ant.bwct.de (ant.bwct.de [85.159.14.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id D087343D48 for ; Mon, 24 Oct 2005 02:55:50 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by ant.bwct.de (8.12.11/8.12.11) with ESMTP id j9O2tRBv021426; Mon, 24 Oct 2005 04:55:27 +0200 (CEST) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id j9O2tJgO076609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Oct 2005 04:55:19 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id j9O2tInr049132; Mon, 24 Oct 2005 04:55:18 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id j9O2tE2D049131; Mon, 24 Oct 2005 04:55:14 +0200 (CEST) (envelope-from ticso) Date: Mon, 24 Oct 2005 04:55:14 +0200 From: Bernd Walter To: Daniel Rudy Message-ID: <20051024025513.GE31913@cicely12.cicely.de> References: <43553287.4030907@pacbell.net> <20051018.223845.67882192.imp@bsdimp.com> <20051020110428.GC31913@cicely12.cicely.de> <435C4845.3080503@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <435C4845.3080503@pacbell.net> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 X-Spam-Report: * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on cicely12.cicely.de Cc: freebsd-hackers@freebsd.org, ticso@cicely.de Subject: Re: Accessing USB Mass Storage Device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 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 Oct 2005 02:55:51 -0000 On Sun, Oct 23, 2005 at 07:34:45PM -0700, Daniel Rudy wrote: > At about the time of 10/20/2005 4:04 AM, Bernd Walter stated the following: > > On Tue, Oct 18, 2005 at 10:38:45PM -0600, M. Warner Losh wrote: > > > >>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 > > > > > > This is the USB serial number, there might even exist another one > > at CAM device layer. > > e.g.: > > [108]cicely13# camcontrol inquiry -n da -u 1 > > pass1: Removable Direct Access SCSI-2 device > > pass1: Serial Number ST92163-2000 > > pass1: 1.000MB/s transfers > > [110]cicely13# devinfo -v | grep umass0 > > umass0 pnpinfo vendor=0x0483 product=0x1307 devclass=0x00 devsubclass=0x00 sernum="4710765066451" interface=0 intclass=0x08 intsubclass=0x06 at port=1 > > > > That was one of the first things that I tried. It didn't work. All I > got was a blank line. Neither the USB serial number nor the CAM one must exist. And if they exist noone garanties that they make sense, in the case above the CAM one sounds more like a chip identification than a unique serial number. However the devinfo umass* line must exist, at least without a serial. To make things more confusing, an USB device may even have different serial numbers in different languages, while it is not often used an USB device can have strings in several languages, the serial number is not an exception here. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de