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>
This commit is contained in:
Jeremy Compostella 2024-10-30 11:26:27 -07:00 committed by Jérémy Compostella
commit c8ab1db0c6
3 changed files with 108 additions and 15 deletions

View file

@ -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",