summaryrefslogtreecommitdiff
path: root/src/vendorcode/google
diff options
context:
space:
mode:
authorJeremy Compostella <jeremy.compostella@intel.com>2024-10-30 11:26:27 -0700
committerJérémy Compostella <jeremy.compostella@intel.com>2024-11-27 21:28:28 +0000
commitc8ab1db0c65f4ffbdebd384abba455af005bd0a5 (patch)
tree3596a893fb98ec8ebd55fbfa22ea1e34e7578f19 /src/vendorcode/google
parent386b5a9ddfab9c0a2855c4a9f90e9d5ecd0483b0 (diff)
drivers/wifi: Support Extended Bluetooth Regulatory Descriptor
Extended Bluetooth Regulatory Descriptor (EBRD) SAR/RFE are safety regulations for limiting antenna radiation near human contact. EBRD provides option to provide up to three sets of TX power limits and power restrictions. As the EBRD table is related to the revision 2 of the BRDS, this commit also adds support for this new revision. The implementation follows document 559910 Intel Connectivity Platforms BIOS Guideline revision 9.2 specification. BUG=b:346600091 TEST=EBRD method is added to the bluetooth companion device and return the data supplied by the SAR binary blob Change-Id: Iebe95815c944d045f4cf686abcd1874a8a45e250 Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84947 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Kapil Porwal <kapilporwal@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/vendorcode/google')
-rw-r--r--src/vendorcode/google/chromeos/sar.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index dd43c977df..6ebf931d7d 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -96,10 +96,14 @@ static size_t dsm_table_size(const struct dsm_profile *dsm)
static size_t bsar_table_size(const struct bsar_profile *bsar)
{
+ int revs_offset = offsetof(struct bsar_profile, revs);
+
if (bsar == NULL)
return 0;
- return sizeof(struct bsar_profile);
+ if (bsar->revision == 2)
+ return revs_offset + sizeof(bsar->revs.rev2);
+ return revs_offset + sizeof(bsar->revs.rev1);
}
static size_t wbem_table_size(const struct wbem_profile *wbem)
@@ -158,6 +162,14 @@ static size_t bdmm_table_size(const struct bdmm_profile *bdmm)
return sizeof(struct bdmm_profile);
}
+static size_t ebrd_table_size(const struct ebrd_profile *ebrd)
+{
+ if (ebrd == NULL)
+ return 0;
+
+ return sizeof(struct ebrd_profile);
+}
+
static bool valid_legacy_length(size_t bin_len)
{
if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE)
@@ -217,6 +229,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t
expected_sar_bin_size += bbsm_table_size(sar_limits->bbsm);
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);
if (sar_bin_size != expected_sar_bin_size) {
printk(BIOS_ERR, "Invalid SAR size, expected: %zu, obtained: %zu\n",