lkml.org 
[lkml]   [2008]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] [PATCH] Loaded driver modalias
On Tue, Nov 4, 2008 at 19:39, Nathaniel McCallum
<nathaniel@natemccallum.com> wrote:
> Please CC me to responses as I'm not subscribed to LKML. Also, this is my
> first kernel patch, advise is certainly welcome.
>
> For something I'm working on I have the need to answer the question, "given
> a hardware ID, does Linux distro X have a driver to support this hardware?"
> and more specifically, "which drivers support this hardware?" I can,
> generally speaking, get this data from files like
> /lib/modules/*/modules.alias. However, this does not work for drivers built
> into the kernel. With that in mind, I've cooked up a little proof of
> concept. Basically, its a sysfs file
> /sys/modules/$module/drivers/$driver/modalias that, when read, contains
> modalias-style filters for this driver.
>
> The attached patch only does this for PCI drivers, each subsystem would need
> a patch like this. Is this idea crazy? Is there a better implementation?

Hmm, what if that gets larger than 4k? It seems not really like
something for sysfs. There are also drivers which export a modalias
which matches more devices, than the device it actually would accept
to bind to. Some driver have logic in the match() function to exclude
stuff.

What's the exact information you need? Would it be sufficient to ask
a bus with a modalias string, which driver of that bus matched that
device?

Kay


\
 
 \ /
  Last update: 2008-11-04 20:57    [W:0.548 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site