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
- Git
- lp:~vicamo/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms
- for-focal/new-upstream-release-8324
- Merge into 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) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
You-Sheng Yang | Approve | ||
Review via email: mp+377553@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/debian/backport-iwlwifi-dkms.modaliases b/debian/backport-iwlwifi-dkms.modaliases |
2 | index 3f4e9d7..375489c 100644 |
3 | --- a/debian/backport-iwlwifi-dkms.modaliases |
4 | +++ b/debian/backport-iwlwifi-dkms.modaliases |
5 | @@ -231,6 +231,9 @@ alias pci:v00008086d00002725sv*sd000000B0bc*sc*i* iwlwifi |
6 | alias pci:v00008086d00002725sv*sd00000310bc*sc*i* iwlwifi |
7 | alias pci:v00008086d00002725sv*sd00000510bc*sc*i* iwlwifi |
8 | alias pci:v00008086d00002725sv*sd00000A10bc*sc*i* iwlwifi |
9 | +alias pci:v00008086d00002726sv*sd00000090bc*sc*i* iwlwifi |
10 | +alias pci:v00008086d00002726sv*sd000000B0bc*sc*i* iwlwifi |
11 | +alias pci:v00008086d00002726sv*sd00000510bc*sc*i* iwlwifi |
12 | alias pci:v00008086d000030DCsv*sd*bc*sc*i* iwlwifi |
13 | alias pci:v00008086d00003165sv*sd00004010bc*sc*i* iwlwifi |
14 | alias pci:v00008086d00003165sv*sd00004012bc*sc*i* iwlwifi |
15 | @@ -246,11 +249,14 @@ alias pci:v00008086d000031DCsv*sd*bc*sc*i* iwlwifi |
16 | alias pci:v00008086d000034F0sv*sd*bc*sc*i* iwlwifi |
17 | alias pci:v00008086d00003DF0sv*sd*bc*sc*i* iwlwifi |
18 | alias pci:v00008086d000043F0sv*sd*bc*sc*i* iwlwifi |
19 | +alias pci:v00008086d00004DF0sv*sd*bc*sc*i* iwlwifi |
20 | alias pci:v00008086d00007A70sv*sd00000090bc*sc*i* iwlwifi |
21 | +alias pci:v00008086d00007A70sv*sd000000B0bc*sc*i* iwlwifi |
22 | alias pci:v00008086d00007A70sv*sd00000310bc*sc*i* iwlwifi |
23 | alias pci:v00008086d00007A70sv*sd00000510bc*sc*i* iwlwifi |
24 | alias pci:v00008086d00007A70sv*sd00000A10bc*sc*i* iwlwifi |
25 | alias pci:v00008086d00007AF0sv*sd00000090bc*sc*i* iwlwifi |
26 | +alias pci:v00008086d00007AF0sv*sd000000B0bc*sc*i* iwlwifi |
27 | alias pci:v00008086d00007AF0sv*sd00000310bc*sc*i* iwlwifi |
28 | alias pci:v00008086d00007AF0sv*sd00000510bc*sc*i* iwlwifi |
29 | alias pci:v00008086d00007AF0sv*sd00000A10bc*sc*i* iwlwifi |
30 | diff --git a/debian/changelog b/debian/changelog |
31 | index e6f67b1..ab4bcc3 100644 |
32 | --- a/debian/changelog |
33 | +++ b/debian/changelog |
34 | @@ -1,3 +1,18 @@ |
35 | +backport-iwlwifi-dkms (8324-0ubuntu1) focal; urgency=low |
36 | + |
37 | + * New release |
38 | + - upstream version 8324 commit 5aa9fb548df6af. |
39 | + - update debian/backport-iwlwifi-dkms.modaliases. |
40 | + |
41 | + -- You-Sheng Yang <vicamo@gmail.com> Mon, 13 Jan 2020 11:28:16 +0800 |
42 | + |
43 | +backport-iwlwifi-dkms (8292-0ubuntu1) focal; urgency=low |
44 | + |
45 | + * New release |
46 | + - upstream version 8292 commit cb9dfa2c338816. |
47 | + |
48 | + -- You-Sheng Yang <vicamo@gmail.com> Thu, 09 Jan 2020 03:15:48 +0000 |
49 | + |
50 | backport-iwlwifi-dkms (8286-0ubuntu1) focal; urgency=low |
51 | |
52 | * New release |
53 | diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c |
54 | index 3790c0e..944d88a 100644 |
55 | --- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c |
56 | +++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c |
57 | @@ -6,7 +6,7 @@ |
58 | * GPL LICENSE SUMMARY |
59 | * |
60 | * Copyright(c) 2015-2017 Intel Deutschland GmbH |
61 | - * Copyright (C) 2018-2019 Intel Corporation |
62 | + * Copyright (C) 2018-2020 Intel Corporation |
63 | * |
64 | * This program is free software; you can redistribute it and/or modify |
65 | * it under the terms of version 2 of the GNU General Public License as |
66 | @@ -20,7 +20,7 @@ |
67 | * BSD LICENSE |
68 | * |
69 | * Copyright(c) 2015-2017 Intel Deutschland GmbH |
70 | - * Copyright (C) 2018-2019 Intel Corporation |
71 | + * Copyright (C) 2018-2020 Intel Corporation |
72 | * All rights reserved. |
73 | * |
74 | * Redistribution and use in source and binary forms, with or without |
75 | @@ -57,7 +57,7 @@ |
76 | #include "iwl-prph.h" |
77 | |
78 | /* Highest firmware API version supported */ |
79 | -#define IWL_22000_UCODE_API_MAX 54 |
80 | +#define IWL_22000_UCODE_API_MAX 55 |
81 | |
82 | /* Lowest firmware API version supported */ |
83 | #define IWL_22000_UCODE_API_MIN 39 |
84 | @@ -91,7 +91,8 @@ |
85 | #define IWL_22000_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0-" |
86 | #define IWL_22000_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0-" |
87 | #define IWL_22000_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0-" |
88 | -#define IWL_22000_SOSNJ_A_GF4_A_FW_PRE "iwlwifi-SoSnj-a0-gf4-a0-" |
89 | +#define IWL_SNJ_A_GF4_A_FW_PRE "iwlwifi-SoSnj-a0-gf4-a0-" |
90 | +#define IWL_SNJ_A_GF_A_FW_PRE "iwlwifi-SoSnj-a0-gf-a0-" |
91 | |
92 | #define IWL_22000_HR_MODULE_FIRMWARE(api) \ |
93 | IWL_22000_HR_FW_PRE __stringify(api) ".ucode" |
94 | @@ -121,6 +122,10 @@ |
95 | IWL_22000_SO_A_GF_A_FW_PRE __stringify(api) ".ucode" |
96 | #define IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(api) \ |
97 | IWL_22000_TY_A_GF_A_FW_PRE __stringify(api) ".ucode" |
98 | +#define IWL_SNJ_A_GF4_A_MODULE_FIRMWARE(api) \ |
99 | + IWL_SNJ_A_GF4_A_FW_PRE __stringify(api) ".ucode" |
100 | +#define IWL_SNJ_A_GF_A_MODULE_FIRMWARE(api) \ |
101 | + IWL_SNJ_A_GF_A_FW_PRE __stringify(api) ".ucode" |
102 | |
103 | static const struct iwl_base_params iwl_22000_base_params = { |
104 | .eeprom_size = OTP_LOW_IMAGE_SIZE_32K, |
105 | @@ -230,6 +235,15 @@ static const struct iwl_ht_params iwl_22000_ht_params = { |
106 | }, \ |
107 | } |
108 | |
109 | +const struct iwl_cfg_trans_params iwl_qnj_trans_cfg = { |
110 | + .mq_rx_supported = true, |
111 | + .use_tfh = true, |
112 | + .rf_id = true, |
113 | + .gen2 = true, |
114 | + .device_family = IWL_DEVICE_FAMILY_22000, |
115 | + .base_params = &iwl_22000_base_params, |
116 | +}; |
117 | + |
118 | const struct iwl_cfg_trans_params iwl_qu_trans_cfg = { |
119 | .mq_rx_supported = true, |
120 | .use_tfh = true, |
121 | @@ -239,15 +253,19 @@ const struct iwl_cfg_trans_params iwl_qu_trans_cfg = { |
122 | .base_params = &iwl_22000_base_params, |
123 | .integrated = true, |
124 | .xtal_latency = 5000, |
125 | + .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_200US, |
126 | }; |
127 | |
128 | -const struct iwl_cfg_trans_params iwl_qnj_trans_cfg = { |
129 | +const struct iwl_cfg_trans_params iwl_qu_medium_latency_trans_cfg = { |
130 | .mq_rx_supported = true, |
131 | .use_tfh = true, |
132 | .rf_id = true, |
133 | .gen2 = true, |
134 | .device_family = IWL_DEVICE_FAMILY_22000, |
135 | .base_params = &iwl_22000_base_params, |
136 | + .integrated = true, |
137 | + .xtal_latency = 1820, |
138 | + .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_1820US, |
139 | }; |
140 | |
141 | const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg = { |
142 | @@ -260,6 +278,7 @@ const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg = { |
143 | .integrated = true, |
144 | .xtal_latency = 12000, |
145 | .low_latency_xtal = true, |
146 | + .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US, |
147 | }; |
148 | |
149 | /* |
150 | @@ -521,22 +540,32 @@ const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0 = { |
151 | }; |
152 | |
153 | const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0 = { |
154 | - .name = "Intel(R) Wi-Fi 7 AX210 160MHz", |
155 | + .name = "Intel(R) Wi-Fi 6 AX210 160MHz", |
156 | .fw_name_pre = IWL_22000_SO_A_HR_B_FW_PRE, |
157 | IWL_DEVICE_AX210, |
158 | .num_rbds = IWL_NUM_RBDS_AX210_HE, |
159 | }; |
160 | |
161 | const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0 = { |
162 | - .name = "Intel(R) Wi-Fi 7 AX211 160MHz", |
163 | + .name = "Intel(R) Wi-Fi 6 AX211 160MHz", |
164 | + .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE, |
165 | + .uhb_supported = true, |
166 | + IWL_DEVICE_AX210, |
167 | + .num_rbds = IWL_NUM_RBDS_AX210_HE, |
168 | +}; |
169 | + |
170 | +const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0_long = { |
171 | + .name = "Intel(R) Wi-Fi 6 AX211 160MHz", |
172 | .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE, |
173 | .uhb_supported = true, |
174 | IWL_DEVICE_AX210, |
175 | .num_rbds = IWL_NUM_RBDS_AX210_HE, |
176 | + .trans.xtal_latency = 12000, |
177 | + .trans.low_latency_xtal = true, |
178 | }; |
179 | |
180 | const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = { |
181 | - .name = "Intel(R) Wi-Fi 7 AX210 160MHz", |
182 | + .name = "Intel(R) Wi-Fi 6 AX210 160MHz", |
183 | .fw_name_pre = IWL_22000_TY_A_GF_A_FW_PRE, |
184 | .uhb_supported = true, |
185 | IWL_DEVICE_AX210, |
186 | @@ -544,16 +573,34 @@ const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = { |
187 | }; |
188 | |
189 | const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0 = { |
190 | - .name = "Intel(R) Wi-Fi 7 AX411 160MHz", |
191 | + .name = "Intel(R) Wi-Fi 6 AX411 160MHz", |
192 | + .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE, |
193 | + .uhb_supported = true, |
194 | + IWL_DEVICE_AX210, |
195 | + .num_rbds = IWL_NUM_RBDS_AX210_HE, |
196 | +}; |
197 | + |
198 | +const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0_long = { |
199 | + .name = "Intel(R) Wi-Fi 6 AX411 160MHz", |
200 | .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE, |
201 | .uhb_supported = true, |
202 | IWL_DEVICE_AX210, |
203 | .num_rbds = IWL_NUM_RBDS_AX210_HE, |
204 | + .trans.xtal_latency = 12000, |
205 | + .trans.low_latency_xtal = true, |
206 | }; |
207 | |
208 | const struct iwl_cfg iwlax411_2ax_cfg_sosnj_gf4_a0 = { |
209 | - .name = "Intel(R) Wi-Fi 7 AX411 160MHz", |
210 | - .fw_name_pre = IWL_22000_SOSNJ_A_GF4_A_FW_PRE, |
211 | + .name = "Intel(R) Wi-Fi 6 AX411 160MHz", |
212 | + .fw_name_pre = IWL_SNJ_A_GF4_A_FW_PRE, |
213 | + .uhb_supported = true, |
214 | + IWL_DEVICE_AX210, |
215 | + .num_rbds = IWL_NUM_RBDS_AX210_HE, |
216 | +}; |
217 | + |
218 | +const struct iwl_cfg iwlax211_cfg_snj_gf_a0 = { |
219 | + .name = "Intel(R) Wi-Fi 6 AX211 160MHz", |
220 | + .fw_name_pre = IWL_SNJ_A_GF_A_FW_PRE, |
221 | .uhb_supported = true, |
222 | IWL_DEVICE_AX210, |
223 | .num_rbds = IWL_NUM_RBDS_AX210_HE, |
224 | @@ -572,3 +619,5 @@ MODULE_FIRMWARE(IWL_22000_SO_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); |
225 | MODULE_FIRMWARE(IWL_22000_SO_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); |
226 | MODULE_FIRMWARE(IWL_22000_SO_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); |
227 | MODULE_FIRMWARE(IWL_22000_TY_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); |
228 | +MODULE_FIRMWARE(IWL_SNJ_A_GF4_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); |
229 | +MODULE_FIRMWARE(IWL_SNJ_A_GF_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); |
230 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c |
231 | index bdc382a..fd8ae5d 100644 |
232 | --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c |
233 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c |
234 | @@ -151,6 +151,82 @@ found: |
235 | } |
236 | IWL_EXPORT_SYMBOL(iwl_acpi_get_wifi_pkg); |
237 | |
238 | +int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt, |
239 | + __le32 *black_list_array, |
240 | + int *black_list_size) |
241 | +{ |
242 | + union acpi_object *wifi_pkg, *data; |
243 | + int ret, tbl_rev, i; |
244 | + bool enabled; |
245 | + |
246 | + data = iwl_acpi_get_object(fwrt->dev, ACPI_WTAS_METHOD); |
247 | + if (IS_ERR(data)) |
248 | + return PTR_ERR(data); |
249 | + |
250 | + wifi_pkg = iwl_acpi_get_wifi_pkg(fwrt->dev, data, |
251 | + ACPI_WTAS_WIFI_DATA_SIZE, |
252 | + &tbl_rev); |
253 | + if (IS_ERR(wifi_pkg)) { |
254 | + ret = PTR_ERR(wifi_pkg); |
255 | + goto out_free; |
256 | + } |
257 | + |
258 | + if (wifi_pkg->package.elements[0].type != ACPI_TYPE_INTEGER || |
259 | + tbl_rev != 0) { |
260 | + ret = -EINVAL; |
261 | + goto out_free; |
262 | + } |
263 | + |
264 | + enabled = !!wifi_pkg->package.elements[0].integer.value; |
265 | + |
266 | + if (!enabled) { |
267 | + *black_list_size = -1; |
268 | + IWL_DEBUG_RADIO(fwrt, "TAS not enabled\n"); |
269 | + ret = 0; |
270 | + goto out_free; |
271 | + } |
272 | + |
273 | + if (wifi_pkg->package.elements[1].type != ACPI_TYPE_INTEGER || |
274 | + wifi_pkg->package.elements[1].integer.value > |
275 | + APCI_WTAS_BLACK_LIST_MAX) { |
276 | + IWL_DEBUG_RADIO(fwrt, "TAS invalid array size %llu\n", |
277 | + wifi_pkg->package.elements[1].integer.value); |
278 | + ret = -EINVAL; |
279 | + goto out_free; |
280 | + } |
281 | + *black_list_size = wifi_pkg->package.elements[1].integer.value; |
282 | + |
283 | + IWL_DEBUG_RADIO(fwrt, "TAS array size %d\n", *black_list_size); |
284 | + if (*black_list_size > APCI_WTAS_BLACK_LIST_MAX) { |
285 | + IWL_DEBUG_RADIO(fwrt, "TAS invalid array size value %u\n", |
286 | + *black_list_size); |
287 | + ret = -EINVAL; |
288 | + goto out_free; |
289 | + } |
290 | + |
291 | + for (i = 0; i < *black_list_size; i++) { |
292 | + u32 country; |
293 | + |
294 | + if (wifi_pkg->package.elements[2 + i].type != |
295 | + ACPI_TYPE_INTEGER) { |
296 | + IWL_DEBUG_RADIO(fwrt, |
297 | + "TAS invalid array elem %d\n", 2 + i); |
298 | + ret = -EINVAL; |
299 | + goto out_free; |
300 | + } |
301 | + |
302 | + country = wifi_pkg->package.elements[2 + i].integer.value; |
303 | + black_list_array[i] = cpu_to_le32(country); |
304 | + IWL_DEBUG_RADIO(fwrt, "TAS black list country %d\n", country); |
305 | + } |
306 | + |
307 | + ret = 0; |
308 | +out_free: |
309 | + kfree(data); |
310 | + return ret; |
311 | +} |
312 | +IWL_EXPORT_SYMBOL(iwl_acpi_get_tas); |
313 | + |
314 | int iwl_acpi_get_mcc(struct device *dev, char *mcc) |
315 | { |
316 | union acpi_object *wifi_pkg, *data; |
317 | @@ -361,8 +437,8 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt) |
318 | { |
319 | union acpi_object *wifi_pkg, *data; |
320 | bool enabled; |
321 | - int i, n_profiles, tbl_rev; |
322 | - int ret = 0; |
323 | + int i, n_profiles, tbl_rev, pos; |
324 | + int ret = 0; |
325 | |
326 | data = iwl_acpi_get_object(fwrt->dev, ACPI_EWRD_METHOD); |
327 | if (IS_ERR(data)) |
328 | @@ -394,10 +470,10 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt) |
329 | goto out_free; |
330 | } |
331 | |
332 | - for (i = 0; i < n_profiles; i++) { |
333 | - /* the tables start at element 3 */ |
334 | - int pos = 3; |
335 | + /* the tables start at element 3 */ |
336 | + pos = 3; |
337 | |
338 | + for (i = 0; i < n_profiles; i++) { |
339 | /* The EWRD profiles officially go from 2 to 4, but we |
340 | * save them in sar_profiles[1-3] (because we don't |
341 | * have profile 0). So in the array we start from 1. |
342 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h |
343 | index 4a6e826..c0a8cb6 100644 |
344 | --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h |
345 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h |
346 | @@ -64,6 +64,7 @@ |
347 | #include "fw/api/commands.h" |
348 | #include "fw/api/power.h" |
349 | #include "fw/api/phy.h" |
350 | +#include "fw/api/nvm-reg.h" |
351 | #include "fw/img.h" |
352 | #include "iwl-trans.h" |
353 | |
354 | @@ -75,6 +76,7 @@ |
355 | #define ACPI_SPLC_METHOD "SPLC" |
356 | #define ACPI_ECKV_METHOD "ECKV" |
357 | #define ACPI_PPAG_METHOD "PPAG" |
358 | +#define ACPI_WTAS_METHOD "WTAS" |
359 | |
360 | #define ACPI_WIFI_DOMAIN (0x07) |
361 | |
362 | @@ -96,6 +98,12 @@ |
363 | #define ACPI_SPLC_WIFI_DATA_SIZE 2 |
364 | #define ACPI_ECKV_WIFI_DATA_SIZE 2 |
365 | |
366 | +/* |
367 | + * 1 type, 1 enabled, 1 black list size, 16 black list array |
368 | + */ |
369 | +#define APCI_WTAS_BLACK_LIST_MAX 16 |
370 | +#define ACPI_WTAS_WIFI_DATA_SIZE (3 + APCI_WTAS_BLACK_LIST_MAX) |
371 | + |
372 | #define ACPI_WGDS_NUM_BANDS 2 |
373 | #define ACPI_WGDS_TABLE_SIZE 3 |
374 | |
375 | @@ -173,6 +181,10 @@ int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt, |
376 | |
377 | void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, |
378 | struct iwl_per_chain_offset_group *table); |
379 | + |
380 | +int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt, __le32 *black_list_array, |
381 | + int *black_list_size); |
382 | + |
383 | #else /* CONFIG_ACPI */ |
384 | |
385 | static inline void *iwl_acpi_get_object(struct device *dev, acpi_string method) |
386 | @@ -248,5 +260,11 @@ static inline void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, |
387 | { |
388 | } |
389 | |
390 | +static inline int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt, |
391 | + __le32 *black_list_array, |
392 | + int *black_list_size) |
393 | +{ |
394 | + return -ENOENT; |
395 | +} |
396 | #endif /* CONFIG_ACPI */ |
397 | #endif /* __iwl_fw_acpi__ */ |
398 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/config.h b/drivers/net/wireless/intel/iwlwifi/fw/api/config.h |
399 | index 5e88fa2..546fa60 100644 |
400 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/config.h |
401 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/config.h |
402 | @@ -8,7 +8,7 @@ |
403 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
404 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
405 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
406 | - * Copyright (C) 2018 Intel Corporation |
407 | + * Copyright (C) 2018 - 2019 Intel Corporation |
408 | * |
409 | * This program is free software; you can redistribute it and/or modify |
410 | * it under the terms of version 2 of the GNU General Public License as |
411 | @@ -31,7 +31,7 @@ |
412 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
413 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
414 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
415 | - * Copyright (C) 2018 Intel Corporation |
416 | + * Copyright (C) 2018 - 2019 Intel Corporation |
417 | * All rights reserved. |
418 | * |
419 | * Redistribution and use in source and binary forms, with or without |
420 | @@ -120,15 +120,48 @@ enum iwl_calib_cfg { |
421 | }; |
422 | |
423 | /** |
424 | + * struct iwl_phy_specific_cfg - specific PHY filter configuration |
425 | + * |
426 | + * Sent as part of the phy configuration command (v3) to configure specific FW |
427 | + * defined PHY filters that can be applied to each antenna. |
428 | + * |
429 | + * @filter_cfg_chain_a: filter config id for LMAC1 chain A |
430 | + * @filter_cfg_chain_b: filter config id for LMAC1 chain B |
431 | + * @filter_cfg_chain_c: filter config id for LMAC2 chain A |
432 | + * @filter_cfg_chain_d: filter config id for LMAC2 chain B |
433 | + * values: 0 - no filter; 0xffffffff - reserved; otherwise - filter id |
434 | + */ |
435 | +struct iwl_phy_specific_cfg { |
436 | + __le32 filter_cfg_chain_a; |
437 | + __le32 filter_cfg_chain_b; |
438 | + __le32 filter_cfg_chain_c; |
439 | + __le32 filter_cfg_chain_d; |
440 | +} __packed; /* PHY_SPECIFIC_CONFIGURATION_API_VER_1*/ |
441 | + |
442 | +/** |
443 | * struct iwl_phy_cfg_cmd - Phy configuration command |
444 | + * |
445 | * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg |
446 | * @calib_control: calibration control data |
447 | */ |
448 | -struct iwl_phy_cfg_cmd { |
449 | +struct iwl_phy_cfg_cmd_v1 { |
450 | __le32 phy_cfg; |
451 | struct iwl_calib_ctrl calib_control; |
452 | } __packed; |
453 | |
454 | +/** |
455 | + * struct iwl_phy_cfg_cmd_v3 - Phy configuration command (v3) |
456 | + * |
457 | + * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg |
458 | + * @calib_control: calibration control data |
459 | + * @phy_specific_cfg: configure predefined PHY filters |
460 | + */ |
461 | +struct iwl_phy_cfg_cmd_v3 { |
462 | + __le32 phy_cfg; |
463 | + struct iwl_calib_ctrl calib_control; |
464 | + struct iwl_phy_specific_cfg phy_specific_cfg; |
465 | +} __packed; /* PHY_CONFIGURATION_CMD_API_S_VER_3 */ |
466 | + |
467 | /* |
468 | * enum iwl_dc2dc_config_id - flag ids |
469 | * |
470 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h |
471 | index 97b4984..2d230a7 100644 |
472 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h |
473 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h |
474 | @@ -80,6 +80,11 @@ enum iwl_regulatory_and_nvm_subcmd_ids { |
475 | * response is &struct iwl_nvm_get_info_rsp |
476 | */ |
477 | NVM_GET_INFO = 0x2, |
478 | + |
479 | + /** |
480 | + * @TAS_CONFIG: &struct iwl_tas_config_cmd |
481 | + */ |
482 | + TAS_CONFIG = 0x3, |
483 | }; |
484 | |
485 | /** |
486 | @@ -431,4 +436,14 @@ enum iwl_mcc_source { |
487 | MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11, |
488 | }; |
489 | |
490 | +#define IWL_TAS_BLACK_LIST_MAX 16 |
491 | +/** |
492 | + * struct iwl_tas_config_cmd - configures the TAS |
493 | + * @black_list_size: size of relevant field in black_list_array |
494 | + * @black_list_array: black list countries (without TAS) |
495 | + */ |
496 | +struct iwl_tas_config_cmd { |
497 | + __le32 black_list_size; |
498 | + __le32 black_list_array[IWL_TAS_BLACK_LIST_MAX]; |
499 | +} __packed; /* TAS_CONFIG_CMD_API_S_VER_2 */ |
500 | #endif /* __iwl_fw_api_nvm_reg_h__ */ |
501 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h b/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h |
502 | index b4211ac..6038b3c 100644 |
503 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h |
504 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h |
505 | @@ -5,10 +5,9 @@ |
506 | * |
507 | * GPL LICENSE SUMMARY |
508 | * |
509 | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
510 | + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. |
511 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
512 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
513 | - * Copyright(c) 2018 - 2019 Intel Corporation |
514 | * |
515 | * This program is free software; you can redistribute it and/or modify |
516 | * it under the terms of version 2 of the GNU General Public License as |
517 | @@ -28,10 +27,9 @@ |
518 | * |
519 | * BSD LICENSE |
520 | * |
521 | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
522 | + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. |
523 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
524 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
525 | - * Copyright(c) 2018 - 2019 Intel Corporation |
526 | * All rights reserved. |
527 | * |
528 | * Redistribution and use in source and binary forms, with or without |
529 | @@ -536,9 +534,9 @@ struct iwl_rx_mpdu_desc_v3 { |
530 | __le32 filter_match; |
531 | |
532 | /** |
533 | - * @phy_data2: depends on info type (see @phy_data1) |
534 | + * @phy_data3: depends on info type (see @phy_data1) |
535 | */ |
536 | - __le32 phy_data2; |
537 | + __le32 phy_data3; |
538 | }; |
539 | |
540 | /* DW8 - carries rss_hash only when rpa_en == 1 */ |
541 | @@ -549,9 +547,9 @@ struct iwl_rx_mpdu_desc_v3 { |
542 | __le32 rss_hash; |
543 | |
544 | /** |
545 | - * @phy_data3: depends on info type (see @phy_data1) |
546 | + * @phy_data2: depends on info type (see @phy_data1) |
547 | */ |
548 | - __le32 phy_data3; |
549 | + __le32 phy_data2; |
550 | }; |
551 | /* DW9 */ |
552 | /** |
553 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/soc.h b/drivers/net/wireless/intel/iwlwifi/fw/api/soc.h |
554 | index aadca78..0c6d7b3 100644 |
555 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/soc.h |
556 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/soc.h |
557 | @@ -5,10 +5,9 @@ |
558 | * |
559 | * GPL LICENSE SUMMARY |
560 | * |
561 | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
562 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
563 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
564 | - * Copyright(c) 2019 Intel Deutschland GmbH |
565 | + * Copyright(c) 2012 - 2014, 2019 - 2020 Intel Corporation |
566 | * |
567 | * This program is free software; you can redistribute it and/or modify |
568 | * it under the terms of version 2 of the GNU General Public License as |
569 | @@ -28,10 +27,9 @@ |
570 | * |
571 | * BSD LICENSE |
572 | * |
573 | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
574 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
575 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
576 | - * Copyright(c) 2019 Intel Deutschland GmbH |
577 | + * Copyright(c) 2012 - 2014, 2019 - 2020 Intel Corporation |
578 | * All rights reserved. |
579 | * |
580 | * Redistribution and use in source and binary forms, with or without |
581 | @@ -68,6 +66,12 @@ |
582 | #define SOC_CONFIG_CMD_FLAGS_DISCRETE BIT(0) |
583 | #define SOC_CONFIG_CMD_FLAGS_LOW_LATENCY BIT(1) |
584 | |
585 | +#define SOC_FLAGS_LTR_APPLY_DELAY_MASK 0xc |
586 | +#define SOC_FLAGS_LTR_APPLY_DELAY_NONE 0 |
587 | +#define SOC_FLAGS_LTR_APPLY_DELAY_200 1 |
588 | +#define SOC_FLAGS_LTR_APPLY_DELAY_2500 2 |
589 | +#define SOC_FLAGS_LTR_APPLY_DELAY_1820 3 |
590 | + |
591 | /** |
592 | * struct iwl_soc_configuration_cmd - Set device stabilization latency |
593 | * |
594 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h b/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h |
595 | index 970e9e5..c010e6f 100644 |
596 | --- a/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h |
597 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h |
598 | @@ -245,32 +245,6 @@ enum iwl_sta_sleep_flag { |
599 | #define STA_KEY_LEN_WEP40 (5) |
600 | #define STA_KEY_LEN_WEP104 (13) |
601 | |
602 | -/** |
603 | - * struct iwl_mvm_keyinfo - key information |
604 | - * @key_flags: type &enum iwl_sta_key_flag |
605 | - * @tkip_rx_tsc_byte2: TSC[2] for key mix ph1 detection |
606 | - * @reserved1: reserved |
607 | - * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx |
608 | - * @key_offset: key offset in the fw's key table |
609 | - * @reserved2: reserved |
610 | - * @key: 16-byte unicast decryption key |
611 | - * @tx_secur_seq_cnt: initial RSC / PN needed for replay check |
612 | - * @hw_tkip_mic_rx_key: byte: MIC Rx Key - used for TKIP only |
613 | - * @hw_tkip_mic_tx_key: byte: MIC Tx Key - used for TKIP only |
614 | - */ |
615 | -struct iwl_mvm_keyinfo { |
616 | - __le16 key_flags; |
617 | - u8 tkip_rx_tsc_byte2; |
618 | - u8 reserved1; |
619 | - __le16 tkip_rx_ttak[5]; |
620 | - u8 key_offset; |
621 | - u8 reserved2; |
622 | - u8 key[16]; |
623 | - __le64 tx_secur_seq_cnt; |
624 | - __le64 hw_tkip_mic_rx_key; |
625 | - __le64 hw_tkip_mic_tx_key; |
626 | -} __packed; |
627 | - |
628 | #define IWL_ADD_STA_STATUS_MASK 0xFF |
629 | #define IWL_ADD_STA_BAID_VALID_MASK 0x8000 |
630 | #define IWL_ADD_STA_BAID_MASK 0x7F00 |
631 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c |
632 | index 2e5d9d8..79fe672 100644 |
633 | --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c |
634 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c |
635 | @@ -8,7 +8,7 @@ |
636 | * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. |
637 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
638 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
639 | - * Copyright(c) 2018 - 2019 Intel Corporation |
640 | + * Copyright(c) 2018 - 2020 Intel Corporation |
641 | * |
642 | * This program is free software; you can redistribute it and/or modify |
643 | * it under the terms of version 2 of the GNU General Public License as |
644 | @@ -31,7 +31,7 @@ |
645 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. |
646 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
647 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
648 | - * Copyright(c) 2018 - 2019 Intel Corporation |
649 | + * Copyright(c) 2018 - 2020 Intel Corporation |
650 | * All rights reserved. |
651 | * |
652 | * Redistribution and use in source and binary forms, with or without |
653 | @@ -1442,11 +1442,7 @@ static int iwl_dump_ini_rxf_iter(struct iwl_fw_runtime *fwrt, |
654 | goto out; |
655 | } |
656 | |
657 | - /* |
658 | - * region register have absolute value so apply rxf offset after |
659 | - * reading the registers |
660 | - */ |
661 | - offs += rxf_data.offset; |
662 | + offs = rxf_data.offset; |
663 | |
664 | /* Lock fence */ |
665 | iwl_write_prph_no_grab(fwrt->trans, RXF_SET_FENCE_MODE + offs, 0x1); |
666 | @@ -2333,26 +2329,40 @@ IWL_EXPORT_SYMBOL(iwl_fw_dbg_collect_desc); |
667 | int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt, |
668 | enum iwl_fw_dbg_trigger trig_type) |
669 | { |
670 | - int ret; |
671 | - struct iwl_fw_dump_desc *iwl_dump_error_desc; |
672 | - |
673 | if (!test_bit(STATUS_DEVICE_ENABLED, &fwrt->trans->status)) |
674 | return -EIO; |
675 | |
676 | - iwl_dump_error_desc = kmalloc(sizeof(*iwl_dump_error_desc), GFP_KERNEL); |
677 | - if (!iwl_dump_error_desc) |
678 | - return -ENOMEM; |
679 | + if (iwl_trans_dbg_ini_valid(fwrt->trans)) { |
680 | + if (trig_type != FW_DBG_TRIGGER_ALIVE_TIMEOUT) |
681 | + return -EIO; |
682 | |
683 | - iwl_dump_error_desc->trig_desc.type = cpu_to_le32(trig_type); |
684 | - iwl_dump_error_desc->len = 0; |
685 | + iwl_dbg_tlv_time_point(fwrt, |
686 | + IWL_FW_INI_TIME_POINT_HOST_ALIVE_TIMEOUT, |
687 | + NULL); |
688 | + } else { |
689 | + struct iwl_fw_dump_desc *iwl_dump_error_desc; |
690 | + int ret; |
691 | |
692 | - ret = iwl_fw_dbg_collect_desc(fwrt, iwl_dump_error_desc, false, 0); |
693 | - if (ret) |
694 | - kfree(iwl_dump_error_desc); |
695 | - else |
696 | - iwl_trans_sync_nmi(fwrt->trans); |
697 | + iwl_dump_error_desc = |
698 | + kmalloc(sizeof(*iwl_dump_error_desc), GFP_KERNEL); |
699 | |
700 | - return ret; |
701 | + if (!iwl_dump_error_desc) |
702 | + return -ENOMEM; |
703 | + |
704 | + iwl_dump_error_desc->trig_desc.type = cpu_to_le32(trig_type); |
705 | + iwl_dump_error_desc->len = 0; |
706 | + |
707 | + ret = iwl_fw_dbg_collect_desc(fwrt, iwl_dump_error_desc, |
708 | + false, 0); |
709 | + if (ret) { |
710 | + kfree(iwl_dump_error_desc); |
711 | + return ret; |
712 | + } |
713 | + } |
714 | + |
715 | + iwl_trans_sync_nmi(fwrt->trans); |
716 | + |
717 | + return 0; |
718 | } |
719 | IWL_EXPORT_SYMBOL(iwl_fw_dbg_error_collect); |
720 | |
721 | diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h |
722 | index ae50d23..7ed1978 100644 |
723 | --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h |
724 | +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h |
725 | @@ -477,6 +477,7 @@ enum iwl_ucode_tlv_capa { |
726 | IWL_UCODE_TLV_CAPA_CS_MODIFY = (__force iwl_ucode_tlv_capa_t)49, |
727 | IWL_UCODE_TLV_CAPA_SET_LTR_GEN2 = (__force iwl_ucode_tlv_capa_t)50, |
728 | IWL_UCODE_TLV_CAPA_SET_PPAG = (__force iwl_ucode_tlv_capa_t)52, |
729 | + IWL_UCODE_TLV_CAPA_TAS_CFG = (__force iwl_ucode_tlv_capa_t)53, |
730 | IWL_UCODE_TLV_CAPA_SESSION_PROT_CMD = (__force iwl_ucode_tlv_capa_t)54, |
731 | |
732 | /* set 2 */ |
733 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h |
734 | index e3d6277..df28b99 100644 |
735 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h |
736 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h |
737 | @@ -5,9 +5,8 @@ |
738 | * |
739 | * GPL LICENSE SUMMARY |
740 | * |
741 | - * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. |
742 | * Copyright (C) 2016 - 2017 Intel Deutschland GmbH |
743 | - * Copyright(c) 2018 - 2019 Intel Corporation |
744 | + * Copyright(c) 2007 - 2014, 2018 - 2020 Intel Corporation |
745 | * |
746 | * This program is free software; you can redistribute it and/or modify |
747 | * it under the terms of version 2 of the GNU General Public License as |
748 | @@ -27,9 +26,8 @@ |
749 | * |
750 | * BSD LICENSE |
751 | * |
752 | - * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. |
753 | * Copyright (C) 2016 - 2017 Intel Deutschland GmbH |
754 | - * Copyright(c) 2018 - 2019 Intel Corporation |
755 | + * Copyright(c) 2005 - 2014, 2018 - 2020 Intel Corporation |
756 | * All rights reserved. |
757 | * |
758 | * Redistribution and use in source and binary forms, with or without |
759 | @@ -284,6 +282,13 @@ struct iwl_pwr_tx_backoff { |
760 | u32 backoff; |
761 | }; |
762 | |
763 | +enum iwl_cfg_trans_ltr_delay { |
764 | + IWL_CFG_TRANS_LTR_DELAY_NONE = 0, |
765 | + IWL_CFG_TRANS_LTR_DELAY_200US = 1, |
766 | + IWL_CFG_TRANS_LTR_DELAY_2500US = 2, |
767 | + IWL_CFG_TRANS_LTR_DELAY_1820US = 3, |
768 | +}; |
769 | + |
770 | /** |
771 | * struct iwl_cfg_trans - information needed to start the trans |
772 | * |
773 | @@ -304,6 +309,7 @@ struct iwl_pwr_tx_backoff { |
774 | * @mq_rx_supported: multi-queue rx support |
775 | * @integrated: discrete or integrated |
776 | * @low_latency_xtal: use the low latency xtal if supported |
777 | + * @ltr_delay: LTR delay parameter, &enum iwl_cfg_trans_ltr_delay. |
778 | */ |
779 | struct iwl_cfg_trans_params { |
780 | const struct iwl_base_params *base_params; |
781 | @@ -317,7 +323,8 @@ struct iwl_cfg_trans_params { |
782 | mq_rx_supported:1, |
783 | integrated:1, |
784 | low_latency_xtal:1, |
785 | - bisr_workaround:1; |
786 | + bisr_workaround:1, |
787 | + ltr_delay:2; |
788 | }; |
789 | |
790 | /** |
791 | @@ -506,8 +513,9 @@ struct iwl_dev_info { |
792 | extern const struct iwl_cfg_trans_params iwl9000_trans_cfg; |
793 | extern const struct iwl_cfg_trans_params iwl9560_trans_cfg; |
794 | extern const struct iwl_cfg_trans_params iwl9560_shared_clk_trans_cfg; |
795 | -extern const struct iwl_cfg_trans_params iwl_qu_trans_cfg; |
796 | extern const struct iwl_cfg_trans_params iwl_qnj_trans_cfg; |
797 | +extern const struct iwl_cfg_trans_params iwl_qu_trans_cfg; |
798 | +extern const struct iwl_cfg_trans_params iwl_qu_medium_latency_trans_cfg; |
799 | extern const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg; |
800 | extern const struct iwl_cfg_trans_params iwl_ax200_trans_cfg; |
801 | extern const char iwl9162_name[]; |
802 | @@ -580,9 +588,12 @@ extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0; |
803 | extern const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0; |
804 | extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0; |
805 | extern const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0; |
806 | +extern const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0_long; |
807 | extern const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0; |
808 | extern const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0; |
809 | +extern const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0_long; |
810 | extern const struct iwl_cfg iwlax411_2ax_cfg_sosnj_gf4_a0; |
811 | +extern const struct iwl_cfg iwlax211_cfg_snj_gf_a0; |
812 | #endif /* CPTCFG_IWLMVM || CPTCFG_IWLFMAC */ |
813 | |
814 | #endif /* __IWL_CONFIG_H__ */ |
815 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h |
816 | index 5169648..db77bb1 100644 |
817 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h |
818 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-cfg.h |
819 | @@ -158,6 +158,10 @@ struct iwl_dbg_cfg { |
820 | IWL_DBG_CFG_RANGE(u8, MVM_UAPSD_NOAGG_LIST_LEN, |
821 | 1, IWL_MVM_UAPSD_NOAGG_BSSIDS_NUM) |
822 | IWL_DBG_CFG(bool, MVM_NON_TRANSMITTING_AP) |
823 | + IWL_DBG_CFG(u32, MVM_PHY_FILTER_CHAIN_A) |
824 | + IWL_DBG_CFG(u32, MVM_PHY_FILTER_CHAIN_B) |
825 | + IWL_DBG_CFG(u32, MVM_PHY_FILTER_CHAIN_C) |
826 | + IWL_DBG_CFG(u32, MVM_PHY_FILTER_CHAIN_D) |
827 | IWL_DBG_CFG(u8, MVM_QUOTA_THRESHOLD) |
828 | IWL_DBG_CFG(u8, MVM_RS_RSSI_BASED_INIT_RATE) |
829 | IWL_DBG_CFG(u8, MVM_RS_80_20_FAR_RANGE_TWEAK) |
830 | @@ -279,8 +283,6 @@ struct iwl_dbg_cfg { |
831 | IWL_DBG_CFG_NODEF(u16, tx_mcs_160) |
832 | IWL_DBG_CFG_NODEF(u32, secure_boot_cfg) |
833 | IWL_MOD_PARAM(u32, uapsd_disable) |
834 | - IWL_MOD_PARAM(bool, lar_disable) |
835 | - IWL_MOD_PARAM(bool, fw_monitor) |
836 | IWL_MOD_PARAM(bool, fw_restart) |
837 | IWL_MOD_PARAM(bool, power_save) |
838 | IWL_MOD_PARAM(bool, bt_coex_active) |
839 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c |
840 | index 35d1d6e..55daf92 100644 |
841 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c |
842 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c |
843 | @@ -5,7 +5,7 @@ |
844 | * |
845 | * GPL LICENSE SUMMARY |
846 | * |
847 | - * Copyright (C) 2018 - 2019 Intel Corporation |
848 | + * Copyright (C) 2018 - 2020 Intel Corporation |
849 | * |
850 | * This program is free software; you can redistribute it and/or modify |
851 | * it under the terms of version 2 of the GNU General Public License as |
852 | @@ -25,7 +25,7 @@ |
853 | * |
854 | * BSD LICENSE |
855 | * |
856 | - * Copyright (C) 2018 - 2019 Intel Corporation |
857 | + * Copyright (C) 2018 - 2020 Intel Corporation |
858 | * All rights reserved. |
859 | * |
860 | * Redistribution and use in source and binary forms, with or without |
861 | @@ -167,14 +167,24 @@ static int iwl_dbg_tlv_alloc_buf_alloc(struct iwl_trans *trans, |
862 | |
863 | if (le32_to_cpu(tlv->length) != sizeof(*alloc) || |
864 | (buf_location != IWL_FW_INI_LOCATION_SRAM_PATH && |
865 | - buf_location != IWL_FW_INI_LOCATION_DRAM_PATH)) |
866 | + buf_location != IWL_FW_INI_LOCATION_DRAM_PATH && |
867 | + buf_location != IWL_FW_INI_LOCATION_NPK_PATH)) { |
868 | + IWL_ERR(trans, |
869 | + "WRT: Invalid allocation TLV\n"); |
870 | + return -EINVAL; |
871 | + } |
872 | + |
873 | + if ((buf_location == IWL_FW_INI_LOCATION_SRAM_PATH || |
874 | + buf_location == IWL_FW_INI_LOCATION_NPK_PATH) && |
875 | + alloc_id != IWL_FW_INI_ALLOCATION_ID_DBGC1) { |
876 | + IWL_ERR(trans, |
877 | + "WRT: Allocation TLV for SMEM/NPK path must have id %u (current: %u)\n", |
878 | + IWL_FW_INI_ALLOCATION_ID_DBGC1, alloc_id); |
879 | return -EINVAL; |
880 | + } |
881 | |
882 | - if ((buf_location == IWL_FW_INI_LOCATION_SRAM_PATH && |
883 | - alloc_id != IWL_FW_INI_ALLOCATION_ID_DBGC1) || |
884 | - (buf_location == IWL_FW_INI_LOCATION_DRAM_PATH && |
885 | - (alloc_id == IWL_FW_INI_ALLOCATION_INVALID || |
886 | - alloc_id >= IWL_FW_INI_ALLOCATION_NUM))) { |
887 | + if (alloc_id == IWL_FW_INI_ALLOCATION_INVALID || |
888 | + alloc_id >= IWL_FW_INI_ALLOCATION_NUM) { |
889 | IWL_ERR(trans, |
890 | "WRT: Invalid allocation id %u for allocation TLV\n", |
891 | alloc_id); |
892 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c |
893 | index 36b8aff..6d94aee 100644 |
894 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c |
895 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c |
896 | @@ -2218,9 +2218,6 @@ MODULE_PARM_DESC(antenna_coupling, |
897 | module_param_named(nvm_file, iwlwifi_mod_params.nvm_file, charp, 0444); |
898 | MODULE_PARM_DESC(nvm_file, "NVM file name"); |
899 | |
900 | -module_param_named(lar_disable, iwlwifi_mod_params.lar_disable, bool, 0444); |
901 | -MODULE_PARM_DESC(lar_disable, "disable LAR functionality (default: N)"); |
902 | - |
903 | module_param_named(uapsd_disable, iwlwifi_mod_params.uapsd_disable, uint, 0644); |
904 | MODULE_PARM_DESC(uapsd_disable, |
905 | "disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3)"); |
906 | @@ -2261,10 +2258,6 @@ module_param_named(power_level, iwlwifi_mod_params.power_level, int, 0444); |
907 | MODULE_PARM_DESC(power_level, |
908 | "default power save level (range from 1 - 5, default: 1)"); |
909 | |
910 | -module_param_named(fw_monitor, iwlwifi_mod_params.fw_monitor, bool, 0444); |
911 | -MODULE_PARM_DESC(fw_monitor, |
912 | - "firmware monitor - to debug FW (default: false - needs lots of memory)"); |
913 | - |
914 | module_param_named(disable_11ac, iwlwifi_mod_params.disable_11ac, bool, 0444); |
915 | MODULE_PARM_DESC(disable_11ac, "Disable VHT capabilities (default: false)"); |
916 | |
917 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h |
918 | index 27d2cb3..91f65ab 100644 |
919 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h |
920 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h |
921 | @@ -116,8 +116,6 @@ enum iwl_uapsd_disable { |
922 | * @uapsd_disable: disable U-APSD, see &enum iwl_uapsd_disable, default = |
923 | * IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT |
924 | * @xvt_default_mode: xVT is the default operation mode, default = false |
925 | - * @lar_disable: disable LAR (regulatory), default = 0 |
926 | - * @fw_monitor: allow to use firmware monitor |
927 | * @disable_11ac: disable VHT capabilities, default = false. |
928 | * @disable_msix: disable MSI-X and fall back to MSI on PCIe, default = false. |
929 | * @remove_when_gone: remove an inaccessible device from the PCIe bus. |
930 | @@ -141,8 +139,6 @@ struct iwl_mod_params { |
931 | #endif |
932 | char *nvm_file; |
933 | u32 uapsd_disable; |
934 | - bool lar_disable; |
935 | - bool fw_monitor; |
936 | bool disable_11ac; |
937 | /** |
938 | * @disable_11ax: disable HE capabilities, default = false |
939 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c |
940 | index f8927ef..7e3e882 100644 |
941 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c |
942 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c |
943 | @@ -1125,10 +1125,11 @@ iwl_nvm_no_wide_in_5ghz(struct iwl_trans *trans, const struct iwl_cfg *cfg, |
944 | |
945 | struct iwl_nvm_data * |
946 | iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, |
947 | + const struct iwl_fw *fw, |
948 | const __be16 *nvm_hw, const __le16 *nvm_sw, |
949 | const __le16 *nvm_calib, const __le16 *regulatory, |
950 | const __le16 *mac_override, const __le16 *phy_sku, |
951 | - u8 tx_chains, u8 rx_chains, bool lar_fw_supported) |
952 | + u8 tx_chains, u8 rx_chains) |
953 | { |
954 | struct iwl_nvm_data *data; |
955 | bool lar_enabled; |
956 | @@ -1219,7 +1220,8 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, |
957 | iwl_init_he_override(trans, &data->bands[NL80211_BAND_2GHZ]); |
958 | iwl_init_he_override(trans, &data->bands[NL80211_BAND_5GHZ]); |
959 | #endif |
960 | - if (lar_fw_supported && lar_enabled) |
961 | + if (lar_enabled && |
962 | + fw_has_capa(&fw->ucode_capa, IWL_UCODE_TLV_CAPA_LAR_SUPPORT)) |
963 | sbands_flags |= IWL_NVM_SBANDS_FLAGS_LAR; |
964 | |
965 | if (iwl_nvm_no_wide_in_5ghz(trans, cfg, nvm_hw)) |
966 | @@ -1620,9 +1622,6 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans, |
967 | .id = WIDE_ID(REGULATORY_AND_NVM_GROUP, NVM_GET_INFO) |
968 | }; |
969 | int ret; |
970 | - bool lar_fw_supported = !iwlwifi_mod_params.lar_disable && |
971 | - fw_has_capa(&fw->ucode_capa, |
972 | - IWL_UCODE_TLV_CAPA_LAR_SUPPORT); |
973 | bool empty_otp; |
974 | u32 mac_flags; |
975 | u32 sbands_flags = 0; |
976 | @@ -1711,7 +1710,9 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans, |
977 | nvm->valid_tx_ant = (u8)le32_to_cpu(rsp->phy_sku.tx_chains); |
978 | nvm->valid_rx_ant = (u8)le32_to_cpu(rsp->phy_sku.rx_chains); |
979 | |
980 | - if (le32_to_cpu(rsp->regulatory.lar_enabled) && lar_fw_supported) { |
981 | + if (le32_to_cpu(rsp->regulatory.lar_enabled) && |
982 | + fw_has_capa(&fw->ucode_capa, |
983 | + IWL_UCODE_TLV_CAPA_LAR_SUPPORT)) { |
984 | nvm->lar_enabled = true; |
985 | sbands_flags |= IWL_NVM_SBANDS_FLAGS_LAR; |
986 | } |
987 | diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h |
988 | index 4eeedb4..fb0b385 100644 |
989 | --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h |
990 | +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h |
991 | @@ -85,10 +85,11 @@ enum iwl_nvm_sbands_flags { |
992 | */ |
993 | struct iwl_nvm_data * |
994 | iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, |
995 | + const struct iwl_fw *fw, |
996 | const __be16 *nvm_hw, const __le16 *nvm_sw, |
997 | const __le16 *nvm_calib, const __le16 *regulatory, |
998 | const __le16 *mac_override, const __le16 *phy_sku, |
999 | - u8 tx_chains, u8 rx_chains, bool lar_fw_supported); |
1000 | + u8 tx_chains, u8 rx_chains); |
1001 | |
1002 | /** |
1003 | * iwl_parse_mcc_info - parse MCC (mobile country code) info coming from FW |
1004 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h |
1005 | index 77af9cd..3f512d1 100644 |
1006 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h |
1007 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h |
1008 | @@ -161,6 +161,10 @@ |
1009 | #define IWL_MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT 20016 |
1010 | #define IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT 20016 |
1011 | #define IWL_MVM_FTM_INITIATOR_SMOOTH_AGE_SEC 2 |
1012 | +#define IWL_MVM_PHY_FILTER_CHAIN_A 0 |
1013 | +#define IWL_MVM_PHY_FILTER_CHAIN_B 0 |
1014 | +#define IWL_MVM_PHY_FILTER_CHAIN_C 0 |
1015 | +#define IWL_MVM_PHY_FILTER_CHAIN_D 0 |
1016 | #else /* CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES */ |
1017 | #define IWL_MVM_DEFAULT_PS_TX_DATA_TIMEOUT (mvm->trans->dbg_cfg.MVM_DEFAULT_PS_TX_DATA_TIMEOUT) |
1018 | #define IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (mvm->trans->dbg_cfg.MVM_DEFAULT_PS_RX_DATA_TIMEOUT) |
1019 | @@ -255,6 +259,10 @@ |
1020 | #define IWL_MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT) |
1021 | #define IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT) |
1022 | #define IWL_MVM_FTM_INITIATOR_SMOOTH_AGE_SEC (mvm->trans->dbg_cfg.MVM_FTM_INITIATOR_SMOOTH_AGE_SEC) |
1023 | +#define IWL_MVM_PHY_FILTER_CHAIN_A (mvm->trans->dbg_cfg.MVM_PHY_FILTER_CHAIN_A) |
1024 | +#define IWL_MVM_PHY_FILTER_CHAIN_B (mvm->trans->dbg_cfg.MVM_PHY_FILTER_CHAIN_B) |
1025 | +#define IWL_MVM_PHY_FILTER_CHAIN_C (mvm->trans->dbg_cfg.MVM_PHY_FILTER_CHAIN_C) |
1026 | +#define IWL_MVM_PHY_FILTER_CHAIN_D (mvm->trans->dbg_cfg.MVM_PHY_FILTER_CHAIN_D) |
1027 | |
1028 | #endif /* CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES */ |
1029 | |
1030 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c |
1031 | index 5e88b8b..9c2db68 100644 |
1032 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c |
1033 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c |
1034 | @@ -8,6 +8,7 @@ |
1035 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
1036 | * Copyright (C) 2018 Intel Corporation |
1037 | * Copyright (C) 2019 Intel Corporation |
1038 | + * Copyright (C) 2020 Intel Corporation |
1039 | * |
1040 | * This program is free software; you can redistribute it and/or modify |
1041 | * it under the terms of version 2 of the GNU General Public License as |
1042 | @@ -30,6 +31,7 @@ |
1043 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
1044 | * Copyright (C) 2018 Intel Corporation |
1045 | * Copyright (C) 2019 Intel Corporation |
1046 | + * Copyright (C) 2020 Intel Corporation |
1047 | * All rights reserved. |
1048 | * |
1049 | * Redistribution and use in source and binary forms, with or without |
1050 | @@ -599,6 +601,8 @@ void iwl_mvm_ftm_abort(struct iwl_mvm *mvm, struct cfg80211_pmsr_request *req) |
1051 | if (req != mvm->ftm_initiator.req) |
1052 | return; |
1053 | |
1054 | + iwl_mvm_ftm_reset(mvm); |
1055 | + |
1056 | if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_RANGE_ABORT_CMD, |
1057 | LOCATION_GROUP, 0), |
1058 | 0, sizeof(cmd), &cmd)) |
1059 | @@ -801,7 +805,6 @@ void iwl_mvm_ftm_range_resp(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) |
1060 | lockdep_assert_held(&mvm->mutex); |
1061 | |
1062 | if (!mvm->ftm_initiator.req) { |
1063 | - IWL_ERR(mvm, "Got FTM response but have no request?\n"); |
1064 | return; |
1065 | } |
1066 | |
1067 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c |
1068 | index d8b5137..2b041f1 100644 |
1069 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c |
1070 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c |
1071 | @@ -5,10 +5,9 @@ |
1072 | * |
1073 | * GPL LICENSE SUMMARY |
1074 | * |
1075 | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
1076 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
1077 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
1078 | - * Copyright(c) 2018 - 2019 Intel Corporation |
1079 | + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation |
1080 | * |
1081 | * This program is free software; you can redistribute it and/or modify |
1082 | * it under the terms of version 2 of the GNU General Public License as |
1083 | @@ -28,10 +27,9 @@ |
1084 | * |
1085 | * BSD LICENSE |
1086 | * |
1087 | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
1088 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
1089 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
1090 | - * Copyright(c) 2018 - 2019 Intel Corporation |
1091 | + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation |
1092 | * All rights reserved. |
1093 | * |
1094 | * Redistribution and use in source and binary forms, with or without |
1095 | @@ -108,6 +106,20 @@ static int iwl_set_soc_latency(struct iwl_mvm *mvm) |
1096 | if (!mvm->trans->trans_cfg->integrated) |
1097 | cmd.flags = cpu_to_le32(SOC_CONFIG_CMD_FLAGS_DISCRETE); |
1098 | |
1099 | + BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_NONE != |
1100 | + SOC_FLAGS_LTR_APPLY_DELAY_NONE); |
1101 | + BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_200US != |
1102 | + SOC_FLAGS_LTR_APPLY_DELAY_200); |
1103 | + BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_2500US != |
1104 | + SOC_FLAGS_LTR_APPLY_DELAY_2500); |
1105 | + BUILD_BUG_ON(IWL_CFG_TRANS_LTR_DELAY_1820US != |
1106 | + SOC_FLAGS_LTR_APPLY_DELAY_1820); |
1107 | + |
1108 | + if (mvm->trans->trans_cfg->ltr_delay != IWL_CFG_TRANS_LTR_DELAY_NONE && |
1109 | + !WARN_ON(!mvm->trans->trans_cfg->integrated)) |
1110 | + cmd.flags |= le32_encode_bits(mvm->trans->trans_cfg->ltr_delay, |
1111 | + SOC_FLAGS_LTR_APPLY_DELAY_MASK); |
1112 | + |
1113 | if (iwl_fw_lookup_cmd_ver(mvm->fw, IWL_ALWAYS_LONG_GROUP, |
1114 | SCAN_REQ_UMAC) >= 2 && |
1115 | mvm->trans->trans_cfg->low_latency_xtal) |
1116 | @@ -561,10 +573,49 @@ error: |
1117 | return ret; |
1118 | } |
1119 | |
1120 | +#ifdef CONFIG_ACPI |
1121 | +static void iwl_mvm_phy_filter_init(struct iwl_mvm *mvm, |
1122 | + struct iwl_phy_specific_cfg *phy_filters) |
1123 | +{ |
1124 | + /* |
1125 | + * TODO: read specific phy config from BIOS |
1126 | + * ACPI table for this feature has not been defined yet, |
1127 | + * so for now we use hardcoded values. |
1128 | + */ |
1129 | + |
1130 | + if (IWL_MVM_PHY_FILTER_CHAIN_A) { |
1131 | + phy_filters->filter_cfg_chain_a = |
1132 | + cpu_to_le32(IWL_MVM_PHY_FILTER_CHAIN_A); |
1133 | + } |
1134 | + if (IWL_MVM_PHY_FILTER_CHAIN_B) { |
1135 | + phy_filters->filter_cfg_chain_b = |
1136 | + cpu_to_le32(IWL_MVM_PHY_FILTER_CHAIN_B); |
1137 | + } |
1138 | + if (IWL_MVM_PHY_FILTER_CHAIN_C) { |
1139 | + phy_filters->filter_cfg_chain_c = |
1140 | + cpu_to_le32(IWL_MVM_PHY_FILTER_CHAIN_C); |
1141 | + } |
1142 | + if (IWL_MVM_PHY_FILTER_CHAIN_D) { |
1143 | + phy_filters->filter_cfg_chain_d = |
1144 | + cpu_to_le32(IWL_MVM_PHY_FILTER_CHAIN_D); |
1145 | + } |
1146 | +} |
1147 | + |
1148 | +#else /* CONFIG_ACPI */ |
1149 | + |
1150 | +static void iwl_mvm_phy_filter_init(struct iwl_mvm *mvm, |
1151 | + struct iwl_phy_specific_cfg *phy_filters) |
1152 | +{ |
1153 | +} |
1154 | +#endif /* CONFIG_ACPI */ |
1155 | + |
1156 | static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm) |
1157 | { |
1158 | - struct iwl_phy_cfg_cmd phy_cfg_cmd; |
1159 | + struct iwl_phy_cfg_cmd_v3 phy_cfg_cmd; |
1160 | enum iwl_ucode_type ucode_type = mvm->fwrt.cur_fw_img; |
1161 | + struct iwl_phy_specific_cfg phy_filters = {}; |
1162 | + u8 cmd_ver; |
1163 | + size_t cmd_size; |
1164 | #ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES |
1165 | u32 override_mask, flow_override, flow_src; |
1166 | u32 event_override, event_src; |
1167 | @@ -601,6 +652,14 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm) |
1168 | phy_cfg_cmd.calib_control.flow_trigger = |
1169 | mvm->fw->default_calib[ucode_type].flow_trigger; |
1170 | |
1171 | + cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, IWL_ALWAYS_LONG_GROUP, |
1172 | + PHY_CONFIGURATION_CMD); |
1173 | + if (cmd_ver == 3) { |
1174 | + iwl_mvm_phy_filter_init(mvm, &phy_filters); |
1175 | + memcpy(&phy_cfg_cmd.phy_specific_cfg, &phy_filters, |
1176 | + sizeof(struct iwl_phy_specific_cfg)); |
1177 | + } |
1178 | + |
1179 | #ifdef CPTCFG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES |
1180 | override_mask = mvm->trans->dbg_cfg.MVM_CALIB_OVERRIDE_CONTROL; |
1181 | if (override_mask) { |
1182 | @@ -669,9 +728,10 @@ static int iwl_send_phy_cfg_cmd(struct iwl_mvm *mvm) |
1183 | #endif |
1184 | IWL_DEBUG_INFO(mvm, "Sending Phy CFG command: 0x%x\n", |
1185 | phy_cfg_cmd.phy_cfg); |
1186 | - |
1187 | + cmd_size = (cmd_ver == 3) ? sizeof(struct iwl_phy_cfg_cmd_v3) : |
1188 | + sizeof(struct iwl_phy_cfg_cmd_v1); |
1189 | return iwl_mvm_send_cmd_pdu(mvm, PHY_CONFIGURATION_CMD, 0, |
1190 | - sizeof(phy_cfg_cmd), &phy_cfg_cmd); |
1191 | + cmd_size, &phy_cfg_cmd); |
1192 | } |
1193 | |
1194 | int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) |
1195 | @@ -1015,6 +1075,40 @@ static int iwl_mvm_ppag_init(struct iwl_mvm *mvm) |
1196 | return iwl_mvm_ppag_send_cmd(mvm); |
1197 | } |
1198 | |
1199 | +static void iwl_mvm_tas_init(struct iwl_mvm *mvm) |
1200 | +{ |
1201 | + int ret; |
1202 | + struct iwl_tas_config_cmd cmd = {}; |
1203 | + int list_size; |
1204 | + |
1205 | + BUILD_BUG_ON(ARRAY_SIZE(cmd.black_list_array) < |
1206 | + APCI_WTAS_BLACK_LIST_MAX); |
1207 | + |
1208 | + if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TAS_CFG)) { |
1209 | + IWL_DEBUG_RADIO(mvm, "TAS not enabled in FW\n"); |
1210 | + return; |
1211 | + } |
1212 | + |
1213 | + ret = iwl_acpi_get_tas(&mvm->fwrt, cmd.black_list_array, &list_size); |
1214 | + if (ret < 0) { |
1215 | + IWL_DEBUG_RADIO(mvm, |
1216 | + "TAS table invalid or unavailable. (%d)\n", |
1217 | + ret); |
1218 | + return; |
1219 | + } |
1220 | + |
1221 | + if (list_size < 0) |
1222 | + return; |
1223 | + |
1224 | + /* list size if TAS enabled can only be non-negative */ |
1225 | + cmd.black_list_size = cpu_to_le32((u32)list_size); |
1226 | + |
1227 | + ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(REGULATORY_AND_NVM_GROUP, |
1228 | + TAS_CONFIG), |
1229 | + 0, sizeof(cmd), &cmd); |
1230 | + if (ret < 0) |
1231 | + IWL_DEBUG_RADIO(mvm, "failed to send TAS_CONFIG (%d)\n", ret); |
1232 | +} |
1233 | #else /* CONFIG_ACPI */ |
1234 | |
1235 | inline int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, |
1236 | @@ -1042,6 +1136,10 @@ static int iwl_mvm_ppag_init(struct iwl_mvm *mvm) |
1237 | { |
1238 | return 0; |
1239 | } |
1240 | + |
1241 | +static void iwl_mvm_tas_init(struct iwl_mvm *mvm) |
1242 | +{ |
1243 | +} |
1244 | #endif /* CONFIG_ACPI */ |
1245 | |
1246 | void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) |
1247 | @@ -1448,6 +1546,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm) |
1248 | if (ret < 0) |
1249 | goto error; |
1250 | |
1251 | + iwl_mvm_tas_init(mvm); |
1252 | iwl_mvm_leds_sync(mvm); |
1253 | |
1254 | iwl_mvm_ftm_initiator_smooth_config(mvm); |
1255 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c |
1256 | index 76e45ec..4343058 100644 |
1257 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c |
1258 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c |
1259 | @@ -5,10 +5,9 @@ |
1260 | * |
1261 | * GPL LICENSE SUMMARY |
1262 | * |
1263 | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
1264 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
1265 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
1266 | - * Copyright(c) 2018 - 2019 Intel Corporation |
1267 | + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation |
1268 | * |
1269 | * This program is free software; you can redistribute it and/or modify |
1270 | * it under the terms of version 2 of the GNU General Public License as |
1271 | @@ -28,10 +27,9 @@ |
1272 | * |
1273 | * BSD LICENSE |
1274 | * |
1275 | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
1276 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
1277 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
1278 | - * Copyright(c) 2018 - 2019 Intel Corporation |
1279 | + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation |
1280 | * All rights reserved. |
1281 | * |
1282 | * Redistribution and use in source and binary forms, with or without |
1283 | @@ -2157,7 +2155,7 @@ static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm, |
1284 | rcu_read_lock(); |
1285 | |
1286 | sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_ctxt_cmd.sta_id]); |
1287 | - if (IS_ERR(sta)) { |
1288 | + if (IS_ERR_OR_NULL(sta)) { |
1289 | rcu_read_unlock(); |
1290 | WARN(1, "Can't find STA to configure HE\n"); |
1291 | return; |
1292 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h |
1293 | index 61853a7..b4855dc 100644 |
1294 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h |
1295 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h |
1296 | @@ -1389,9 +1389,6 @@ static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm) |
1297 | bool tlv_lar = fw_has_capa(&mvm->fw->ucode_capa, |
1298 | IWL_UCODE_TLV_CAPA_LAR_SUPPORT); |
1299 | |
1300 | - if (iwlwifi_mod_params.lar_disable) |
1301 | - return false; |
1302 | - |
1303 | /* |
1304 | * Enable LAR only if it is supported by the FW (TLV) && |
1305 | * enabled in the NVM |
1306 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c |
1307 | index 1b6b242..d2649ef 100644 |
1308 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c |
1309 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c |
1310 | @@ -277,7 +277,6 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) |
1311 | struct iwl_nvm_section *sections = mvm->nvm_sections; |
1312 | const __be16 *hw; |
1313 | const __le16 *sw, *calib, *regulatory, *mac_override, *phy_sku; |
1314 | - bool lar_enabled; |
1315 | int regulatory_type; |
1316 | |
1317 | /* Checking for required sections */ |
1318 | @@ -327,14 +326,9 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) |
1319 | (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY_SDP].data : |
1320 | (const __le16 *)sections[NVM_SECTION_TYPE_REGULATORY].data; |
1321 | |
1322 | - lar_enabled = !iwlwifi_mod_params.lar_disable && |
1323 | - fw_has_capa(&mvm->fw->ucode_capa, |
1324 | - IWL_UCODE_TLV_CAPA_LAR_SUPPORT); |
1325 | - |
1326 | - return iwl_parse_nvm_data(mvm->trans, mvm->cfg, hw, sw, calib, |
1327 | + return iwl_parse_nvm_data(mvm->trans, mvm->cfg, mvm->fw, hw, sw, calib, |
1328 | regulatory, mac_override, phy_sku, |
1329 | - mvm->fw->valid_tx_ant, mvm->fw->valid_rx_ant, |
1330 | - lar_enabled); |
1331 | + mvm->fw->valid_tx_ant, mvm->fw->valid_rx_ant); |
1332 | } |
1333 | |
1334 | /* Loads the NVM data stored in mvm->nvm_sections into the NIC */ |
1335 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c |
1336 | index a0524da..f9cef76 100644 |
1337 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c |
1338 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c |
1339 | @@ -566,6 +566,7 @@ static const struct iwl_hcmd_names iwl_mvm_prot_offload_names[] = { |
1340 | static const struct iwl_hcmd_names iwl_mvm_regulatory_and_nvm_names[] = { |
1341 | HCMD_NAME(NVM_ACCESS_COMPLETE), |
1342 | HCMD_NAME(NVM_GET_INFO), |
1343 | + HCMD_NAME(TAS_CONFIG), |
1344 | }; |
1345 | |
1346 | static const struct iwl_hcmd_arr iwl_mvm_groups[] = { |
1347 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c |
1348 | index 98e1a85..696d70f 100644 |
1349 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c |
1350 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c |
1351 | @@ -1233,7 +1233,7 @@ static int iwl_mvm_legacy_config_scan(struct iwl_mvm *mvm) |
1352 | cmd_size = sizeof(struct iwl_scan_config_v2); |
1353 | else |
1354 | cmd_size = sizeof(struct iwl_scan_config_v1); |
1355 | - cmd_size += num_channels; |
1356 | + cmd_size += mvm->fw->ucode_capa.n_scan_channels; |
1357 | |
1358 | cfg = kzalloc(cmd_size, GFP_KERNEL); |
1359 | if (!cfg) |
1360 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c |
1361 | index 3db864a..04e1e08 100644 |
1362 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c |
1363 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c |
1364 | @@ -3322,6 +3322,10 @@ static int iwl_mvm_send_sta_igtk(struct iwl_mvm *mvm, |
1365 | igtk_cmd.sta_id = cpu_to_le32(sta_id); |
1366 | |
1367 | if (remove_key) { |
1368 | + /* This is a valid situation for IGTK */ |
1369 | + if (sta_id == IWL_MVM_INVALID_STA) |
1370 | + return 0; |
1371 | + |
1372 | igtk_cmd.ctrl_flags |= cpu_to_le32(STA_KEY_NOT_VALID); |
1373 | } else { |
1374 | struct ieee80211_key_seq seq; |
1375 | @@ -3576,9 +3580,9 @@ int iwl_mvm_remove_sta_key(struct iwl_mvm *mvm, |
1376 | IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n", |
1377 | keyconf->keyidx, sta_id); |
1378 | |
1379 | - if (mvm_sta && (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC || |
1380 | - keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || |
1381 | - keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)) |
1382 | + if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC || |
1383 | + keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || |
1384 | + keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) |
1385 | return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true); |
1386 | |
1387 | if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) { |
1388 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c |
1389 | index b5a16f0..418e59b 100644 |
1390 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c |
1391 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c |
1392 | @@ -8,7 +8,7 @@ |
1393 | * Copyright(c) 2013 - 2014, 2019 Intel Corporation. All rights reserved. |
1394 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
1395 | * Copyright(c) 2015 - 2016 Intel Deutschland GmbH |
1396 | - * Copyright(c) 2019 Intel Corporation |
1397 | + * Copyright(c) 2019 - 2020 Intel Corporation |
1398 | * |
1399 | * This program is free software; you can redistribute it and/or modify |
1400 | * it under the terms of version 2 of the GNU General Public License as |
1401 | @@ -31,7 +31,7 @@ |
1402 | * Copyright(c) 2012 - 2014, 2019 Intel Corporation. All rights reserved. |
1403 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
1404 | * Copyright(c) 2015 - 2016 Intel Deutschland GmbH |
1405 | - * Copyright(c) 2019 Intel Corporation |
1406 | + * Copyright(c) 2019 - 2020 Intel Corporation |
1407 | * All rights reserved. |
1408 | * |
1409 | * Redistribution and use in source and binary forms, with or without |
1410 | @@ -234,7 +234,7 @@ static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm) |
1411 | .flags = cpu_to_le32(DTS_TRIGGER_CMD_FLAGS_TEMP), |
1412 | }; |
1413 | struct iwl_ext_dts_measurement_cmd extcmd = { |
1414 | - .control_mode = cpu_to_le32(DTS_AUTOMATIC), |
1415 | + .control_mode = cpu_to_le32(DTS_DIRECT_WITHOUT_MEASURE), |
1416 | }; |
1417 | u32 cmdid; |
1418 | |
1419 | @@ -734,7 +734,8 @@ static struct thermal_zone_device_ops tzone_ops = { |
1420 | static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm) |
1421 | { |
1422 | int i; |
1423 | - char name[] = "iwlwifi"; |
1424 | + char name[16]; |
1425 | + static atomic_t counter = ATOMIC_INIT(0); |
1426 | |
1427 | if (!iwl_mvm_is_tt_in_fw(mvm)) { |
1428 | mvm->tz_device.tzone = NULL; |
1429 | @@ -744,6 +745,7 @@ static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm) |
1430 | |
1431 | BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH); |
1432 | |
1433 | + sprintf(name, "iwlwifi_%u", atomic_inc_return(&counter) & 0xFF); |
1434 | mvm->tz_device.tzone = thermal_zone_device_register(name, |
1435 | IWL_MAX_DTS_TRIPS, |
1436 | IWL_WRITABLE_TRIPS_MSK, |
1437 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c |
1438 | index 01f248b..27e94e6 100644 |
1439 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c |
1440 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c |
1441 | @@ -5,7 +5,7 @@ |
1442 | * |
1443 | * GPL LICENSE SUMMARY |
1444 | * |
1445 | - * Copyright(c) 2018 - 2019 Intel Corporation |
1446 | + * Copyright(c) 2018 - 2020 Intel Corporation |
1447 | * |
1448 | * This program is free software; you can redistribute it and/or modify |
1449 | * it under the terms of version 2 of the GNU General Public License as |
1450 | @@ -18,7 +18,7 @@ |
1451 | * |
1452 | * BSD LICENSE |
1453 | * |
1454 | - * Copyright(c) 2018 - 2019 Intel Corporation |
1455 | + * Copyright(c) 2018 - 2020 Intel Corporation |
1456 | * All rights reserved. |
1457 | * |
1458 | * Redistribution and use in source and binary forms, with or without |
1459 | @@ -84,32 +84,35 @@ iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans, |
1460 | |
1461 | fw_mon_cfg = &trans->dbg.fw_mon_cfg[alloc_id]; |
1462 | |
1463 | - if (le32_to_cpu(fw_mon_cfg->buf_location) == |
1464 | - IWL_FW_INI_LOCATION_SRAM_PATH) { |
1465 | + switch (le32_to_cpu(fw_mon_cfg->buf_location)) { |
1466 | + case IWL_FW_INI_LOCATION_SRAM_PATH: |
1467 | dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_INTERNAL; |
1468 | - |
1469 | IWL_DEBUG_FW(trans, |
1470 | - "WRT: Applying SMEM buffer destination\n"); |
1471 | - |
1472 | - goto out; |
1473 | - } |
1474 | - |
1475 | - if (le32_to_cpu(fw_mon_cfg->buf_location) == |
1476 | - IWL_FW_INI_LOCATION_DRAM_PATH && |
1477 | - trans->dbg.fw_mon_ini[alloc_id].num_frags) { |
1478 | - struct iwl_dram_data *frag = |
1479 | - &trans->dbg.fw_mon_ini[alloc_id].frags[0]; |
1480 | - |
1481 | - dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_DRAM; |
1482 | + "WRT: Applying SMEM buffer destination\n"); |
1483 | + break; |
1484 | |
1485 | + case IWL_FW_INI_LOCATION_NPK_PATH: |
1486 | + dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_TB22DTF; |
1487 | IWL_DEBUG_FW(trans, |
1488 | - "WRT: Applying DRAM destination (alloc_id=%u)\n", |
1489 | - alloc_id); |
1490 | + "WRT: Applying NPK buffer destination\n"); |
1491 | + break; |
1492 | |
1493 | - dbg_cfg->hwm_base_addr = cpu_to_le64(frag->physical); |
1494 | - dbg_cfg->hwm_size = cpu_to_le32(frag->size); |
1495 | + case IWL_FW_INI_LOCATION_DRAM_PATH: |
1496 | + if (trans->dbg.fw_mon_ini[alloc_id].num_frags) { |
1497 | + struct iwl_dram_data *frag = |
1498 | + &trans->dbg.fw_mon_ini[alloc_id].frags[0]; |
1499 | + dbg_flags |= IWL_PRPH_SCRATCH_EDBG_DEST_DRAM; |
1500 | + dbg_cfg->hwm_base_addr = cpu_to_le64(frag->physical); |
1501 | + dbg_cfg->hwm_size = cpu_to_le32(frag->size); |
1502 | + IWL_DEBUG_FW(trans, |
1503 | + "WRT: Applying DRAM destination (alloc_id=%u, num_frags=%u)\n", |
1504 | + alloc_id, |
1505 | + trans->dbg.fw_mon_ini[alloc_id].num_frags); |
1506 | + } |
1507 | + break; |
1508 | + default: |
1509 | + IWL_ERR(trans, "WRT: Invalid buffer destination\n"); |
1510 | } |
1511 | - |
1512 | out: |
1513 | if (dbg_flags) |
1514 | *control_flags |= IWL_PRPH_SCRATCH_EARLY_DEBUG_EN | dbg_flags; |
1515 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
1516 | index 23c2aec..cbe49d9 100644 |
1517 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
1518 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c |
1519 | @@ -338,8 +338,10 @@ static const struct pci_device_id iwl_hw_card_ids[] = { |
1520 | /* Qu devices */ |
1521 | {IWL_PCI_DEVICE(0x02F0, PCI_ANY_ID, iwl_qu_trans_cfg)}, |
1522 | {IWL_PCI_DEVICE(0x06F0, PCI_ANY_ID, iwl_qu_trans_cfg)}, |
1523 | - {IWL_PCI_DEVICE(0x34F0, PCI_ANY_ID, iwl_qu_trans_cfg)}, |
1524 | - {IWL_PCI_DEVICE(0x3DF0, PCI_ANY_ID, iwl_qu_trans_cfg)}, |
1525 | + |
1526 | + {IWL_PCI_DEVICE(0x34F0, PCI_ANY_ID, iwl_qu_medium_latency_trans_cfg)}, |
1527 | + {IWL_PCI_DEVICE(0x3DF0, PCI_ANY_ID, iwl_qu_medium_latency_trans_cfg)}, |
1528 | + {IWL_PCI_DEVICE(0x4DF0, PCI_ANY_ID, iwl_qu_medium_latency_trans_cfg)}, |
1529 | |
1530 | {IWL_PCI_DEVICE(0x43F0, PCI_ANY_ID, iwl_qu_long_latency_trans_cfg)}, |
1531 | {IWL_PCI_DEVICE(0xA0F0, PCI_ANY_ID, iwl_qu_long_latency_trans_cfg)}, |
1532 | @@ -356,12 +358,17 @@ static const struct pci_device_id iwl_hw_card_ids[] = { |
1533 | {IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_ty_gf_a0)}, |
1534 | {IWL_PCI_DEVICE(0x2725, 0x0510, iwlax210_2ax_cfg_ty_gf_a0)}, |
1535 | {IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_ty_gf_a0)}, |
1536 | - {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax411_2ax_cfg_so_gf4_a0)}, |
1537 | - {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax211_2ax_cfg_so_gf_a0)}, |
1538 | - {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax211_2ax_cfg_so_gf_a0)}, |
1539 | - {IWL_PCI_DEVICE(0x7A70, 0x0510, iwlax211_2ax_cfg_so_gf_a0)}, |
1540 | - {IWL_PCI_DEVICE(0x7A70, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)}, |
1541 | + {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax411_2ax_cfg_sosnj_gf4_a0)}, |
1542 | + {IWL_PCI_DEVICE(0x2726, 0x0090, iwlax211_cfg_snj_gf_a0)}, |
1543 | + {IWL_PCI_DEVICE(0x2726, 0x00B0, iwlax411_2ax_cfg_sosnj_gf4_a0)}, |
1544 | + {IWL_PCI_DEVICE(0x2726, 0x0510, iwlax211_cfg_snj_gf_a0)}, |
1545 | + {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax211_2ax_cfg_so_gf_a0_long)}, |
1546 | + {IWL_PCI_DEVICE(0x7A70, 0x00B0, iwlax411_2ax_cfg_so_gf4_a0_long)}, |
1547 | + {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax211_2ax_cfg_so_gf_a0_long)}, |
1548 | + {IWL_PCI_DEVICE(0x7A70, 0x0510, iwlax211_2ax_cfg_so_gf_a0_long)}, |
1549 | + {IWL_PCI_DEVICE(0x7A70, 0x0A10, iwlax211_2ax_cfg_so_gf_a0_long)}, |
1550 | {IWL_PCI_DEVICE(0x7AF0, 0x0090, iwlax211_2ax_cfg_so_gf_a0)}, |
1551 | + {IWL_PCI_DEVICE(0x7AF0, 0x00B0, iwlax411_2ax_cfg_so_gf4_a0)}, |
1552 | {IWL_PCI_DEVICE(0x7AF0, 0x0310, iwlax211_2ax_cfg_so_gf_a0)}, |
1553 | {IWL_PCI_DEVICE(0x7AF0, 0x0510, iwlax211_2ax_cfg_so_gf_a0)}, |
1554 | {IWL_PCI_DEVICE(0x7AF0, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)}, |
1555 | @@ -461,6 +468,32 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { |
1556 | IWL_DEV_INFO(0x34F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), |
1557 | IWL_DEV_INFO(0x34F0, 0x4244, iwl_ax101_cfg_qu_hr, NULL), |
1558 | |
1559 | + IWL_DEV_INFO(0x3DF0, 0x0044, iwl_ax101_cfg_qu_hr, NULL), |
1560 | + IWL_DEV_INFO(0x3DF0, 0x0070, iwl_ax201_cfg_qu_hr, NULL), |
1561 | + IWL_DEV_INFO(0x3DF0, 0x0074, iwl_ax201_cfg_qu_hr, NULL), |
1562 | + IWL_DEV_INFO(0x3DF0, 0x0078, iwl_ax201_cfg_qu_hr, NULL), |
1563 | + IWL_DEV_INFO(0x3DF0, 0x007C, iwl_ax201_cfg_qu_hr, NULL), |
1564 | + IWL_DEV_INFO(0x3DF0, 0x0244, iwl_ax101_cfg_qu_hr, NULL), |
1565 | + IWL_DEV_INFO(0x3DF0, 0x0310, iwl_ax201_cfg_qu_hr, NULL), |
1566 | + IWL_DEV_INFO(0x3DF0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL), |
1567 | + IWL_DEV_INFO(0x3DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL), |
1568 | + IWL_DEV_INFO(0x3DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), |
1569 | + IWL_DEV_INFO(0x3DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), |
1570 | + IWL_DEV_INFO(0x3DF0, 0x4244, iwl_ax101_cfg_qu_hr, NULL), |
1571 | + |
1572 | + IWL_DEV_INFO(0x4DF0, 0x0044, iwl_ax101_cfg_qu_hr, NULL), |
1573 | + IWL_DEV_INFO(0x4DF0, 0x0070, iwl_ax201_cfg_qu_hr, NULL), |
1574 | + IWL_DEV_INFO(0x4DF0, 0x0074, iwl_ax201_cfg_qu_hr, NULL), |
1575 | + IWL_DEV_INFO(0x4DF0, 0x0078, iwl_ax201_cfg_qu_hr, NULL), |
1576 | + IWL_DEV_INFO(0x4DF0, 0x007C, iwl_ax201_cfg_qu_hr, NULL), |
1577 | + IWL_DEV_INFO(0x4DF0, 0x0244, iwl_ax101_cfg_qu_hr, NULL), |
1578 | + IWL_DEV_INFO(0x4DF0, 0x0310, iwl_ax201_cfg_qu_hr, NULL), |
1579 | + IWL_DEV_INFO(0x4DF0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, NULL), |
1580 | + IWL_DEV_INFO(0x4DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL), |
1581 | + IWL_DEV_INFO(0x4DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), |
1582 | + IWL_DEV_INFO(0x4DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), |
1583 | + IWL_DEV_INFO(0x4DF0, 0x4244, iwl_ax101_cfg_qu_hr, NULL), |
1584 | + |
1585 | IWL_DEV_INFO(0x2720, 0x0000, iwl22000_2ax_cfg_qnj_hr_b0, NULL), |
1586 | IWL_DEV_INFO(0x2720, 0x0040, iwl22000_2ax_cfg_qnj_hr_b0, NULL), |
1587 | IWL_DEV_INFO(0x2720, 0x0044, iwl22000_2ax_cfg_qnj_hr_b0, NULL), |
1588 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c |
1589 | index e646ac3..54f57f2 100644 |
1590 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c |
1591 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c |
1592 | @@ -1055,21 +1055,8 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans, |
1593 | return ret; |
1594 | } |
1595 | |
1596 | - /* supported for 7000 only for the moment */ |
1597 | - if (iwlwifi_mod_params.fw_monitor && |
1598 | - trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_7000) { |
1599 | - struct iwl_dram_data *fw_mon = &trans->dbg.fw_mon; |
1600 | - |
1601 | - iwl_pcie_alloc_fw_monitor(trans, 0); |
1602 | - if (fw_mon->size) { |
1603 | - iwl_write_prph(trans, MON_BUFF_BASE_ADDR, |
1604 | - fw_mon->physical >> 4); |
1605 | - iwl_write_prph(trans, MON_BUFF_END_ADDR, |
1606 | - (fw_mon->physical + fw_mon->size) >> 4); |
1607 | - } |
1608 | - } else if (iwl_pcie_dbg_on(trans)) { |
1609 | + if (iwl_pcie_dbg_on(trans)) |
1610 | iwl_pcie_apply_destination(trans); |
1611 | - } |
1612 | |
1613 | #ifdef CPTCFG_IWLWIFI_DEVICE_TESTMODE |
1614 | iwl_dnt_configure(trans, image); |
1615 | diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c |
1616 | index bd35097..3478ee8 100644 |
1617 | --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c |
1618 | +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c |
1619 | @@ -340,7 +340,7 @@ static int iwl_pcie_gen2_set_tb_with_wa(struct iwl_trans *trans, |
1620 | } |
1621 | IWL_WARN(trans, |
1622 | "TB bug workaround: copied %d bytes from 0x%llx to 0x%llx\n", |
1623 | - len, oldphys, phys); |
1624 | + len, (unsigned long long)oldphys, (unsigned long long)phys); |
1625 | |
1626 | ret = 0; |
1627 | unmap: |
1628 | diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/fw.c b/drivers/net/wireless/intel/iwlwifi/xvt/fw.c |
1629 | index 6755e7d..392e0da 100644 |
1630 | --- a/drivers/net/wireless/intel/iwlwifi/xvt/fw.c |
1631 | +++ b/drivers/net/wireless/intel/iwlwifi/xvt/fw.c |
1632 | @@ -360,6 +360,9 @@ int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type) |
1633 | iwl_trans_stop_device(xvt->trans); |
1634 | } |
1635 | |
1636 | + iwl_dbg_tlv_time_point(&xvt->fwrt, IWL_FW_INI_TIME_POINT_AFTER_ALIVE, |
1637 | + NULL); |
1638 | + |
1639 | if (iwl_xvt_is_unified_fw(xvt)) { |
1640 | ret = iwl_xvt_send_extended_config(xvt); |
1641 | if (ret) { |
1642 | @@ -377,11 +380,13 @@ int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type) |
1643 | IWL_UCODE_TLV_CAPA_SET_LTR_GEN2))) |
1644 | WARN_ON(iwl_xvt_config_ltr(xvt)); |
1645 | |
1646 | - xvt->fwrt.dump.conf = FW_DBG_INVALID; |
1647 | - /* if we have a destination, assume EARLY START */ |
1648 | - if (xvt->fw->dbg.dest_tlv) |
1649 | - xvt->fwrt.dump.conf = FW_DBG_START_FROM_ALIVE; |
1650 | - iwl_fw_start_dbg_conf(&xvt->fwrt, FW_DBG_START_FROM_ALIVE); |
1651 | + if (!iwl_trans_dbg_ini_valid(xvt->trans)) { |
1652 | + xvt->fwrt.dump.conf = FW_DBG_INVALID; |
1653 | + /* if we have a destination, assume EARLY START */ |
1654 | + if (xvt->fw->dbg.dest_tlv) |
1655 | + xvt->fwrt.dump.conf = FW_DBG_START_FROM_ALIVE; |
1656 | + iwl_fw_start_dbg_conf(&xvt->fwrt, FW_DBG_START_FROM_ALIVE); |
1657 | + } |
1658 | |
1659 | return ret; |
1660 | } |
1661 | diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c b/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c |
1662 | index 5cca001..4fda9a7 100644 |
1663 | --- a/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c |
1664 | +++ b/drivers/net/wireless/intel/iwlwifi/xvt/user-infc.c |
1665 | @@ -85,6 +85,7 @@ |
1666 | #include "iwl-trans.h" |
1667 | #include "fw/dbg.h" |
1668 | #include "fw/acpi.h" |
1669 | +#include "fw/img.h" |
1670 | |
1671 | #define XVT_UCODE_CALIB_TIMEOUT (CPTCFG_IWL_TIMEOUT_FACTOR * HZ) |
1672 | #define XVT_SCU_BASE (0xe6a00000) |
1673 | @@ -310,7 +311,7 @@ static int iwl_xvt_set_sw_config(struct iwl_xvt *xvt, |
1674 | { |
1675 | struct iwl_xvt_sw_cfg_request *sw_cfg = |
1676 | (struct iwl_xvt_sw_cfg_request *)data_in->data; |
1677 | - struct iwl_phy_cfg_cmd *fw_calib_cmd_cfg = |
1678 | + struct iwl_phy_cfg_cmd_v3 *fw_calib_cmd_cfg = |
1679 | xvt->sw_stack_cfg.fw_calib_cmd_cfg; |
1680 | __le32 cfg_mask = cpu_to_le32(sw_cfg->cfg_mask), |
1681 | fw_calib_event, fw_calib_flow, |
1682 | @@ -370,7 +371,7 @@ static int iwl_xvt_get_sw_config(struct iwl_xvt *xvt, |
1683 | { |
1684 | struct iwl_xvt_sw_cfg_request *get_cfg_req; |
1685 | struct iwl_xvt_sw_cfg_request *sw_cfg; |
1686 | - struct iwl_phy_cfg_cmd *fw_calib_cmd_cfg = |
1687 | + struct iwl_phy_cfg_cmd_v3 *fw_calib_cmd_cfg = |
1688 | xvt->sw_stack_cfg.fw_calib_cmd_cfg; |
1689 | __le32 event_trigger, flow_trigger; |
1690 | int i, u; |
1691 | @@ -425,9 +426,10 @@ static int iwl_xvt_get_sw_config(struct iwl_xvt *xvt, |
1692 | |
1693 | static int iwl_xvt_send_phy_cfg_cmd(struct iwl_xvt *xvt, u32 ucode_type) |
1694 | { |
1695 | - struct iwl_phy_cfg_cmd *calib_cmd_cfg = |
1696 | + struct iwl_phy_cfg_cmd_v3 *calib_cmd_cfg = |
1697 | &xvt->sw_stack_cfg.fw_calib_cmd_cfg[ucode_type]; |
1698 | int err; |
1699 | + size_t cmd_size; |
1700 | |
1701 | IWL_DEBUG_INFO(xvt, "Sending Phy CFG command: 0x%x\n", |
1702 | calib_cmd_cfg->phy_cfg); |
1703 | @@ -437,10 +439,14 @@ static int iwl_xvt_send_phy_cfg_cmd(struct iwl_xvt *xvt, u32 ucode_type) |
1704 | calib_cmd_cfg->calib_control.event_trigger = 0; |
1705 | calib_cmd_cfg->calib_control.flow_trigger = 0; |
1706 | } |
1707 | + cmd_size = iwl_fw_lookup_cmd_ver(xvt->fw, IWL_ALWAYS_LONG_GROUP, |
1708 | + PHY_CONFIGURATION_CMD) == 3 ? |
1709 | + sizeof(struct iwl_phy_cfg_cmd_v3) : |
1710 | + sizeof(struct iwl_phy_cfg_cmd_v1); |
1711 | |
1712 | /* Sending calibration configuration control data */ |
1713 | err = iwl_xvt_send_cmd_pdu(xvt, PHY_CONFIGURATION_CMD, 0, |
1714 | - sizeof(*calib_cmd_cfg), calib_cmd_cfg); |
1715 | + cmd_size, calib_cmd_cfg); |
1716 | if (err) |
1717 | IWL_ERR(xvt, "Error (%d) running INIT calibrations control\n", |
1718 | err); |
1719 | diff --git a/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h b/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h |
1720 | index fd88766..005ad0b 100644 |
1721 | --- a/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h |
1722 | +++ b/drivers/net/wireless/intel/iwlwifi/xvt/xvt.h |
1723 | @@ -191,13 +191,13 @@ struct tx_payload { |
1724 | /** |
1725 | * iwl_sw_stack_config - Holds active SW stack config as set from user space |
1726 | * @load_mask: Which FW are to be loaded during SW stack up |
1727 | - * @iwl_phy_cfg_cmd: Which calibrations should be done |
1728 | + * @fw_calib_cmd_cfg: Which calibrations should be done |
1729 | */ |
1730 | struct iwl_sw_stack_config { |
1731 | u32 load_mask; |
1732 | u32 calib_override_mask; |
1733 | u32 fw_dbg_flags; |
1734 | - struct iwl_phy_cfg_cmd fw_calib_cmd_cfg[IWL_UCODE_TYPE_MAX]; |
1735 | + struct iwl_phy_cfg_cmd_v3 fw_calib_cmd_cfg[IWL_UCODE_TYPE_MAX]; |
1736 | }; |
1737 | |
1738 | /* Note: This structure is read from the device with IO accesses, |
1739 | diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h |
1740 | index 5444959..5a8df7a 100644 |
1741 | --- a/include/linux/ieee80211.h |
1742 | +++ b/include/linux/ieee80211.h |
1743 | @@ -1439,9 +1439,7 @@ struct ieee80211_ht_operation { |
1744 | #define IEEE80211_AP_INFO_TBTT_HDR_FILTERED 0x4 |
1745 | #define IEEE80211_AP_INFO_TBTT_HDR_COLOC 0x8 |
1746 | #define IEEE80211_AP_INFO_TBTT_HDR_COUNT 0xF0 |
1747 | -#define IEEE80211_TBTT_INFO_OFFSET_BSSID 7 |
1748 | #define IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM 8 |
1749 | -#define IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID 11 |
1750 | #define IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM 12 |
1751 | |
1752 | #define IEEE80211_RNR_TBTT_PARAMS_OCT_RECOMMENDED 0x1 |
1753 | @@ -1450,6 +1448,7 @@ struct ieee80211_ht_operation { |
1754 | #define IEEE80211_RNR_TBTT_PARAMS_TRANSMITTED_BSSID 0x8 |
1755 | #define IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS 0x10 |
1756 | #define IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE 0x20 |
1757 | +#define IEEE80211_RNR_TBTT_PARAMS_COLOC_AP 0x40 |
1758 | |
1759 | struct cfg80211_neighbor_ap_info { |
1760 | u8 tbtt_info_hdr; |
1761 | diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c |
1762 | index 67335a7..05b9404 100644 |
1763 | --- a/net/mac80211/mlme.c |
1764 | +++ b/net/mac80211/mlme.c |
1765 | @@ -8,7 +8,7 @@ |
1766 | * Copyright 2007, Michael Wu <flamingice@sourmilk.net> |
1767 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
1768 | * Copyright (C) 2015 - 2017 Intel Deutschland GmbH |
1769 | - * Copyright (C) 2018 - 2019 Intel Corporation |
1770 | + * Copyright (C) 2018 - 2020 Intel Corporation |
1771 | */ |
1772 | |
1773 | #include <linux/delay.h> |
1774 | @@ -193,21 +193,25 @@ ieee80211_determine_chantype_6ghz(struct ieee80211_sub_if_data *sdata, |
1775 | he_chandef.width = NL80211_CHAN_WIDTH_80; |
1776 | break; |
1777 | case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_160MHZ: |
1778 | - /* FIXME: not sure this is right - the spec is weird */ |
1779 | - if (he_6ghz_oper->ccfs1) |
1780 | - he_chandef.width = NL80211_CHAN_WIDTH_80P80; |
1781 | - else |
1782 | + if (abs(he_6ghz_oper->ccfs1 - he_6ghz_oper->ccfs0) == 8) |
1783 | he_chandef.width = NL80211_CHAN_WIDTH_160; |
1784 | + else |
1785 | + he_chandef.width = NL80211_CHAN_WIDTH_80P80; |
1786 | break; |
1787 | } |
1788 | |
1789 | - he_chandef.center_freq1 = |
1790 | - ieee80211_channel_to_frequency(he_6ghz_oper->ccfs0, |
1791 | - NL80211_BAND_6GHZ); |
1792 | - he_chandef.center_freq2 = |
1793 | - ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1, |
1794 | - NL80211_BAND_6GHZ); |
1795 | - |
1796 | + if (he_chandef.width == NL80211_CHAN_WIDTH_160) { |
1797 | + he_chandef.center_freq1 = |
1798 | + ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1, |
1799 | + NL80211_BAND_6GHZ); |
1800 | + } else { |
1801 | + he_chandef.center_freq1 = |
1802 | + ieee80211_channel_to_frequency(he_6ghz_oper->ccfs0, |
1803 | + NL80211_BAND_6GHZ); |
1804 | + he_chandef.center_freq2 = |
1805 | + ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1, |
1806 | + NL80211_BAND_6GHZ); |
1807 | + } |
1808 | if (!cfg80211_chandef_valid(&he_chandef)) { |
1809 | sdata_info(sdata, |
1810 | "HE 6GHz operation resulted in invalid chandef: %d MHz/%d/%d MHz/%d MHz\n", |
1811 | @@ -403,8 +407,8 @@ out: |
1812 | ret |= ieee80211_chandef_downgrade(chandef); |
1813 | } |
1814 | |
1815 | - if (!cfg80211_chandef_usable(sdata->wdev.wiphy, chandef, |
1816 | - IEEE80211_CHAN_NO_HE)) |
1817 | + if (!he_oper || !cfg80211_chandef_usable(sdata->wdev.wiphy, chandef, |
1818 | + IEEE80211_CHAN_NO_HE)) |
1819 | ret |= IEEE80211_STA_DISABLE_HE; |
1820 | |
1821 | if (chandef->width != vht_chandef.width && !tracking) |
1822 | @@ -779,6 +783,13 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) |
1823 | struct ieee80211_chanctx_conf *chanctx_conf; |
1824 | struct ieee80211_channel *chan; |
1825 | u32 rates = 0; |
1826 | + struct element *ext_capa = NULL; |
1827 | + |
1828 | + /* we know it's writable, cast away the const */ |
1829 | + if (assoc_data->ie_len) |
1830 | + ext_capa = (void *)cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, |
1831 | + assoc_data->ie, |
1832 | + assoc_data->ie_len); |
1833 | |
1834 | sdata_assert_lock(sdata); |
1835 | |
1836 | @@ -929,7 +940,15 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) |
1837 | *pos++ = ieee80211_chandef_max_power(&chanctx_conf->def); |
1838 | } |
1839 | |
1840 | - if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) { |
1841 | + /* |
1842 | + * Per spec, we shouldn't include the list of channels if we advertise |
1843 | + * support for extended channel switching, but we've always done that; |
1844 | + * (for now?) apply this restriction only on the (new) 6 GHz band. |
1845 | + */ |
1846 | + if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT && |
1847 | + (sband->band != NL80211_BAND_6GHZ || |
1848 | + !ext_capa || ext_capa->datalen < 1 || |
1849 | + !(ext_capa->data[0] & WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING))) { |
1850 | /* TODO: get this in reg domain format */ |
1851 | pos = skb_put(skb, 2 * sband->n_channels + 2); |
1852 | *pos++ = WLAN_EID_SUPPORTED_CHANNELS; |
1853 | @@ -943,18 +962,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) |
1854 | |
1855 | /* Set MBSSID support for HE AP if needed */ |
1856 | if (ieee80211_hw_check(&local->hw, SUPPORTS_ONLY_HE_MULTI_BSSID) && |
1857 | - !(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && assoc_data->ie_len) { |
1858 | - struct element *elem; |
1859 | - |
1860 | - /* we know it's writable, cast away the const */ |
1861 | - elem = (void *)cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, |
1862 | - assoc_data->ie, |
1863 | - assoc_data->ie_len); |
1864 | - |
1865 | - /* We can probably assume both always true */ |
1866 | - if (elem && elem->datalen >= 3) |
1867 | - elem->data[2] |= WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT; |
1868 | - } |
1869 | + !(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && assoc_data->ie_len && |
1870 | + ext_capa && ext_capa->datalen >= 3) |
1871 | + ext_capa->data[2] |= WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT; |
1872 | |
1873 | /* if present, add any custom IEs that go before HT */ |
1874 | if (assoc_data->ie_len) { |
1875 | @@ -1445,7 +1455,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, |
1876 | if (!res) { |
1877 | ch_switch.timestamp = timestamp; |
1878 | ch_switch.device_timestamp = device_timestamp; |
1879 | - ch_switch.block_tx = beacon ? csa_ie.mode : 0; |
1880 | + ch_switch.block_tx = csa_ie.mode; |
1881 | ch_switch.chandef = csa_ie.chandef; |
1882 | ch_switch.count = csa_ie.count; |
1883 | ch_switch.delay = csa_ie.max_switch_time; |
1884 | @@ -1538,7 +1548,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, |
1885 | |
1886 | sdata->vif.csa_active = true; |
1887 | sdata->csa_chandef = csa_ie.chandef; |
1888 | - sdata->csa_block_tx = ch_switch.block_tx; |
1889 | + sdata->csa_block_tx = csa_ie.mode; |
1890 | ifmgd->csa_ignored_same_chan = false; |
1891 | |
1892 | if (sdata->csa_block_tx) |
1893 | @@ -1572,7 +1582,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, |
1894 | * reset when the disconnection worker runs. |
1895 | */ |
1896 | sdata->vif.csa_active = true; |
1897 | - sdata->csa_block_tx = ch_switch.block_tx; |
1898 | + sdata->csa_block_tx = csa_ie.mode; |
1899 | |
1900 | ieee80211_queue_work(&local->hw, &ifmgd->csa_connection_drop_work); |
1901 | mutex_unlock(&local->chanctx_mtx); |
1902 | @@ -3777,13 +3787,28 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata, |
1903 | struct ieee80211_mgmt *mgmt = (void *)skb->data; |
1904 | struct ieee80211_if_managed *ifmgd; |
1905 | struct ieee80211_rx_status *rx_status = (void *) skb->cb; |
1906 | + struct ieee80211_channel *channel; |
1907 | size_t baselen, len = skb->len; |
1908 | |
1909 | ifmgd = &sdata->u.mgd; |
1910 | |
1911 | sdata_assert_lock(sdata); |
1912 | |
1913 | - if (!ether_addr_equal(mgmt->da, sdata->vif.addr)) |
1914 | + /* |
1915 | + * According to Draft P802.11ax D6.0 clause 26.17.2.3.2: |
1916 | + * "If a 6 GHz AP receives a Probe Request frame and responds with |
1917 | + * a Probe Response frame [..], the Address 1 field of the Probe |
1918 | + * Response frame shall be set to the broadcast address [..]" |
1919 | + * So, on 6GHz band we should also accept broadcast responses. |
1920 | + */ |
1921 | + channel = ieee80211_get_channel(sdata->local->hw.wiphy, |
1922 | + rx_status->freq); |
1923 | + if (!channel) |
1924 | + return; |
1925 | + |
1926 | + if (!ether_addr_equal(mgmt->da, sdata->vif.addr) && |
1927 | + (channel->band != NL80211_BAND_6GHZ || |
1928 | + !is_broadcast_ether_addr(mgmt->da))) |
1929 | return; /* ignore ProbeResp to foreign address */ |
1930 | |
1931 | baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt; |
1932 | diff --git a/net/wireless/core.h b/net/wireless/core.h |
1933 | index 3c4ff6c..e5bc6ec 100644 |
1934 | --- a/net/wireless/core.h |
1935 | +++ b/net/wireless/core.h |
1936 | @@ -385,7 +385,7 @@ void cfg80211_mlme_down(struct cfg80211_registered_device *rdev, |
1937 | struct net_device *dev); |
1938 | int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_pid, |
1939 | u16 frame_type, const u8 *match_data, |
1940 | - int match_len); |
1941 | + int match_len, struct netlink_ext_ack *extack); |
1942 | void cfg80211_mlme_unreg_wk(struct work_struct *wk); |
1943 | void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlpid); |
1944 | void cfg80211_mlme_purge_registrations(struct wireless_dev *wdev); |
1945 | diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c |
1946 | index 1b5cf1a..0657c5a 100644 |
1947 | --- a/net/wireless/mlme.c |
1948 | +++ b/net/wireless/mlme.c |
1949 | @@ -4,6 +4,7 @@ |
1950 | * |
1951 | * Copyright (c) 2009, Jouni Malinen <j@w1.fi> |
1952 | * Copyright (c) 2015 Intel Deutschland GmbH |
1953 | + * Copyright (C) 2019 Intel Corporation |
1954 | */ |
1955 | |
1956 | #include <linux/kernel.h> |
1957 | @@ -470,7 +471,7 @@ void cfg80211_mlme_unreg_wk(struct work_struct *wk) |
1958 | |
1959 | int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid, |
1960 | u16 frame_type, const u8 *match_data, |
1961 | - int match_len) |
1962 | + int match_len, struct netlink_ext_ack *extack) |
1963 | { |
1964 | struct wiphy *wiphy = wdev->wiphy; |
1965 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
1966 | @@ -481,15 +482,38 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid, |
1967 | if (!wdev->wiphy->mgmt_stypes) |
1968 | return -EOPNOTSUPP; |
1969 | |
1970 | - if ((frame_type & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) |
1971 | + if ((frame_type & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) { |
1972 | + NL_SET_ERR_MSG(extack, "frame type not management"); |
1973 | return -EINVAL; |
1974 | + } |
1975 | |
1976 | - if (frame_type & ~(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) |
1977 | + if (frame_type & ~(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) { |
1978 | + NL_SET_ERR_MSG(extack, "Invalid frame type"); |
1979 | return -EINVAL; |
1980 | + } |
1981 | |
1982 | mgmt_type = (frame_type & IEEE80211_FCTL_STYPE) >> 4; |
1983 | - if (!(wdev->wiphy->mgmt_stypes[wdev->iftype].rx & BIT(mgmt_type))) |
1984 | + if (!(wdev->wiphy->mgmt_stypes[wdev->iftype].rx & BIT(mgmt_type))) { |
1985 | + NL_SET_ERR_MSG(extack, |
1986 | + "Registration to specific type not supported"); |
1987 | + return -EINVAL; |
1988 | + } |
1989 | + |
1990 | + /* |
1991 | + * To support Pre Association Security Negotiation (PASN), registration |
1992 | + * for authentication frames should be supported. However, as some |
1993 | + * versions of the user space daemons wrongly register to all types of |
1994 | + * authentication frames (which might result in unexpected behavior) |
1995 | + * allow such registration if the request is for a specific |
1996 | + * authentication algorithm number. |
1997 | + */ |
1998 | + if (wdev->iftype == NL80211_IFTYPE_STATION && |
1999 | + (frame_type & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_AUTH && |
2000 | + !(match_data && match_len >= 2)) { |
2001 | + NL_SET_ERR_MSG(extack, |
2002 | + "Authentication algorithm number required"); |
2003 | return -EINVAL; |
2004 | + } |
2005 | |
2006 | nreg = kzalloc(sizeof(*reg) + match_len, GFP_KERNEL); |
2007 | if (!nreg) |
2008 | @@ -504,6 +528,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid, |
2009 | continue; |
2010 | |
2011 | if (memcmp(reg->match, match_data, mlen) == 0) { |
2012 | + NL_SET_ERR_MSG(extack, "Match already configured"); |
2013 | err = -EALREADY; |
2014 | break; |
2015 | } |
2016 | diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c |
2017 | index 56d8559..fa70b33 100644 |
2018 | --- a/net/wireless/nl80211.c |
2019 | +++ b/net/wireless/nl80211.c |
2020 | @@ -10430,7 +10430,8 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info) |
2021 | return cfg80211_mlme_register_mgmt(wdev, genl_info_snd_portid(info), |
2022 | frame_type, |
2023 | nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]), |
2024 | - nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH])); |
2025 | + nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]), |
2026 | + genl_info_extack(info)); |
2027 | } |
2028 | |
2029 | static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) |
2030 | diff --git a/net/wireless/scan.c b/net/wireless/scan.c |
2031 | index ac6cf47..eeef8d9 100644 |
2032 | --- a/net/wireless/scan.c |
2033 | +++ b/net/wireless/scan.c |
2034 | @@ -484,8 +484,8 @@ static bool cfg80211_bss_expire_oldest(struct cfg80211_registered_device *rdev) |
2035 | return ret; |
2036 | } |
2037 | |
2038 | -static void cfg80211_parse_bss_param(u8 data, |
2039 | - struct cfg80211_colocated_ap *coloc_ap) |
2040 | +static u8 cfg80211_parse_bss_param(u8 data, |
2041 | + struct cfg80211_colocated_ap *coloc_ap) |
2042 | { |
2043 | coloc_ap->oct_recommended = |
2044 | u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_OCT_RECOMMENDED); |
2045 | @@ -499,6 +499,8 @@ static void cfg80211_parse_bss_param(u8 data, |
2046 | u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE); |
2047 | coloc_ap->colocated_ess = |
2048 | u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_COLOC_ESS); |
2049 | + |
2050 | + return u8_get_bits(data, IEEE80211_RNR_TBTT_PARAMS_COLOC_AP); |
2051 | } |
2052 | |
2053 | static int cfg80211_calc_short_ssid(const struct cfg80211_bss_ies *ies, |
2054 | @@ -524,7 +526,7 @@ static void cfg80211_free_coloc_ap_list(struct list_head *coloc_ap_list) |
2055 | } |
2056 | |
2057 | static int cfg80211_parse_ap_info(struct cfg80211_colocated_ap *entry, |
2058 | - const u8 *pos, u8 length, bool filtered, |
2059 | + const u8 *pos, u8 length, |
2060 | const struct element *ssid_elem, |
2061 | int s_ssid_tmp) |
2062 | { |
2063 | @@ -534,25 +536,24 @@ static int cfg80211_parse_ap_info(struct cfg80211_colocated_ap *entry, |
2064 | memcpy(entry->bssid, pos, ETH_ALEN); |
2065 | pos += ETH_ALEN; |
2066 | |
2067 | - if (length == IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID || |
2068 | - length == |
2069 | - IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM) { |
2070 | + if (length == IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM) { |
2071 | memcpy(&entry->short_ssid, pos, |
2072 | sizeof(entry->short_ssid)); |
2073 | pos += 4; |
2074 | } |
2075 | |
2076 | - if (length == |
2077 | - IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM) { |
2078 | - cfg80211_parse_bss_param(*pos, entry); |
2079 | - pos++; |
2080 | + /* skip non colocated APs */ |
2081 | + if (!cfg80211_parse_bss_param(*pos, entry)) |
2082 | + return -EINVAL; |
2083 | + pos++; |
2084 | |
2085 | + if (length == IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM) { |
2086 | /* no information about the short ssid - ignore it */ |
2087 | if (!entry->same_ssid) |
2088 | return -EINVAL; |
2089 | } |
2090 | |
2091 | - if (entry->same_ssid || filtered) { |
2092 | + if (entry->same_ssid) { |
2093 | entry->short_ssid = s_ssid_tmp; |
2094 | memcpy(&entry->ssid, &ssid_elem->data, |
2095 | ssid_elem->datalen); |
2096 | @@ -584,37 +585,35 @@ static int cfg80211_parse_colocated_ap(const struct cfg80211_bss_ies *ies, |
2097 | |
2098 | /* RNR IE may contain more than one NEIGHBOR_AP_INFO */ |
2099 | while (pos + IEEE80211_MIN_AP_NEIGHBOR_INFO_SIZE <= end) { |
2100 | - bool filtered, colocated; |
2101 | struct cfg80211_neighbor_ap_info *ap_info; |
2102 | enum nl80211_band band; |
2103 | int freq; |
2104 | u8 length, i, count; |
2105 | |
2106 | ap_info = (struct cfg80211_neighbor_ap_info *)pos; |
2107 | - filtered = u8_get_bits(ap_info->tbtt_info_hdr, |
2108 | - IEEE80211_AP_INFO_TBTT_HDR_FILTERED); |
2109 | - colocated = u8_get_bits(ap_info->tbtt_info_hdr, |
2110 | - IEEE80211_AP_INFO_TBTT_HDR_COLOC); |
2111 | count = u8_get_bits(ap_info->tbtt_info_hdr, |
2112 | IEEE80211_AP_INFO_TBTT_HDR_COUNT) + 1; |
2113 | length = ap_info->tbtt_info_len; |
2114 | |
2115 | pos += sizeof(*ap_info); |
2116 | |
2117 | - ieee80211_operating_class_to_band(ap_info->op_class, &band); |
2118 | + if (!ieee80211_operating_class_to_band(ap_info->op_class, |
2119 | + &band)) |
2120 | + break; |
2121 | + |
2122 | freq = ieee80211_channel_to_frequency(ap_info->channel, band); |
2123 | |
2124 | if (end - pos < count * ap_info->tbtt_info_len) |
2125 | - return 0; |
2126 | + break; |
2127 | |
2128 | /* |
2129 | - * TBTT info must include both BSSID and (short SSID or SSID) |
2130 | - * ignore other options, and move to the next AP info |
2131 | + * TBTT info must include bss param + BSSID + |
2132 | + * (short SSID or same_ssid bit to be set). |
2133 | + * ignore other options, and move to the |
2134 | + * next AP info |
2135 | */ |
2136 | - if (!colocated || band != NL80211_BAND_6GHZ || |
2137 | - (length != IEEE80211_TBTT_INFO_OFFSET_BSSID && |
2138 | - length != IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM && |
2139 | - length != IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID && |
2140 | + if (band != NL80211_BAND_6GHZ || |
2141 | + (length != IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM && |
2142 | length < IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM)) { |
2143 | pos += count * ap_info->tbtt_info_len; |
2144 | continue; |
2145 | @@ -626,15 +625,12 @@ static int cfg80211_parse_colocated_ap(const struct cfg80211_bss_ies *ies, |
2146 | entry = kzalloc(sizeof(*entry) + IEEE80211_MAX_SSID_LEN, |
2147 | GFP_ATOMIC); |
2148 | |
2149 | - if (!entry) { |
2150 | - cfg80211_free_coloc_ap_list(&ap_list); |
2151 | - return 0; |
2152 | - } |
2153 | + if (!entry) |
2154 | + break; |
2155 | |
2156 | entry->center_freq = freq; |
2157 | |
2158 | - if (!cfg80211_parse_ap_info(entry, pos, length, |
2159 | - filtered, elem, |
2160 | + if (!cfg80211_parse_ap_info(entry, pos, length, elem, |
2161 | s_ssid_tmp)){ |
2162 | n_coloc++; |
2163 | list_add_tail(&entry->list, &ap_list); |
2164 | diff --git a/versions b/versions |
2165 | index e38a8a8..a3eee32 100644 |
2166 | --- a/versions |
2167 | +++ b/versions |
2168 | @@ -2,4 +2,4 @@ BACKPORTS_VERSION="(see git)" |
2169 | BACKPORTED_KERNEL_VERSION="(see git)" |
2170 | BACKPORTED_KERNEL_NAME="iwlwifi" |
2171 | BACKPORTS_BUILD_TSTAMP=__DATE__ \" \" __TIME__ |
2172 | -BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:master:8286:2451d0de" |
2173 | +BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:master:8324:9176b151" |
Landed.