All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: faking or posing as a specific USB ID?
Date: Sun, 10 May 2009 20:44:28 +0000	[thread overview]
Message-ID: <20090510204428.GA26748@kroah.com> (raw)
In-Reply-To: <gu7d87$5on$1@ger.gmane.org>

On Sun, May 10, 2009 at 11:25:42PM +0300, Jani Monoses wrote:
> Hello,
> 
> the lkml is probably a better list for this question but there may be a 
> udev answer to it.
> 
> The problem I am trying to find the most elegant solution for is the 
> following: given a certain driver that supports USB device AAAA:BBBB try 
> to see if it works with new device CCCC:DDDD without rebuilding (or 
> hexediting :) the module by somehow asking it to treat the new device as 
> if it were AAAA:BBBB.

Just use the "new_id" files in sysfs and the bind and unbind files there
to do the binding after writing the new id to the driver.  That is what
those files are there for.

> This may not be possible with the current kernel, as drivers only look 
> for devices hardcoded in their .initdata sections. While  some can be 
> told via a new_id sysfs attribute to add a new ID dynamically to their
> supported list, webcams and probably other families of devices would 
> need to specify extra parameters (ex: bridge and img sensor tuple) 
> besides the ID.

If a driver needs more than the id, then no, the new_id stuff will not
work, sorry.

> Does udev have some way of faking insertion events or altering an event 
> coming from the kernel and sending it back that way? A rule that says in 
> effect, rename USB ID AAAA:BBBB to CCCC:DDDD ?

No, that will not work, use bind/unbind/new_id from userspace through
sysfs.

> If not, the the ID matching code in the kernel is the one I think could 
> be told via a syfs atribute similar to new_id.

Yes, use that :)

hope this helps,

greg k-h

      reply	other threads:[~2009-05-10 20:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-10 20:25 faking or posing as a specific USB ID? Jani Monoses
2009-05-10 20:44 ` Greg KH [this message]

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=20090510204428.GA26748@kroah.com \
    --to=greg@kroah.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.