Skip to content

Commit bec50f6

Browse files
committed
[ACPI] Report a docking device to the system
1 parent 076f08c commit bec50f6

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

drivers/bus/acpi/buspdo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ Bus_PDO_QueryDeviceCaps(
419419
deviceCapabilities->Address = device->pnp.bus_address;
420420
}
421421

422+
if (DeviceData->DockDevice)
423+
deviceCapabilities->DockDevice = TRUE;
424+
DPRINT("DockDevice: %u\n", deviceCapabilities->DockDevice);
425+
422426
if (!device ||
423427
(device->flags.hardware_id &&
424428
(strstr(device->pnp.hardware_id, ACPI_BUTTON_HID_LID) ||

drivers/bus/acpi/include/acpisys.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ typedef struct _PDO_DEVICE_DATA
4242
// An array of (zero terminated wide character strings).
4343
// The array itself also null terminated
4444
PWCHAR HardwareIDs;
45+
BOOLEAN DockDevice;
4546
// Link point to hold all the PDOs for a single bus together
4647
LIST_ENTRY Link;
4748
ULONG InterfaceRefCount;

drivers/bus/acpi/pnp.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ Bus_InitializePdo (
422422
PPDO_DEVICE_DATA pdoData;
423423
int acpistate;
424424
DEVICE_POWER_STATE ntState;
425+
ACPI_HANDLE handle = 0;
426+
ACPI_STATUS status = 0;
425427

426428
PAGED_CODE ();
427429

@@ -468,6 +470,17 @@ Bus_InitializePdo (
468470
pdoData->Common.DevicePowerState = ntState;
469471
pdoData->Common.SystemPowerState = FdoData->Common.SystemPowerState;
470472

473+
/* Identify the dock device */
474+
if (pdoData->AcpiHandle)
475+
{
476+
status = AcpiGetHandle(pdoData->AcpiHandle, "_DCK", &handle);
477+
if (ACPI_SUCCESS(status))
478+
{
479+
DPRINT("Found _DCK method!");
480+
pdoData->DockDevice = TRUE;
481+
}
482+
}
483+
471484
ExAcquireFastMutex (&FdoData->Mutex);
472485
InsertTailList(&FdoData->ListOfPDOs, &pdoData->Link);
473486
FdoData->NumPDOs++;

0 commit comments

Comments
 (0)