opnsense-src/sys/dev/pci
Kevin Bowling 61272c8a2a pci: Expose PME support by power state
The presence of the PCI power management capability does not imply that
a function can signal PME# from every power state.  Drivers which
advertise wake based only on pci_has_pm() can consequently expose wake
modes that cannot work.

Add pci_has_pme() to query the PME_Support bitmap for a specific state.
Use it to implement LinuxKPI pci_pme_capable(), removing its duplicate
PME_Support decoder.

Validated the helper against PCI PMC capability values from 82571EB,
82573L, 82579LM, I210, I225, and I226-V controllers.  The 82571 and
82573 reported PMC 0xc822, while the I226-V reported 0xc823.  In both
values, bits 15, 14, and 11 advertise PME from D3cold, D3hot, and D0;
the low-bit difference is only the PM capability version.

Sponsored by:	BBOX.io

(cherry picked from commit c4e24e95c3f905b817d4bfc6e93457eb297bfa4b)
2026-09-23 12:01:02 +02:00
..
controller pci/n1sdp: Disable HotPlug 2026-01-13 14:06:19 +00:00
fixup_pci.c chore: replace {0, 0} with {DEV,KOBJ}METHOD_END 2026-04-25 09:46:07 -07:00
hostb_pci.c chore: replace {0, 0} with {DEV,KOBJ}METHOD_END 2026-04-25 09:46:07 -07:00
ignore_pci.c chore: replace {0, 0} with {DEV,KOBJ}METHOD_END 2026-04-25 09:46:07 -07:00
isa_pci.c
pci.c pci: Expose PME support by power state 2026-09-23 12:01:02 +02:00
pci_dw.c
pci_dw.h
pci_dw_if.m
pci_dw_mv.c
pci_host_generic.c pci: pci_host_generic: provide cleanup methods outside of detach 2026-09-23 10:52:48 +02:00
pci_host_generic.h pci: pci_host_generic: provide cleanup methods outside of detach 2026-09-23 10:52:48 +02:00
pci_host_generic_acpi.c
pci_host_generic_acpi.h
pci_host_generic_den0115.c newbus: replace leftover device unit wildcards 2025-06-21 05:57:45 +03:00
pci_host_generic_fdt.c pci: pci_host_generic: provide cleanup methods outside of detach 2026-09-23 10:52:48 +02:00
pci_host_generic_fdt.h pci: pci_host_generic: provide cleanup methods outside of detach 2026-09-23 10:52:48 +02:00
pci_if.m
pci_iov.c pci: Expose a VF's owning PF to bus subclasses 2026-09-23 12:01:02 +02:00
pci_iov.h
pci_iov_if.m
pci_iov_private.h pci_iov: Support dynamic subordinate bus growth during VF creation 2025-07-29 15:09:53 -04:00
pci_iov_schema.c
pci_pci.c pcib: Assume a window where both the base and limit are 0 is uninitialized 2026-04-24 11:39:43 -04:00
pci_private.h pci: Expose a VF's owning PF to bus subclasses 2026-09-23 12:01:02 +02:00
pci_subr.c
pci_user.c pci: Export bus numbers for bridge devices in struct pci_conf 2026-04-24 13:33:53 -04:00
pcib_if.m
pcib_private.h
pcib_support.c
pcireg.h pci: Add L1 PM definitions 2026-09-23 12:01:00 +02:00
pcivar.h pci: Expose PME support by power state 2026-09-23 12:01:02 +02:00
schema_private.h
vga_pci.c sys: Use is_pci_device instead of direct comparisons to devclasses 2026-09-23 11:30:15 +02:00