tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Docking stations and ACPI?




On Jun 18, 2008, at 8:49 PM, Steven M. Bellovin wrote:

On Wed, 18 Jun 2008 20:13:35 -0700
James Chacon <jmc%NetBSD.org@localhost> wrote:

So I noticed when booting current on my laptop everything maps
cleanly under ACPI now (including the previously broken cardbus back
in the pre 4.0 days).

However there's no driver for the dock. Running acpidump on this
laptop shows it described correctly and it provides EJD tags for any
devices it's passing through to the doc (com, lpt and usb in my case).

What I was wondering is if there's any current plans for drivers for
docks? It's been a significant amount of time since I last looked at
things so wanted to know if anyone was already looking at this.

From what I can tell the sequence for dealing with docks would be:

Issue some form of "please allow eject" from a dock call.
For all devices containing an EJD tag for that dock, attempt a
detach on them. For things which are in active use (USB drives, etc)
fail of course until they're ready.
OS side does a _DCK(0) call (blocks until dock is ready)
OS issues an asych _EJ0 call
ACPI completes this once the actual undock has happened
Rescan devices that had EJD tags associated with this dock and
reattach any that are still around.

i.e. on my laptop the com/lpt ports are pass-through out to the
dock. So after eject they're still around and active and should be
reattached, but not all the USB ports are there (the dock has a
couple more exposed).

I'm assuming the user level side of this could be augmented support
in eject(1) and possibly a dock device to call against.

Does this sound sane as a start?

Presumably, some of that could be done at user level via drvctl.
Reattaching is trickier, though I think drvctl can do that, too.


Hmmm...clearly been a while since I looked at things, as I don't recall drvctl :)

Most of this could be pushed out to sysmon, but how would userland easily know which devices to attempt detach on? (based on todays device tree)

Also, what would hook in userland? powerd doesn't seem the right place since this isn't a sleep/power function.

I suppose the device tree could build initially as

acpi0 -> dock0 -> com0, lpt0, etc

Except for usb ports themselves. On my laptop for instance it has 3 usb ports exposed on the dock. However acpidump only shows 2 with EJD tags. Looking at dmesg it's because one of them is actually a USB 2.0 hub hanging off the port of another usb 2.0 hub. So both of the ports it exposes can be wrapped into that one tag since that hub isn't otherwise accessible without the dock.

James




Home | Main Index | Thread Index | Old Index