Merge ~vicamo/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:for-focal/new-upstream-release-8324 into ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:ubuntu/focal

Proposed by You-Sheng Yang
Status: Merged
Merged at revision: 18408d250b9b8e275ad6001bf2e7eec044fd0955
Proposed branch: ~vicamo/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:for-focal/new-upstream-release-8324
Merge into: ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:ubuntu/focal
Diff against target: 2173 lines (+668/-269)
43 files modified
debian/backport-iwlwifi-dkms.modaliases (+6/-0)
debian/changelog (+15/-0)
drivers/net/wireless/intel/iwlwifi/cfg/22000.c (+60/-11)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c (+81/-5)
drivers/net/wireless/intel/iwlwifi/fw/acpi.h (+18/-0)
drivers/net/wireless/intel/iwlwifi/fw/api/config.h (+36/-3)
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h (+15/-0)
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h (+6/-8)
drivers/net/wireless/intel/iwlwifi/fw/api/soc.h (+8/-4)
drivers/net/wireless/intel/iwlwifi/fw/api/sta.h (+0/-26)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c (+31/-21)
drivers/net/wireless/intel/iwlwifi/fw/file.h (+1/-0)
drivers/net/wireless/intel/iwlwifi/iwl-config.h (+17/-6)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h (+4/-2)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c (+18/-8)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c (+0/-7)
drivers/net/wireless/intel/iwlwifi/iwl-modparams.h (+0/-4)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c (+7/-6)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h (+2/-1)
drivers/net/wireless/intel/iwlwifi/mvm/constants.h (+8/-0)
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c (+4/-1)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c (+106/-7)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c (+3/-5)
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h (+0/-3)
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c (+2/-8)
drivers/net/wireless/intel/iwlwifi/mvm/ops.c (+1/-0)
drivers/net/wireless/intel/iwlwifi/mvm/scan.c (+1/-1)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c (+7/-3)
drivers/net/wireless/intel/iwlwifi/mvm/tt.c (+6/-4)
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c (+25/-22)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c (+40/-7)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c (+1/-14)
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c (+1/-1)
drivers/net/wireless/intel/iwlwifi/xvt/fw.c (+10/-5)
drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c (+10/-4)
drivers/net/wireless/intel/iwlwifi/xvt/xvt.h (+2/-2)
include/linux/ieee80211.h (+1/-2)
net/mac80211/mlme.c (+56/-31)
net/wireless/core.h (+1/-1)
net/wireless/mlme.c (+29/-4)
net/wireless/nl80211.c (+2/-1)
net/wireless/scan.c (+26/-30)
versions (+1/-1)
Reviewer Review Type Date Requested Status
You-Sheng Yang Approve
Review via email: mp+377553@code.launchpad.net
To post a comment you must log in.
Revision history for this message
You-Sheng Yang (vicamo) wrote :

