summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drivers/wifi/generic/acpi.c38
-rw-r--r--src/include/sar.h9
-rw-r--r--src/vendorcode/google/chromeos/sar.c12
3 files changed, 58 insertions, 1 deletions
diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c
index e303589660..13120d4acf 100644
--- a/src/drivers/wifi/generic/acpi.c
+++ b/src/drivers/wifi/generic/acpi.c
@@ -539,6 +539,43 @@ static void sar_emit_brds(const struct bsar_profile *bsar)
acpigen_write_package_end();
}
+static void sar_emit_wbem(const struct wbem_profile *wbem)
+{
+ if (wbem == NULL)
+ return;
+
+ /*
+ * Name ("WBEM", Package() {
+ * {
+ * Revision,
+ * Package()
+ * {
+ * DomainType, // 0x7:WiFi
+ * bandwidth_320mhz_country_enablement // 0 Disabled
+ * // 1 Japan Enabled
+ * // 2 South Korea Enabled
+ * // 3 Japan + South Korea Enabled
+ * }
+ } })
+ */
+ if (wbem->revision != WBEM_REVISION) {
+ printk(BIOS_ERR, "Unsupported WBEM table revision: %d\n",
+ wbem->revision);
+ return;
+ }
+
+ acpigen_write_name("WBEM");
+ acpigen_write_package(2);
+ acpigen_write_dword(wbem->revision);
+
+ acpigen_write_package(2);
+ acpigen_write_dword(DOMAIN_TYPE_WIFI);
+ acpigen_write_dword(wbem->bandwidth_320mhz_country_enablement);
+
+ acpigen_write_package_end();
+ acpigen_write_package_end();
+}
+
static void emit_sar_acpi_structures(const struct device *dev, struct dsm_profile *dsm,
struct bsar_profile *bsar, bool *bsar_loaded)
{
@@ -562,6 +599,7 @@ static void emit_sar_acpi_structures(const struct device *dev, struct dsm_profil
sar_emit_wgds(sar_limits.wgds);
sar_emit_ppag(sar_limits.ppag);
sar_emit_wtas(sar_limits.wtas);
+ sar_emit_wbem(sar_limits.wbem);
/* copy the dsm data to be later used for creating _DSM function */
if (sar_limits.dsm != NULL)
diff --git a/src/include/sar.h b/src/include/sar.h
index 7c1b95d530..5968645154 100644
--- a/src/include/sar.h
+++ b/src/include/sar.h
@@ -9,9 +9,10 @@
#define MAX_DENYLIST_ENTRY 16
#define MAX_DSAR_SET_COUNT 3
#define MAX_GEO_OFFSET_REVISION 3
-#define MAX_PROFILE_COUNT 6
+#define MAX_PROFILE_COUNT 7
#define MAX_SAR_REVISION 2
#define BSAR_REVISION 1
+#define WBEM_REVISION 0
#define REVISION_SIZE 1
#define SAR_REV0_CHAINS_COUNT 2
#define SAR_REV0_SUBBANDS_COUNT 5
@@ -73,6 +74,11 @@ struct bsar_profile {
uint8_t le_lr_modulation;
} __packed;
+struct wbem_profile {
+ uint8_t revision;
+ uint32_t bandwidth_320mhz_country_enablement;
+} __packed;
+
struct sar_header {
char marker[SAR_STR_PREFIX_SIZE];
uint8_t version;
@@ -88,6 +94,7 @@ union wifi_sar_limits {
struct avg_profile *wtas;
struct dsm_profile *dsm;
struct bsar_profile *bsar;
+ struct wbem_profile *wbem;
};
void *profile[MAX_PROFILE_COUNT];
};
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index 8195886ebc..50c59d5ed0 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -102,6 +102,14 @@ static int bsar_table_size(const struct bsar_profile *bsar)
return sizeof(struct bsar_profile);
}
+static int wbem_table_size(const struct wbem_profile *wbem)
+{
+ if (wbem == NULL)
+ return 0;
+
+ return sizeof(struct wbem_profile);
+}
+
static bool valid_legacy_length(size_t bin_len)
{
if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE)
@@ -154,6 +162,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t
expected_sar_bin_size += sar_avg_table_size(sar_limits->wtas);
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);
if (sar_bin_size != expected_sar_bin_size) {
printk(BIOS_ERR, "Invalid SAR size, expected: %zu, obtained: %zu\n",
@@ -220,6 +229,7 @@ static int fill_wifi_sar_limits_legacy(union wifi_sar_limits *sar_limits,
* [WTAS_REVISION, WTAS_DATA]
* [DSM_RETURN_VALUES]
* [BSAR_REVISION,IPML,LB,BR,EDR2,EDR3,LE,LE2,LE_LR]
+ * [WBEM_REVISION, WBEM_DATA]
*
* The configuration data will always have the revision added in the file for each of the
* block, based on the revision number and validity, size of the specific block will be
@@ -259,6 +269,8 @@ static int fill_wifi_sar_limits_legacy(union wifi_sar_limits *sar_limits,
* [Enable/disable the TAS feature]
* [Number of blocked countries that are not approved by the OEM to support this feature]
* [deny_list_entry_<1-16>: ISO country code to block]
+ * [WBEM_DATA] =
+ * [Enable or disable 320MHZ Bandwidth for Japan, SouthKorea]
*/
int get_wifi_sar_limits(union wifi_sar_limits *sar_limits)
{