diff options
-rw-r--r-- | src/drivers/wifi/generic/acpi.c | 36 | ||||
-rw-r--r-- | src/include/sar.h | 9 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/sar.c | 9 |
3 files changed, 53 insertions, 1 deletions
diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c index 8bfce816fb..a3fd3ca4c0 100644 --- a/src/drivers/wifi/generic/acpi.c +++ b/src/drivers/wifi/generic/acpi.c @@ -771,6 +771,41 @@ static void sar_emit_bdcm(const struct bdcm_profile *bdcm) acpigen_write_package_end(); } +static void sar_emit_bbsm(const struct bbsm_profile *bbsm) +{ + if (bbsm == NULL) + return; + + /* + * Name ("BBSM", Package () { + * Revision, + * Package () { + * Domain Type, // 0x12:Bluetooth + * Bluetooth Bands Selection + * } + * }) + */ + if (bbsm->revision != BBSM_REVISION) { + printk(BIOS_ERR, "Unsupported BBSM table revision: %d\n", + bbsm->revision); + return; + } + + acpigen_write_name("BBSM"); + acpigen_write_package(2); + acpigen_write_dword(bbsm->revision); + + /* + * Emit 'Domain Type' + 'Bluetooth Bands Selection' + */ + acpigen_write_package(2); + acpigen_write_dword(DOMAIN_TYPE_BLUETOOTH); + acpigen_write_dword(bbsm->bands_selection); + + 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) { @@ -906,6 +941,7 @@ static void wifi_ssdt_write_properties(const struct device *dev, const char *sco sar_emit_bpag(sar_limits.bpag); sar_emit_bbfb(sar_limits.bbfb); sar_emit_bdcm(sar_limits.bdcm); + sar_emit_bbsm(sar_limits.bbsm); acpigen_write_scope_end(); } else { printk(BIOS_ERR, "Failed to get %s Bluetooth companion ACPI path\n", diff --git a/src/include/sar.h b/src/include/sar.h index d09ee0dd03..71daa238b4 100644 --- a/src/include/sar.h +++ b/src/include/sar.h @@ -9,13 +9,14 @@ #define MAX_DENYLIST_ENTRY 16 #define MAX_DSAR_SET_COUNT 3 #define MAX_GEO_OFFSET_REVISION 3 -#define MAX_PROFILE_COUNT 10 +#define MAX_PROFILE_COUNT 11 #define MAX_SAR_REVISION 2 #define BSAR_REVISION 1 #define WBEM_REVISION 0 #define BPAG_REVISION 2 #define BBFB_REVISION 1 #define BDCM_REVISION 1 +#define BBSM_REVISION 1 #define REVISION_SIZE 1 #define SAR_REV0_CHAINS_COUNT 2 #define SAR_REV0_SUBBANDS_COUNT 5 @@ -99,6 +100,11 @@ struct bdcm_profile { uint32_t dual_chain_mode; } __packed; +struct bbsm_profile { + uint8_t revision; + uint32_t bands_selection; +} __packed; + struct sar_header { char marker[SAR_STR_PREFIX_SIZE]; uint8_t version; @@ -118,6 +124,7 @@ union wifi_sar_limits { struct bpag_profile *bpag; struct bbfb_profile *bbfb; struct bdcm_profile *bdcm; + struct bbsm_profile *bbsm; }; void *profile[MAX_PROFILE_COUNT]; }; diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c index bf2900b019..f6f11181d6 100644 --- a/src/vendorcode/google/chromeos/sar.c +++ b/src/vendorcode/google/chromeos/sar.c @@ -134,6 +134,14 @@ static size_t bdcm_table_size(const struct bdcm_profile *bdcm) return sizeof(struct bdcm_profile); } +static size_t bbsm_table_size(const struct bbsm_profile *bbsm) +{ + if (bbsm == NULL) + return 0; + + return sizeof(struct bbsm_profile); +} + static bool valid_legacy_length(size_t bin_len) { if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE) @@ -190,6 +198,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t expected_sar_bin_size += bpag_table_size(sar_limits->bpag); expected_sar_bin_size += bbfb_table_size(sar_limits->bbfb); expected_sar_bin_size += bdcm_table_size(sar_limits->bdcm); + expected_sar_bin_size += bbsm_table_size(sar_limits->bbsm); if (sar_bin_size != expected_sar_bin_size) { printk(BIOS_ERR, "Invalid SAR size, expected: %zu, obtained: %zu\n", |