From owner-freebsd-questions@FreeBSD.ORG Thu Jul 9 16:59:30 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29D6106568A for ; Thu, 9 Jul 2009 16:59:30 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr15.xs4all.nl (smtp-vbr15.xs4all.nl [194.109.24.35]) by mx1.freebsd.org (Postfix) with ESMTP id 57C588FC12 for ; Thu, 9 Jul 2009 16:59:29 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr15.xs4all.nl (8.13.8/8.13.8) with ESMTP id n69GxRQn005024; Thu, 9 Jul 2009 18:59:27 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 43DE5BAAA; Thu, 9 Jul 2009 18:59:27 +0200 (CEST) Date: Thu, 9 Jul 2009 18:59:27 +0200 From: Roland Smith To: Sagara Wijetunga Message-ID: <20090709165927.GB63043@slackbox.xs4all.nl> References: <4A560B28.6080705@tomahawk.com.sg> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LpQ9ahxlCli8rRTG" Content-Disposition: inline In-Reply-To: <4A560B28.6080705@tomahawk.com.sg> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: Why this flash drive not detected in devd? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 16:59:31 -0000 --LpQ9ahxlCli8rRTG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 09, 2009 at 11:22:16PM +0800, Sagara Wijetunga wrote: > Hi FreeBSD community >=20 > This is FreeBSD 7.2 on i386. >=20 > sysctl -a | grep dev.umass > dev.umass.1.%desc: Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 > dev.umass.1.%driver: umass > dev.umass.1.%location: port=3D6 interface=3D0 > dev.umass.1.%pnpinfo: vendor=3D0x0718 product=3D0x0081 devclass=3D0x00=20 > devsubclass=3D0x00 release=3D0x0103 sernum=3D"14925B00" intclass=3D0x08= =20 > intsubclass=3D0x06 > dev.umass.1.%parent: uhub4 >=20 > Following added to /etc/devd.conf: > # Imation Flash Drive, class 0/0, rev 2.00/1.03, addr 3 > attach 200 { > match "vendor" "0x0718"; > match "product" "0x0081"; > match "serial" "14925B00"; > action "touch /tmp/Imation-Flash-Drive-detected"; > }; >=20 >=20 > Could I know why the flash drive is not detected on attach? The USB subsystem isn't currently equipped to notify devd (technically, the devctl_notify function isn't used in the USB stack). So the only notification you'll get is when devfs creates a device. Since there is no predictable link between a USB device and a disk device, info from the USB stack would be less then usefull. You can check this by reading from /dev/devctrl (when devd is not running, since this device can only be opened by one program at a time) just after you plugged in the device. For my usb thumbdrive I get: cat /dev/devctl !system=3DDEVFS subsystem=3DCDEV type=3DCREATE cdev=3Dpass2 !system=3DDEVFS subsystem=3DCDEV type=3DCREATE cdev=3Dda0 !system=3DDEVFS subsystem=3DCDEV type=3DCREATE cdev=3Dda0s1 !system=3DDEVFS subsystem=3DCDEV type=3DCREATE cdev=3Dmsdosfs/RFS1 While sysctl gives: dev.umass.0.%desc: vendor 0x3538 USB Mass Storage Device, class 0/0, rev 2.= 00/1.00, addr 2 dev.umass.0.%driver: umass dev.umass.0.%location: port=3D4 interface=3D0 dev.umass.0.%pnpinfo: vendor=3D0x3538 product=3D0x0042 devclass=3D0x00 devs= ubclass=3D0x00 release=3D0x0100 sernum=3D"000000000004E1" intclass=3D0x08 i= ntsubclass=3D0x06 dev.umass.0.%parent: uhub4 So for now, you'll have to match on the creation of da* devices, or labels if you use those. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --LpQ9ahxlCli8rRTG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkpWIe8ACgkQEnfvsMMhpyXxYgCeJaaTQ9WXOVIfKw4MJtl9ApSs tO4An0hdlN/Yrm95Jk5RKp47eMIoR+uq =QTJp -----END PGP SIGNATURE----- --LpQ9ahxlCli8rRTG--