linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 07/12] iwlwifi: skip first element in the WTAS ACPI table
Date: Thu,  5 Aug 2021 14:21:53 +0300	[thread overview]
Message-ID: <iwlwifi.20210805141826.ff8148197b15.I70636c04e37b2b57a5df3ce611511f62203d27a7@changeid> (raw)
In-Reply-To: <20210805112158.460799-1-luca@coelho.fi>

From: Abhishek Naik <abhishek.naik@intel.com>

By mistake we were considering the first element of the WTAS wifi
package as part of the data we want to rid, but that element is the wifi
package signature (always 0x07), so it should be skipped.

Change the code to read the data starting from element 1 instead.

Signed-off-by: Abhishek Naik <abhishek.naik@intel.com>
Fixes: 28dd7ccdc56f ("iwlwifi: acpi: read TAS table from ACPI and send it to the FW")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index 3d2962260665..78f0f2032c59 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -264,7 +264,7 @@ int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt,
 		goto out_free;
 	}
 
-	enabled = !!wifi_pkg->package.elements[0].integer.value;
+	enabled = !!wifi_pkg->package.elements[1].integer.value;
 
 	if (!enabled) {
 		*block_list_size = -1;
@@ -273,15 +273,15 @@ int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt,
 		goto out_free;
 	}
 
-	if (wifi_pkg->package.elements[1].type != ACPI_TYPE_INTEGER ||
-	    wifi_pkg->package.elements[1].integer.value >
+	if (wifi_pkg->package.elements[2].type != ACPI_TYPE_INTEGER ||
+	    wifi_pkg->package.elements[2].integer.value >
 	    APCI_WTAS_BLACK_LIST_MAX) {
 		IWL_DEBUG_RADIO(fwrt, "TAS invalid array size %llu\n",
 				wifi_pkg->package.elements[1].integer.value);
 		ret = -EINVAL;
 		goto out_free;
 	}
-	*block_list_size = wifi_pkg->package.elements[1].integer.value;
+	*block_list_size = wifi_pkg->package.elements[2].integer.value;
 
 	IWL_DEBUG_RADIO(fwrt, "TAS array size %d\n", *block_list_size);
 	if (*block_list_size > APCI_WTAS_BLACK_LIST_MAX) {
@@ -294,15 +294,15 @@ int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt,
 	for (i = 0; i < *block_list_size; i++) {
 		u32 country;
 
-		if (wifi_pkg->package.elements[2 + i].type !=
+		if (wifi_pkg->package.elements[3 + i].type !=
 		    ACPI_TYPE_INTEGER) {
 			IWL_DEBUG_RADIO(fwrt,
-					"TAS invalid array elem %d\n", 2 + i);
+					"TAS invalid array elem %d\n", 3 + i);
 			ret = -EINVAL;
 			goto out_free;
 		}
 
-		country = wifi_pkg->package.elements[2 + i].integer.value;
+		country = wifi_pkg->package.elements[3 + i].integer.value;
 		block_list_array[i] = cpu_to_le32(country);
 		IWL_DEBUG_RADIO(fwrt, "TAS block list country %d\n", country);
 	}
-- 
2.32.0


  parent reply	other threads:[~2021-08-05 11:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 11:21 [PATCH 00/12] iwlwifi: updates intended for v5.15 2021-08-05 part 2 Luca Coelho
2021-08-05 11:21 ` [PATCH 01/12] iwlwifi: pass number of chains and sub-bands to iwl_sar_set_profile() Luca Coelho
2021-08-26 20:36   ` Luca Coelho
2021-08-05 11:21 ` [PATCH 02/12] iwlwifi: acpi: support reading and storing WRDS revision 1 and 2 Luca Coelho
2021-08-05 11:21 ` [PATCH 03/12] iwlwifi: support reading and storing EWRD revisions " Luca Coelho
2021-08-05 11:21 ` [PATCH 04/12] iwlwifi: remove unused ACPI_WGDS_TABLE_SIZE definition Luca Coelho
2021-08-05 11:21 ` [PATCH 05/12] iwlwifi: convert flat GEO profile table to a struct version Luca Coelho
2021-08-05 11:21 ` [PATCH 06/12] iwlwifi: mvm: support version 11 of wowlan statuses notification Luca Coelho
2021-08-05 11:21 ` Luca Coelho [this message]
2021-08-05 11:21 ` [PATCH 08/12] iwlwifi: fw: correctly limit to monitor dump Luca Coelho
2021-08-05 11:21 ` [PATCH 09/12] iwlwifi: mvm: trigger WRT when no beacon heard Luca Coelho
2021-08-05 11:21 ` [PATCH 10/12] iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage Luca Coelho
2021-08-05 11:21 ` [PATCH 11/12] iwlwifi: mvm: load regdomain " Luca Coelho
2021-08-05 11:21 ` [PATCH 12/12] iwlwifi: acpi: support reading and storing WGDS revision 2 Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iwlwifi.20210805141826.ff8148197b15.I70636c04e37b2b57a5df3ce611511f62203d27a7@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).