Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Dec 2011 23:29:31 +0000
From:      Mike Clarke <jmc-freebsd2@milibyte.co.uk>
To:        freebsd-questions@freebsd.org, Polytropon <freebsd@edvax.de>
Subject:   Re: umass to /dev/da* mapping
Message-ID:  <201112052329.32027.jmc-freebsd2@milibyte.co.uk>
In-Reply-To: <20111205182508.005fd1fd.freebsd@edvax.de>
References:  <201112051708.16072.jmc-freebsd2@milibyte.co.uk> <20111205182508.005fd1fd.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 05 December 2011, Polytropon wrote:

> On Mon, 5 Dec 2011 17:08:15 +0000, Mike Clarke wrote:

[snip]

> > Is there any convenient way for my script to determine which da*
> > devices correspond to the umass device name?
>
> Maybe you could use a matching against
>
> 	match "bus" "0x????";
> 	match "vendor" "0x????";
> 	match "product" "0x????";
> 	match "release" "0x????";
>
> to determine which device you're currently accessing.
> As the USB IDs stay the same for at least the card
> reader, it should be easy to conclude. :-)
>
> USB devices are usually "enumerated" in the order they
> appear to the system.

Thanks for that idea. I'd originally thought in terms of not being able 
to use the vendor info to identify a usb stick since that can't be 
known in advance for every stick that might ever be inserted but I'd 
overlooked using the info to eliminate the built in card reader.

So now when any umass device is attached devd calls my script which just 
iterate over sysctl dev.umass | grep "%pnpinfo" building up a list of 
devices, adding four if it's the card reader or one for each other 
umass, and it works a treat.

-- 
Mike Clarke



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112052329.32027.jmc-freebsd2>