Opinions about using USB serial numbers - Patch
Bernd Walter
ticso at cicely12.cicely.de
Tue Mar 23 09:24:40 PST 2004
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 at bwct.de info at bwct.de
More information about the freebsd-arch
mailing list