summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormk <mk@openbsd.org>2007-04-23 19:29:03 +0000
committermk <mk@openbsd.org>2007-04-23 19:29:03 +0000
commit77d6f5e32272ea99ace0905c0c2eab61d6764af9 (patch)
treeae7931e156d077c5594a19d27c8e1b732e51ff3d
parentRemove duplicate commment (diff)
downloadwireguard-openbsd-77d6f5e32272ea99ace0905c0c2eab61d6764af9.tar.xz
wireguard-openbsd-77d6f5e32272ea99ace0905c0c2eab61d6764af9.zip
When receiving an undock request, walk the list of dependant devices
and pull their _EJ0 knobs before undocking. This ejects any dependant devices (if necessary) before actually undocking. Without this, the usb hub in my X6 gets upset when it's suddenly kicked off the system without warning, and upon redocking it attaches as uberry. Now it's behaving as it should.
-rw-r--r--sys/dev/acpi/acpidock.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpidock.c b/sys/dev/acpi/acpidock.c
index a94c72ffebd..f22a97fa8f6 100644
--- a/sys/dev/acpi/acpidock.c
+++ b/sys/dev/acpi/acpidock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidock.c,v 1.24 2007/04/23 18:34:42 mk Exp $ */
+/* $OpenBSD: acpidock.c,v 1.25 2007/04/23 19:29:03 mk Exp $ */
/*
* Copyright (c) 2006,2007 Michael Knudsen <mk@openbsd.org>
*
@@ -233,7 +233,12 @@ acpidock_notify(struct aml_node *node, int notify_type, void *arg)
acpidock_dockctl(sc, 1);
break;
- case ACPIDOCK_EVENT_EJECT:
+ case ACPIDOCK_EVENT_EJECT: {
+ struct aml_nodelist *n;
+
+ TAILQ_FOREACH(n, &sc->sc_deps_h, entries)
+ acpidock_eject(sc, n->node);
+
acpidock_dockctl(sc, 0);
acpidock_docklock(sc, 0);
@@ -243,6 +248,7 @@ acpidock_notify(struct aml_node *node, int notify_type, void *arg)
printf("%s: undock", DEVNAME(sc));
break;
+ }
}
acpidock_status(sc);