[PATCH] Hotplug for openfirmware/macio devices

Jeff Mahoney jeffm at suse.com
Fri Sep 17 06:08:09 EST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hey all -

Many devices on the macintosh hardware platform are hidden behind a
macio asic that places devices beyond the PCI bus for hotplug. Loading
the driver manually works fine, but we have this wonderful hotplug
system now. Why should macio be a second class citizen?

At least for me, the most noticable one was my airport card, but there
may be others. I only have an ibook and a powermac.

Attached are three patches, which do the following:
* kernel-of-hotplug.diff; against 2.6.9-rc2 (mainline)
~  - exports OF information to userspace
~  - removes struct of_device in favor of struct of_device_id, which
~    uses character arrays such that the structure can be more easily
~    used by module-init-tools [the renaming is required to use the
~    MODULE_DEVICE_TABLE macro]
~  - changes the semantics of OF_MATCH_ANY to be an empty string
~  - adds the name, type, and compat strings to the macio sysfs tree
~  - adds a hotplug filter to pass the name, type, and compat info
~    to hotplug
~  - adds the appropriate MODULE_DEVICE_TABLE entries so that
~    module-init-tools can know about macio devices
~  - (Yes, I know this information is available via /proc/device_tree,
~     but sysfs is a much more natural fit)
* hotplug-macio.diff
~  - macio.rc: handles coldplugging of devices by traversing
~    the macio sysfs tree
~  - macio.agent: handles macio hotplug events
* module-init-tools-3.0-pre10-openfirmware.diff
~  - adds support for a modules.ofmap table so that the hotplug scripts
~    can determine which modules to load based on the OF information.

Is there a limit for the length of the various OF strings? I've assumed
32 for the sake of testing, but it's completely arbitrary.

Take a look if you're interested. My familiarity with the PPC world is
peripheral at best. I'd love feedback.

- -Jeff

- --
Jeff Mahoney
SuSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBSfKpLPWxlyuTD7IRAjogAJ0YN3ikH4Vdlc0HFL8VqmudfXdWPgCff6D6
8AwEoPW6w5nUGlzAiHmiq4I=
=pF7H
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hotplug-macio.diff
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20040916/c2b8e794/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: module-init-tools-3.0-pre10-openfirmware.diff
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20040916/c2b8e794/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kernel-of-hotplug.diff
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20040916/c2b8e794/attachment-0001.asc>


More information about the Linuxppc-dev mailing list