From: Daniel Stekloff <dsteklof@us.ibm.com>
To: Jon Smirl <jonsmirl@yahoo.com>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: sysfs - which driver for a device?
Date: Wed, 24 Sep 2003 09:03:21 +0000 [thread overview]
Message-ID: <200309240903.22042.dsteklof@us.ibm.com> (raw)
In-Reply-To: <20030924020344.55460.qmail@web14905.mail.yahoo.com>
Hi,
On Wednesday 24 September 2003 02:03 am, Jon Smirl wrote:
> In sysfs it is easy to see which devices a driver is supporting.
> For example /sys/bus/pci/drivers/e1000 links to 0000:02:0c.0 in my system.
>
> But how do you go the other way; starting from 0000:02:0c.0 to determine
> the driver? Is the best solution to loop though the drivers directories
> searching for the device? Or would it be better to change sysfs to add an
> attribute to each device containing the driver name?
>
> In /proc/bus/pci/devices the driver name is the last field.
Have you looked at libsysfs? You can query for a sysfs_device, which includes
the name of the driver. Libsysfs' goal is to provide an easy interface for
retrieving such information. The library should also reduce the need for
adding extra references or attributes in the kernel.
Libsysfs is included in the sysfsutils package that also contains systool, a
command to view system information exposed through sysfs.
Sysfsutils can be found at:
http://linux-diag.sourceforge.net/
Thanks,
Dan
> =====
> Jon Smirl
> jonsmirl@yahoo.com
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2003-09-24 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-24 2:03 Jon Smirl
2003-09-24 9:03 ` Daniel Stekloff [this message]
2003-09-25 18:05 ` Patrick Mochel
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=200309240903.22042.dsteklof@us.ibm.com \
--to=dsteklof@us.ibm.com \
--cc=jonsmirl@yahoo.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®