Furquan Shaikh has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46032 )
Change subject: drivers/wifi/generic: Log WiFi wake source to event log ......................................................................
drivers/wifi/generic: Log WiFi wake source to event log
This change adds a call to `pci_dev_is_wake_source()` to determine and log WiFi wake source to event log just like the Intel WiFi driver does. This is done in preparation to merge the generic and Intel WiFi drivers in follow-up changes.
BUG=b:169802515 BRANCH=zork
Change-Id: I20528ae1f72ca633da31e01d777c46fd5f4a337f Signed-off-by: Furquan Shaikh furquan@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/46032 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Rob Barnes robbarnes@google.com Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/drivers/wifi/generic/generic.c 1 file changed, 8 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved Rob Barnes: Looks good to me, but someone else must approve
diff --git a/src/drivers/wifi/generic/generic.c b/src/drivers/wifi/generic/generic.c index b175f23..2ecaadc 100644 --- a/src/drivers/wifi/generic/generic.c +++ b/src/drivers/wifi/generic/generic.c @@ -6,6 +6,7 @@ #include <device/device.h> #include <device/pci.h> #include <device/pci_def.h> +#include <elog.h> #include <sar.h> #include <string.h> #include <wrdd.h> @@ -237,10 +238,17 @@ wifi_generic_fill_ssdt(dev, dev->chip_info); }
+static void wifi_pci_dev_init(struct device *dev) +{ + if (pci_dev_is_wake_source(dev)) + elog_add_event_wake(ELOG_WAKE_SOURCE_PME_WIFI, 0); +} + struct device_operations wifi_generic_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, + .init = wifi_pci_dev_init, .ops_pci = &pci_dev_ops_pci, .acpi_name = wifi_generic_acpi_name, .acpi_fill_ssdt = wifi_generic_fill_ssdt_generator,