From 1e8c6819b16ef5e21b2f3f0137a6027367387298 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Thu, 31 Oct 2024 13:08:44 -0700 Subject: drivers/wifi: Support Wi-Fi PHY Filter Configuration This feature provides ability to provide Wi-Fi PHY filter Configuration. A well-defined dedicated filter on particular platform can be used to perform the maximum Wi-Fi performance. The implementation follows document 559910 Intel Connectivity Platforms BIOS Guideline revision 9.2 specification. BUG=b:346600091 TEST=WPFC method is added to the wifi device and return the data supplied by the SAR binary blob Change-Id: Iebe95815c944d045f4cf686abcd1874a8a45e270 Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/84948 Reviewed-by: Kapil Porwal Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/drivers/wifi/generic/acpi.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src/drivers/wifi') diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c index be44f6b907..d3277cc1e0 100644 --- a/src/drivers/wifi/generic/acpi.c +++ b/src/drivers/wifi/generic/acpi.c @@ -927,6 +927,46 @@ static void sar_emit_ebrd(const struct ebrd_profile *ebrd) acpigen_write_package_end(); } +static void sar_emit_wpfc(const struct wpfc_profile *wpfc) +{ + if (wpfc == NULL) + return; + + /* + * Name ("WPFC", Package() { + * { + * Revision, + * Package() + * { + * DomainType, // 0x7:WiFi + * Chain A Filter Platform Configuration + * Chain B Filter Platform Configuration + * Chain C Filter Platform Configuration + * Chain D Filter Platform Configuration + * } + } }) + */ + if (wpfc->revision != WPFC_REVISION) { + printk(BIOS_ERR, "Unsupported WPFC table revision: %d\n", + wpfc->revision); + return; + } + + acpigen_write_name("WPFC"); + acpigen_write_package(2); + acpigen_write_dword(wpfc->revision); + + acpigen_write_package(5); + acpigen_write_dword(DOMAIN_TYPE_WIFI); + acpigen_write_byte(wpfc->filter_cfg_chain_a); + acpigen_write_byte(wpfc->filter_cfg_chain_b); + acpigen_write_byte(wpfc->filter_cfg_chain_c); + acpigen_write_byte(wpfc->filter_cfg_chain_d); + + acpigen_write_package_end(); + acpigen_write_package_end(); +} + static void emit_wifi_sar_acpi_structures(const struct device *dev, union wifi_sar_limits *sar_limits) { @@ -943,6 +983,7 @@ static void emit_wifi_sar_acpi_structures(const struct device *dev, sar_emit_ppag(sar_limits->ppag); sar_emit_wtas(sar_limits->wtas); sar_emit_wbem(sar_limits->wbem); + sar_emit_wpfc(sar_limits->wpfc); } static void wifi_ssdt_write_device(const struct device *dev, const char *path) -- cgit v1.2.3