From owner-freebsd-arch@FreeBSD.ORG Tue Mar 23 09:24:40 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A0EA216A4CE for ; Tue, 23 Mar 2004 09:24:40 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDE3843D58 for ; Tue, 23 Mar 2004 09:24:39 -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) i2NHMhUS020301 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 23 Mar 2004 18:22:48 +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 i2NHLjhn057553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 23 Mar 2004 18:21:45 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id i2NHLid0079128; Tue, 23 Mar 2004 18:21:44 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id i2NHLiZk079127; Tue, 23 Mar 2004 18:21:44 +0100 (CET) (envelope-from ticso) Date: Tue, 23 Mar 2004 18:21:44 +0100 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20040323172142.GF63452@cicely12.cicely.de> References: <20040320052007.GC33602@cicely12.cicely.de> <20040320.184336.88475380.imp@bsdimp.com> <20040321071100.GH33602@cicely12.cicely.de> <20040322123048.GP63452@cicely12.cicely.de> <20040322151647.GU63452@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040322151647.GU63452@cicely12.cicely.de> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham version=2.61 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on cicely5.cicely.de cc: ticso@cicely12.cicely.de cc: arch@FreeBSD.org cc: ticso@cicely.de Subject: Opinions about using USB serial numbers - Patch X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 17:24:40 -0000 On Mon, Mar 22, 2004 at 04:16:48PM +0100, Bernd Walter wrote: > On Mon, Mar 22, 2004 at 01:30:49PM +0100, Bernd Walter wrote: > > What still puzzles me is why only the nomatch event includes pnpinfo. > > I've found the code in subr_bus and it looks very intentionally to me. > Should I move the serial number into the location string? > Or can we add the pnpinfo to attach/detach messages as well? I just added pnpinfo to attach/detach messages as well and I managed to get devd to create the required symlinks: Processing event '+ubser0 vendor=0x03da product=0x0001 devclass=0x00 devsubclass=0x00 sernum="1080054842" intclass=0xff intsubclass=0x00 at port=3 interface=0 on uhub3' Pushing table device-name=ubser0 vendor=0x03da product=0x0001 devclass=0x00 devsubclass=0x00 sernum=1080054842 intclass=0xff intsubclass=0x00 Processing attach event Testing device-name=ubser0 against ^ed50 Testing device-name=ubser0 against ^ubser[0-9]+ Executing '/etc/devd/ubser-start.sh ubser0 1080054842' Popping table Processing event '-ubser0 vendor=0x03da product=0x0001 devclass=0x00 devsubclass=0x00 sernum="" intclass=0xff intsubclass=0x00 at port=3 interface=0 on uhub3' Pushing table device-name=ubser0 vendor=0x03da product=0x0001 devclass=0x00 devsubclass=0x00 sernum= intclass=0xff intsubclass=0x00 Processing detach event Testing device-name=ubser0 against ^ed50 Testing device-name=ubser0 against ^ubser[0-9]+ Executing '/etc/devd/ubser-stop.sh ubser0 ' Popping table [102]cicely13# ls -al /dev/ubser0.* crw-rw---- 1 uucp dialer 233, 0 Mar 23 17:34 /dev/ubser0.0 crw-rw---- 1 uucp dialer 233, 1 Mar 23 17:34 /dev/ubser0.1 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.0 -> ubser0.0 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.1 -> ubser0.1 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.2 -> ubser0.2 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.3 -> ubser0.3 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.4 -> ubser0.4 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.5 -> ubser0.5 crw-rw---- 1 uucp dialer 233, 2 Mar 23 17:34 /dev/ubser0.2 crw-rw---- 1 uucp dialer 233, 3 Mar 23 17:34 /dev/ubser0.3 crw-rw---- 1 uucp dialer 233, 4 Mar 23 17:34 /dev/ubser0.4 crw-rw---- 1 uucp dialer 233, 5 Mar 23 17:34 /dev/ubser0.5 [103]cicely13# ls -al /dev/ubser0.* ls: No match. Exit 1 The detach message doesn't contain the serial since this is not cached as the other values - however the device-name is enough to rm the links at detach because we know they are pointing to ubser0.* nodes. Since this is an interface level driver I should add the interface number to the symlink name as well - but that's up to the one configuring devd. The patch is at http://www.bwct.de/usb-devd.patch -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de