drivers/wifi/generic: Fix properties in generic-under-PCI device case
In the devicetree case where a generic device underneath the Intel PCI
CNVi device carries the device properties, the incorrect device was
passed to wifi_ssdt_write_properties.
Also while here, update the UUID for `DmaProperty` to match what
Microsoft defined here:
https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports
BUG=b:215424986, b:220639445
TEST=dump SSDT and see that _PRW for CNVi device is no longer garbage,
but contains the value from the devicetree (GPE0_PME_B0).
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: Iafd86458d2f65ccb7e74d1308d37fd3ebbf7f520
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62746
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: YH Lin <yueherngl@google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Varshit B Pandya <varshit.b.pandya@intel.com>
diff --git a/src/drivers/wifi/generic/generic.c b/src/drivers/wifi/generic/generic.c
index 5aaedae..1187b332 100644
--- a/src/drivers/wifi/generic/generic.c
+++ b/src/drivers/wifi/generic/generic.c
@@ -21,6 +21,7 @@
.enable_resources = pci_dev_enable_resources,
.init = wifi_pci_dev_init,
.ops_pci = &pci_dev_ops_pci,
+ .scan_bus = scan_static_bus,
#if CONFIG(HAVE_ACPI_TABLES)
.acpi_name = wifi_pcie_acpi_name,
.acpi_fill_ssdt = wifi_pcie_fill_ssdt,
@@ -41,6 +42,11 @@
#endif
};
+struct device_operations wifi_generic_ops = {
+ .read_resources = noop_read_resources,
+ .set_resources = noop_set_resources,
+};
+
static bool is_cnvi(const struct device *dev)
{
return dev && dev->path.type != DEVICE_PATH_PCI;
@@ -59,16 +65,12 @@
static void wifi_generic_enable(struct device *dev)
{
- DEVTREE_CONST struct drivers_wifi_generic_config *config = dev ? dev->chip_info : NULL;
-
- if (!config)
- return;
-
#if !DEVTREE_EARLY
- if (is_cnvi(dev))
- dev->ops = &wifi_cnvi_ops;
+ const struct device *parent = dev->bus->dev;
+ if (parent && parent->ops == &wifi_pcie_ops)
+ dev->ops = &wifi_generic_ops;
else
- dev->ops = &wifi_pcie_ops;
+ dev->ops = &wifi_cnvi_ops;
#endif
}