From 354cba21a41aa868b7b41804c2859f920d2e1b17 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Mon, 28 Oct 2024 14:03:29 -0700 Subject: drivers/wifi: Support Bluetooth Per-Platform Antenna Gain The ACPI BPAG method provide information to controls the antenna gain method to be used per country. The antenna gain mode is a bit field (0 - disabled, 1 -enabled) defined as follow: - Bit 0 - Antenna gain in EU - Bit 1 - Antenna gain in China Mainland The implementation follows document 559910 Intel Connectivity Platforms BIOS Guideline revision 9.2 specification. BUG=b:346600091 TEST=BPAG method is added to the bluetooth companion device and return the data supplied by the SAR binary blob Change-Id: Iebe95815c944d045f4cf686abcd1874a8a45e210 Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/84941 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Kapil Porwal --- src/vendorcode/google/chromeos/sar.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/vendorcode/google/chromeos') diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c index e8d4410f4b..dcf647398e 100644 --- a/src/vendorcode/google/chromeos/sar.c +++ b/src/vendorcode/google/chromeos/sar.c @@ -110,6 +110,14 @@ static size_t wbem_table_size(const struct wbem_profile *wbem) return sizeof(struct wbem_profile); } +static size_t bpag_table_size(const struct bpag_profile *bpag) +{ + if (bpag == NULL) + return 0; + + return sizeof(struct bpag_profile); +} + static bool valid_legacy_length(size_t bin_len) { if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE) @@ -163,6 +171,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t expected_sar_bin_size += dsm_table_size(sar_limits->dsm); expected_sar_bin_size += bsar_table_size(sar_limits->bsar); expected_sar_bin_size += wbem_table_size(sar_limits->wbem); + expected_sar_bin_size += bpag_table_size(sar_limits->bpag); if (sar_bin_size != expected_sar_bin_size) { printk(BIOS_ERR, "Invalid SAR size, expected: %zu, obtained: %zu\n", -- cgit v1.2.3