2021-08-05 11:22:28

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 01/12] iwlwifi: pass number of chains and sub-bands to iwl_sar_set_profile()

From: Luca Coelho <[email protected]>

The number of chains and sub-bands read from the ACPI tables varies
depending on the revision. Pass these numbers to the
iwl_sar_set_profile() function in order to make using different
revisions easier.

Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index f20f0150f407..9175f53806bf 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -412,7 +412,7 @@ IWL_EXPORT_SYMBOL(iwl_acpi_get_eckv);

static int iwl_sar_set_profile(union acpi_object *table,
struct iwl_sar_profile *profile,
- bool enabled)
+ bool enabled, u8 num_chains, u8 num_sub_bands)
{
int i, j, idx = 0;

@@ -422,8 +422,8 @@ static int iwl_sar_set_profile(union acpi_object *table,
* The table from ACPI is flat, but we store it in a
* structured array.
*/
- for (i = 0; i < ACPI_SAR_NUM_CHAINS; i++) {
- for (j = 0; j < ACPI_SAR_NUM_SUB_BANDS; j++) {
+ for (i = 0; i < num_chains; i++) {
+ for (j = 0; j < num_sub_bands; j++) {
if (table[idx].type != ACPI_TYPE_INTEGER ||
table[idx].integer.value > U8_MAX)
return -EINVAL;
@@ -539,7 +539,8 @@ int iwl_sar_get_wrds_table(struct iwl_fw_runtime *fwrt)
/* The profile from WRDS is officially profile 1, but goes
* into sar_profiles[0] (because we don't have a profile 0).
*/
- ret = iwl_sar_set_profile(table, &fwrt->sar_profiles[0], enabled);
+ ret = iwl_sar_set_profile(table, &fwrt->sar_profiles[0], enabled,
+ ACPI_SAR_NUM_CHAINS, ACPI_SAR_NUM_SUB_BANDS);
out_free:
kfree(data);
return ret;
@@ -598,7 +599,9 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
*/
ret = iwl_sar_set_profile(&wifi_pkg->package.elements[pos],
&fwrt->sar_profiles[i + 1],
- enabled);
+ enabled,
+ ACPI_SAR_NUM_CHAINS,
+ ACPI_SAR_NUM_SUB_BANDS);
if (ret < 0)
break;

--
2.32.0


2021-08-26 20:38:04

by Luca Coelho

[permalink] [raw]
Subject: Re: [PATCH 01/12] iwlwifi: pass number of chains and sub-bands to iwl_sar_set_profile()

Luca Coelho <[email protected]> wrote:

> From: Luca Coelho <[email protected]>
>
> The number of chains and sub-bands read from the ACPI tables varies
> depending on the revision. Pass these numbers to the
> iwl_sar_set_profile() function in order to make using different
> revisions easier.
>
> Signed-off-by: Luca Coelho <[email protected]>

12 patches applied to iwlwifi-next.git, thanks.

8ecf0477b990 iwlwifi: pass number of chains and sub-bands to iwl_sar_set_profile()
2a8084147bff iwlwifi: acpi: support reading and storing WRDS revision 1 and 2
51266c11cecc iwlwifi: support reading and storing EWRD revisions 1 and 2
de95c9288ae1 iwlwifi: remove unused ACPI_WGDS_TABLE_SIZE definition
5bf7a9edddbb iwlwifi: convert flat GEO profile table to a struct version
058b94dc9bf8 iwlwifi: mvm: support version 11 of wowlan statuses notification
19426d54302e iwlwifi: skip first element in the WTAS ACPI table
e6344c060209 iwlwifi: fw: correctly limit to monitor dump
b537ffb6ea16 iwlwifi: mvm: trigger WRT when no beacon heard
78a19d5285d9 iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage
eb09ae93dabf iwlwifi: mvm: load regdomain at INIT stage
664c011b763e iwlwifi: acpi: support reading and storing WGDS revision 2