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 <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84948
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Jeremy Compostella 2024-10-31 13:08:44 -07:00 committed by Jérémy Compostella
commit 1e8c6819b1
3 changed files with 61 additions and 1 deletions

View file

@ -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)

View file

@ -9,7 +9,7 @@
#define MAX_DENYLIST_ENTRY 16
#define MAX_DSAR_SET_COUNT 3
#define MAX_GEO_OFFSET_REVISION 3
#define MAX_PROFILE_COUNT 14
#define MAX_PROFILE_COUNT 15
#define MAX_SAR_REVISION 2
#define MAX_BSAR_REVISION 2
#define WBEM_REVISION 0
@ -20,6 +20,7 @@
#define BUCS_REVISION 1
#define BDMM_REVISION 1
#define EBRD_REVISION 1
#define WPFC_REVISION 0
#define REVISION_SIZE 1
#define SAR_REV0_CHAINS_COUNT 2
#define SAR_REV0_SUBBANDS_COUNT 5
@ -144,6 +145,14 @@ struct ebrd_profile {
} sar_table_sets[3];
} __packed;
struct wpfc_profile {
uint8_t revision;
uint8_t filter_cfg_chain_a;
uint8_t filter_cfg_chain_b;
uint8_t filter_cfg_chain_c;
uint8_t filter_cfg_chain_d;
} __packed;
struct sar_header {
char marker[SAR_STR_PREFIX_SIZE];
uint8_t version;
@ -167,6 +176,7 @@ union wifi_sar_limits {
struct bucs_profile *bucs;
struct bdmm_profile *bdmm;
struct ebrd_profile *ebrd;
struct wpfc_profile *wpfc;
};
void *profile[MAX_PROFILE_COUNT];
};

View file

@ -170,6 +170,14 @@ static size_t ebrd_table_size(const struct ebrd_profile *ebrd)
return sizeof(struct ebrd_profile);
}
static size_t wpfc_table_size(const struct wpfc_profile *wpfc)
{
if (wpfc == NULL)
return 0;
return sizeof(struct wpfc_profile);
}
static bool valid_legacy_length(size_t bin_len)
{
if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE)
@ -230,6 +238,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t
expected_sar_bin_size += bucs_table_size(sar_limits->bucs);
expected_sar_bin_size += bdmm_table_size(sar_limits->bdmm);
expected_sar_bin_size += ebrd_table_size(sar_limits->ebrd);
expected_sar_bin_size += wpfc_table_size(sar_limits->wpfc);
if (sar_bin_size != expected_sar_bin_size) {
printk(BIOS_ERR, "Invalid SAR size, expected: %zu, obtained: %zu\n",