From: Matthew Wilcox <matthew@wil.cx>
To: Li Shaohua <shaohua.li@intel.com>
Cc: ACPI-DEV <acpi-devel@lists.sourceforge.net>,
lkml <linux-kernel@vger.kernel.org>,
Len Brown <len.brown@intel.com>, Greg <greg@kroah.com>,
Patrick Mochel <mochel@digitalimplant.org>
Subject: Re: [ACPI] [PATCH/RFC 4/4]An experimental implementation for IDE bus
Date: Mon, 8 Nov 2004 15:24:50 +0000 [thread overview]
Message-ID: <20041108152450.GB32374@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <1099887081.1750.249.camel@sli10-desk.sh.intel.com>
On Mon, Nov 08, 2004 at 12:11:47PM +0800, Li Shaohua wrote:
> A sample patch to bind IDE devices. I'm not familar with IDE driver, so
> the patch possibly is completely wrong, though it can show correct ACPI
> path in my laptop. This test case just shows the framework works, please
> don't apply it.
> +#ifdef CONFIG_ACPI
> +#include <linux/acpi.h>
> +int generic_ide_platform_bind(struct device *dev)
> +{
> + acpi_handle parent_handle = NULL;
> + acpi_integer address;
> + int i;
> +
> + /* Seems dev->parent->parent is the PCI IDE controller */
> + if (dev->parent && dev->parent->parent)
> + parent_handle = dev->parent->parent->handle;
An IDE struct device is the gendev embedded in the ide_drive_t. Its parent
is the ide_hwif_t, and its parent is the PCI device (or maybe SBUS
or whatever). You can see this in /sys:
$ ls /sys/devices/pci0000:00/0000:00:1f.1/ide0/0.0
block detach_state power
The '0.0' is the device with an ide_bus_type. ide0 is the hwif.
0000:00:1f.1 is a pci_dev. Or in ACPI terms, ACPI/_SB/PCI0/IDEC
is ide0 and ACPI/_SB/PCI0/IDEC/PRID is 0.0
At least, I think that's the mapping. Are we ever going to do anything
with /sys/firmware/acpi/namespace/ or will it just stay around consuming
inodes and dentries for no good reason?
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
next prev parent reply other threads:[~2004-11-08 16:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-08 4:11 Li Shaohua
2004-11-08 5:15 ` [ACPI] " Hiroshi 2 Itoh
2004-11-08 15:24 ` Matthew Wilcox [this message]
2004-11-09 5:35 ` /sys/firmware/acpi (Re: [ACPI] [PATCH/RFC 4/4]An experimental implementation for IDE bus) Len Brown
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=20041108152450.GB32374@parcelfarce.linux.theplanet.co.uk \
--to=matthew@wil.cx \
--cc=acpi-devel@lists.sourceforge.net \
--cc=greg@kroah.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@digitalimplant.org \
--cc=shaohua.li@intel.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®