Landed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/backport-iwlwifi-dkms.modaliases b/debian/backport-iwlwifi-dkms.modaliases
index 3f4e9d7..375489c 100644
--- a/debian/backport-iwlwifi-dkms.modaliases
+++ b/debian/backport-iwlwifi-dkms.modaliases
@@ -231,6 +231,9 @@ alias pci:v00008086d00002725sv*sd000000B0bc*sc*i* iwlwifi
231alias pci:v00008086d00002725sv*sd00000310bc*sc*i* iwlwifi231alias pci:v00008086d00002725sv*sd00000310bc*sc*i* iwlwifi
232alias pci:v00008086d00002725sv*sd00000510bc*sc*i* iwlwifi232alias pci:v00008086d00002725sv*sd00000510bc*sc*i* iwlwifi
233alias pci:v00008086d00002725sv*sd00000A10bc*sc*i* iwlwifi233alias pci:v00008086d00002725sv*sd00000A10bc*sc*i* iwlwifi
234alias pci:v00008086d00002726sv*sd00000090bc*sc*i* iwlwifi
235alias pci:v00008086d00002726sv*sd000000B0bc*sc*i* iwlwifi
236alias pci:v00008086d00002726sv*sd00000510bc*sc*i* iwlwifi
234alias pci:v00008086d000030DCsv*sd*bc*sc*i* iwlwifi237alias pci:v00008086d000030DCsv*sd*bc*sc*i* iwlwifi
235alias pci:v00008086d00003165sv*sd00004010bc*sc*i* iwlwifi238alias pci:v00008086d00003165sv*sd00004010bc*sc*i* iwlwifi
236alias pci:v00008086d00003165sv*sd00004012bc*sc*i* iwlwifi239alias pci:v00008086d00003165sv*sd00004012bc*sc*i* iwlwifi
@@ -246,11 +249,14 @@ alias pci:v00008086d000031DCsv*sd*bc*sc*i* iwlwifi
246alias pci:v00008086d000034F0sv*sd*bc*sc*i* iwlwifi249alias pci:v00008086d000034F0sv*sd*bc*sc*i* iwlwifi
247alias pci:v00008086d00003DF0sv*sd*bc*sc*i* iwlwifi250alias pci:v00008086d00003DF0sv*sd*bc*sc*i* iwlwifi
248alias pci:v00008086d000043F0sv*sd*bc*sc*i* iwlwifi251alias pci:v00008086d000043F0sv*sd*bc*sc*i* iwlwifi
252alias pci:v00008086d00004DF0sv*sd*bc*sc*i* iwlwifi
249alias pci:v00008086d00007A70sv*sd00000090bc*sc*i* iwlwifi253alias pci:v00008086d00007A70sv*sd00000090bc*sc*i* iwlwifi
254alias pci:v00008086d00007A70sv*sd000000B0bc*sc*i* iwlwifi
250alias pci:v00008086d00007A70sv*sd00000310bc*sc*i* iwlwifi255alias pci:v00008086d00007A70sv*sd00000310bc*sc*i* iwlwifi
251alias pci:v00008086d00007A70sv*sd00000510bc*sc*i* iwlwifi256alias pci:v00008086d00007A70sv*sd00000510bc*sc*i* iwlwifi
252alias pci:v00008086d00007A70sv*sd00000A10bc*sc*i* iwlwifi257alias pci:v00008086d00007A70sv*sd00000A10bc*sc*i* iwlwifi
253alias pci:v00008086d00007AF0sv*sd00000090bc*sc*i* iwlwifi258alias pci:v00008086d00007AF0sv*sd00000090bc*sc*i* iwlwifi
259alias pci:v00008086d00007AF0sv*sd000000B0bc*sc*i* iwlwifi
254alias pci:v00008086d00007AF0sv*sd00000310bc*sc*i* iwlwifi260alias pci:v00008086d00007AF0sv*sd00000310bc*sc*i* iwlwifi
255alias pci:v00008086d00007AF0sv*sd00000510bc*sc*i* iwlwifi261alias pci:v00008086d00007AF0sv*sd00000510bc*sc*i* iwlwifi
256alias pci:v00008086d00007AF0sv*sd00000A10bc*sc*i* iwlwifi262alias pci:v00008086d00007AF0sv*sd00000A10bc*sc*i* iwlwifi
diff --git a/debian/changelog b/debian/changelog
index e6f67b1..ab4bcc3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
1backport-iwlwifi-dkms (8324-0ubuntu1) focal; urgency=low
2
3 * New release
4 - upstream version 8324 commit 5aa9fb548df6af.
5 - update debian/backport-iwlwifi-dkms.modaliases.
6
7 -- You-Sheng Yang <vicamo@gmail.com> Mon, 13 Jan 2020 11:28:16 +0800
8
9backport-iwlwifi-dkms (8292-0ubuntu1) focal; urgency=low
10
11 * New release
12 - upstream version 8292 commit cb9dfa2c338816.
13
14 -- You-Sheng Yang <vicamo@gmail.com> Thu, 09 Jan 2020 03:15:48 +0000
15
1backport-iwlwifi-dkms (8286-0ubuntu1) focal; urgency=low16backport-iwlwifi-dkms (8286-0ubuntu1) focal; urgency=low
217
3 * New release18 * New release
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
index 3790c0e..944d88a 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
@@ -6,7 +6,7 @@
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright(c) 2015-2017 Intel Deutschland GmbH8 * Copyright(c) 2015-2017 Intel Deutschland GmbH
9 * Copyright (C) 2018-2019 Intel Corporation9 * Copyright (C) 2018-2020 Intel Corporation
10 *10 *
11 * This program is free software; you can redistribute it and/or modify11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as12 * it under the terms of version 2 of the GNU General Public License as
@@ -20,7 +20,7 @@
20 * BSD LICENSE20 * BSD LICENSE
21 *21 *
22 * Copyright(c) 2015-2017 Intel Deutschland GmbH22 * Copyright(c) 2015-2017 Intel Deutschland GmbH
23 * Copyright (C) 2018-2019 Intel Corporation23 * Copyright (C) 2018-2020 Intel Corporation
24 * All rights reserved.24 * All rights reserved.
25 *25 *
26 * Redistribution and use in source and binary forms, with or without26 * Redistribution and use in source and binary forms, with or without
@@ -57,7 +57,7 @@
57#include "iwl-prph.h"57#include "iwl-prph.h"
5858
59/* Highest firmware API version supported */59/* Highest firmware API version supported */
60#define IWL_22000_UCODE_API_MAX 5460#define IWL_22000_UCODE_API_MAX 55
6161
62/* Lowest firmware API version supported */62/* Lowest firmware API version supported */
63#define IWL_22000_UCODE_API_MIN 3963#define IWL_22000_UCODE_API_MIN 39
@@ -91,7 +91,8 @@
91#define IWL_22000_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0-"91#define IWL_22000_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0-"
92#define IWL_22000_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0-"92#define IWL_22000_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0-"
93#define IWL_22000_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0-"93#define IWL_22000_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0-"
94#define IWL_22000_SOSNJ_A_GF4_A_FW_PRE "iwlwifi-SoSnj-a0-gf4-a0-"94#define IWL_SNJ_A_GF4_A_FW_PRE "iwlwifi-SoSnj-a0-gf4-a0-"
95#define IWL_SNJ_A_GF_A_FW_PRE "iwlwifi-SoSnj-a0-gf-a0-"
9596
96#define IWL_22000_HR_MODULE_FIRMWARE(api) \97#define IWL_22000_HR_MODULE_FIRMWARE(api) \
97 IWL_22000_HR_FW_PRE __stringify(api) ".ucode"98 IWL_22000_HR_FW_PRE __stringify(api) ".ucode"
@@ -121,6 +122,10 @@
121 IWL_22000_SO_A_GF_A_FW_PRE __stringify(api) ".ucode"122 IWL_22000_SO_A_GF_A_FW_PRE __stringify(api) ".ucode"
122#define IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(api) \123#define IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(api) \
123 IWL_22000_TY_A_GF_A_FW_PRE __stringify(api) ".ucode"124 IWL_22000_TY_A_GF_A_FW_PRE __stringify(api) ".ucode"
125#define IWL_SNJ_A_GF4_A_MODULE_FIRMWARE(api) \
126 IWL_SNJ_A_GF4_A_FW_PRE __stringify(api) ".ucode"
127#define IWL_SNJ_A_GF_A_MODULE_FIRMWARE(api) \
128 IWL_SNJ_A_GF_A_FW_PRE __stringify(api) ".ucode"
124129
125static const struct iwl_base_params iwl_22000_base_params = {130static const struct iwl_base_params iwl_22000_base_params = {
126 .eeprom_size = OTP_LOW_IMAGE_SIZE_32K,131 .eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
@@ -230,6 +235,15 @@ static const struct iwl_ht_params iwl_22000_ht_params = {
230 }, \235 }, \
231 }236 }
232237
238const struct iwl_cfg_trans_params iwl_qnj_trans_cfg = {
239 .mq_rx_supported = true,
240 .use_tfh = true,
241 .rf_id = true,
242 .gen2 = true,
243 .device_family = IWL_DEVICE_FAMILY_22000,
244 .base_params = &iwl_22000_base_params,
245};
246
233const struct iwl_cfg_trans_params iwl_qu_trans_cfg = {247const struct iwl_cfg_trans_params iwl_qu_trans_cfg = {
234 .mq_rx_supported = true,248 .mq_rx_supported = true,
235 .use_tfh = true,249 .use_tfh = true,
@@ -239,15 +253,19 @@ const struct iwl_cfg_trans_params iwl_qu_trans_cfg = {
239 .base_params = &iwl_22000_base_params,253 .base_params = &iwl_22000_base_params,
240 .integrated = true,254 .integrated = true,
241 .xtal_latency = 5000,255 .xtal_latency = 5000,
256 .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_200US,
242};257};
243258
244const struct iwl_cfg_trans_params iwl_qnj_trans_cfg = {259const struct iwl_cfg_trans_params iwl_qu_medium_latency_trans_cfg = {
245 .mq_rx_supported = true,260 .mq_rx_supported = true,
246 .use_tfh = true,261 .use_tfh = true,
247 .rf_id = true,262 .rf_id = true,
248 .gen2 = true,263 .gen2 = true,
249 .device_family = IWL_DEVICE_FAMILY_22000,264 .device_family = IWL_DEVICE_FAMILY_22000,
250 .base_params = &iwl_22000_base_params,265 .base_params = &iwl_22000_base_params,
266 .integrated = true,
267 .xtal_latency = 1820,
268 .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_1820US,
251};269};
252270
253const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg = {271const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg = {
@@ -260,6 +278,7 @@ const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg = {
260 .integrated = true,278 .integrated = true,
261 .xtal_latency = 12000,279 .xtal_latency = 12000,
262 .low_latency_xtal = true,280 .low_latency_xtal = true,
281 .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US,
263};282};
264283
265/*284/*
@@ -521,22 +540,32 @@ const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0 = {
521};540};
522541
523const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0 = {542const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0 = {
524 .name = "Intel(R) Wi-Fi 7 AX210 160MHz",543 .name = "Intel(R) Wi-Fi 6 AX210 160MHz",
525 .fw_name_pre = IWL_22000_SO_A_HR_B_FW_PRE,544 .fw_name_pre = IWL_22000_SO_A_HR_B_FW_PRE,
526 IWL_DEVICE_AX210,545 IWL_DEVICE_AX210,
527 .num_rbds = IWL_NUM_RBDS_AX210_HE,546 .num_rbds = IWL_NUM_RBDS_AX210_HE,
528};547};
529548
530const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0 = {549const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0 = {
531 .name = "Intel(R) Wi-Fi 7 AX211 160MHz",550 .name = "Intel(R) Wi-Fi 6 AX211 160MHz",
551 .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE,
552 .uhb_supported = true,
553 IWL_DEVICE_AX210,
554 .num_rbds = IWL_NUM_RBDS_AX210_HE,
555};
556
557const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0_long = {
558 .name = "Intel(R) Wi-Fi 6 AX211 160MHz",
532 .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE,559 .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE,
533 .uhb_supported = true,560 .uhb_supported = true,
534 IWL_DEVICE_AX210,561 IWL_DEVICE_AX210,
535 .num_rbds = IWL_NUM_RBDS_AX210_HE,562 .num_rbds = IWL_NUM_RBDS_AX210_HE,
563 .trans.xtal_latency = 12000,
564 .trans.low_latency_xtal = true,
536};565};
537566
538const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = {567const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = {
539 .name = "Intel(R) Wi-Fi 7 AX210 160MHz",568 .name = "Intel(R) Wi-Fi 6 AX210 160MHz",
540 .fw_name_pre = IWL_22000_TY_A_GF_A_FW_PRE,569 .fw_name_pre = IWL_22000_TY_A_GF_A_FW_PRE,
541 .uhb_supported = true,570 .uhb_supported = true,
542 IWL_DEVICE_AX210,571 IWL_DEVICE_AX210,
@@ -544,16 +573,34 @@ const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = {
544};573};
545574
546const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0 = {575const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0 = {
547 .name = "Intel(R) Wi-Fi 7 AX411 160MHz",576 .name = "Intel(R) Wi-Fi 6 AX411 160MHz",
577 .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE,
578 .uhb_supported = true,
579 IWL_DEVICE_AX210,
580 .num_rbds = IWL_NUM_RBDS_AX210_HE,
581};
582
583const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0_long = {
584 .name = "Intel(R) Wi-Fi 6 AX411 160MHz",
548 .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE,585 .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE,
549 .uhb_supported = true,586 .uhb_supported = true,
550 IWL_DEVICE_AX210,587 IWL_DEVICE_AX210,
551 .num_rbds = IWL_NUM_RBDS_AX210_HE,588 .num_rbds = IWL_NUM_RBDS_AX210_HE,
589 .trans.xtal_latency = 12000,
590 .trans.low_latency_xtal = true,
552};591};
553592
554const struct iwl_cfg iwlax411_2ax_cfg_sosnj_gf4_a0 = {593const struct iwl_cfg iwlax411_2ax_cfg_sosnj_gf4_a0 = {
555 .name = "Intel(R) Wi-Fi 7 AX411 160MHz",594 .name = "Intel(R) Wi-Fi 6 AX411 160MHz",
556 .fw_name_pre = IWL_22000_SOSNJ_A_GF4_A_FW_PRE,595 .fw_name_pre = IWL_SNJ_A_GF4_A_FW_PRE,
596 .uhb_supported = true,
597 IWL_DEVICE_AX210,
598 .num_rbds = IWL_NUM_RBDS_AX210_HE,
599};
600
601const struct iwl_cfg iwlax211_cfg_snj_gf_a0 = {
602 .name = "Intel(R) Wi-Fi 6 AX211 160MHz",
603 .fw_name_pre = IWL_SNJ_A_GF_A_FW_PRE,
557 .uhb_supported = true,604 .uhb_supported = true,
558 IWL_DEVICE_AX210,605 IWL_DEVICE_AX210,
559 .num_rbds = IWL_NUM_RBDS_AX210_HE,606 .num_rbds = IWL_NUM_RBDS_AX210_HE,
@@ -572,3 +619,5 @@ MODULE_FIRMWARE(IWL_22000_SO_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
572MODULE_FIRMWARE(IWL_22000_SO_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));619MODULE_FIRMWARE(IWL_22000_SO_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
573MODULE_FIRMWARE(IWL_22000_SO_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));620MODULE_FIRMWARE(IWL_22000_SO_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
574MODULE_FIRMWARE(IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));621MODULE_FIRMWARE(IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
622MODULE_FIRMWARE(IWL_SNJ_A_GF4_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
623MODULE_FIRMWARE(IWL_SNJ_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index bdc382a..fd8ae5d 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -151,6 +151,82 @@ found:
151}151}
152IWL_EXPORT_SYMBOL(iwl_acpi_get_wifi_pkg);152IWL_EXPORT_SYMBOL(iwl_acpi_get_wifi_pkg);
153153
154int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt,
155 __le32 *black_list_array,
156 int *black_list_size)
157{
158 union acpi_object *wifi_pkg, *data;
159 int ret, tbl_rev, i;
160 bool enabled;
161
162 data = iwl_acpi_get_object(fwrt->dev, ACPI_WTAS_METHOD);
163 if (IS_ERR(data))
164 return PTR_ERR(data);
165
166 wifi_pkg = iwl_acpi_get_wifi_pkg(fwrt->dev, data,
167 ACPI_WTAS_WIFI_DATA_SIZE,
168 &tbl_rev);
169 if (IS_ERR(wifi_pkg)) {
170 ret = PTR_ERR(wifi_pkg);
171 goto out_free;
172 }
173
174 if (wifi_pkg->package.elements[0].type != ACPI_TYPE_INTEGER ||
175 tbl_rev != 0) {
176 ret = -EINVAL;
177 goto out_free;
178 }
179
180 enabled = !!wifi_pkg->package.elements[0].integer.value;
181
182 if (!enabled) {
183 *black_list_size = -1;
184 IWL_DEBUG_RADIO(fwrt, "TAS not enabled\n");
185 ret = 0;
186 goto out_free;
187 }
188
189 if (wifi_pkg->package.elements[1].type != ACPI_TYPE_INTEGER ||
190 wifi_pkg->package.elements[1].integer.value >
191 APCI_WTAS_BLACK_LIST_MAX) {
192 IWL_DEBUG_RADIO(fwrt, "TAS invalid array size %llu\n",
193 wifi_pkg->package.elements[1].integer.value);
194 ret = -EINVAL;
195 goto out_free;
196 }
197 *black_list_size = wifi_pkg->package.elements[1].integer.value;
198
199 IWL_DEBUG_RADIO(fwrt, "TAS array size %d\n", *black_list_size);
200 if (*black_list_size > APCI_WTAS_BLACK_LIST_MAX) {
201 IWL_DEBUG_RADIO(fwrt, "TAS invalid array size value %u\n",
202 *black_list_size);
203 ret = -EINVAL;
204 goto out_free;
205 }
206
207 for (i = 0; i < *black_list_size; i++) {
208 u32 country;
209
210 if (wifi_pkg->package.elements[2 + i].type !=
211 ACPI_TYPE_INTEGER) {
212 IWL_DEBUG_RADIO(fwrt,
213 "TAS invalid array elem %d\n", 2 + i);
214 ret = -EINVAL;
215 goto out_free;
216 }
217
218 country = wifi_pkg->package.elements[2 + i].integer.value;
219 black_list_array[i] = cpu_to_le32(country);
220 IWL_DEBUG_RADIO(fwrt, "TAS black list country %d\n", country);
221 }
222
223 ret = 0;
224out_free:
225 kfree(data);
226 return ret;
227}
228IWL_EXPORT_SYMBOL(iwl_acpi_get_tas);
229
154int iwl_acpi_get_mcc(struct device *dev, char *mcc)230int iwl_acpi_get_mcc(struct device *dev, char *mcc)
155{231{
156 union acpi_object *wifi_pkg, *data;232 union acpi_object *wifi_pkg, *data;
@@ -361,8 +437,8 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
361{437{
362 union acpi_object *wifi_pkg, *data;438 union acpi_object *wifi_pkg, *data;
363 bool enabled;439 bool enabled;
364 int i, n_profiles, tbl_rev;440 int i, n_profiles, tbl_rev, pos;
365 int ret = 0;441 int ret = 0;
366442
367 data = iwl_acpi_get_object(fwrt->dev, ACPI_EWRD_METHOD);443 data = iwl_acpi_get_object(fwrt->dev, ACPI_EWRD_METHOD);
368 if (IS_ERR(data))444 if (IS_ERR(data))
@@ -394,10 +470,10 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
394 goto out_free;470 goto out_free;
395 }471 }
396472
397 for (i = 0; i < n_profiles; i++) {473 /* the tables start at element 3 */
398 /* the tables start at element 3 */474 pos = 3;
399 int pos = 3;
400475
476 for (i = 0; i < n_profiles; i++) {
401 /* The EWRD profiles officially go from 2 to 4, but we477 /* The EWRD profiles officially go from 2 to 4, but we
402 * save them in sar_profiles[1-3] (because we don't478 * save them in sar_profiles[1-3] (because we don't
403 * have profile 0). So in the array we start from 1.479 * have profile 0). So in the array we start from 1.
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
index 4a6e826..c0a8cb6 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
@@ -64,6 +64,7 @@
64#include "fw/api/commands.h"64#include "fw/api/commands.h"
65#include "fw/api/power.h"65#include "fw/api/power.h"
66#include "fw/api/phy.h"66#include "fw/api/phy.h"
67#include "fw/api/nvm-reg.h"
67#include "fw/img.h"68#include "fw/img.h"
68#include "iwl-trans.h"69#include "iwl-trans.h"
6970
@@ -75,6 +76,7 @@
75#define ACPI_SPLC_METHOD "SPLC"76#define ACPI_SPLC_METHOD "SPLC"
76#define ACPI_ECKV_METHOD "ECKV"77#define ACPI_ECKV_METHOD "ECKV"
77#define ACPI_PPAG_METHOD "PPAG"78#define ACPI_PPAG_METHOD "PPAG"
79#define ACPI_WTAS_METHOD "WTAS"
7880
79#define ACPI_WIFI_DOMAIN (0x07)81#define ACPI_WIFI_DOMAIN (0x07)
8082
@@ -96,6 +98,12 @@
96#define ACPI_SPLC_WIFI_DATA_SIZE 298#define ACPI_SPLC_WIFI_DATA_SIZE 2
97#define ACPI_ECKV_WIFI_DATA_SIZE 299#define ACPI_ECKV_WIFI_DATA_SIZE 2
98100
101/*
102 * 1 type, 1 enabled, 1 black list size, 16 black list array
103 */
104#define APCI_WTAS_BLACK_LIST_MAX 16
105#define ACPI_WTAS_WIFI_DATA_SIZE (3 + APCI_WTAS_BLACK_LIST_MAX)
106
99#define ACPI_WGDS_NUM_BANDS 2107#define ACPI_WGDS_NUM_BANDS 2
100#define ACPI_WGDS_TABLE_SIZE 3108#define ACPI_WGDS_TABLE_SIZE 3
101109
@@ -173,6 +181,10 @@ int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt,
173181
174void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,182void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
175 struct iwl_per_chain_offset_group *table);183 struct iwl_per_chain_offset_group *table);
184
185int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt, __le32 *black_list_array,
186 int *black_list_size);
187
176#else /* CONFIG_ACPI */188#else /* CONFIG_ACPI */
177189
178static inline void *iwl_acpi_get_object(struct device *dev, acpi_string method)190static inline void *iwl_acpi_get_object(struct device *dev, acpi_string method)
@@ -248,5 +260,11 @@ static inline void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
248{260{
249}261}
250262
263static inline int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt,
264 __le32 *black_list_array,
265 int *black_list_size)
266{
267 return -ENOENT;
268}
251#endif /* CONFIG_ACPI */269#endif /* CONFIG_ACPI */
252#endif /* __iwl_fw_acpi__ */270#endif /* __iwl_fw_acpi__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/config.h b/drivers/net/wireless/intel/iwlwifi/fw/api/config.h
index 5e88fa2..546fa60 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/config.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/config.h
@@ -8,7 +8,7 @@
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright (C) 2018 Intel Corporation11 * Copyright (C) 2018 - 2019 Intel Corporation
12 *12 *
13 * This program is free software; you can redistribute it and/or modify13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as14 * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright (C) 2018 Intel Corporation34 * Copyright (C) 2018 - 2019 Intel Corporation
35 * All rights reserved.35 * All rights reserved.
36 *36 *
37 * Redistribution and use in source and binary forms, with or without37 * Redistribution and use in source and binary forms, with or without
@@ -120,15 +120,48 @@ enum iwl_calib_cfg {
120};120};
121121
122/**122/**
123 * struct iwl_phy_specific_cfg - specific PHY filter configuration
124 *
125 * Sent as part of the phy configuration command (v3) to configure specific FW
126 * defined PHY filters that can be applied to each antenna.
127 *
128 * @filter_cfg_chain_a: filter config id for LMAC1 chain A
129 * @filter_cfg_chain_b: filter config id for LMAC1 chain B
130 * @filter_cfg_chain_c: filter config id for LMAC2 chain A
131 * @filter_cfg_chain_d: filter config id for LMAC2 chain B
132 * values: 0 - no filter; 0xffffffff - reserved; otherwise - filter id
133 */
134struct iwl_phy_specific_cfg {
135 __le32 filter_cfg_chain_a;
136 __le32 filter_cfg_chain_b;
137 __le32 filter_cfg_chain_c;
138 __le32 filter_cfg_chain_d;
139} __packed; /* PHY_SPECIFIC_CONFIGURATION_API_VER_1*/
140
141/**
123 * struct iwl_phy_cfg_cmd - Phy configuration command142 * struct iwl_phy_cfg_cmd - Phy configuration command
143 *
124 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg144 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
125 * @calib_control: calibration control data145 * @calib_control: calibration control data
126 */146 */
127struct iwl_phy_cfg_cmd {147struct iwl_phy_cfg_cmd_v1 {
128 __le32 phy_cfg;148 __le32 phy_cfg;
129 struct iwl_calib_ctrl calib_control;149 struct iwl_calib_ctrl calib_control;
130} __packed;150} __packed;
131151
152/**
153 * struct iwl_phy_cfg_cmd_v3 - Phy configuration command (v3)
154 *
155 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
156 * @calib_control: calibration control data
157 * @phy_specific_cfg: configure predefined PHY filters
158 */
159struct iwl_phy_cfg_cmd_v3 {
160 __le32 phy_cfg;
161 struct iwl_calib_ctrl calib_control;
162 struct iwl_phy_specific_cfg phy_specific_cfg;
163} __packed; /* PHY_CONFIGURATION_CMD_API_S_VER_3 */
164
132/*165/*
133 * enum iwl_dc2dc_config_id - flag ids166 * enum iwl_dc2dc_config_id - flag ids
134 *167 *
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
index 97b4984..2d230a7 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
@@ -80,6 +80,11 @@ enum iwl_regulatory_and_nvm_subcmd_ids {
80 * response is &struct iwl_nvm_get_info_rsp80 * response is &struct iwl_nvm_get_info_rsp
81 */81 */
82 NVM_GET_INFO = 0x2,82 NVM_GET_INFO = 0x2,
83
84 /**
85 * @TAS_CONFIG: &struct iwl_tas_config_cmd
86 */
87 TAS_CONFIG = 0x3,
83};88};
8489
85/**90/**
@@ -431,4 +436,14 @@ enum iwl_mcc_source {
431 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,436 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
432};437};
433438
439#define IWL_TAS_BLACK_LIST_MAX 16
440/**
441 * struct iwl_tas_config_cmd - configures the TAS
442 * @black_list_size: size of relevant field in black_list_array
443 * @black_list_array: black list countries (without TAS)
444 */
445struct iwl_tas_config_cmd {
446 __le32 black_list_size;
447 __le32 black_list_array[IWL_TAS_BLACK_LIST_MAX];
448} __packed; /* TAS_CONFIG_CMD_API_S_VER_2 */
434#endif /* __iwl_fw_api_nvm_reg_h__ */449#endif /* __iwl_fw_api_nvm_reg_h__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h b/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
index b4211ac..6038b3c 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
@@ -5,10 +5,9 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.8 * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2018 - 2019 Intel Corporation
12 *11 *
13 * This program is free software; you can redistribute it and/or modify12 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as13 * it under the terms of version 2 of the GNU General Public License as
@@ -28,10 +27,9 @@
28 *27 *
29 * BSD LICENSE28 * BSD LICENSE
30 *29 *
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.30 * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH32 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2018 - 2019 Intel Corporation
35 * All rights reserved.33 * All rights reserved.
36 *34 *
37 * Redistribution and use in source and binary forms, with or without35 * Redistribution and use in source and binary forms, with or without
@@ -536,9 +534,9 @@ struct iwl_rx_mpdu_desc_v3 {
536 __le32 filter_match;534 __le32 filter_match;
537535
538 /**536 /**
539 * @phy_data2: depends on info type (see @phy_data1)537 * @phy_data3: depends on info type (see @phy_data1)
540 */538 */
541 __le32 phy_data2;539 __le32 phy_data3;
542 };540 };
543541
544 /* DW8 - carries rss_hash only when rpa_en == 1 */542 /* DW8 - carries rss_hash only when rpa_en == 1 */
@@ -549,9 +547,9 @@ struct iwl_rx_mpdu_desc_v3 {
549 __le32 rss_hash;547 __le32 rss_hash;
550548
551 /**549 /**
552 * @phy_data3: depends on info type (see @phy_data1)550 * @phy_data2: depends on info type (see @phy_data1)
553 */551 */
554 __le32 phy_data3;552 __le32 phy_data2;
555 };553 };
556 /* DW9 */554 /* DW9 */
557 /**555 /**
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/soc.h b/drivers/net/wireless/intel/iwlwifi/fw/api/soc.h
index aadca78..0c6d7b3 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/soc.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/soc.h
@@ -5,10 +5,9 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH8 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH9 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2019 Intel Deutschland GmbH10 * Copyright(c) 2012 - 2014, 2019 - 2020 Intel Corporation
12 *11 *
13 * This program is free software; you can redistribute it and/or modify12 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as13 * it under the terms of version 2 of the GNU General Public License as
@@ -28,10 +27,9 @@
28 *27 *
29 * BSD LICENSE28 * BSD LICENSE
30 *29 *
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH30 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH31 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2019 Intel Deutschland GmbH32 * Copyright(c) 2012 - 2014, 2019 - 2020 Intel Corporation
35 * All rights reserved.33 * All rights reserved.
36 *34 *
37 * Redistribution and use in source and binary forms, with or without35 * Redistribution and use in source and binary forms, with or without
@@ -68,6 +66,12 @@
68#define SOC_CONFIG_CMD_FLAGS_DISCRETE BIT(0)66#define SOC_CONFIG_CMD_FLAGS_DISCRETE BIT(0)
69#define SOC_CONFIG_CMD_FLAGS_LOW_LATENCY BIT(1)67#define SOC_CONFIG_CMD_FLAGS_LOW_LATENCY BIT(1)
7068
69#define SOC_FLAGS_LTR_APPLY_DELAY_MASK 0xc
70#define SOC_FLAGS_LTR_APPLY_DELAY_NONE 0
71#define SOC_FLAGS_LTR_APPLY_DELAY_200 1
72#define SOC_FLAGS_LTR_APPLY_DELAY_2500 2
73#define SOC_FLAGS_LTR_APPLY_DELAY_1820 3
74
71/**75/**
72 * struct iwl_soc_configuration_cmd - Set device stabilization latency76 * struct iwl_soc_configuration_cmd - Set device stabilization latency
73 *77 *
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h b/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h
index 970e9e5..c010e6f 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h
@@ -245,32 +245,6 @@ enum iwl_sta_sleep_flag {
245#define STA_KEY_LEN_WEP40 (5)245#define STA_KEY_LEN_WEP40 (5)
246#define STA_KEY_LEN_WEP104 (13)246#define STA_KEY_LEN_WEP104 (13)
247247
248/**
249 * struct iwl_mvm_keyinfo - key information
250 * @key_flags: type &enum iwl_sta_key_flag
251 * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection
252 * @reserved1: reserved
253 * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
254 * @key_offset: key offset in the fw's key table
255 * @reserved2: reserved
256 * @key: 16-byte unicast decryption key
257 * @tx_secur_seq_cnt: initial RSC / PN needed for replay check
258 * @hw_tkip_mic_rx_key: byte: MIC Rx Key - used for TKIP only
259 * @hw_tkip_mic_tx_key: byte: MIC Tx Key - used for TKIP only
260 */
261struct iwl_mvm_keyinfo {
262 __le16 key_flags;
263 u8 tkip_rx_tsc_byte2;
264 u8 reserved1;
265 __le16 tkip_rx_ttak[5];
266 u8 key_offset;
267 u8 reserved2;
268 u8 key[16];
269 __le64 tx_secur_seq_cnt;
270 __le64 hw_tkip_mic_rx_key;
271 __le64 hw_tkip_mic_tx_key;
272} __packed;
273
274#define IWL_ADD_STA_STATUS_MASK 0xFF248#define IWL_ADD_STA_STATUS_MASK 0xFF
275#define IWL_ADD_STA_BAID_VALID_MASK 0x8000249#define IWL_ADD_STA_BAID_VALID_MASK 0x8000
276#define IWL_ADD_STA_BAID_MASK 0x7F00250#define IWL_ADD_STA_BAID_MASK 0x7F00
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index 2e5d9d8..79fe672 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -8,7 +8,7 @@
8 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.8 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2018 - 2019 Intel Corporation11 * Copyright(c) 2018 - 2020 Intel Corporation
12 *12 *
13 * This program is free software; you can redistribute it and/or modify13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as14 * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
31 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.31 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2018 - 2019 Intel Corporation34 * Copyright(c) 2018 - 2020 Intel Corporation
35 * All rights reserved.35 * All rights reserved.
36 *36 *
37 * Redistribution and use in source and binary forms, with or without37 * Redistribution and use in source and binary forms, with or without
@@ -1442,11 +1442,7 @@ static int iwl_dump_ini_rxf_iter(struct iwl_fw_runtime *fwrt,
1442 goto out;1442 goto out;
1443 }1443 }
14441444
1445 /*1445 offs = rxf_data.offset;
1446 * region register have absolute value so apply rxf offset after
1447 * reading the registers
1448 */
1449 offs += rxf_data.offset;
14501446
1451 /* Lock fence */1447 /* Lock fence */
1452 iwl_write_prph_no_grab(fwrt->trans, RXF_SET_FENCE_MODE + offs, 0x1);1448 iwl_write_prph_no_grab(fwrt->trans, RXF_SET_FENCE_MODE + offs, 0x1);
@@ -2333,26 +2329,40 @@ IWL_EXPORT_SYMBOL(iwl_fw_dbg_collect_desc);
2333int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt,2329int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt,
2334 enum iwl_fw_dbg_trigger trig_type)2330 enum iwl_fw_dbg_trigger trig_type)
2335{2331{
2336 int ret;
2337 struct iwl_fw_dump_desc *iwl_dump_error_desc;
2338
2339 if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status))2332 if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status))
2340 return -EIO;2333 return -EIO;
23412334
2342 iwl_dump_error_desc = kmalloc(sizeof(*iwl_dump_error_desc), GFP_KERNEL);2335 if (iwl_trans_dbg_ini_valid(fwrt->trans)) {
2343 if (!iwl_dump_error_desc)2336 if (trig_type != FW_DBG_TRIGGER_ALIVE_TIMEOUT)
2344 return -ENOMEM;2337 return -EIO;
23452338
2346 iwl_dump_error_desc->trig_desc.type = cpu_to_le32(trig_type);2339 iwl_dbg_tlv_time_point(fwrt,
2347 iwl_dump_error_desc->len = 0;2340 IWL_FW_INI_TIME_POINT_HOST_ALIVE_TIMEOUT,
2341 NULL);
2342 } else {
2343 struct iwl_fw_dump_desc *iwl_dump_error_desc;
2344 int ret;
23482345
2349 ret = iwl_fw_dbg_collect_desc(fwrt, iwl_dump_error_desc, false, 0);2346 iwl_dump_error_desc =
2350 if (ret)2347 kmalloc(sizeof(*iwl_dump_error_desc), GFP_KERNEL);
2351 kfree(iwl_dump_error_desc);
2352 else
2353 iwl_trans_sync_nmi(fwrt->trans);
23542348
2355 return ret;2349 if (!iwl_dump_error_desc)
2350 return -ENOMEM;
2351
2352 iwl_dump_error_desc->trig_desc.type = cpu_to_le32(trig_type);
2353 iwl_dump_error_desc->len = 0;
2354
2355 ret = iwl_fw_dbg_collect_desc(fwrt, iwl_dump_error_desc,
2356 false, 0);
2357 if (ret) {
2358 kfree(iwl_dump_error_desc);
2359 return ret;
2360 }
2361 }
2362
2363 iwl_trans_sync_nmi(fwrt->trans);
2364
2365 return 0;
2356}2366}
2357IWL_EXPORT_SYMBOL(iwl_fw_dbg_error_collect);2367IWL_EXPORT_SYMBOL(iwl_fw_dbg_error_collect);
23582368
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index ae50d23..7ed1978 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -477,6 +477,7 @@ enum iwl_ucode_tlv_capa {
477 IWL_UCODE_TLV_CAPA_CS_MODIFY = (__force iwl_ucode_tlv_capa_t)49,477 IWL_UCODE_TLV_CAPA_CS_MODIFY = (__force iwl_ucode_tlv_capa_t)49,
478 IWL_UCODE_TLV_CAPA_SET_LTR_GEN2 = (__force iwl_ucode_tlv_capa_t)50,478 IWL_UCODE_TLV_CAPA_SET_LTR_GEN2 = (__force iwl_ucode_tlv_capa_t)50,
479 IWL_UCODE_TLV_CAPA_SET_PPAG = (__force iwl_ucode_tlv_capa_t)52,479 IWL_UCODE_TLV_CAPA_SET_PPAG = (__force iwl_ucode_tlv_capa_t)52,
480 IWL_UCODE_TLV_CAPA_TAS_CFG = (__force iwl_ucode_tlv_capa_t)53,
480 IWL_UCODE_TLV_CAPA_SESSION_PROT_CMD = (__force iwl_ucode_tlv_capa_t)54,481 IWL_UCODE_TLV_CAPA_SESSION_PROT_CMD = (__force iwl_ucode_tlv_capa_t)54,
481482
482 /* set 2 */483 /* set 2 */
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index e3d6277..df28b99 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -5,9 +5,8 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
9 * Copyright (C) 2016 - 2017 Intel Deutschland GmbH8 * Copyright (C) 2016 - 2017 Intel Deutschland GmbH
10 * Copyright(c) 2018 - 2019 Intel Corporation9 * Copyright(c) 2007 - 2014, 2018 - 2020 Intel Corporation
11 *10 *
12 * This program is free software; you can redistribute it and/or modify11 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as12 * it under the terms of version 2 of the GNU General Public License as
@@ -27,9 +26,8 @@
27 *26 *
28 * BSD LICENSE27 * BSD LICENSE
29 *28 *
30 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
31 * Copyright (C) 2016 - 2017 Intel Deutschland GmbH29 * Copyright (C) 2016 - 2017 Intel Deutschland GmbH
32 * Copyright(c) 2018 - 2019 Intel Corporation30 * Copyright(c) 2005 - 2014, 2018 - 2020 Intel Corporation
33 * All rights reserved.31 * All rights reserved.
34 *32 *
35 * Redistribution and use in source and binary forms, with or without33 * Redistribution and use in source and binary forms, with or without
@@ -284,6 +282,13 @@ struct iwl_pwr_tx_backoff {
284 u32 backoff;282 u32 backoff;
285};283};
286284
285enum iwl_cfg_trans_ltr_delay {
286 IWL_CFG_TRANS_LTR_DELAY_NONE = 0,
287 IWL_CFG_TRANS_LTR_DELAY_200US = 1,
288 IWL_CFG_TRANS_LTR_DELAY_2500US = 2,
289 IWL_CFG_TRANS_LTR_DELAY_1820US = 3,
290};
291
287/**292/**
288 * struct iwl_cfg_trans - information needed to start the trans293 * struct iwl_cfg_trans - information needed to start the trans
289 *294 *
@@ -304,6 +309,7 @@ struct iwl_pwr_tx_backoff {
304 * @mq_rx_supported: multi-queue rx support309 * @mq_rx_supported: multi-queue rx support
305 * @integrated: discrete or integrated310 * @integrated: discrete or integrated
306 * @low_latency_xtal: use the low latency xtal if supported311 * @low_latency_xtal: use the low latency xtal if supported
312 * @ltr_delay: LTR delay parameter, &enum iwl_cfg_trans_ltr_delay.
307 */313 */
308struct iwl_cfg_trans_params {314struct iwl_cfg_trans_params {
309 const struct iwl_base_params *base_params;315 const struct iwl_base_params *base_params;
@@ -317,7 +323,8 @@ struct iwl_cfg_trans_params {
317 mq_rx_supported:1,323 mq_rx_supported:1,
318 integrated:1,324 integrated:1,
319 low_latency_xtal:1,325 low_latency_xtal:1,
320 bisr_workaround:1;326 bisr_workaround:1,
327 ltr_delay:2;
321};328};
322329
323/**330/**
@@ -506,8 +513,9 @@ struct iwl_dev_info {
506extern const struct iwl_cfg_trans_params iwl9000_trans_cfg;513extern const struct iwl_cfg_trans_params iwl9000_trans_cfg;
507extern const struct iwl_cfg_trans_params iwl9560_trans_cfg;514extern const struct iwl_cfg_trans_params iwl9560_trans_cfg;
508extern const struct iwl_cfg_trans_params iwl9560_shared_clk_trans_cfg;515extern const struct iwl_cfg_trans_params iwl9560_shared_clk_trans_cfg;
509extern const struct iwl_cfg_trans_params iwl_qu_trans_cfg;
510extern const struct iwl_cfg_trans_params iwl_qnj_trans_cfg;516extern const struct iwl_cfg_trans_params iwl_qnj_trans_cfg;
517extern const struct iwl_cfg_trans_params iwl_qu_trans_cfg;
518extern const struct iwl_cfg_trans_params iwl_qu_medium_latency_trans_cfg;
511extern const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg;519extern const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg;
512extern const struct iwl_cfg_trans_params iwl_ax200_trans_cfg;520extern const struct iwl_cfg_trans_params iwl_ax200_trans_cfg;
513extern const char iwl9162_name[];521extern const char iwl9162_name[];
@@ -580,9 +588,12 @@ extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0;
580extern const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0;588extern const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0;
581extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0;589extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0;
582extern const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0;590extern const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0;
591extern const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0_long;
583extern const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0;592extern const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0;
584extern const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0;593extern const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0;
594extern const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0_long;
585extern const struct iwl_cfg iwlax411_2ax_cfg_sosnj_gf4_a0;595extern const struct iwl_cfg iwlax411_2ax_cfg_sosnj_gf4_a0;
596extern const struct iwl_cfg iwlax211_cfg_snj_gf_a0;
586#endif /* CPTCFG_IWLMVM || CPTCFG_IWLFMAC */597#endif /* CPTCFG_IWLMVM || CPTCFG_IWLFMAC */
587598
588#endif /* __IWL_CONFIG_H__ */599#endif /* __IWL_CONFIG_H__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h
index 5169648..db77bb1 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h
@@ -158,6 +158,10 @@ struct iwl_dbg_cfg {
158 IWL_DBG_CFG_RANGE(u8, MVM_UAPSD_NOAGG_LIST_LEN,158 IWL_DBG_CFG_RANGE(u8, MVM_UAPSD_NOAGG_LIST_LEN,
159 1, IWL_MVM_UAPSD_NOAGG_BSSIDS_NUM)159 1, IWL_MVM_UAPSD_NOAGG_BSSIDS_NUM)
160 IWL_DBG_CFG(bool, MVM_NON_TRANSMITTING_AP)160 IWL_DBG_CFG(bool, MVM_NON_TRANSMITTING_AP)
161 IWL_DBG_CFG(u32, MVM_PHY_FILTER_CHAIN_A)
162 IWL_DBG_CFG(u32, MVM_PHY_FILTER_CHAIN_B)
163 IWL_DBG_CFG(u32, MVM_PHY_FILTER_CHAIN_C)
164 IWL_DBG_CFG(u32, MVM_PHY_FILTER_CHAIN_D)
161 IWL_DBG_CFG(u8, MVM_QUOTA_THRESHOLD)165 IWL_DBG_CFG(u8, MVM_QUOTA_THRESHOLD)
162 IWL_DBG_CFG(u8, MVM_RS_RSSI_BASED_INIT_RATE)166 IWL_DBG_CFG(u8, MVM_RS_RSSI_BASED_INIT_RATE)
163 IWL_DBG_CFG(u8, MVM_RS_80_20_FAR_RANGE_TWEAK)167 IWL_DBG_CFG(u8, MVM_RS_80_20_FAR_RANGE_TWEAK)
@@ -279,8 +283,6 @@ struct iwl_dbg_cfg {
279 IWL_DBG_CFG_NODEF(u16, tx_mcs_160)283 IWL_DBG_CFG_NODEF(u16, tx_mcs_160)
280 IWL_DBG_CFG_NODEF(u32, secure_boot_cfg)284 IWL_DBG_CFG_NODEF(u32, secure_boot_cfg)
281 IWL_MOD_PARAM(u32, uapsd_disable)285 IWL_MOD_PARAM(u32, uapsd_disable)
282 IWL_MOD_PARAM(bool, lar_disable)
283 IWL_MOD_PARAM(bool, fw_monitor)
284 IWL_MOD_PARAM(bool, fw_restart)286 IWL_MOD_PARAM(bool, fw_restart)
285 IWL_MOD_PARAM(bool, power_save)287 IWL_MOD_PARAM(bool, power_save)
286 IWL_MOD_PARAM(bool, bt_coex_active)288 IWL_MOD_PARAM(bool, bt_coex_active)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
index 35d1d6e..55daf92 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
@@ -5,7 +5,7 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright (C) 2018 - 2019 Intel Corporation8 * Copyright (C) 2018 - 2020 Intel Corporation
9 *9 *
10 * This program is free software; you can redistribute it and/or modify10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as11 * it under the terms of version 2 of the GNU General Public License as
@@ -25,7 +25,7 @@
25 *25 *
26 * BSD LICENSE26 * BSD LICENSE
27 *27 *
28 * Copyright (C) 2018 - 2019 Intel Corporation28 * Copyright (C) 2018 - 2020 Intel Corporation
29 * All rights reserved.29 * All rights reserved.
30 *30 *
31 * Redistribution and use in source and binary forms, with or without31 * Redistribution and use in source and binary forms, with or without
@@ -167,14 +167,24 @@ static int iwl_dbg_tlv_alloc_buf_alloc(struct iwl_trans *trans,
167167
168 if (le32_to_cpu(tlv->length) != sizeof(*alloc) ||168 if (le32_to_cpu(tlv->length) != sizeof(*alloc) ||
169 (buf_location != IWL_FW_INI_LOCATION_SRAM_PATH &&169 (buf_location != IWL_FW_INI_LOCATION_SRAM_PATH &&
170 buf_location != IWL_FW_INI_LOCATION_DRAM_PATH))170 buf_location != IWL_FW_INI_LOCATION_DRAM_PATH &&
171 buf_location != IWL_FW_INI_LOCATION_NPK_PATH)) {
172 IWL_ERR(trans,
173 "WRT: Invalid allocation TLV\n");
174 return -EINVAL;
175 }
176
177 if ((buf_location == IWL_FW_INI_LOCATION_SRAM_PATH ||
178 buf_location == IWL_FW_INI_LOCATION_NPK_PATH) &&
179 alloc_id != IWL_FW_INI_ALLOCATION_ID_DBGC1) {
180 IWL_ERR(trans,
181 "WRT: Allocation TLV for SMEM/NPK path must have id %u (current: %u)\n",
182 IWL_FW_INI_ALLOCATION_ID_DBGC1, alloc_id);
171 return -EINVAL;183 return -EINVAL;
184 }
172185
173 if ((buf_location == IWL_FW_INI_LOCATION_SRAM_PATH &&186 if (alloc_id == IWL_FW_INI_ALLOCATION_INVALID ||
174 alloc_id != IWL_FW_INI_ALLOCATION_ID_DBGC1) ||187 alloc_id >= IWL_FW_INI_ALLOCATION_NUM) {
175 (buf_location == IWL_FW_INI_LOCATION_DRAM_PATH &&
176 (alloc_id == IWL_FW_INI_ALLOCATION_INVALID ||
177 alloc_id >= IWL_FW_INI_ALLOCATION_NUM))) {
178 IWL_ERR(trans,188 IWL_ERR(trans,
179 "WRT: Invalid allocation id %u for allocation TLV\n",189 "WRT: Invalid allocation id %u for allocation TLV\n",
180 alloc_id);190 alloc_id);
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index 36b8aff..6d94aee 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -2218,9 +2218,6 @@ MODULE_PARM_DESC(antenna_coupling,
2218module_param_named(nvm_file, iwlwifi_mod_params.nvm_file, charp, 0444);2218module_param_named(nvm_file, iwlwifi_mod_params.nvm_file, charp, 0444);
2219MODULE_PARM_DESC(nvm_file, "NVM file name");2219MODULE_PARM_DESC(nvm_file, "NVM file name");
22202220
2221module_param_named(lar_disable, iwlwifi_mod_params.lar_disable, bool, 0444);
2222MODULE_PARM_DESC(lar_disable, "disable LAR functionality (default: N)");
2223
2224module_param_named(uapsd_disable, iwlwifi_mod_params.uapsd_disable, uint, 0644);2221module_param_named(uapsd_disable, iwlwifi_mod_params.uapsd_disable, uint, 0644);
2225MODULE_PARM_DESC(uapsd_disable,2222MODULE_PARM_DESC(uapsd_disable,
2226 "disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3)");2223 "disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3)");
@@ -2261,10 +2258,6 @@ module_param_named(power_level, iwlwifi_mod_params.power_level, int, 0444);
2261MODULE_PARM_DESC(power_level,2258MODULE_PARM_DESC(power_level,
2262 "default power save level (range from 1 - 5, default: 1)");2259 "default power save level (range from 1 - 5, default: 1)");
22632260
2264module_param_named(fw_monitor, iwlwifi_mod_params.fw_monitor, bool, 0444);
2265MODULE_PARM_DESC(fw_monitor,
2266 "firmware monitor - to debug FW (default: false - needs lots of memory)");
2267
2268module_param_named(disable_11ac, iwlwifi_mod_params.disable_11ac, bool, 0444);2261module_param_named(disable_11ac, iwlwifi_mod_params.disable_11ac, bool, 0444);
2269MODULE_PARM_DESC(disable_11ac, "Disable VHT capabilities (default: false)");2262MODULE_PARM_DESC(disable_11ac, "Disable VHT capabilities (default: false)");
22702263
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
index 27d2cb3..91f65ab 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
@@ -116,8 +116,6 @@ enum iwl_uapsd_disable {
116 * @uapsd_disable: disable U-APSD, see &enum iwl_uapsd_disable, default =116 * @uapsd_disable: disable U-APSD, see &enum iwl_uapsd_disable, default =
117 * IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT117 * IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT
118 * @xvt_default_mode: xVT is the default operation mode, default = false118 * @xvt_default_mode: xVT is the default operation mode, default = false
119 * @lar_disable: disable LAR (regulatory), default = 0
120 * @fw_monitor: allow to use firmware monitor
121 * @disable_11ac: disable VHT capabilities, default = false.119 * @disable_11ac: disable VHT capabilities, default = false.
122 * @disable_msix: disable MSI-X and fall back to MSI on PCIe, default = false.120 * @disable_msix: disable MSI-X and fall back to MSI on PCIe, default = false.
123 * @remove_when_gone: remove an inaccessible device from the PCIe bus.121 * @remove_when_gone: remove an inaccessible device from the PCIe bus.
@@ -141,8 +139,6 @@ struct iwl_mod_params {
141#endif139#endif
142 char *nvm_file;140 char *nvm_file;
143 u32 uapsd_disable;141 u32 uapsd_disable;
144 bool lar_disable;
145 bool fw_monitor;
146 bool disable_11ac;142 bool disable_11ac;
147 /**143 /**
148 * @disable_11ax: disable HE capabilities, default = false144 * @disable_11ax: disable HE capabilities, default = false
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index f8927ef..7e3e882 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -1125,10 +1125,11 @@ iwl_nvm_no_wide_in_5ghz(struct iwl_trans *trans, const struct iwl_cfg *cfg,
11251125
1126struct iwl_nvm_data *1126struct iwl_nvm_data *
1127iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,1127iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
1128 const struct iwl_fw *fw,
1128 const __be16 *nvm_hw, const __le16 *nvm_sw,1129 const __be16 *nvm_hw, const __le16 *nvm_sw,
1129 const __le16 *nvm_calib, const __le16 *regulatory,1130 const __le16 *nvm_calib, const __le16 *regulatory,
1130 const __le16 *mac_override, const __le16 *phy_sku,1131 const __le16 *mac_override, const __le16 *phy_sku,
1131 u8 tx_chains, u8 rx_chains, bool lar_fw_supported)1132 u8 tx_chains, u8 rx_chains)
1132{1133{
1133 struct iwl_nvm_data *data;1134 struct iwl_nvm_data *data;
1134 bool lar_enabled;1135 bool lar_enabled;
@@ -1219,7 +1220,8 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
1219 iwl_init_he_override(trans, &data->bands[NL80211_BAND_2GHZ]);1220 iwl_init_he_override(trans, &data->bands[NL80211_BAND_2GHZ]);
1220 iwl_init_he_override(trans, &data->bands[NL80211_BAND_5GHZ]);1221 iwl_init_he_override(trans, &data->bands[NL80211_BAND_5GHZ]);
1221#endif1222#endif
1222 if (lar_fw_supported && lar_enabled)1223 if (lar_enabled &&
1224 fw_has_capa(&fw->ucode_capa, IWL_UCODE_TLV_CAPA_LAR_SUPPORT))
1223 sbands_flags |= IWL_NVM_SBANDS_FLAGS_LAR;1225 sbands_flags |= IWL_NVM_SBANDS_FLAGS_LAR;
12241226
1225 if (iwl_nvm_no_wide_in_5ghz(trans, cfg, nvm_hw))1227 if (iwl_nvm_no_wide_in_5ghz(trans, cfg, nvm_hw))
@@ -1620,9 +1622,6 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans,
1620 .id = WIDE_ID(REGULATORY_AND_NVM_GROUP, NVM_GET_INFO)1622 .id = WIDE_ID(REGULATORY_AND_NVM_GROUP, NVM_GET_INFO)
1621 };1623 };
1622 int ret;1624 int ret;
1623 bool lar_fw_supported = !iwlwifi_mod_params.lar_disable &&
1624 fw_has_capa(&fw->ucode_capa,
1625 IWL_UCODE_TLV_CAPA_LAR_SUPPORT);
1626 bool empty_otp;1625 bool empty_otp;
1627 u32 mac_flags;1626 u32 mac_flags;
1628 u32 sbands_flags = 0;1627 u32 sbands_flags = 0;
@@ -1711,7 +1710,9 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans,
1711 nvm->valid_tx_ant = (u8)le32_to_cpu(rsp->phy_sku.tx_chains);1710 nvm->valid_tx_ant = (u8)le32_to_cpu(rsp->phy_sku.tx_chains);
1712 nvm->valid_rx_ant = (u8)le32_to_cpu(rsp->phy_sku.rx_chains);1711 nvm->valid_rx_ant = (u8)le32_to_cpu(rsp->phy_sku.rx_chains);
17131712
1714 if (le32_to_cpu(rsp->regulatory.lar_enabled) && lar_fw_supported) {1713 if (le32_to_cpu(rsp->regulatory.lar_enabled) &&
1714 fw_has_capa(&fw->ucode_capa,
1715 IWL_UCODE_TLV_CAPA_LAR_SUPPORT)) {
1715 nvm->lar_enabled = true;1716 nvm->lar_enabled = true;
1716 sbands_flags |= IWL_NVM_SBANDS_FLAGS_LAR;1717 sbands_flags |= IWL_NVM_SBANDS_FLAGS_LAR;
1717 }1718 }
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h
index 4eeedb4..fb0b385 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h
@@ -85,10 +85,11 @@ enum iwl_nvm_sbands_flags {
85 */85 */
86struct iwl_nvm_data *86struct iwl_nvm_data *
87iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,87iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
88 const struct iwl_fw *fw,
88 const __be16 *nvm_hw, const __le16 *nvm_sw,89 const __be16 *nvm_hw, const __le16 *nvm_sw,
89 const __le16 *nvm_calib, const __le16 *regulatory,90 const __le16 *nvm_calib, const __le16 *regulatory,
90 const __le16 *mac_override, const __le16 *phy_sku,91 const __le16 *mac_override, const __le16 *phy_sku,
91 u8 tx_chains, u8 rx_chains, bool lar_fw_supported);92 u8 tx_chains, u8 rx_chains);
9293
93/**94/**
94 * iwl_parse_mcc_info - parse MCC (mobile country code) info coming from FW95 * iwl_parse_mcc_info - parse MCC (mobile country code) info coming from FW
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h
index 77af9cd..3f512d1 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h
@@ -161,6 +161,10 @@
161#define IWL_MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT 20016161#define IWL_MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT 20016
162#define IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT 20016162#define IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT 20016
163#define IWL_MVM_FTM_INITIATOR_SMOOTH_AGE_SEC 2163#define IWL_MVM_FTM_INITIATOR_SMOOTH_AGE_SEC 2
164#define IWL_MVM_PHY_FILTER_CHAIN_A 0
165#define IWL_MVM_PHY_FILTER_CHAIN_B 0
166#define IWL_MVM_PHY_FILTER_CHAIN_C 0
167#define IWL_MVM_PHY_FILTER_CHAIN_D 0
164#else /* CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES */168#else /* CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES */
165#define IWL_MVM_DEFAULT_PS_TX_DATA_TIMEOUT (mvm->trans->dbg_cfg.MVM_DEFAULT_PS_TX_DATA_TIMEOUT)169#define IWL_MVM_DEFAULT_PS_TX_DATA_TIMEOUT (mvm->trans->dbg_cfg.MVM_DEFAULT_PS_TX_DATA_TIMEOUT)
166#define IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (mvm->trans->dbg_cfg.MVM_DEFAULT_PS_RX_DATA_TIMEOUT)170#define IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (mvm->trans->dbg_cfg.MVM_DEFAULT_PS_RX_DATA_TIMEOUT)
@@ -255,6 +259,10 @@
255#define IWL_MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT)259#define IWL_MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT)
256#define IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT)260#define IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT)
257#define IWL_MVM_FTM_INITIATOR_SMOOTH_AGE_SEC (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_AGE_SEC)261#define IWL_MVM_FTM_INITIATOR_SMOOTH_AGE_SEC (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_AGE_SEC)
262#define IWL_MVM_PHY_FILTER_CHAIN_A (mvm->trans->dbg_cfg.MVM_PHY_FILTER_CHAIN_A)
263#define IWL_MVM_PHY_FILTER_CHAIN_B (mvm->trans->dbg_cfg.MVM_PHY_FILTER_CHAIN_B)
264#define IWL_MVM_PHY_FILTER_CHAIN_C (mvm->trans->dbg_cfg.MVM_PHY_FILTER_CHAIN_C)
265#define IWL_MVM_PHY_FILTER_CHAIN_D (mvm->trans->dbg_cfg.MVM_PHY_FILTER_CHAIN_D)
258266
259#endif /* CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES */267#endif /* CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES */
260268
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index 5e88b8b..9c2db68 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
@@ -8,6 +8,7 @@
8 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH8 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
9 * Copyright (C) 2018 Intel Corporation9 * Copyright (C) 2018 Intel Corporation
10 * Copyright (C) 2019 Intel Corporation10 * Copyright (C) 2019 Intel Corporation
11 * Copyright (C) 2020 Intel Corporation
11 *12 *
12 * This program is free software; you can redistribute it and/or modify13 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as14 * it under the terms of version 2 of the GNU General Public License as
@@ -30,6 +31,7 @@
30 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH31 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
31 * Copyright (C) 2018 Intel Corporation32 * Copyright (C) 2018 Intel Corporation
32 * Copyright (C) 2019 Intel Corporation33 * Copyright (C) 2019 Intel Corporation
34 * Copyright (C) 2020 Intel Corporation
33 * All rights reserved.35 * All rights reserved.
34 *36 *
35 * Redistribution and use in source and binary forms, with or without37 * Redistribution and use in source and binary forms, with or without
@@ -599,6 +601,8 @@ void iwl_mvm_ftm_abort(struct iwl_mvm *mvm, struct cfg80211_pmsr_request *req)
599 if (req != mvm->ftm_initiator.req)601 if (req != mvm->ftm_initiator.req)
600 return;602 return;
601603
604 iwl_mvm_ftm_reset(mvm);
605
602 if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_RANGE_ABORT_CMD,606 if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_RANGE_ABORT_CMD,
603 LOCATION_GROUP, 0),607 LOCATION_GROUP, 0),
604 0, sizeof(cmd), &cmd))608 0, sizeof(cmd), &cmd))
@@ -801,7 +805,6 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
801 lockdep_assert_held(&mvm->mutex);805 lockdep_assert_held(&mvm->mutex);
802806
803 if (!mvm->ftm_initiator.req) {807 if (!mvm->ftm_initiator.req) {
804 IWL_ERR(mvm, "Got FTM response but have no request?\n");
805 return;808 return;
806 }809 }
807810
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index d8b5137..2b041f1 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -5,10 +5,9 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH8 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH9 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2018 - 2019 Intel Corporation10 * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation
12 *11 *
13 * This program is free software; you can redistribute it and/or modify12 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as13 * it under the terms of version 2 of the GNU General Public License as
@@ -28,10 +27,9 @@
28 *27 *
29 * BSD LICENSE28 * BSD LICENSE
30 *29 *
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH30 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH31 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2018 - 2019 Intel Corporation32 * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation
35 * All rights reserved.33 * All rights reserved.
36 *34 *
37 * Redistribution and use in source and binary forms, with or without35 * Redistribution and use in source and binary forms, with or without
@@ -108,6 +106,20 @@ static int iwl_set_soc_latency(struct iwl_mvm *mvm)
108 if (!mvm->trans->trans_cfg->integrated)106 if (!mvm->trans->trans_cfg->integrated)
109 cmd.flags = cpu_to_le32(SOC_CONFIG_CMD_FLAGS_DISCRETE);107 cmd.flags = cpu_to_le32(SOC_CONFIG_CMD_FLAGS_DISCRETE);
110108
109 BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_NONE !=
110 SOC_FLAGS_LTR_APPLY_DELAY_NONE);
111 BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_200US !=
112 SOC_FLAGS_LTR_APPLY_DELAY_200);
113 BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_2500US !=
114 SOC_FLAGS_LTR_APPLY_DELAY_2500);
115 BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_1820US !=
116 SOC_FLAGS_LTR_APPLY_DELAY_1820);
117
118 if (mvm->trans->trans_cfg->ltr_delay != IWL_CFG_TRANS_LTR_DELAY_NONE &&
119 !WARN_ON(!mvm->trans->trans_cfg->integrated))
120 cmd.flags |= le32_encode_bits(mvm->trans->trans_cfg->ltr_delay,
121 SOC_FLAGS_LTR_APPLY_DELAY_MASK);
122
111 if (iwl_fw_lookup_cmd_ver(mvm->fw, IWL_ALWAYS_LONG_GROUP,123 if (iwl_fw_lookup_cmd_ver(mvm->fw, IWL_ALWAYS_LONG_GROUP,
112 SCAN_REQ_UMAC) >= 2 &&124 SCAN_REQ_UMAC) >= 2 &&
113 mvm->trans->trans_cfg->low_latency_xtal)125 mvm->trans->trans_cfg->low_latency_xtal)
@@ -561,10 +573,49 @@ error:
561 return ret;573 return ret;
562}574}
563575
576#ifdef CONFIG_ACPI
577static void iwl_mvm_phy_filter_init(struct iwl_mvm *mvm,
578 struct iwl_phy_specific_cfg *phy_filters)
579{
580 /*
581 * TODO: read specific phy config from BIOS
582 * ACPI table for this feature has not been defined yet,
583 * so for now we use hardcoded values.
584 */
585
586 if (IWL_MVM_PHY_FILTER_CHAIN_A) {
587 phy_filters->filter_cfg_chain_a =
588 cpu_to_le32(IWL_MVM_PHY_FILTER_CHAIN_A);
589 }
590 if (IWL_MVM_PHY_FILTER_CHAIN_B) {
591 phy_filters->filter_cfg_chain_b =
592 cpu_to_le32(IWL_MVM_PHY_FILTER_CHAIN_B);
593 }
594 if (IWL_MVM_PHY_FILTER_CHAIN_C) {
595 phy_filters->filter_cfg_chain_c =
596 cpu_to_le32(IWL_MVM_PHY_FILTER_CHAIN_C);
597 }
598 if (IWL_MVM_PHY_FILTER_CHAIN_D) {
599 phy_filters->filter_cfg_chain_d =
600 cpu_to_le32(IWL_MVM_PHY_FILTER_CHAIN_D);
601 }
602}
603
604#else /* CONFIG_ACPI */
605
606static void iwl_mvm_phy_filter_init(struct iwl_mvm *mvm,
607 struct iwl_phy_specific_cfg *phy_filters)
608{
609}
610#endif /* CONFIG_ACPI */
611
564static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)612static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
565{613{
566 struct iwl_phy_cfg_cmd phy_cfg_cmd;614 struct iwl_phy_cfg_cmd_v3 phy_cfg_cmd;
567 enum iwl_ucode_type ucode_type = mvm->fwrt.cur_fw_img;615 enum iwl_ucode_type ucode_type = mvm->fwrt.cur_fw_img;
616 struct iwl_phy_specific_cfg phy_filters = {};
617 u8 cmd_ver;
618 size_t cmd_size;
568#ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES619#ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES
569 u32 override_mask, flow_override, flow_src;620 u32 override_mask, flow_override, flow_src;
570 u32 event_override, event_src;621 u32 event_override, event_src;
@@ -601,6 +652,14 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
601 phy_cfg_cmd.calib_control.flow_trigger =652 phy_cfg_cmd.calib_control.flow_trigger =
602 mvm->fw->default_calib[ucode_type].flow_trigger;653 mvm->fw->default_calib[ucode_type].flow_trigger;
603654
655 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, IWL_ALWAYS_LONG_GROUP,
656 PHY_CONFIGURATION_CMD);
657 if (cmd_ver == 3) {
658 iwl_mvm_phy_filter_init(mvm, &phy_filters);
659 memcpy(&phy_cfg_cmd.phy_specific_cfg, &phy_filters,
660 sizeof(struct iwl_phy_specific_cfg));
661 }
662
604#ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES663#ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES
605 override_mask = mvm->trans->dbg_cfg.MVM_CALIB_OVERRIDE_CONTROL;664 override_mask = mvm->trans->dbg_cfg.MVM_CALIB_OVERRIDE_CONTROL;
606 if (override_mask) {665 if (override_mask) {
@@ -669,9 +728,10 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm)
669#endif728#endif
670 IWL_DEBUG_INFO(mvm, "Sending Phy CFG command: 0x%x\n",729 IWL_DEBUG_INFO(mvm, "Sending Phy CFG command: 0x%x\n",
671 phy_cfg_cmd.phy_cfg);730 phy_cfg_cmd.phy_cfg);
672731 cmd_size = (cmd_ver == 3) ? sizeof(struct iwl_phy_cfg_cmd_v3) :
732 sizeof(struct iwl_phy_cfg_cmd_v1);
673 return iwl_mvm_send_cmd_pdu(mvm, PHY_CONFIGURATION_CMD, 0,733 return iwl_mvm_send_cmd_pdu(mvm, PHY_CONFIGURATION_CMD, 0,
674 sizeof(phy_cfg_cmd), &phy_cfg_cmd);734 cmd_size, &phy_cfg_cmd);
675}735}
676736
677int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)737int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
@@ -1015,6 +1075,40 @@ static int iwl_mvm_ppag_init(struct iwl_mvm *mvm)
1015 return iwl_mvm_ppag_send_cmd(mvm);1075 return iwl_mvm_ppag_send_cmd(mvm);
1016}1076}
10171077
1078static void iwl_mvm_tas_init(struct iwl_mvm *mvm)
1079{
1080 int ret;
1081 struct iwl_tas_config_cmd cmd = {};
1082 int list_size;
1083
1084 BUILD_BUG_ON(ARRAY_SIZE(cmd.black_list_array) <
1085 APCI_WTAS_BLACK_LIST_MAX);
1086
1087 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TAS_CFG)) {
1088 IWL_DEBUG_RADIO(mvm, "TAS not enabled in FW\n");
1089 return;
1090 }
1091
1092 ret = iwl_acpi_get_tas(&mvm->fwrt, cmd.black_list_array, &list_size);
1093 if (ret < 0) {
1094 IWL_DEBUG_RADIO(mvm,
1095 "TAS table invalid or unavailable. (%d)\n",
1096 ret);
1097 return;
1098 }
1099
1100 if (list_size < 0)
1101 return;
1102
1103 /* list size if TAS enabled can only be non-negative */
1104 cmd.black_list_size = cpu_to_le32((u32)list_size);
1105
1106 ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(REGULATORY_AND_NVM_GROUP,
1107 TAS_CONFIG),
1108 0, sizeof(cmd), &cmd);
1109 if (ret < 0)
1110 IWL_DEBUG_RADIO(mvm, "failed to send TAS_CONFIG (%d)\n", ret);
1111}
1018#else /* CONFIG_ACPI */1112#else /* CONFIG_ACPI */
10191113
1020inline int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm,1114inline int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm,
@@ -1042,6 +1136,10 @@ static int iwl_mvm_ppag_init(struct iwl_mvm *mvm)
1042{1136{
1043 return 0;1137 return 0;
1044}1138}
1139
1140static void iwl_mvm_tas_init(struct iwl_mvm *mvm)
1141{
1142}
1045#endif /* CONFIG_ACPI */1143#endif /* CONFIG_ACPI */
10461144
1047void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)1145void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
@@ -1448,6 +1546,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
1448 if (ret < 0)1546 if (ret < 0)
1449 goto error;1547 goto error;
14501548
1549 iwl_mvm_tas_init(mvm);
1451 iwl_mvm_leds_sync(mvm);1550 iwl_mvm_leds_sync(mvm);
14521551
1453 iwl_mvm_ftm_initiator_smooth_config(mvm);1552 iwl_mvm_ftm_initiator_smooth_config(mvm);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 76e45ec..4343058 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -5,10 +5,9 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH8 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH9 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2018 - 2019 Intel Corporation10 * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation
12 *11 *
13 * This program is free software; you can redistribute it and/or modify12 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as13 * it under the terms of version 2 of the GNU General Public License as
@@ -28,10 +27,9 @@
28 *27 *
29 * BSD LICENSE28 * BSD LICENSE
30 *29 *
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH30 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH31 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2018 - 2019 Intel Corporation32 * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation
35 * All rights reserved.33 * All rights reserved.
36 *34 *
37 * Redistribution and use in source and binary forms, with or without35 * Redistribution and use in source and binary forms, with or without
@@ -2157,7 +2155,7 @@ static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm,
2157 rcu_read_lock();2155 rcu_read_lock();
21582156
2159 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_ctxt_cmd.sta_id]);2157 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_ctxt_cmd.sta_id]);
2160 if (IS_ERR(sta)) {2158 if (IS_ERR_OR_NULL(sta)) {
2161 rcu_read_unlock();2159 rcu_read_unlock();
2162 WARN(1, "Can't find STA to configure HE\n");2160 WARN(1, "Can't find STA to configure HE\n");
2163 return;2161 return;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 61853a7..b4855dc 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1389,9 +1389,6 @@ static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm)
1389 bool tlv_lar = fw_has_capa(&mvm->fw->ucode_capa,1389 bool tlv_lar = fw_has_capa(&mvm->fw->ucode_capa,
1390 IWL_UCODE_TLV_CAPA_LAR_SUPPORT);1390 IWL_UCODE_TLV_CAPA_LAR_SUPPORT);
13911391
1392 if (iwlwifi_mod_params.lar_disable)
1393 return false;
1394
1395 /*1392 /*
1396 * Enable LAR only if it is supported by the FW (TLV) &&1393 * Enable LAR only if it is supported by the FW (TLV) &&
1397 * enabled in the NVM1394 * enabled in the NVM
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
index 1b6b242..d2649ef 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
@@ -277,7 +277,6 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm)
277 struct iwl_nvm_section *sections = mvm->nvm_sections;277 struct iwl_nvm_section *sections = mvm->nvm_sections;
278 const __be16 *hw;278 const __be16 *hw;
279 const __le16 *sw, *calib, *regulatory, *mac_override, *phy_sku;279 const __le16 *sw, *calib, *regulatory, *mac_override, *phy_sku;
280 bool lar_enabled;
281 int regulatory_type;280 int regulatory_type;
282281
283 /* Checking for required sections */282 /* Checking for required sections */
@@ -327,14 +326,9 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm)
327 (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY_SDP].data :326 (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY_SDP].data :
328 (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY].data;327 (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY].data;
329328
330 lar_enabled = !iwlwifi_mod_params.lar_disable &&329 return iwl_parse_nvm_data(mvm->trans, mvm->cfg, mvm->fw, hw, sw, calib,
331 fw_has_capa(&mvm->fw->ucode_capa,
332 IWL_UCODE_TLV_CAPA_LAR_SUPPORT);
333
334 return iwl_parse_nvm_data(mvm->trans, mvm->cfg, hw, sw, calib,
335 regulatory, mac_override, phy_sku,330 regulatory, mac_override, phy_sku,
336 mvm->fw->valid_tx_ant, mvm->fw->valid_rx_ant,331 mvm->fw->valid_tx_ant, mvm->fw->valid_rx_ant);
337 lar_enabled);
338}332}
339333
340/* Loads the NVM data stored in mvm->nvm_sections into the NIC */334/* Loads the NVM data stored in mvm->nvm_sections into the NIC */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index a0524da..f9cef76 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -566,6 +566,7 @@ static const struct iwl_hcmd_names iwl_mvm_prot_offload_names[] = {
566static const struct iwl_hcmd_names iwl_mvm_regulatory_and_nvm_names[] = {566static const struct iwl_hcmd_names iwl_mvm_regulatory_and_nvm_names[] = {
567 HCMD_NAME(NVM_ACCESS_COMPLETE),567 HCMD_NAME(NVM_ACCESS_COMPLETE),
568 HCMD_NAME(NVM_GET_INFO),568 HCMD_NAME(NVM_GET_INFO),
569 HCMD_NAME(TAS_CONFIG),
569};570};
570571
571static const struct iwl_hcmd_arr iwl_mvm_groups[] = {572static const struct iwl_hcmd_arr iwl_mvm_groups[] = {
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index 98e1a85..696d70f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -1233,7 +1233,7 @@ static int iwl_mvm_legacy_config_scan(struct iwl_mvm *mvm)
1233 cmd_size = sizeof(struct iwl_scan_config_v2);1233 cmd_size = sizeof(struct iwl_scan_config_v2);
1234 else1234 else
1235 cmd_size = sizeof(struct iwl_scan_config_v1);1235 cmd_size = sizeof(struct iwl_scan_config_v1);
1236 cmd_size += num_channels;1236 cmd_size += mvm->fw->ucode_capa.n_scan_channels;
12371237
1238 cfg = kzalloc(cmd_size, GFP_KERNEL);1238 cfg = kzalloc(cmd_size, GFP_KERNEL);
1239 if (!cfg)1239 if (!cfg)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 3db864a..04e1e08 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -3322,6 +3322,10 @@ static int iwl_mvm_send_sta_igtk(struct iwl_mvm *mvm,
3322 igtk_cmd.sta_id = cpu_to_le32(sta_id);3322 igtk_cmd.sta_id = cpu_to_le32(sta_id);
33233323
3324 if (remove_key) {3324 if (remove_key) {
3325 /* This is a valid situation for IGTK */
3326 if (sta_id == IWL_MVM_INVALID_STA)
3327 return 0;
3328
3325 igtk_cmd.ctrl_flags |= cpu_to_le32(STA_KEY_NOT_VALID);3329 igtk_cmd.ctrl_flags |= cpu_to_le32(STA_KEY_NOT_VALID);
3326 } else {3330 } else {
3327 struct ieee80211_key_seq seq;3331 struct ieee80211_key_seq seq;
@@ -3576,9 +3580,9 @@ int iwl_mvm_remove_sta_key(struct iwl_mvm *mvm,
3576 IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n",3580 IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n",
3577 keyconf->keyidx, sta_id);3581 keyconf->keyidx, sta_id);
35783582
3579 if (mvm_sta && (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||3583 if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
3580 keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||3584 keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
3581 keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256))3585 keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)
3582 return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true);3586 return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true);
35833587
3584 if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) {3588 if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) {
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index b5a16f0..418e59b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -8,7 +8,7 @@
8 * Copyright(c) 2013 - 2014, 2019 Intel Corporation. All rights reserved.8 * Copyright(c) 2013 - 2014, 2019 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
10 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH10 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
11 * Copyright(c) 2019 Intel Corporation11 * Copyright(c) 2019 - 2020 Intel Corporation
12 *12 *
13 * This program is free software; you can redistribute it and/or modify13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as14 * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
31 * Copyright(c) 2012 - 2014, 2019 Intel Corporation. All rights reserved.31 * Copyright(c) 2012 - 2014, 2019 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
33 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH33 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
34 * Copyright(c) 2019 Intel Corporation34 * Copyright(c) 2019 - 2020 Intel Corporation
35 * All rights reserved.35 * All rights reserved.
36 *36 *
37 * Redistribution and use in source and binary forms, with or without37 * Redistribution and use in source and binary forms, with or without
@@ -234,7 +234,7 @@ static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm)
234 .flags = cpu_to_le32(DTS_TRIGGER_CMD_FLAGS_TEMP),234 .flags = cpu_to_le32(DTS_TRIGGER_CMD_FLAGS_TEMP),
235 };235 };
236 struct iwl_ext_dts_measurement_cmd extcmd = {236 struct iwl_ext_dts_measurement_cmd extcmd = {
237 .control_mode = cpu_to_le32(DTS_AUTOMATIC),237 .control_mode = cpu_to_le32(DTS_DIRECT_WITHOUT_MEASURE),
238 };238 };
239 u32 cmdid;239 u32 cmdid;
240240
@@ -734,7 +734,8 @@ static struct thermal_zone_device_ops tzone_ops = {
734static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)734static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)
735{735{
736 int i;736 int i;
737 char name[] = "iwlwifi";737 char name[16];
738 static atomic_t counter = ATOMIC_INIT(0);
738739
739 if (!iwl_mvm_is_tt_in_fw(mvm)) {740 if (!iwl_mvm_is_tt_in_fw(mvm)) {
740 mvm->tz_device.tzone = NULL;741 mvm->tz_device.tzone = NULL;
@@ -744,6 +745,7 @@ static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)
744745
745 BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH);746 BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH);
746747
748 sprintf(name, "iwlwifi_%u", atomic_inc_return(&counter) & 0xFF);
747 mvm->tz_device.tzone = thermal_zone_device_register(name,749 mvm->tz_device.tzone = thermal_zone_device_register(name,
748 IWL_MAX_DTS_TRIPS,750 IWL_MAX_DTS_TRIPS,
749 IWL_WRITABLE_TRIPS_MSK,751 IWL_WRITABLE_TRIPS_MSK,
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
index 01f248b..27e94e6 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
@@ -5,7 +5,7 @@
5 *5 *
6 * GPL LICENSE SUMMARY6 * GPL LICENSE SUMMARY
7 *7 *
8 * Copyright(c) 2018 - 2019 Intel Corporation8 * Copyright(c) 2018 - 2020 Intel Corporation
9 *9 *
10 * This program is free software; you can redistribute it and/or modify10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as11 * it under the terms of version 2 of the GNU General Public License as
@@ -18,7 +18,7 @@
18 *18 *
19 * BSD LICENSE19 * BSD LICENSE
20 *20 *
21 * Copyright(c) 2018 - 2019 Intel Corporation21 * Copyright(c) 2018 - 2020 Intel Corporation
22 * All rights reserved.22 * All rights reserved.
23 *23 *
24 * Redistribution and use in source and binary forms, with or without24 * Redistribution and use in source and binary forms, with or without
@@ -84,32 +84,35 @@ iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans,
8484
85 fw_mon_cfg = &trans->dbg.fw_mon_cfg[alloc_id];85 fw_mon_cfg = &trans->dbg.fw_mon_cfg[alloc_id];
8686
87 if (le32_to_cpu(fw_mon_cfg->buf_location) ==87 switch (le32_to_cpu(fw_mon_cfg->buf_location)) {
88 IWL_FW_INI_LOCATION_SRAM_PATH) {88 case IWL_FW_INI_LOCATION_SRAM_PATH:
89 dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_INTERNAL;89 dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_INTERNAL;
90
91 IWL_DEBUG_FW(trans,90 IWL_DEBUG_FW(trans,
92 "WRT: Applying SMEM buffer destination\n");91 "WRT: Applying SMEM buffer destination\n");
9392 break;
94 goto out;
95 }
96
97 if (le32_to_cpu(fw_mon_cfg->buf_location) ==
98 IWL_FW_INI_LOCATION_DRAM_PATH &&
99 trans->dbg.fw_mon_ini[alloc_id].num_frags) {
100 struct iwl_dram_data *frag =
101 &trans->dbg.fw_mon_ini[alloc_id].frags[0];
102
103 dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_DRAM;
10493
94 case IWL_FW_INI_LOCATION_NPK_PATH:
95 dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_TB22DTF;
105 IWL_DEBUG_FW(trans,96 IWL_DEBUG_FW(trans,
106 "WRT: Applying DRAM destination (alloc_id=%u)\n",97 "WRT: Applying NPK buffer destination\n");
107 alloc_id);98 break;
10899
109 dbg_cfg->hwm_base_addr = cpu_to_le64(frag->physical);100 case IWL_FW_INI_LOCATION_DRAM_PATH:
110 dbg_cfg->hwm_size = cpu_to_le32(frag->size);101 if (trans->dbg.fw_mon_ini[alloc_id].num_frags) {
102 struct iwl_dram_data *frag =
103 &trans->dbg.fw_mon_ini[alloc_id].frags[0];
104 dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_DRAM;
105 dbg_cfg->hwm_base_addr = cpu_to_le64(frag->physical);
106 dbg_cfg->hwm_size = cpu_to_le32(frag->size);
107 IWL_DEBUG_FW(trans,
108 "WRT: Applying DRAM destination (alloc_id=%u, num_frags=%u)\n",
109 alloc_id,
110 trans->dbg.fw_mon_ini[alloc_id].num_frags);
111 }
112 break;
113 default:
114 IWL_ERR(trans, "WRT: Invalid buffer destination\n");
111 }115 }
112
113out:116out:
114 if (dbg_flags)117 if (dbg_flags)
115 *control_flags |= IWL_PRPH_SCRATCH_EARLY_DEBUG_EN | dbg_flags;118 *control_flags |= IWL_PRPH_SCRATCH_EARLY_DEBUG_EN | dbg_flags;
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 23c2aec..cbe49d9 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -338,8 +338,10 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
338/* Qu devices */338/* Qu devices */
339 {IWL_PCI_DEVICE(0x02F0, PCI_ANY_ID, iwl_qu_trans_cfg)},339 {IWL_PCI_DEVICE(0x02F0, PCI_ANY_ID, iwl_qu_trans_cfg)},
340 {IWL_PCI_DEVICE(0x06F0, PCI_ANY_ID, iwl_qu_trans_cfg)},340 {IWL_PCI_DEVICE(0x06F0, PCI_ANY_ID, iwl_qu_trans_cfg)},
341 {IWL_PCI_DEVICE(0x34F0, PCI_ANY_ID, iwl_qu_trans_cfg)},341
342 {IWL_PCI_DEVICE(0x3DF0, PCI_ANY_ID, iwl_qu_trans_cfg)},342 {IWL_PCI_DEVICE(0x34F0, PCI_ANY_ID, iwl_qu_medium_latency_trans_cfg)},
343 {IWL_PCI_DEVICE(0x3DF0, PCI_ANY_ID, iwl_qu_medium_latency_trans_cfg)},
344 {IWL_PCI_DEVICE(0x4DF0, PCI_ANY_ID, iwl_qu_medium_latency_trans_cfg)},
343345
344 {IWL_PCI_DEVICE(0x43F0, PCI_ANY_ID, iwl_qu_long_latency_trans_cfg)},346 {IWL_PCI_DEVICE(0x43F0, PCI_ANY_ID, iwl_qu_long_latency_trans_cfg)},
345 {IWL_PCI_DEVICE(0xA0F0, PCI_ANY_ID, iwl_qu_long_latency_trans_cfg)},347 {IWL_PCI_DEVICE(0xA0F0, PCI_ANY_ID, iwl_qu_long_latency_trans_cfg)},
@@ -356,12 +358,17 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
356 {IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_ty_gf_a0)},358 {IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_ty_gf_a0)},
357 {IWL_PCI_DEVICE(0x2725, 0x0510, iwlax210_2ax_cfg_ty_gf_a0)},359 {IWL_PCI_DEVICE(0x2725, 0x0510, iwlax210_2ax_cfg_ty_gf_a0)},
358 {IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_ty_gf_a0)},360 {IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_ty_gf_a0)},
359 {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax411_2ax_cfg_so_gf4_a0)},361 {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax411_2ax_cfg_sosnj_gf4_a0)},
360 {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},362 {IWL_PCI_DEVICE(0x2726, 0x0090, iwlax211_cfg_snj_gf_a0)},
361 {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},363 {IWL_PCI_DEVICE(0x2726, 0x00B0, iwlax411_2ax_cfg_sosnj_gf4_a0)},
362 {IWL_PCI_DEVICE(0x7A70, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},364 {IWL_PCI_DEVICE(0x2726, 0x0510, iwlax211_cfg_snj_gf_a0)},
363 {IWL_PCI_DEVICE(0x7A70, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},365 {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax211_2ax_cfg_so_gf_a0_long)},
366 {IWL_PCI_DEVICE(0x7A70, 0x00B0, iwlax411_2ax_cfg_so_gf4_a0_long)},
367 {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax211_2ax_cfg_so_gf_a0_long)},
368 {IWL_PCI_DEVICE(0x7A70, 0x0510, iwlax211_2ax_cfg_so_gf_a0_long)},
369 {IWL_PCI_DEVICE(0x7A70, 0x0A10, iwlax211_2ax_cfg_so_gf_a0_long)},
364 {IWL_PCI_DEVICE(0x7AF0, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},370 {IWL_PCI_DEVICE(0x7AF0, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},
371 {IWL_PCI_DEVICE(0x7AF0, 0x00B0, iwlax411_2ax_cfg_so_gf4_a0)},
365 {IWL_PCI_DEVICE(0x7AF0, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},372 {IWL_PCI_DEVICE(0x7AF0, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},
366 {IWL_PCI_DEVICE(0x7AF0, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},373 {IWL_PCI_DEVICE(0x7AF0, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},
367 {IWL_PCI_DEVICE(0x7AF0, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},374 {IWL_PCI_DEVICE(0x7AF0, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},
@@ -461,6 +468,32 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
461 IWL_DEV_INFO(0x34F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),468 IWL_DEV_INFO(0x34F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),
462 IWL_DEV_INFO(0x34F0, 0x4244, iwl_ax101_cfg_qu_hr, NULL),469 IWL_DEV_INFO(0x34F0, 0x4244, iwl_ax101_cfg_qu_hr, NULL),
463470
471 IWL_DEV_INFO(0x3DF0, 0x0044, iwl_ax101_cfg_qu_hr, NULL),
472 IWL_DEV_INFO(0x3DF0, 0x0070, iwl_ax201_cfg_qu_hr, NULL),
473 IWL_DEV_INFO(0x3DF0, 0x0074, iwl_ax201_cfg_qu_hr, NULL),
474 IWL_DEV_INFO(0x3DF0, 0x0078, iwl_ax201_cfg_qu_hr, NULL),
475 IWL_DEV_INFO(0x3DF0, 0x007C, iwl_ax201_cfg_qu_hr, NULL),
476 IWL_DEV_INFO(0x3DF0, 0x0244, iwl_ax101_cfg_qu_hr, NULL),
477 IWL_DEV_INFO(0x3DF0, 0x0310, iwl_ax201_cfg_qu_hr, NULL),
478 IWL_DEV_INFO(0x3DF0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL),
479 IWL_DEV_INFO(0x3DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL),
480 IWL_DEV_INFO(0x3DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL),
481 IWL_DEV_INFO(0x3DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),
482 IWL_DEV_INFO(0x3DF0, 0x4244, iwl_ax101_cfg_qu_hr, NULL),
483
484 IWL_DEV_INFO(0x4DF0, 0x0044, iwl_ax101_cfg_qu_hr, NULL),
485 IWL_DEV_INFO(0x4DF0, 0x0070, iwl_ax201_cfg_qu_hr, NULL),
486 IWL_DEV_INFO(0x4DF0, 0x0074, iwl_ax201_cfg_qu_hr, NULL),
487 IWL_DEV_INFO(0x4DF0, 0x0078, iwl_ax201_cfg_qu_hr, NULL),
488 IWL_DEV_INFO(0x4DF0, 0x007C, iwl_ax201_cfg_qu_hr, NULL),
489 IWL_DEV_INFO(0x4DF0, 0x0244, iwl_ax101_cfg_qu_hr, NULL),
490 IWL_DEV_INFO(0x4DF0, 0x0310, iwl_ax201_cfg_qu_hr, NULL),
491 IWL_DEV_INFO(0x4DF0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL),
492 IWL_DEV_INFO(0x4DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL),
493 IWL_DEV_INFO(0x4DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL),
494 IWL_DEV_INFO(0x4DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),
495 IWL_DEV_INFO(0x4DF0, 0x4244, iwl_ax101_cfg_qu_hr, NULL),
496
464 IWL_DEV_INFO(0x2720, 0x0000, iwl22000_2ax_cfg_qnj_hr_b0, NULL),497 IWL_DEV_INFO(0x2720, 0x0000, iwl22000_2ax_cfg_qnj_hr_b0, NULL),
465 IWL_DEV_INFO(0x2720, 0x0040, iwl22000_2ax_cfg_qnj_hr_b0, NULL),498 IWL_DEV_INFO(0x2720, 0x0040, iwl22000_2ax_cfg_qnj_hr_b0, NULL),
466 IWL_DEV_INFO(0x2720, 0x0044, iwl22000_2ax_cfg_qnj_hr_b0, NULL),499 IWL_DEV_INFO(0x2720, 0x0044, iwl22000_2ax_cfg_qnj_hr_b0, NULL),
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index e646ac3..54f57f2 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -1055,21 +1055,8 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans,
1055 return ret;1055 return ret;
1056 }1056 }
10571057
1058 /* supported for 7000 only for the moment */1058 if (iwl_pcie_dbg_on(trans))
1059 if (iwlwifi_mod_params.fw_monitor &&
1060 trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_7000) {
1061 struct iwl_dram_data *fw_mon = &trans->dbg.fw_mon;
1062
1063 iwl_pcie_alloc_fw_monitor(trans, 0);
1064 if (fw_mon->size) {
1065 iwl_write_prph(trans, MON_BUFF_BASE_ADDR,
1066 fw_mon->physical >> 4);
1067 iwl_write_prph(trans, MON_BUFF_END_ADDR,
1068 (fw_mon->physical + fw_mon->size) >> 4);
1069 }
1070 } else if (iwl_pcie_dbg_on(trans)) {
1071 iwl_pcie_apply_destination(trans);1059 iwl_pcie_apply_destination(trans);
1072 }
10731060
1074#ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE1061#ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE
1075 iwl_dnt_configure(trans, image);1062 iwl_dnt_configure(trans, image);
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
index bd35097..3478ee8 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -340,7 +340,7 @@ static int iwl_pcie_gen2_set_tb_with_wa(struct iwl_trans *trans,
340 }340 }
341 IWL_WARN(trans,341 IWL_WARN(trans,
342 "TB bug workaround: copied %d bytes from 0x%llx to 0x%llx\n",342 "TB bug workaround: copied %d bytes from 0x%llx to 0x%llx\n",
343 len, oldphys, phys);343 len, (unsigned long long)oldphys, (unsigned long long)phys);
344344
345 ret = 0;345 ret = 0;
346unmap:346unmap:
diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/fw.c b/drivers/net/wireless/intel/iwlwifi/xvt/fw.c
index 6755e7d..392e0da 100644
--- a/drivers/net/wireless/intel/iwlwifi/xvt/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/xvt/fw.c
@@ -360,6 +360,9 @@ int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type)
360 iwl_trans_stop_device(xvt->trans);360 iwl_trans_stop_device(xvt->trans);
361 }361 }
362362
363 iwl_dbg_tlv_time_point(&xvt->fwrt, IWL_FW_INI_TIME_POINT_AFTER_ALIVE,
364 NULL);
365
363 if (iwl_xvt_is_unified_fw(xvt)) {366 if (iwl_xvt_is_unified_fw(xvt)) {
364 ret = iwl_xvt_send_extended_config(xvt);367 ret = iwl_xvt_send_extended_config(xvt);
365 if (ret) {368 if (ret) {
@@ -377,11 +380,13 @@ int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type)
377 IWL_UCODE_TLV_CAPA_SET_LTR_GEN2)))380 IWL_UCODE_TLV_CAPA_SET_LTR_GEN2)))
378 WARN_ON(iwl_xvt_config_ltr(xvt));381 WARN_ON(iwl_xvt_config_ltr(xvt));
379382
380 xvt->fwrt.dump.conf = FW_DBG_INVALID;383 if (!iwl_trans_dbg_ini_valid(xvt->trans)) {
381 /* if we have a destination, assume EARLY START */384 xvt->fwrt.dump.conf = FW_DBG_INVALID;
382 if (xvt->fw->dbg.dest_tlv)385 /* if we have a destination, assume EARLY START */
383 xvt->fwrt.dump.conf = FW_DBG_START_FROM_ALIVE;386 if (xvt->fw->dbg.dest_tlv)
384 iwl_fw_start_dbg_conf(&xvt->fwrt, FW_DBG_START_FROM_ALIVE);387 xvt->fwrt.dump.conf = FW_DBG_START_FROM_ALIVE;
388 iwl_fw_start_dbg_conf(&xvt->fwrt, FW_DBG_START_FROM_ALIVE);
389 }
385390
386 return ret;391 return ret;
387}392}
diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c b/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c
index 5cca001..4fda9a7 100644
--- a/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c
+++ b/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c
@@ -85,6 +85,7 @@
85#include "iwl-trans.h"85#include "iwl-trans.h"
86#include "fw/dbg.h"86#include "fw/dbg.h"
87#include "fw/acpi.h"87#include "fw/acpi.h"
88#include "fw/img.h"
8889
89#define XVT_UCODE_CALIB_TIMEOUT (CPTCFG_IWL_TIMEOUT_FACTOR * HZ)90#define XVT_UCODE_CALIB_TIMEOUT (CPTCFG_IWL_TIMEOUT_FACTOR * HZ)
90#define XVT_SCU_BASE (0xe6a00000)91#define XVT_SCU_BASE (0xe6a00000)
@@ -310,7 +311,7 @@ static int iwl_xvt_set_sw_config(struct iwl_xvt *xvt,
310{311{
311 struct iwl_xvt_sw_cfg_request *sw_cfg =312 struct iwl_xvt_sw_cfg_request *sw_cfg =
312 (struct iwl_xvt_sw_cfg_request *)data_in->data;313 (struct iwl_xvt_sw_cfg_request *)data_in->data;
313 struct iwl_phy_cfg_cmd *fw_calib_cmd_cfg =314 struct iwl_phy_cfg_cmd_v3 *fw_calib_cmd_cfg =
314 xvt->sw_stack_cfg.fw_calib_cmd_cfg;315 xvt->sw_stack_cfg.fw_calib_cmd_cfg;
315 __le32 cfg_mask = cpu_to_le32(sw_cfg->cfg_mask),316 __le32 cfg_mask = cpu_to_le32(sw_cfg->cfg_mask),
316 fw_calib_event, fw_calib_flow,317 fw_calib_event, fw_calib_flow,
@@ -370,7 +371,7 @@ static int iwl_xvt_get_sw_config(struct iwl_xvt *xvt,
370{371{
371 struct iwl_xvt_sw_cfg_request *get_cfg_req;372 struct iwl_xvt_sw_cfg_request *get_cfg_req;
372 struct iwl_xvt_sw_cfg_request *sw_cfg;373 struct iwl_xvt_sw_cfg_request *sw_cfg;
373 struct iwl_phy_cfg_cmd *fw_calib_cmd_cfg =374 struct iwl_phy_cfg_cmd_v3 *fw_calib_cmd_cfg =
374 xvt->sw_stack_cfg.fw_calib_cmd_cfg;375 xvt->sw_stack_cfg.fw_calib_cmd_cfg;
375 __le32 event_trigger, flow_trigger;376 __le32 event_trigger, flow_trigger;
376 int i, u;377 int i, u;
@@ -425,9 +426,10 @@ static int iwl_xvt_get_sw_config(struct iwl_xvt *xvt,
425426
426static int iwl_xvt_send_phy_cfg_cmd(struct iwl_xvt *xvt, u32 ucode_type)427static int iwl_xvt_send_phy_cfg_cmd(struct iwl_xvt *xvt, u32 ucode_type)
427{428{
428 struct iwl_phy_cfg_cmd *calib_cmd_cfg =429 struct iwl_phy_cfg_cmd_v3 *calib_cmd_cfg =
429 &xvt->sw_stack_cfg.fw_calib_cmd_cfg[ucode_type];430 &xvt->sw_stack_cfg.fw_calib_cmd_cfg[ucode_type];
430 int err;431 int err;
432 size_t cmd_size;
431433
432 IWL_DEBUG_INFO(xvt, "Sending Phy CFG command: 0x%x\n",434 IWL_DEBUG_INFO(xvt, "Sending Phy CFG command: 0x%x\n",
433 calib_cmd_cfg->phy_cfg);435 calib_cmd_cfg->phy_cfg);
@@ -437,10 +439,14 @@ static int iwl_xvt_send_phy_cfg_cmd(struct iwl_xvt *xvt, u32 ucode_type)
437 calib_cmd_cfg->calib_control.event_trigger = 0;439 calib_cmd_cfg->calib_control.event_trigger = 0;
438 calib_cmd_cfg->calib_control.flow_trigger = 0;440 calib_cmd_cfg->calib_control.flow_trigger = 0;
439 }441 }
442 cmd_size = iwl_fw_lookup_cmd_ver(xvt->fw, IWL_ALWAYS_LONG_GROUP,
443 PHY_CONFIGURATION_CMD) == 3 ?
444 sizeof(struct iwl_phy_cfg_cmd_v3) :
445 sizeof(struct iwl_phy_cfg_cmd_v1);
440446
441 /* Sending calibration configuration control data */447 /* Sending calibration configuration control data */
442 err = iwl_xvt_send_cmd_pdu(xvt, PHY_CONFIGURATION_CMD, 0,448 err = iwl_xvt_send_cmd_pdu(xvt, PHY_CONFIGURATION_CMD, 0,
443 sizeof(*calib_cmd_cfg), calib_cmd_cfg);449 cmd_size, calib_cmd_cfg);
444 if (err)450 if (err)
445 IWL_ERR(xvt, "Error (%d) running INIT calibrations control\n",451 IWL_ERR(xvt, "Error (%d) running INIT calibrations control\n",
446 err);452 err);
diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h b/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h
index fd88766..005ad0b 100644
--- a/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h
+++ b/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h
@@ -191,13 +191,13 @@ struct tx_payload {
191/**191/**
192 * iwl_sw_stack_config - Holds active SW stack config as set from user space192 * iwl_sw_stack_config - Holds active SW stack config as set from user space
193 * @load_mask: Which FW are to be loaded during SW stack up193 * @load_mask: Which FW are to be loaded during SW stack up
194 * @iwl_phy_cfg_cmd: Which calibrations should be done194 * @fw_calib_cmd_cfg: Which calibrations should be done
195 */195 */
196struct iwl_sw_stack_config {196struct iwl_sw_stack_config {
197 u32 load_mask;197 u32 load_mask;
198 u32 calib_override_mask;198 u32 calib_override_mask;
199 u32 fw_dbg_flags;199 u32 fw_dbg_flags;
200 struct iwl_phy_cfg_cmd fw_calib_cmd_cfg[IWL_UCODE_TYPE_MAX];200 struct iwl_phy_cfg_cmd_v3 fw_calib_cmd_cfg[IWL_UCODE_TYPE_MAX];
201};201};
202202
203/* Note: This structure is read from the device with IO accesses,203/* Note: This structure is read from the device with IO accesses,
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 5444959..5a8df7a 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1439,9 +1439,7 @@ struct ieee80211_ht_operation {
1439#define IEEE80211_AP_INFO_TBTT_HDR_FILTERED 0x41439#define IEEE80211_AP_INFO_TBTT_HDR_FILTERED 0x4
1440#define IEEE80211_AP_INFO_TBTT_HDR_COLOC 0x81440#define IEEE80211_AP_INFO_TBTT_HDR_COLOC 0x8
1441#define IEEE80211_AP_INFO_TBTT_HDR_COUNT 0xF01441#define IEEE80211_AP_INFO_TBTT_HDR_COUNT 0xF0
1442#define IEEE80211_TBTT_INFO_OFFSET_BSSID 7
1443#define IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM 81442#define IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM 8
1444#define IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID 11
1445#define IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM 121443#define IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM 12
14461444
1447#define IEEE80211_RNR_TBTT_PARAMS_OCT_RECOMMENDED 0x11445#define IEEE80211_RNR_TBTT_PARAMS_OCT_RECOMMENDED 0x1
@@ -1450,6 +1448,7 @@ struct ieee80211_ht_operation {
1450#define IEEE80211_RNR_TBTT_PARAMS_TRANSMITTED_BSSID 0x81448#define IEEE80211_RNR_TBTT_PARAMS_TRANSMITTED_BSSID 0x8
1451#define IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS 0x101449#define IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS 0x10
1452#define IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE 0x201450#define IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE 0x20
1451#define IEEE80211_RNR_TBTT_PARAMS_COLOC_AP 0x40
14531452
1454struct cfg80211_neighbor_ap_info {1453struct cfg80211_neighbor_ap_info {
1455 u8 tbtt_info_hdr;1454 u8 tbtt_info_hdr;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 67335a7..05b9404 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -8,7 +8,7 @@
8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
9 * Copyright 2013-2014 Intel Mobile Communications GmbH9 * Copyright 2013-2014 Intel Mobile Communications GmbH
10 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH10 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
11 * Copyright (C) 2018 - 2019 Intel Corporation11 * Copyright (C) 2018 - 2020 Intel Corporation
12 */12 */
1313
14#include <linux/delay.h>14#include <linux/delay.h>
@@ -193,21 +193,25 @@ ieee80211_determine_chantype_6ghz(struct ieee80211_sub_if_data *sdata,
193 he_chandef.width = NL80211_CHAN_WIDTH_80;193 he_chandef.width = NL80211_CHAN_WIDTH_80;
194 break;194 break;
195 case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ:195 case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ:
196 /* FIXME: not sure this is right - the spec is weird */196 if (abs(he_6ghz_oper->ccfs1 - he_6ghz_oper->ccfs0) == 8)
197 if (he_6ghz_oper->ccfs1)
198 he_chandef.width = NL80211_CHAN_WIDTH_80P80;
199 else
200 he_chandef.width = NL80211_CHAN_WIDTH_160;197 he_chandef.width = NL80211_CHAN_WIDTH_160;
198 else
199 he_chandef.width = NL80211_CHAN_WIDTH_80P80;
201 break;200 break;
202 }201 }
203202
204 he_chandef.center_freq1 =203 if (he_chandef.width == NL80211_CHAN_WIDTH_160) {
205 ieee80211_channel_to_frequency(he_6ghz_oper->ccfs0,204 he_chandef.center_freq1 =
206 NL80211_BAND_6GHZ);205 ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1,
207 he_chandef.center_freq2 =206 NL80211_BAND_6GHZ);
208 ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1,207 } else {
209 NL80211_BAND_6GHZ);208 he_chandef.center_freq1 =
210209 ieee80211_channel_to_frequency(he_6ghz_oper->ccfs0,
210 NL80211_BAND_6GHZ);
211 he_chandef.center_freq2 =
212 ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1,
213 NL80211_BAND_6GHZ);
214 }
211 if (!cfg80211_chandef_valid(&he_chandef)) {215 if (!cfg80211_chandef_valid(&he_chandef)) {
212 sdata_info(sdata,216 sdata_info(sdata,
213 "HE 6GHz operation resulted in invalid chandef: %d MHz/%d/%d MHz/%d MHz\n",217 "HE 6GHz operation resulted in invalid chandef: %d MHz/%d/%d MHz/%d MHz\n",
@@ -403,8 +407,8 @@ out:
403 ret |= ieee80211_chandef_downgrade(chandef);407 ret |= ieee80211_chandef_downgrade(chandef);
404 }408 }
405409
406 if (!cfg80211_chandef_usable(sdata->wdev.wiphy, chandef,410 if (!he_oper || !cfg80211_chandef_usable(sdata->wdev.wiphy, chandef,
407 IEEE80211_CHAN_NO_HE))411 IEEE80211_CHAN_NO_HE))
408 ret |= IEEE80211_STA_DISABLE_HE;412 ret |= IEEE80211_STA_DISABLE_HE;
409413
410 if (chandef->width != vht_chandef.width && !tracking)414 if (chandef->width != vht_chandef.width && !tracking)
@@ -779,6 +783,13 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
779 struct ieee80211_chanctx_conf *chanctx_conf;783 struct ieee80211_chanctx_conf *chanctx_conf;
780 struct ieee80211_channel *chan;784 struct ieee80211_channel *chan;
781 u32 rates = 0;785 u32 rates = 0;
786 struct element *ext_capa = NULL;
787
788 /* we know it's writable, cast away the const */
789 if (assoc_data->ie_len)
790 ext_capa = (void *)cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY,
791 assoc_data->ie,
792 assoc_data->ie_len);
782793
783 sdata_assert_lock(sdata);794 sdata_assert_lock(sdata);
784795
@@ -929,7 +940,15 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
929 *pos++ = ieee80211_chandef_max_power(&chanctx_conf->def);940 *pos++ = ieee80211_chandef_max_power(&chanctx_conf->def);
930 }941 }
931942
932 if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) {943 /*
944 * Per spec, we shouldn't include the list of channels if we advertise
945 * support for extended channel switching, but we've always done that;
946 * (for now?) apply this restriction only on the (new) 6 GHz band.
947 */
948 if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT &&
949 (sband->band != NL80211_BAND_6GHZ ||
950 !ext_capa || ext_capa->datalen < 1 ||
951 !(ext_capa->data[0] & WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING))) {
933 /* TODO: get this in reg domain format */952 /* TODO: get this in reg domain format */
934 pos = skb_put(skb, 2 * sband->n_channels + 2);953 pos = skb_put(skb, 2 * sband->n_channels + 2);
935 *pos++ = WLAN_EID_SUPPORTED_CHANNELS;954 *pos++ = WLAN_EID_SUPPORTED_CHANNELS;
@@ -943,18 +962,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
943962
944 /* Set MBSSID support for HE AP if needed */963 /* Set MBSSID support for HE AP if needed */
945 if (ieee80211_hw_check(&local->hw, SUPPORTS_ONLY_HE_MULTI_BSSID) &&964 if (ieee80211_hw_check(&local->hw, SUPPORTS_ONLY_HE_MULTI_BSSID) &&
946 !(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && assoc_data->ie_len) {965 !(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && assoc_data->ie_len &&
947 struct element *elem;966 ext_capa && ext_capa->datalen >= 3)
948967 ext_capa->data[2] |= WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT;
949 /* we know it's writable, cast away the const */
950 elem = (void *)cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY,
951 assoc_data->ie,
952 assoc_data->ie_len);
953
954 /* We can probably assume both always true */
955 if (elem && elem->datalen >= 3)
956 elem->data[2] |= WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT;
957 }
958968
959 /* if present, add any custom IEs that go before HT */969 /* if present, add any custom IEs that go before HT */
960 if (assoc_data->ie_len) {970 if (assoc_data->ie_len) {
@@ -1445,7 +1455,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1445 if (!res) {1455 if (!res) {
1446 ch_switch.timestamp = timestamp;1456 ch_switch.timestamp = timestamp;
1447 ch_switch.device_timestamp = device_timestamp;1457 ch_switch.device_timestamp = device_timestamp;
1448 ch_switch.block_tx = beacon ? csa_ie.mode : 0;1458 ch_switch.block_tx = csa_ie.mode;
1449 ch_switch.chandef = csa_ie.chandef;1459 ch_switch.chandef = csa_ie.chandef;
1450 ch_switch.count = csa_ie.count;1460 ch_switch.count = csa_ie.count;
1451 ch_switch.delay = csa_ie.max_switch_time;1461 ch_switch.delay = csa_ie.max_switch_time;
@@ -1538,7 +1548,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
15381548
1539 sdata->vif.csa_active = true;1549 sdata->vif.csa_active = true;
1540 sdata->csa_chandef = csa_ie.chandef;1550 sdata->csa_chandef = csa_ie.chandef;
1541 sdata->csa_block_tx = ch_switch.block_tx;1551 sdata->csa_block_tx = csa_ie.mode;
1542 ifmgd->csa_ignored_same_chan = false;1552 ifmgd->csa_ignored_same_chan = false;
15431553
1544 if (sdata->csa_block_tx)1554 if (sdata->csa_block_tx)
@@ -1572,7 +1582,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1572 * reset when the disconnection worker runs.1582 * reset when the disconnection worker runs.
1573 */1583 */
1574 sdata->vif.csa_active = true;1584 sdata->vif.csa_active = true;
1575 sdata->csa_block_tx = ch_switch.block_tx;1585 sdata->csa_block_tx = csa_ie.mode;
15761586
1577 ieee80211_queue_work(&local->hw, &ifmgd->csa_connection_drop_work);1587 ieee80211_queue_work(&local->hw, &ifmgd->csa_connection_drop_work);
1578 mutex_unlock(&local->chanctx_mtx);1588 mutex_unlock(&local->chanctx_mtx);
@@ -3777,13 +3787,28 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata,
3777 struct ieee80211_mgmt *mgmt = (void *)skb->data;3787 struct ieee80211_mgmt *mgmt = (void *)skb->data;
3778 struct ieee80211_if_managed *ifmgd;3788 struct ieee80211_if_managed *ifmgd;
3779 struct ieee80211_rx_status *rx_status = (void *) skb->cb;3789 struct ieee80211_rx_status *rx_status = (void *) skb->cb;
3790 struct ieee80211_channel *channel;
3780 size_t baselen, len = skb->len;3791 size_t baselen, len = skb->len;
37813792
3782 ifmgd = &sdata->u.mgd;3793 ifmgd = &sdata->u.mgd;
37833794
3784 sdata_assert_lock(sdata);3795 sdata_assert_lock(sdata);
37853796
3786 if (!ether_addr_equal(mgmt->da, sdata->vif.addr))3797 /*
3798 * According to Draft P802.11ax D6.0 clause 26.17.2.3.2:
3799 * "If a 6 GHz AP receives a Probe Request frame and responds with
3800 * a Probe Response frame [..], the Address 1 field of the Probe
3801 * Response frame shall be set to the broadcast address [..]"
3802 * So, on 6GHz band we should also accept broadcast responses.
3803 */
3804 channel = ieee80211_get_channel(sdata->local->hw.wiphy,
3805 rx_status->freq);
3806 if (!channel)
3807 return;
3808
3809 if (!ether_addr_equal(mgmt->da, sdata->vif.addr) &&
3810 (channel->band != NL80211_BAND_6GHZ ||
3811 !is_broadcast_ether_addr(mgmt->da)))
3787 return; /* ignore ProbeResp to foreign address */3812 return; /* ignore ProbeResp to foreign address */
37883813
3789 baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;3814 baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 3c4ff6c..e5bc6ec 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -385,7 +385,7 @@ void cfg80211_mlme_down(struct cfg80211_registered_device *rdev,
385 struct net_device *dev);385 struct net_device *dev);
386int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,386int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid,
387 u16 frame_type, const u8 *match_data,387 u16 frame_type, const u8 *match_data,
388 int match_len);388 int match_len, struct netlink_ext_ack *extack);
389void cfg80211_mlme_unreg_wk(struct work_struct *wk);389void cfg80211_mlme_unreg_wk(struct work_struct *wk);
390void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid);390void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid);
391void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev);391void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev);
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 1b5cf1a..0657c5a 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -4,6 +4,7 @@
4 *4 *
5 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>5 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
6 * Copyright (c) 2015 Intel Deutschland GmbH6 * Copyright (c) 2015 Intel Deutschland GmbH
7 * Copyright (C) 2019 Intel Corporation
7 */8 */
89
9#include <linux/kernel.h>10#include <linux/kernel.h>
@@ -470,7 +471,7 @@ void cfg80211_mlme_unreg_wk(struct work_struct *wk)
470471
471int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,472int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,
472 u16 frame_type, const u8 *match_data,473 u16 frame_type, const u8 *match_data,
473 int match_len)474 int match_len, struct netlink_ext_ack *extack)
474{475{
475 struct wiphy *wiphy = wdev->wiphy;476 struct wiphy *wiphy = wdev->wiphy;
476 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);477 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
@@ -481,15 +482,38 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,
481 if (!wdev->wiphy->mgmt_stypes)482 if (!wdev->wiphy->mgmt_stypes)
482 return -EOPNOTSUPP;483 return -EOPNOTSUPP;
483484
484 if ((frame_type & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT)485 if ((frame_type & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) {
486 NL_SET_ERR_MSG(extack, "frame type not management");
485 return -EINVAL;487 return -EINVAL;
488 }
486489
487 if (frame_type & ~(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE))490 if (frame_type & ~(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) {
491 NL_SET_ERR_MSG(extack, "Invalid frame type");
488 return -EINVAL;492 return -EINVAL;
493 }
489494
490 mgmt_type = (frame_type & IEEE80211_FCTL_STYPE) >> 4;495 mgmt_type = (frame_type & IEEE80211_FCTL_STYPE) >> 4;
491 if (!(wdev->wiphy->mgmt_stypes[wdev->iftype].rx & BIT(mgmt_type)))496 if (!(wdev->wiphy->mgmt_stypes[wdev->iftype].rx & BIT(mgmt_type))) {
497 NL_SET_ERR_MSG(extack,
498 "Registration to specific type not supported");
499 return -EINVAL;
500 }
501
502 /*
503 * To support Pre Association Security Negotiation (PASN), registration
504 * for authentication frames should be supported. However, as some
505 * versions of the user space daemons wrongly register to all types of
506 * authentication frames (which might result in unexpected behavior)
507 * allow such registration if the request is for a specific
508 * authentication algorithm number.
509 */
510 if (wdev->iftype == NL80211_IFTYPE_STATION &&
511 (frame_type & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_AUTH &&
512 !(match_data && match_len >= 2)) {
513 NL_SET_ERR_MSG(extack,
514 "Authentication algorithm number required");
492 return -EINVAL;515 return -EINVAL;
516 }
493517
494 nreg = kzalloc(sizeof(*reg) + match_len, GFP_KERNEL);518 nreg = kzalloc(sizeof(*reg) + match_len, GFP_KERNEL);
495 if (!nreg)519 if (!nreg)
@@ -504,6 +528,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid,
504 continue;528 continue;
505529
506 if (memcmp(reg->match, match_data, mlen) == 0) {530 if (memcmp(reg->match, match_data, mlen) == 0) {
531 NL_SET_ERR_MSG(extack, "Match already configured");
507 err = -EALREADY;532 err = -EALREADY;
508 break;533 break;
509 }534 }
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 56d8559..fa70b33 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10430,7 +10430,8 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
10430 return cfg80211_mlme_register_mgmt(wdev, genl_info_snd_portid(info),10430 return cfg80211_mlme_register_mgmt(wdev, genl_info_snd_portid(info),
10431 frame_type,10431 frame_type,
10432 nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]),10432 nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]),
10433 nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]));10433 nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]),
10434 genl_info_extack(info));
10434}10435}
1043510436
10436static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)10437static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index ac6cf47..eeef8d9 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -484,8 +484,8 @@ static bool cfg80211_bss_expire_oldest(struct cfg80211_registered_device *rdev)
484 return ret;484 return ret;
485}485}
486486
487static void cfg80211_parse_bss_param(u8 data,487static u8 cfg80211_parse_bss_param(u8 data,
488 struct cfg80211_colocated_ap *coloc_ap)488 struct cfg80211_colocated_ap *coloc_ap)
489{489{
490 coloc_ap->oct_recommended =490 coloc_ap->oct_recommended =
491 u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_OCT_RECOMMENDED);491 u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_OCT_RECOMMENDED);
@@ -499,6 +499,8 @@ static void cfg80211_parse_bss_param(u8 data,
499 u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE);499 u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE);
500 coloc_ap->colocated_ess =500 coloc_ap->colocated_ess =
501 u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS);501 u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS);
502
503 return u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_COLOC_AP);
502}504}
503505
504static int cfg80211_calc_short_ssid(const struct cfg80211_bss_ies *ies,506static int cfg80211_calc_short_ssid(const struct cfg80211_bss_ies *ies,
@@ -524,7 +526,7 @@ static void cfg80211_free_coloc_ap_list(struct list_head *coloc_ap_list)
524}526}
525527
526static int cfg80211_parse_ap_info(struct cfg80211_colocated_ap *entry,528static int cfg80211_parse_ap_info(struct cfg80211_colocated_ap *entry,
527 const u8 *pos, u8 length, bool filtered,529 const u8 *pos, u8 length,
528 const struct element *ssid_elem,530 const struct element *ssid_elem,
529 int s_ssid_tmp)531 int s_ssid_tmp)
530{532{
@@ -534,25 +536,24 @@ static int cfg80211_parse_ap_info(struct cfg80211_colocated_ap *entry,
534 memcpy(entry->bssid, pos, ETH_ALEN);536 memcpy(entry->bssid, pos, ETH_ALEN);
535 pos += ETH_ALEN;537 pos += ETH_ALEN;
536538
537 if (length == IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID ||539 if (length == IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM) {
538 length ==
539 IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM) {
540 memcpy(&entry->short_ssid, pos,540 memcpy(&entry->short_ssid, pos,
541 sizeof(entry->short_ssid));541 sizeof(entry->short_ssid));
542 pos += 4;542 pos += 4;
543 }543 }
544544
545 if (length ==545 /* skip non colocated APs */
546 IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM) {546 if (!cfg80211_parse_bss_param(*pos, entry))
547 cfg80211_parse_bss_param(*pos, entry);547 return -EINVAL;
548 pos++;548 pos++;
549549
550 if (length == IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM) {
550 /* no information about the short ssid - ignore it */551 /* no information about the short ssid - ignore it */
551 if (!entry->same_ssid)552 if (!entry->same_ssid)
552 return -EINVAL;553 return -EINVAL;
553 }554 }
554555
555 if (entry->same_ssid || filtered) {556 if (entry->same_ssid) {
556 entry->short_ssid = s_ssid_tmp;557 entry->short_ssid = s_ssid_tmp;
557 memcpy(&entry->ssid, &ssid_elem->data,558 memcpy(&entry->ssid, &ssid_elem->data,
558 ssid_elem->datalen);559 ssid_elem->datalen);
@@ -584,37 +585,35 @@ static int cfg80211_parse_colocated_ap(const struct cfg80211_bss_ies *ies,
584585
585 /* RNR IE may contain more than one NEIGHBOR_AP_INFO */586 /* RNR IE may contain more than one NEIGHBOR_AP_INFO */
586 while (pos + IEEE80211_MIN_AP_NEIGHBOR_INFO_SIZE <= end) {587 while (pos + IEEE80211_MIN_AP_NEIGHBOR_INFO_SIZE <= end) {
587 bool filtered, colocated;
588 struct cfg80211_neighbor_ap_info *ap_info;588 struct cfg80211_neighbor_ap_info *ap_info;
589 enum nl80211_band band;589 enum nl80211_band band;
590 int freq;590 int freq;
591 u8 length, i, count;591 u8 length, i, count;
592592
593 ap_info = (struct cfg80211_neighbor_ap_info *)pos;593 ap_info = (struct cfg80211_neighbor_ap_info *)pos;
594 filtered = u8_get_bits(ap_info->tbtt_info_hdr,
595 IEEE80211_AP_INFO_TBTT_HDR_FILTERED);
596 colocated = u8_get_bits(ap_info->tbtt_info_hdr,
597 IEEE80211_AP_INFO_TBTT_HDR_COLOC);
598 count = u8_get_bits(ap_info->tbtt_info_hdr,594 count = u8_get_bits(ap_info->tbtt_info_hdr,
599 IEEE80211_AP_INFO_TBTT_HDR_COUNT) + 1;595 IEEE80211_AP_INFO_TBTT_HDR_COUNT) + 1;
600 length = ap_info->tbtt_info_len;596 length = ap_info->tbtt_info_len;
601597
602 pos += sizeof(*ap_info);598 pos += sizeof(*ap_info);
603599
604 ieee80211_operating_class_to_band(ap_info->op_class, &band);600 if (!ieee80211_operating_class_to_band(ap_info->op_class,
601 &band))
602 break;
603
605 freq = ieee80211_channel_to_frequency(ap_info->channel, band);604 freq = ieee80211_channel_to_frequency(ap_info->channel, band);
606605
607 if (end - pos < count * ap_info->tbtt_info_len)606 if (end - pos < count * ap_info->tbtt_info_len)
608 return 0;607 break;
609608
610 /*609 /*
611 * TBTT info must include both BSSID and (short SSID or SSID)610 * TBTT info must include bss param + BSSID +
612 * ignore other options, and move to the next AP info611 * (short SSID or same_ssid bit to be set).
612 * ignore other options, and move to the
613 * next AP info
613 */614 */
614 if (!colocated || band != NL80211_BAND_6GHZ ||615 if (band != NL80211_BAND_6GHZ ||
615 (length != IEEE80211_TBTT_INFO_OFFSET_BSSID &&616 (length != IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM &&
616 length != IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM &&
617 length != IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID &&
618 length < IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM)) {617 length < IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM)) {
619 pos += count * ap_info->tbtt_info_len;618 pos += count * ap_info->tbtt_info_len;
620 continue;619 continue;
@@ -626,15 +625,12 @@ static int cfg80211_parse_colocated_ap(const struct cfg80211_bss_ies *ies,
626 entry = kzalloc(sizeof(*entry) + IEEE80211_MAX_SSID_LEN,625 entry = kzalloc(sizeof(*entry) + IEEE80211_MAX_SSID_LEN,
627 GFP_ATOMIC);626 GFP_ATOMIC);
628627
629 if (!entry) {628 if (!entry)
630 cfg80211_free_coloc_ap_list(&ap_list);629 break;
631 return 0;
632 }
633630
634 entry->center_freq = freq;631 entry->center_freq = freq;
635632
636 if (!cfg80211_parse_ap_info(entry, pos, length,633 if (!cfg80211_parse_ap_info(entry, pos, length, elem,
637 filtered, elem,
638 s_ssid_tmp)){634 s_ssid_tmp)){
639 n_coloc++;635 n_coloc++;
640 list_add_tail(&entry->list, &ap_list);636 list_add_tail(&entry->list, &ap_list);
diff --git a/versions b/versions
index e38a8a8..a3eee32 100644
--- a/versions
+++ b/versions
@@ -2,4 +2,4 @@ BACKPORTS_VERSION="(see git)"
2BACKPORTED_KERNEL_VERSION="(see git)"2BACKPORTED_KERNEL_VERSION="(see git)"
3BACKPORTED_KERNEL_NAME="iwlwifi"3BACKPORTED_KERNEL_NAME="iwlwifi"
4BACKPORTS_BUILD_TSTAMP=__DATE__ \" \" __TIME__4BACKPORTS_BUILD_TSTAMP=__DATE__ \" \" __TIME__
5BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:master:8286:2451d0de"5BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:master:8324:9176b151"

Subscribers

People subscribed via source and target branches