Re: [PATCH] Add bluetooth-hid2hci to udev-extras

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

 



On Fri, 2009-06-12 at 13:31 -0500, Mario Limonciello wrote:

> > Using ATTRS is needlessly expensive because it walks up the chain of
> > parent devices to search for a match. It also does not make sure we
> > run only once per usb_device, it will match all usb_interface and
> > usb_endpoint devices.
> >
> > The appendend works fine here, care to check what's going wrong on your side?
> >   
> It looks like since I'm matching as far as the kernel mouse* device, I
> needed to actually match the input subsystem for the Dell stuff, whereas
> it's the USB subsystem for everything else.

I see, then we just do: "KERNEL=="mouse*", SUBSYSTEMS=="usb", ..." for
this rule, and should be fine.

> Here's an updated attached patch that works for me.

Uh, why are the ID_VENDOR matches back? As mentioned in the earlier
mail, we should not rely on the numeric fallback values of the usb_id
program (happens only when no textual string is available), that is just
too fragile. It isn't even guaranteed, that usb_id will even run before
these rules.

We should be able to directly use ATTR{} of the device, not a value
imported by an earlier program.

Something like the appended should work, and we should also be able to
fold all the very similar rules into fewer pattern matches.

Sorry for insisting here, but we need to get this right, people will
copy the stuff we ship to other rules, and we need to be careful,
because all rules match on all device events on the system, and we need
to make sure not to match needlessly on things that will never be
executed. And we need to avoid needless dependencies between rules
files.

Thanks,
Kay

#################
ACTION!="add", GOTO="hid2hci_end"

KERNEL=="mouse*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \
  RUN+="hid2hci --method dell -v $attr{idVendor} -p $attr{idProduct} --mode hci"

SUBSYSTEM!="usb", GOTO="hid2hci_end"
ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end"

ATTR{idVendor}=="046d", ATTR{idProduct}=="c70[345abce]" RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
ATTR{idVendor}=="046d", ATTR{idProduct}=="c71[34bc]" RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
...

LABEL="hid2hci_end"
#################

--
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