Commit c5b42c67 authored by Luca Coelho's avatar Luca Coelho

iwlwifi: acpi: fill in WGDS table with defaults

The tables we store are the larger of all the revisions, so we need to
fill in the values that we don't get from ACPI when using older
revisions.
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210819183728.01b12461a30b.I08d1f9154f26eca25c44616efdb5223bcc1935f3@changeidSigned-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent a6a39ab2
...@@ -745,20 +745,18 @@ int iwl_sar_get_wgds_table(struct iwl_fw_runtime *fwrt) ...@@ -745,20 +745,18 @@ int iwl_sar_get_wgds_table(struct iwl_fw_runtime *fwrt)
read_table: read_table:
fwrt->geo_rev = tbl_rev; fwrt->geo_rev = tbl_rev;
for (i = 0; i < ACPI_NUM_GEO_PROFILES; i++) { for (i = 0; i < ACPI_NUM_GEO_PROFILES; i++) {
for (j = 0; j < num_bands; j++) { for (j = 0; j < ACPI_GEO_NUM_BANDS_REV2; j++) {
union acpi_object *entry; union acpi_object *entry;
entry = &wifi_pkg->package.elements[idx++]; /*
if (entry->type != ACPI_TYPE_INTEGER || * num_bands is either 2 or 3, if it's only 2 then
entry->integer.value > U8_MAX) { * fill the third band (6 GHz) with the values from
ret = -EINVAL; * 5 GHz (second band)
goto out_free; */
} if (j >= num_bands) {
fwrt->geo_profiles[i].bands[j].max =
fwrt->geo_profiles[i].bands[j].max = fwrt->geo_profiles[i].bands[1].max;
entry->integer.value; } else {
for (k = 0; k < ACPI_GEO_NUM_CHAINS; k++) {
entry = &wifi_pkg->package.elements[idx++]; entry = &wifi_pkg->package.elements[idx++];
if (entry->type != ACPI_TYPE_INTEGER || if (entry->type != ACPI_TYPE_INTEGER ||
entry->integer.value > U8_MAX) { entry->integer.value > U8_MAX) {
...@@ -766,9 +764,27 @@ int iwl_sar_get_wgds_table(struct iwl_fw_runtime *fwrt) ...@@ -766,9 +764,27 @@ int iwl_sar_get_wgds_table(struct iwl_fw_runtime *fwrt)
goto out_free; goto out_free;
} }
fwrt->geo_profiles[i].bands[j].chains[k] = fwrt->geo_profiles[i].bands[j].max =
entry->integer.value; entry->integer.value;
} }
for (k = 0; k < ACPI_GEO_NUM_CHAINS; k++) {
/* same here as above */
if (j >= num_bands) {
fwrt->geo_profiles[i].bands[j].chains[k] =
fwrt->geo_profiles[i].bands[1].chains[k];
} else {
entry = &wifi_pkg->package.elements[idx++];
if (entry->type != ACPI_TYPE_INTEGER ||
entry->integer.value > U8_MAX) {
ret = -EINVAL;
goto out_free;
}
fwrt->geo_profiles[i].bands[j].chains[k] =
entry->integer.value;
}
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment