]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iwlwifi: skip first element in the WTAS ACPI table
authorAbhishek Naik <abhishek.naik@intel.com>
Thu, 5 Aug 2021 11:21:53 +0000 (14:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:50:45 +0000 (09:50 +0200)
[ Upstream commit 19426d54302e199b3fd2d575f926a13af66be2b9 ]

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>
Link: https://lore.kernel.org/r/iwlwifi.20210805141826.ff8148197b15.I70636c04e37b2b57a5df3ce611511f62203d27a7@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/fw/acpi.c

index 8c78c6180d055c726977b317ce876e3b7f81eeb9..5e4faf9ce4bbef9a22b3c10881a82d935835dc9f 100644 (file)
@@ -254,7 +254,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;
@@ -263,15 +263,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) {
@@ -284,15 +284,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);
        }