Re: Why this flash drive not detected in devd?



On Thu, Jul 09, 2009 at 11:22:16PM +0800, Sagara Wijetunga wrote:
Hi FreeBSD community

This is FreeBSD 7.2 on i386.

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=6 interface=0
dev.umass.1.%pnpinfo: vendor=0x0718 product=0x0081 devclass=0x00
devsubclass=0x00 release=0x0103 sernum="14925B00" intclass=0x08
intsubclass=0x06
dev.umass.1.%parent: uhub4

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";
};


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=DEVFS subsystem=CDEV type=CREATE cdev=pass2
!system=DEVFS subsystem=CDEV type=CREATE cdev=da0
!system=DEVFS subsystem=CDEV type=CREATE cdev=da0s1
!system=DEVFS subsystem=CDEV type=CREATE cdev=msdosfs/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=4 interface=0
dev.umass.0.%pnpinfo: vendor=0x3538 product=0x0042 devclass=0x00 devsubclass=0x00 release=0x0100 sernum="000000000004E1" intclass=0x08 intsubclass=0x06
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
--
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)

Attachment: pgp4e3Oc0NI9r.pgp
Description: PGP signature



Relevant Pages

  • Re: So when was the change that broke umass introduced?
    ... now causes a Fatal Trap 12 when I attach my camera, whereas umass ... usb/133390 usb umass crashes system in 7.1 when Olympus D-540 attache ...
    (comp.unix.bsd.freebsd.misc)
  • Why this flash drive not detected in devd?
    ... sysctl -a | grep dev.umass ... dev.umass.1.%driver: umass ... Could I know why the flash drive is not detected on attach? ...
    (freebsd-questions)
  • Re: panic after removing usb flash drive
    ... Panics are not acceptable or expected behaviour in any situation, ... When the thumbdrive gets pulled, the umass driver gets told to ... a SIM that would attach to the root hub instance of each USB controller ...
    (freebsd-current)
  • Re: panic after removing usb flash drive
    ... >>1) When the thumbdrive gets pulled, the umass driver gets told to ... >>down correctly because there is an open reference to the target in CAM ... >>and would treat the USB bus as a CAM bus. ...
    (freebsd-current)
  • Re: OT - need help with defragging
    ... Most laptops these days are loaded with USB ports-- ... so you can attach all sorts of things. ... has a USB connector on it. ... When I'm at my daughter's in Tucson I use her laptop to which she has ...
    (alt.support.stop-smoking)