From: "Kay Sievers" <kay.sievers@vrfy.org>
To: Alemao <xcarandiru@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: usb & udev
Date: Mon, 20 Aug 2007 12:30:20 +0200 [thread overview]
Message-ID: <3ae72650708200330k3d6f4151x60d97e2444ea6dc4@mail.gmail.com> (raw)
In-Reply-To: <d970ff420708192306gfe0628dn192f01e8301f2b39@mail.gmail.com>
On 8/20/07, Alemao <xcarandiru@gmail.com> wrote:
> When I plug my board with the FT232R chip from FTDI (USB to serial) a
> module named usbserial.ko and ftdi_sio.ko is inserted automatically.
>
> I saw in udev rules that this is the line responsible for doing that:
>
> # Load drivers that match kernel-supplied alias
> ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -Q $env{MODALIAS}"
>
> What I want to know is who send this for udev? usbcore module?
The driver core. In this case it's the USB core, which enumerates the
devices on the USB bus. When the USB core discovers a new device, it
requests a new object from the driver core, which sends the event.
> The variable $env{MODALIAS} is something like this:
>
> usb:v0403p6001d0600dc00dsc00dp00icFFiscFFipFF
>
> v0403 is the vendor ID, p6001 is the product ID, but the others? I
> didnt find anything about this in modprobe or udev docs....
MODALIAS strings are specific to every subsystem. They start with
"<subsystem>:" and append all sorts of values depending on the
individual properties of the subsystem.
For USB these are the values of:
idVendor, idProduct, bcdDevice, bDeviceClass, bDeviceSubClass,
bDeviceProtocol, bInterfaceClass, bInterfaceSubClass, bInterfaceProtocol.
They are not defined outside the kernel, they are just used for
wildcard matches with MODULE_ALIAS() strings in the modules itself:
$ modinfo ftdi_sio.ko
...
alias: usb:v15BAp0003d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0403pEE18d*dc*dsc*dp*ic*isc*ip*
...
The called modprobe matches the kernel supplied MODALIAS with the
entries contained in the module itself, and loads all matching
modules.
Kay
prev parent reply other threads:[~2007-08-20 10:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-20 6:06 Alemao
2007-08-20 10:30 ` Kay Sievers [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=3ae72650708200330k3d6f4151x60d97e2444ea6dc4@mail.gmail.com \
--to=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xcarandiru@gmail.com \
/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
all inboxes | Powered by JetHome®