Re: why was MODALIAS removed from usb kernel events? [u]

"Andreas Jellinghaus [c]" <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.linux.kernel
Message-ID <[email protected]>
Am Dienstag, 21. August 2007 schrieb Greg KH:
> On Fri, Aug 17, 2007 at 04:22:04PM +0200, Andreas Jellinghaus [c] wrote:
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit
> >diff;h=9f8b17e643fe6aa505629658445849397bda4e4f
> >
> > removes MODALIAS from one of the events,
>
> Which event?

here is the event with kernel 2.6.21:
UEVENT[1187683991.583384] 
add      /devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1.7/2-1.7:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1.7/2-1.7:1.0
SUBSYSTEM=usb
SEQNUM=3070
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/002/006
PRODUCT=8e6/3438/100
TYPE=0/0/0
INTERFACE=11/0/0
MODALIAS=usb:v08E6p3438d0100dc00dsc00dp00ic0Bisc00ip00

note: it has both - MODALIAS and DEVICE.

here is the event with kernel 2.6.22 (with CONFIG_USB_DEVICE_CLASS):
UEVENT[1187684539.588975] 
add      /devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1.7/2-1.7:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1.7/2-1.7:1.0
SUBSYSTEM=usb
SEQNUM=3029
DEVTYPE=usb_interface
PHYSDEVBUS=usb
INTERFACE=11/0/0
MODALIAS=usb:v08E6p3438d0100dc00dsc00dp00ic0Bisc00ip00

you see, it is missing DEVICE and PRODUCT and TYPE

and here is the event with kernel 2.6.22 with alans patch and 
CONFIG_USB_DEVICE_CLASS:

UEVENT[1187684125.860105] 
add      /devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1.7/2-1.7:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1.7/2-1.7:1.0
SUBSYSTEM=usb
SEQNUM=3029
DEVTYPE=usb_interface
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/002/006
BUSNUM=002
DEVNUM=006
INTERFACE=11/0/0
MODALIAS=usb:v08E6p3438d0100dc00dsc00dp00ic0Bisc00ip00

it still misses PRODUCT and TYPE, for real compatibility those should be added 
too. (I can work around that, as the PRODUCT information is part of MODALIAS 
and I don't use TYPE.)

> If you enable CONFIG_USB_DEVICE_CLASS, does everything work the same
> again?

both with CONFIG_USB_DEVICE_CLASS. would it change anything here?

> What specific udev rule are you matching against here that is now
> broken?

still trying to get it to work, so far I try:

SUBSYSTEM!="usb", GOTO="openct_usb_rules_end"
ACTION!="add", GOTO="openct_usb_rules_end"
ENV{MODALIAS}=="usb:v0973p0001*", RUN+="/lib/udev/openct_usb"
ENV{MODALIAS}=="usb:*ic0Bisc00*", RUN+="/lib/udev/openct_usb"
LABEL="openct_usb_rules_end"

this should work?

> > The text does not mention MODALIAS nor the reason for it's removal.
>
> The reason is we don't need the usb_device class anymore, but we still
> provide for the compatibility if you have an old distro with old udev
> rules that is expecting it (only rule we ran into was the one for the
> usbfs /dev nodes, but there might be more.)

I'm no udev expert, but old kernels provide an event with all three 
informations I care about: MODALIAS, DEVICE and PRODUCT. this is changed,
and I don't understand what it has to do with usb_device class.

but I can say that without any event that has all three (or at least the first 
two - I can create PRODUCT from MODALIAS i think), I would need to redesign
how openct finds out if new devices are plugged in. long term I might need
to do so anyway, but right now people complain "it doesn't work" to me, and 
the culprit seems to be the kernel to me - 2.6.21 works, 2.6.22 does not.

Now I'm working on getting openct udev rules and handling script fixed so
they work at least with alans patch and work around missing PRODUCT.

Regards, Andreas

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.