Subject: Re: Introducing environment in autoconf(9)
To: Martin Husemann <email@example.com>
From: Quentin Garnier <firstname.lastname@example.org>
Date: 11/19/2005 20:57:09
Content-Type: text/plain; charset=us-ascii
On Sat, Nov 12, 2005 at 02:14:39AM +0100, Martin Husemann wrote:
> On Sat, Nov 12, 2005 at 01:33:11AM +0100, Quentin Garnier wrote:
> > The reason for that is that the ACPI
> > table itself doesn't carry enough information to allow us to match a
> > device in the ACPI table to a device found by autoconf, and in return,
> > given a device, it's almost impossible to extract its ACPI counterpart.
> Ok. If that would be solvable, I bet most other problems would have
> easy, obvious solutions.
> In the OpenFirmware world we face many of the problems you describe, but =
> is always very easy to know the firmware device node coresponding to a de=
> you just start to discover in autoconfig. You can then easily walk the OF
> tree around and collect all necessary information "on demand". Everything
> else you can store in device properties and retrieve later (but this
> mostly makes MI drivers live easier, by abstracting MD things into
> abstract properties)
In the ACPI world, the device nodes can have arbitrary names (some
vendors give them human-readable names, such as "PCI0", "USB1", some
prefer concealing them under numbers "C001", "C002"). Not all of them
have explicit types (given by the _HID method): PCI root buses have the
_HID method, but children buses are combined with their parent bridge,
which has no explicit type but instead might (as in "sometimes not")
have the _PRT method, which is specific to PCI buses. So given a found
device, it's not possible to retrieve the handle of the matching ACPI
device without already knowing the path of the parent.
But it's also not possible to walk the ACPI namespace first, because
it's not possible either to predict the name of the real device that
will be found: sometimes there is no actual device, and the lack of
explicit type makes it impossible to tell what driver will attach.
Also, things such as missing _PRT makes it impossible to predict the bus
number of the PCI bus objects until the device is actually attached.
That also means using properties(9) would be hackish, because it is
designed to work with known objects. I could use it with a "config"
database, and a fixed object "0", but it just would be a hack, as the
config properties don't apply to a real object. I think the API I
currently have is simple enough for its task.
Now, what should I do with my changes? Commit the config_env stuff,
then go on with the changes to acpi(4) and pci(4) to use them? Maybe I
could put all that in a branch so that it is easier to review them and
possibly tweak them a bit before it goes into the trunk?
Quentin Garnier - email@example.com - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)
-----END PGP SIGNATURE-----