aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorAymeric Wibo <obiwac@FreeBSD.org>2025-06-14 15:29:25 +0000
committerAymeric Wibo <obiwac@FreeBSD.org>2025-08-08 09:42:44 +0000
commit84bbfc32a3f47bd2e32741247afe516cbeff7789 (patch)
tree53b13b371a306a9db97df302d7b1f6f31e997d6a /sys/dev/pci
parent7988e7e1675d8414f2694c1ee4ed73ac214abfc4 (diff)
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c7
-rw-r--r--sys/dev/pci/pcivar.h27
2 files changed, 20 insertions, 14 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index f94438cda041..4629165f34b2 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -81,6 +81,9 @@
#include <dev/iommu/iommu.h>
+#include <contrib/dev/acpica/include/acpi.h>
+#include <dev/acpica/acpivar.h>
+
#include "pcib_if.h"
#include "pci_if.h"
@@ -2896,8 +2899,8 @@ pci_set_powerstate_method(device_t dev, device_t child, int state)
}
if (bootverbose)
- pci_printf(cfg, "Transition from D%d to D%d\n", oldstate,
- state);
+ pci_printf(cfg, "Transition from %s to %s\n",
+ acpi_d_state_to_str(oldstate), acpi_d_state_to_str(state));
PCI_WRITE_CONFIG(dev, child, cfg->pp.pp_location + PCIR_POWER_STATUS,
status, 2);
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index d1b7d28eae91..832305b9adee 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -497,22 +497,25 @@ pci_is_vga_memory_range(rman_res_t start, rman_res_t end)
/*
* PCI power states are as defined by ACPI:
*
- * D0 State in which device is on and running. It is receiving full
- * power from the system and delivering full functionality to the user.
- * D1 Class-specific low-power state in which device context may or may not
- * be lost. Buses in D1 cannot do anything to the bus that would force
- * devices on that bus to lose context.
- * D2 Class-specific low-power state in which device context may or may
- * not be lost. Attains greater power savings than D1. Buses in D2
- * can cause devices on that bus to lose some context. Devices in D2
- * must be prepared for the bus to be in D2 or higher.
- * D3 State in which the device is off and not running. Device context is
- * lost. Power can be removed from the device.
+ * D0 State in which device is on and running. It is receiving full
+ * power from the system and delivering full functionality to the user.
+ * D1 Class-specific low-power state in which device context may or may not
+ * be lost. Buses in D1 cannot do anything to the bus that would force
+ * devices on that bus to lose context.
+ * D2 Class-specific low-power state in which device context may or may
+ * not be lost. Attains greater power savings than D1. Buses in D2
+ * can cause devices on that bus to lose some context. Devices in D2
+ * must be prepared for the bus to be in D2 or higher.
+ * D3hot State in which the device is off and not running. Device context is
+ * lost. Power can be removed from the device.
+ * D3cold Same as D3hot, but power has been removed from the device.
*/
#define PCI_POWERSTATE_D0 0
#define PCI_POWERSTATE_D1 1
#define PCI_POWERSTATE_D2 2
-#define PCI_POWERSTATE_D3 3
+#define PCI_POWERSTATE_D3_HOT 3
+#define PCI_POWERSTATE_D3_COLD 4
+#define PCI_POWERSTATE_D3 PCI_POWERSTATE_D3_COLD
#define PCI_POWERSTATE_UNKNOWN -1
static __inline int