ATTRS{idVendor}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I must be missing something really fundamental, because whatever rules
I write, they don't seem to see attributes.

Here is one example.  I am inserting a device that is a CDMA modem.
Its path is:

/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/ttyUSB0/tty/ttyUSB0

If I start in /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/ttyUSB0/tty/ttyUSB0
and start searching upward, I find a file named:

   /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-2/idVendor

That file contains the string "1410" ... so far so good, that's
exactly what I want.

Next, I try to write a rule like this:

ACTION=="add", ATTRS{idVendor}=="1410", DRIVERS=="option",
ATTRS{port_number}=="0", SYMLINK+="usb-cell"

Nothing happens.  It doesn't match, because idVendor is (apparently)
not assigned.  So, to troubleshoot this I try something else:

ACTION=="add", RUN+="/usr/bin/logger add devpath=%p driver=$driver
id=%b links=$links vendor=$attr{idVendor}, product=$attr{product}"

What that should do is that any time ANYTHING is added it uses logger
to write a line to the log file.  I remove and reinsert the device
and, indeed, logger gets called.  What gets logged is a string like
this:

logger: add devpath=/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/ttyUSB0/tty/ttyUSB0
driver=option id=3-2:1.0 links=char/188:0
serial/by-path/pci-0000:00:1d.1-usb-0:2:1.0-port0
serial/by-id/usb-Novatel_Wireless_Inc._Novatel_Wireless_CDMA_091073597351000-if00-port0
vendor=, product=


So ... lots of useful stuff there.  It logged, it sees a device path
that makes sense, but vendor and product are not assigned.

What am I doing wrong?

My system is ubuntu 9.04.  Here's some relevant version info:

# udevd --version
141

# aptitude show udevd  # useless stuff removed
Package: udev
Version: 141-1
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux