FreeBSD Bugzilla – Attachment 204738 Details for
Bug 238138
[PATCH] acpi_dock(4): Notify devd(8) on dock status change
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
acpi_dock(4): Notify devd(8) on dock status change
0001-acpi_dock-4-Notify-devd-8-on-dock-status-change.patch (text/plain), 2.40 KB, created by
Muhammad Kaisar Arkhan
on 2019-05-31 11:14:47 UTC
(
hide
)
Description:
acpi_dock(4): Notify devd(8) on dock status change
Filename:
MIME Type:
Creator:
Muhammad Kaisar Arkhan
Created:
2019-05-31 11:14:47 UTC
Size:
2.40 KB
patch
obsolete
>From 16577b7746e8633e9f630b529ccb8ebff3c84bb3 Mon Sep 17 00:00:00 2001 >From: Muhammad Kaisar Arkhan <kaisar@arkhan.io> >Date: Sun, 12 May 2019 14:36:48 +0200 >Subject: [PATCH] acpi_dock(4): Notify devd(8) on dock status change > >If devd(8) is running, it notifies devd(8) when the computer is docked and >undocked. > >Original patch taken from: >https://people.freebsd.org/~iwasaki/acpi/acpi_dock_devd-20080204.diff >--- > sbin/devd/devd.conf.5 | 2 ++ > sys/dev/acpica/acpi_dock.c | 18 +++++++++++++++--- > 2 files changed, 17 insertions(+), 3 deletions(-) > >diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 >index d1e74c4492cd..781e491bd6ca 100644 >--- a/sbin/devd/devd.conf.5 >+++ b/sbin/devd/devd.conf.5 >@@ -351,6 +351,8 @@ Resume notification. > Suspend notification. > .It Li Thermal > Thermal zone events. >+.It Li Dock >+Dock state ($notify=0x00 is undocked, 0x01 is docked). > .El > .Pp > .It Li CARP >diff --git a/sys/dev/acpica/acpi_dock.c b/sys/dev/acpica/acpi_dock.c >index d27b4bdf3c5f..c52081a17440 100644 >--- a/sys/dev/acpica/acpi_dock.c >+++ b/sys/dev/acpica/acpi_dock.c >@@ -256,11 +256,13 @@ acpi_dock_insert_children(device_t dev) > static void > acpi_dock_insert(device_t dev) > { >- struct acpi_dock_softc *sc; >+ struct acpi_dock_softc *sc; >+ ACPI_HANDLE h; > > ACPI_SERIAL_ASSERT(dock); > > sc = device_get_softc(dev); >+ h = acpi_get_handle(dev); > > if (sc->status == ACPI_DOCK_STATUS_UNDOCKED || > sc->status == ACPI_DOCK_STATUS_UNKNOWN) { >@@ -270,8 +272,13 @@ acpi_dock_insert(device_t dev) > return; > } > >- if (!cold) >+ if (!cold) { > acpi_dock_insert_children(dev); >+ >+ /* Notify devd(8) that we're docked */ >+ acpi_UserNotify("Dock", h, 1); >+ } >+ > sc->status = ACPI_DOCK_STATUS_DOCKED; > } > } >@@ -325,10 +332,13 @@ static void > acpi_dock_removal(device_t dev) > { > struct acpi_dock_softc *sc; >+ ACPI_HANDLE h; > > ACPI_SERIAL_ASSERT(dock); > > sc = device_get_softc(dev); >+ h = acpi_get_handle(dev); >+ > if (sc->status == ACPI_DOCK_STATUS_DOCKED || > sc->status == ACPI_DOCK_STATUS_UNKNOWN) { > acpi_dock_eject_children(dev); >@@ -342,6 +352,9 @@ acpi_dock_removal(device_t dev) > return; > } > >+ /* Notify devd(8) that we're undocked */ >+ acpi_UserNotify("Dock", h, 0); >+ > sc->status = ACPI_DOCK_STATUS_UNDOCKED; > } > >@@ -534,4 +547,3 @@ static devclass_t acpi_dock_devclass; > > DRIVER_MODULE(acpi_dock, acpi, acpi_dock_driver, acpi_dock_devclass, 0, 0); > MODULE_DEPEND(acpi_dock, acpi, 1, 1, 1); >- >-- >2.21.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 238138
:
204618
|
204619
| 204738