linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] Add bluetooth-hid2hci to udev-extras
Date: Fri, 12 Jun 2009 19:14:19 +0000	[thread overview]
Message-ID: <1244834059.30814.24.camel@yio.site> (raw)
In-Reply-To: <4A303B6D.6020508@dell.com>

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


  parent reply	other threads:[~2009-06-12 19:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-10 23:02 [PATCH] Add bluetooth-hid2hci to udev-extras Mario Limonciello
2009-06-11 13:03 ` Marcel Holtmann
2009-06-11 16:13 ` Mario Limonciello
2009-06-11 19:41 ` Kay Sievers
2009-06-11 21:05 ` Mario Limonciello
2009-06-11 21:46 ` Kay Sievers
2009-06-12 18:31 ` Mario Limonciello
2009-06-12 19:14 ` Kay Sievers [this message]
2009-06-13  1:31 ` Kay Sievers
2009-06-15 14:09 ` Mario Limonciello
2009-06-15 14:18 ` Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1244834059.30814.24.camel@yio.site \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).