1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
4  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5  * Copyright (C) 2016-2017 Intel Deutschland GmbH
6  */
7 #ifndef __iwl_fw_api_nvm_reg_h__
8 #define __iwl_fw_api_nvm_reg_h__
9 
10 /**
11  * enum iwl_regulatory_and_nvm_subcmd_ids - regulatory/NVM commands
12  */
13 enum iwl_regulatory_and_nvm_subcmd_ids {
14 	/**
15 	 * @NVM_ACCESS_COMPLETE: &struct iwl_nvm_access_complete_cmd
16 	 */
17 	NVM_ACCESS_COMPLETE = 0x0,
18 
19 	/**
20 	 * @LARI_CONFIG_CHANGE: &struct iwl_lari_config_change_cmd_v1,
21 	 *	&struct iwl_lari_config_change_cmd_v2,
22 	 *	&struct iwl_lari_config_change_cmd_v3,
23 	 *	&struct iwl_lari_config_change_cmd_v4,
24 	 *	&struct iwl_lari_config_change_cmd_v5,
25 	 *	&struct iwl_lari_config_change_cmd_v6,
26 	 *	&struct iwl_lari_config_change_cmd_v7,
27 	 *	&struct iwl_lari_config_change_cmd_v10 or
28 	 *	&struct iwl_lari_config_change_cmd
29 	 */
30 	LARI_CONFIG_CHANGE = 0x1,
31 
32 	/**
33 	 * @NVM_GET_INFO:
34 	 * Command is &struct iwl_nvm_get_info,
35 	 * response is &struct iwl_nvm_get_info_rsp
36 	 */
37 	NVM_GET_INFO = 0x2,
38 
39 	/**
40 	 * @TAS_CONFIG: &union iwl_tas_config_cmd
41 	 */
42 	TAS_CONFIG = 0x3,
43 
44 	/**
45 	 * @SAR_OFFSET_MAPPING_TABLE_CMD: &struct iwl_sar_offset_mapping_cmd
46 	 */
47 	SAR_OFFSET_MAPPING_TABLE_CMD = 0x4,
48 
49 	/**
50 	 * @MCC_ALLOWED_AP_TYPE_CMD: &struct iwl_mcc_allowed_ap_type_cmd
51 	 */
52 	MCC_ALLOWED_AP_TYPE_CMD = 0x5,
53 
54 	/**
55 	 * @PNVM_INIT_COMPLETE_NTFY: &struct iwl_pnvm_init_complete_ntfy
56 	 */
57 	PNVM_INIT_COMPLETE_NTFY = 0xFE,
58 };
59 
60 /**
61  * enum iwl_nvm_access_op - NVM access opcode
62  * @IWL_NVM_READ: read NVM
63  * @IWL_NVM_WRITE: write NVM
64  */
65 enum iwl_nvm_access_op {
66 	IWL_NVM_READ	= 0,
67 	IWL_NVM_WRITE	= 1,
68 };
69 
70 /**
71  * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
72  * @NVM_ACCESS_TARGET_CACHE: access the cache
73  * @NVM_ACCESS_TARGET_OTP: access the OTP
74  * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
75  */
76 enum iwl_nvm_access_target {
77 	NVM_ACCESS_TARGET_CACHE = 0,
78 	NVM_ACCESS_TARGET_OTP = 1,
79 	NVM_ACCESS_TARGET_EEPROM = 2,
80 };
81 
82 /**
83  * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
84  * @NVM_SECTION_TYPE_SW: software section
85  * @NVM_SECTION_TYPE_REGULATORY: regulatory section
86  * @NVM_SECTION_TYPE_CALIBRATION: calibration section
87  * @NVM_SECTION_TYPE_PRODUCTION: production section
88  * @NVM_SECTION_TYPE_REGULATORY_SDP: regulatory section used by 3168 series
89  * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
90  * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
91  * @NVM_MAX_NUM_SECTIONS: number of sections
92  */
93 enum iwl_nvm_section_type {
94 	NVM_SECTION_TYPE_SW = 1,
95 	NVM_SECTION_TYPE_REGULATORY = 3,
96 	NVM_SECTION_TYPE_CALIBRATION = 4,
97 	NVM_SECTION_TYPE_PRODUCTION = 5,
98 	NVM_SECTION_TYPE_REGULATORY_SDP = 8,
99 	NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
100 	NVM_SECTION_TYPE_PHY_SKU = 12,
101 	NVM_MAX_NUM_SECTIONS = 13,
102 };
103 
104 /**
105  * struct iwl_nvm_access_cmd - Request the device to send an NVM section
106  * @op_code: &enum iwl_nvm_access_op
107  * @target: &enum iwl_nvm_access_target
108  * @type: &enum iwl_nvm_section_type
109  * @offset: offset in bytes into the section
110  * @length: in bytes, to read/write
111  * @data: if write operation, the data to write. On read its empty
112  */
113 struct iwl_nvm_access_cmd {
114 	u8 op_code;
115 	u8 target;
116 	__le16 type;
117 	__le16 offset;
118 	__le16 length;
119 	u8 data[];
120 } __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
121 
122 /**
123  * struct iwl_nvm_access_resp - response to NVM_ACCESS_CMD
124  * @offset: offset in bytes into the section
125  * @length: in bytes, either how much was written or read
126  * @type: NVM_SECTION_TYPE_*
127  * @status: 0 for success, fail otherwise
128  * @data: if read operation, the data returned. Empty on write.
129  */
130 struct iwl_nvm_access_resp {
131 	__le16 offset;
132 	__le16 length;
133 	__le16 type;
134 	__le16 status;
135 	u8 data[];
136 } __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
137 
138 /*
139  * struct iwl_nvm_get_info - request to get NVM data
140  */
141 struct iwl_nvm_get_info {
142 	__le32 reserved;
143 } __packed; /* REGULATORY_NVM_GET_INFO_CMD_API_S_VER_1 */
144 
145 /**
146  * enum iwl_nvm_info_general_flags - flags in NVM_GET_INFO resp
147  * @NVM_GENERAL_FLAGS_EMPTY_OTP: 1 if OTP is empty
148  */
149 enum iwl_nvm_info_general_flags {
150 	NVM_GENERAL_FLAGS_EMPTY_OTP	= BIT(0),
151 };
152 
153 /**
154  * struct iwl_nvm_get_info_general - general NVM data
155  * @flags: bit 0: 1 - empty, 0 - non-empty
156  * @nvm_version: nvm version
157  * @board_type: board type
158  * @n_hw_addrs: number of reserved MAC addresses
159  */
160 struct iwl_nvm_get_info_general {
161 	__le32 flags;
162 	__le16 nvm_version;
163 	u8 board_type;
164 	u8 n_hw_addrs;
165 } __packed; /* REGULATORY_NVM_GET_INFO_GENERAL_S_VER_2 */
166 
167 /**
168  * enum iwl_nvm_mac_sku_flags - flags in &iwl_nvm_get_info_sku
169  * @NVM_MAC_SKU_FLAGS_BAND_2_4_ENABLED: true if 2.4 band enabled
170  * @NVM_MAC_SKU_FLAGS_BAND_5_2_ENABLED: true if 5.2 band enabled
171  * @NVM_MAC_SKU_FLAGS_802_11N_ENABLED: true if 11n enabled
172  * @NVM_MAC_SKU_FLAGS_802_11AC_ENABLED: true if 11ac enabled
173  * @NVM_MAC_SKU_FLAGS_MIMO_DISABLED: true if MIMO disabled
174  * @NVM_MAC_SKU_FLAGS_WAPI_ENABLED: true if WAPI enabled
175  * @NVM_MAC_SKU_FLAGS_REG_CHECK_ENABLED: true if regulatory checker enabled
176  * @NVM_MAC_SKU_FLAGS_API_LOCK_ENABLED: true if API lock enabled
177  */
178 enum iwl_nvm_mac_sku_flags {
179 	NVM_MAC_SKU_FLAGS_BAND_2_4_ENABLED	= BIT(0),
180 	NVM_MAC_SKU_FLAGS_BAND_5_2_ENABLED	= BIT(1),
181 	NVM_MAC_SKU_FLAGS_802_11N_ENABLED	= BIT(2),
182 	NVM_MAC_SKU_FLAGS_802_11AC_ENABLED	= BIT(3),
183 	/**
184 	 * @NVM_MAC_SKU_FLAGS_802_11AX_ENABLED: true if 11ax enabled
185 	 */
186 	NVM_MAC_SKU_FLAGS_802_11AX_ENABLED	= BIT(4),
187 	NVM_MAC_SKU_FLAGS_MIMO_DISABLED		= BIT(5),
188 	NVM_MAC_SKU_FLAGS_WAPI_ENABLED		= BIT(8),
189 	NVM_MAC_SKU_FLAGS_REG_CHECK_ENABLED	= BIT(14),
190 	NVM_MAC_SKU_FLAGS_API_LOCK_ENABLED	= BIT(15),
191 };
192 
193 /**
194  * struct iwl_nvm_get_info_sku - mac information
195  * @mac_sku_flags: flags for SKU, see &enum iwl_nvm_mac_sku_flags
196  */
197 struct iwl_nvm_get_info_sku {
198 	__le32 mac_sku_flags;
199 } __packed; /* REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_2 */
200 
201 /**
202  * struct iwl_nvm_get_info_phy - phy information
203  * @tx_chains: BIT 0 chain A, BIT 1 chain B
204  * @rx_chains: BIT 0 chain A, BIT 1 chain B
205  */
206 struct iwl_nvm_get_info_phy {
207 	__le32 tx_chains;
208 	__le32 rx_chains;
209 } __packed; /* REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
210 
211 #define IWL_NUM_CHANNELS_V1	51
212 #define IWL_NUM_CHANNELS	110
213 
214 /**
215  * struct iwl_nvm_get_info_regulatory_v1 - regulatory information
216  * @lar_enabled: is LAR enabled
217  * @channel_profile: regulatory data of this channel
218  * @reserved: reserved
219  */
220 struct iwl_nvm_get_info_regulatory_v1 {
221 	__le32 lar_enabled;
222 	__le16 channel_profile[IWL_NUM_CHANNELS_V1];
223 	__le16 reserved;
224 } __packed; /* REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
225 
226 /**
227  * struct iwl_nvm_get_info_regulatory - regulatory information
228  * @lar_enabled: is LAR enabled
229  * @n_channels: number of valid channels in the array
230  * @channel_profile: regulatory data of this channel
231  */
232 struct iwl_nvm_get_info_regulatory {
233 	__le32 lar_enabled;
234 	__le32 n_channels;
235 	__le32 channel_profile[IWL_NUM_CHANNELS];
236 } __packed; /* REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_2 */
237 
238 /**
239  * struct iwl_nvm_get_info_rsp_v3 - response to get NVM data
240  * @general: general NVM data
241  * @mac_sku: data relating to MAC sku
242  * @phy_sku: data relating to PHY sku
243  * @regulatory: regulatory data
244  */
245 struct iwl_nvm_get_info_rsp_v3 {
246 	struct iwl_nvm_get_info_general general;
247 	struct iwl_nvm_get_info_sku mac_sku;
248 	struct iwl_nvm_get_info_phy phy_sku;
249 	struct iwl_nvm_get_info_regulatory_v1 regulatory;
250 } __packed; /* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_3 */
251 
252 /**
253  * struct iwl_nvm_get_info_rsp - response to get NVM data
254  * @general: general NVM data
255  * @mac_sku: data relating to MAC sku
256  * @phy_sku: data relating to PHY sku
257  * @regulatory: regulatory data
258  */
259 struct iwl_nvm_get_info_rsp {
260 	struct iwl_nvm_get_info_general general;
261 	struct iwl_nvm_get_info_sku mac_sku;
262 	struct iwl_nvm_get_info_phy phy_sku;
263 	struct iwl_nvm_get_info_regulatory regulatory;
264 } __packed; /* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_4 */
265 
266 /**
267  * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
268  * @reserved: reserved
269  */
270 struct iwl_nvm_access_complete_cmd {
271 	__le32 reserved;
272 } __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
273 
274 #define IWL_MCC_US	0x5553
275 #define IWL_MCC_CANADA	0x4341
276 
277 /**
278  * struct iwl_mcc_update_cmd - Request the device to update geographic
279  * regulatory profile according to the given MCC (Mobile Country Code).
280  * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
281  * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
282  * MCC in the cmd response will be the relevant MCC in the NVM.
283  * @mcc: given mobile country code
284  * @source_id: the source from where we got the MCC, see iwl_mcc_source
285  * @reserved: reserved for alignment
286  * @key: integrity key for MCC API OEM testing
287  * @reserved2: reserved
288  */
289 struct iwl_mcc_update_cmd {
290 	__le16 mcc;
291 	u8 source_id;
292 	u8 reserved;
293 	__le32 key;
294 	u8 reserved2[20];
295 } __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
296 
297 /**
298  * enum iwl_geo_information - geographic information.
299  * @GEO_NO_INFO: no special info for this geo profile.
300  * @GEO_WMM_ETSI_5GHZ_INFO: this geo profile limits the WMM params
301  *	for the 5 GHz band.
302  */
303 enum iwl_geo_information {
304 	GEO_NO_INFO =			0,
305 	GEO_WMM_ETSI_5GHZ_INFO =	BIT(0),
306 };
307 
308 /**
309  * struct iwl_mcc_update_resp_v3 - response to MCC_UPDATE_CMD.
310  * Contains the new channel control profile map, if changed, and the new MCC
311  * (mobile country code).
312  * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
313  * @status: see &enum iwl_mcc_update_status
314  * @mcc: the new applied MCC
315  * @cap: capabilities for all channels which matches the MCC
316  * @source_id: the MCC source, see iwl_mcc_source
317  * @time: time elapsed from the MCC test start (in units of 30 seconds)
318  * @geo_info: geographic specific profile information
319  *	see &enum iwl_geo_information.
320  * @n_channels: number of channels in @channels_data.
321  * @channels: channel control data map, DWORD for each channel. Only the first
322  *	16bits are used.
323  */
324 struct iwl_mcc_update_resp_v3 {
325 	__le32 status;
326 	__le16 mcc;
327 	u8 cap;
328 	u8 source_id;
329 	__le16 time;
330 	__le16 geo_info;
331 	__le32 n_channels;
332 	__le32 channels[];
333 } __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_3 */
334 
335 /**
336  * struct iwl_mcc_update_resp_v4 - response to MCC_UPDATE_CMD.
337  * Contains the new channel control profile map, if changed, and the new MCC
338  * (mobile country code).
339  * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
340  * @status: see &enum iwl_mcc_update_status
341  * @mcc: the new applied MCC
342  * @cap: capabilities for all channels which matches the MCC
343  * @time: time elapsed from the MCC test start (in units of 30 seconds)
344  * @geo_info: geographic specific profile information
345  *	see &enum iwl_geo_information.
346  * @source_id: the MCC source, see iwl_mcc_source
347  * @reserved: for four bytes alignment.
348  * @n_channels: number of channels in @channels_data.
349  * @channels: channel control data map, DWORD for each channel. Only the first
350  *	16bits are used.
351  */
352 struct iwl_mcc_update_resp_v4 {
353 	__le32 status;
354 	__le16 mcc;
355 	__le16 cap;
356 	__le16 time;
357 	__le16 geo_info;
358 	u8 source_id;
359 	u8 reserved[3];
360 	__le32 n_channels;
361 	__le32 channels[];
362 } __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_4 */
363 
364 /**
365  * struct iwl_mcc_update_resp_v8 - response to MCC_UPDATE_CMD.
366  * Contains the new channel control profile map, if changed, and the new MCC
367  * (mobile country code).
368  * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
369  * @status: see &enum iwl_mcc_update_status
370  * @mcc: the new applied MCC
371  * @padding: padding for 2 bytes.
372  * @cap: capabilities for all channels which matches the MCC
373  * @time: time elapsed from the MCC test start (in units of 30 seconds)
374  * @geo_info: geographic specific profile information
375  *     see &enum iwl_geo_information.
376  * @source_id: the MCC source, see iwl_mcc_source
377  * @reserved: for four bytes alignment.
378  * @n_channels: number of channels in @channels_data.
379  * @channels: channel control data map, DWORD for each channel. Only the first
380  *     16bits are used.
381  */
382 struct iwl_mcc_update_resp_v8 {
383 	__le32 status;
384 	__le16 mcc;
385 	u8 padding[2];
386 	__le32 cap;
387 	__le16 time;
388 	__le16 geo_info;
389 	u8 source_id;
390 	u8 reserved[3];
391 	__le32 n_channels;
392 	__le32 channels[];
393 } __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_8 */
394 
395 /**
396  * struct iwl_mcc_chub_notif - chub notifies of mcc change
397  * (MCC_CHUB_UPDATE_CMD = 0xc9)
398  * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
399  * the cellular and connectivity cores that gets updates of the mcc, and
400  * notifies the ucode directly of any mcc change.
401  * The ucode requests the driver to request the device to update geographic
402  * regulatory  profile according to the given MCC (Mobile Country Code).
403  * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
404  * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
405  * MCC in the cmd response will be the relevant MCC in the NVM.
406  * @mcc: given mobile country code
407  * @source_id: identity of the change originator, see iwl_mcc_source
408  * @reserved1: reserved for alignment
409  */
410 struct iwl_mcc_chub_notif {
411 	__le16 mcc;
412 	u8 source_id;
413 	u8 reserved1;
414 } __packed; /* LAR_MCC_NOTIFY_S */
415 
416 enum iwl_mcc_update_status {
417 	MCC_RESP_NEW_CHAN_PROFILE,
418 	MCC_RESP_SAME_CHAN_PROFILE,
419 	MCC_RESP_INVALID,
420 	MCC_RESP_NVM_DISABLED,
421 	MCC_RESP_ILLEGAL,
422 	MCC_RESP_LOW_PRIORITY,
423 	MCC_RESP_TEST_MODE_ACTIVE,
424 	MCC_RESP_TEST_MODE_NOT_ACTIVE,
425 	MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
426 };
427 
428 enum iwl_mcc_source {
429 	MCC_SOURCE_OLD_FW = 0,
430 	MCC_SOURCE_ME = 1,
431 	MCC_SOURCE_BIOS = 2,
432 	MCC_SOURCE_3G_LTE_HOST = 3,
433 	MCC_SOURCE_3G_LTE_DEVICE = 4,
434 	MCC_SOURCE_WIFI = 5,
435 	MCC_SOURCE_RESERVED = 6,
436 	MCC_SOURCE_DEFAULT = 7,
437 	MCC_SOURCE_UNINITIALIZED = 8,
438 	MCC_SOURCE_MCC_API = 9,
439 	MCC_SOURCE_GET_CURRENT = 0x10,
440 	MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
441 };
442 
443 #define IWL_WTAS_BLACK_LIST_MAX		16
444 /**
445  * struct iwl_tas_config_cmd_common - configures the TAS.
446  * This is also the v2 structure.
447  * @block_list_size: size of relevant field in block_list_array
448  * @block_list_array: list of countries where TAS must be disabled
449  */
450 struct iwl_tas_config_cmd_common {
451 	__le32 block_list_size;
452 	__le32 block_list_array[IWL_WTAS_BLACK_LIST_MAX];
453 } __packed; /* TAS_CONFIG_CMD_API_S_VER_2 */
454 
455 /**
456  * struct iwl_tas_config_cmd_v3 - configures the TAS
457  * @override_tas_iec: indicates whether to override default value of IEC regulatory
458  * @enable_tas_iec: in case override_tas_iec is set -
459  *	indicates whether IEC regulatory is enabled or disabled
460  */
461 struct iwl_tas_config_cmd_v3 {
462 	__le16 override_tas_iec;
463 	__le16 enable_tas_iec;
464 } __packed; /* TAS_CONFIG_CMD_API_S_VER_3 */
465 
466 /**
467  * enum iwl_tas_uhb_allowed_flags - per country TAS UHB allowed flags.
468  * @TAS_UHB_ALLOWED_CANADA: TAS UHB is allowed in Canada. This flag is valid
469  *	only when fw has %IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT capability.
470  */
471 enum iwl_tas_uhb_allowed_flags {
472 	TAS_UHB_ALLOWED_CANADA	= BIT(0),
473 };
474 
475 /**
476  * struct iwl_tas_config_cmd_v4 - configures the TAS
477  * @override_tas_iec: indicates whether to override default value of IEC regulatory
478  * @enable_tas_iec: in case override_tas_iec is set -
479  *	indicates whether IEC regulatory is enabled or disabled
480  * @usa_tas_uhb_allowed: if set, allow TAS UHB in the USA
481  * @uhb_allowed_flags: see &enum iwl_tas_uhb_allowed_flags.
482  */
483 struct iwl_tas_config_cmd_v4 {
484 	u8 override_tas_iec;
485 	u8 enable_tas_iec;
486 	u8 usa_tas_uhb_allowed;
487 	u8 uhb_allowed_flags;
488 } __packed; /* TAS_CONFIG_CMD_API_S_VER_4 */
489 
490 struct iwl_tas_config_cmd_v2_v4 {
491 	struct iwl_tas_config_cmd_common common;
492 	union {
493 		struct iwl_tas_config_cmd_v3 v3;
494 		struct iwl_tas_config_cmd_v4 v4;
495 	};
496 };
497 
498 /**
499  * enum bios_source - source of bios data
500  * @BIOS_SOURCE_NONE: BIOS source is not defined
501  * @BIOS_SOURCE_ACPI: BIOS source is ACPI
502  * @BIOS_SOURCE_UEFI: BIOS source is UEFI
503  */
504 enum bios_source {
505 	BIOS_SOURCE_NONE,
506 	BIOS_SOURCE_ACPI,
507 	BIOS_SOURCE_UEFI,
508 };
509 
510 /**
511  * struct bios_value_u32 - BIOS configuration.
512  * @table_source: see &enum bios_source
513  * @table_revision: table revision.
514  * @reserved: reserved
515  * @value: value in bios.
516  */
517 struct bios_value_u32 {
518 	u8 table_source;
519 	u8 table_revision;
520 	u8 reserved[2];
521 	__le32 value;
522 } __packed; /* BIOS_TABLE_SOURCE_U32_S_VER_1 */
523 
524 /**
525  * struct iwl_tas_config_cmd - configures the TAS.
526  * @block_list_size: size of relevant field in block_list_array
527  * @block_list_array: list of countries where TAS must be disabled
528  * @reserved: reserved
529  * @tas_config_info: see @struct bios_value_u32
530  */
531 struct iwl_tas_config_cmd {
532 	__le16 block_list_size;
533 	__le16 block_list_array[IWL_WTAS_BLACK_LIST_MAX];
534 	u8 reserved[2];
535 	struct bios_value_u32 tas_config_info;
536 } __packed; /* TAS_CONFIG_CMD_API_S_VER_5 */
537 
538 /**
539  * enum iwl_lari_config_masks - bit masks for the various LARI config operations
540  * @LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK: disable 11ac in ukraine
541  * @LARI_CONFIG_CHANGE_ETSI_TO_PASSIVE_MSK: ETSI 5.8GHz SRD passive scan
542  * @LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK: ETSI 5.8GHz SRD disabled
543  * @LARI_CONFIG_ENABLE_5G2_IN_INDONESIA_MSK: enable 5.15/5.35GHz bands in
544  * 	Indonesia
545  * @LARI_CONFIG_ENABLE_CHINA_22_REG_SUPPORT_MSK: enable 2022 china regulatory
546  */
547 enum iwl_lari_config_masks {
548 	LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK		= BIT(0),
549 	LARI_CONFIG_CHANGE_ETSI_TO_PASSIVE_MSK		= BIT(1),
550 	LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK		= BIT(2),
551 	LARI_CONFIG_ENABLE_5G2_IN_INDONESIA_MSK		= BIT(3),
552 	LARI_CONFIG_ENABLE_CHINA_22_REG_SUPPORT_MSK	= BIT(7),
553 };
554 
555 #define IWL_11AX_UKRAINE_MASK 3
556 #define IWL_11AX_UKRAINE_SHIFT 8
557 
558 /**
559  * struct iwl_lari_config_change_cmd_v1 - change LARI configuration
560  * @config_bitmap: bit map of the config commands. each bit will trigger a
561  * different predefined FW config operation
562  */
563 struct iwl_lari_config_change_cmd_v1 {
564 	__le32 config_bitmap;
565 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_1 */
566 
567 /**
568  * struct iwl_lari_config_change_cmd_v2 - change LARI configuration
569  * @config_bitmap: bit map of the config commands. each bit will trigger a
570  * different predefined FW config operation
571  * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets
572  */
573 struct iwl_lari_config_change_cmd_v2 {
574 	__le32 config_bitmap;
575 	__le32 oem_uhb_allow_bitmap;
576 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_2 */
577 
578 /**
579  * struct iwl_lari_config_change_cmd_v3 - change LARI configuration
580  * @config_bitmap: bit map of the config commands. each bit will trigger a
581  * different predefined FW config operation
582  * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets
583  * @oem_11ax_allow_bitmap: bitmap of 11ax allowed MCCs.
584  * For each supported country, a pair of regulatory override bit and 11ax mode exist
585  * in the bit field.
586  */
587 struct iwl_lari_config_change_cmd_v3 {
588 	__le32 config_bitmap;
589 	__le32 oem_uhb_allow_bitmap;
590 	__le32 oem_11ax_allow_bitmap;
591 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_3 */
592 
593 /**
594  * struct iwl_lari_config_change_cmd_v4 - change LARI configuration
595  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
596  *     different predefined FW config operation.
597  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
598  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
599  *     per country, one to indicate whether to override and the other to
600  *     indicate the value to use.
601  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
602  *     per country, one to indicate whether to override and the other to
603  *     indicate allow/disallow unii4 channels.
604  */
605 struct iwl_lari_config_change_cmd_v4 {
606 	__le32 config_bitmap;
607 	__le32 oem_uhb_allow_bitmap;
608 	__le32 oem_11ax_allow_bitmap;
609 	__le32 oem_unii4_allow_bitmap;
610 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_4 */
611 
612 /**
613  * struct iwl_lari_config_change_cmd_v5 - change LARI configuration
614  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
615  *     different predefined FW config operation.
616  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
617  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
618  *     per country, one to indicate whether to override and the other to
619  *     indicate the value to use.
620  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
621  *     per country, one to indicate whether to override and the other to
622  *     indicate allow/disallow unii4 channels.
623  * @chan_state_active_bitmap: Bitmap for overriding channel state to active.
624  *     Each bit represents a country or region to activate, according to the BIOS
625  *     definitions.
626  */
627 struct iwl_lari_config_change_cmd_v5 {
628 	__le32 config_bitmap;
629 	__le32 oem_uhb_allow_bitmap;
630 	__le32 oem_11ax_allow_bitmap;
631 	__le32 oem_unii4_allow_bitmap;
632 	__le32 chan_state_active_bitmap;
633 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_5 */
634 
635 /**
636  * struct iwl_lari_config_change_cmd_v6 - change LARI configuration
637  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
638  *     different predefined FW config operation.
639  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
640  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
641  *     per country, one to indicate whether to override and the other to
642  *     indicate the value to use.
643  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
644  *     per country, one to indicate whether to override and the other to
645  *     indicate allow/disallow unii4 channels.
646  * @chan_state_active_bitmap: Bitmap for overriding channel state to active.
647  *     Each bit represents a country or region to activate, according to the BIOS
648  *     definitions.
649  * @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
650  *     Each bit represents a set of channels in a specific band that should be disabled
651  */
652 struct iwl_lari_config_change_cmd_v6 {
653 	__le32 config_bitmap;
654 	__le32 oem_uhb_allow_bitmap;
655 	__le32 oem_11ax_allow_bitmap;
656 	__le32 oem_unii4_allow_bitmap;
657 	__le32 chan_state_active_bitmap;
658 	__le32 force_disable_channels_bitmap;
659 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_6 */
660 
661 /**
662  * struct iwl_lari_config_change_cmd_v7 - change LARI configuration
663  * This structure is used also for lari cmd version 8 and 9.
664  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
665  *     different predefined FW config operation.
666  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
667  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
668  *     per country, one to indicate whether to override and the other to
669  *     indicate the value to use.
670  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
671  *     per country, one to indicate whether to override and the other to
672  *     indicate allow/disallow unii4 channels.
673  *     For LARI cmd version 4 to 8 - bits 0:3 are supported.
674  *     For LARI cmd version 9 - bits 0:5 are supported.
675  * @chan_state_active_bitmap: Bitmap to enable different bands per country
676  *     or region.
677  *     Each bit represents a country or region, and a band to activate
678  *     according to the BIOS definitions.
679  *     For LARI cmd version 7 - bits 0:3 are supported.
680  *     For LARI cmd version 8 - bits 0:4 are supported.
681  * @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
682  *     Each bit represents a set of channels in a specific band that should be
683  *     disabled
684  * @edt_bitmap: Bitmap of energy detection threshold table.
685  *	Disable/enable the EDT optimization method for different band.
686  */
687 struct iwl_lari_config_change_cmd_v7 {
688 	__le32 config_bitmap;
689 	__le32 oem_uhb_allow_bitmap;
690 	__le32 oem_11ax_allow_bitmap;
691 	__le32 oem_unii4_allow_bitmap;
692 	__le32 chan_state_active_bitmap;
693 	__le32 force_disable_channels_bitmap;
694 	__le32 edt_bitmap;
695 } __packed;
696 /* LARI_CHANGE_CONF_CMD_S_VER_7 */
697 /* LARI_CHANGE_CONF_CMD_S_VER_8 */
698 /* LARI_CHANGE_CONF_CMD_S_VER_9 */
699 
700 /**
701  * struct iwl_lari_config_change_cmd_v10 - change LARI configuration
702  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
703  *	different predefined FW config operation.
704  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
705  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
706  *	per country, one to indicate whether to override and the other to
707  *	indicate the value to use.
708  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
709  *	per country, one to indicate whether to override and the other to
710  *	indicate allow/disallow unii4 channels.
711  *	For LARI cmd version 10 - bits 0:5 are supported.
712  * @chan_state_active_bitmap: Bitmap to enable different bands per country
713  *	or region.
714  *	Each bit represents a country or region, and a band to activate
715  *	according to the BIOS definitions.
716  *	For LARI cmd version 10 - bits 0:4 are supported.
717  * @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
718  *	Each bit represents a set of channels in a specific band that should be
719  *	disabled
720  * @edt_bitmap: Bitmap of energy detection threshold table.
721  *	Disable/enable the EDT optimization method for different band.
722  * @oem_320mhz_allow_bitmap: 320Mhz bandwidth enablement bitmap per MCC.
723  *	bit0: enable 320Mhz in Japan.
724  *	bit1: enable 320Mhz in South Korea.
725  *	bit 2 - 31: reserved.
726  */
727 struct iwl_lari_config_change_cmd_v10 {
728 	__le32 config_bitmap;
729 	__le32 oem_uhb_allow_bitmap;
730 	__le32 oem_11ax_allow_bitmap;
731 	__le32 oem_unii4_allow_bitmap;
732 	__le32 chan_state_active_bitmap;
733 	__le32 force_disable_channels_bitmap;
734 	__le32 edt_bitmap;
735 	__le32 oem_320mhz_allow_bitmap;
736 } __packed;
737 /* LARI_CHANGE_CONF_CMD_S_VER_10 */
738 
739 /**
740  * struct iwl_lari_config_change_cmd - change LARI configuration
741  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
742  *	different predefined FW config operation.
743  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
744  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
745  *	per country, one to indicate whether to override and the other to
746  *	indicate the value to use.
747  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
748  *	per country, one to indicate whether to override and the other to
749  *	indicate allow/disallow unii4 channels.
750  *	For LARI cmd version 11 - bits 0:5 are supported.
751  * @chan_state_active_bitmap: Bitmap to enable different bands per country
752  *	or region.
753  *	Each bit represents a country or region, and a band to activate
754  *	according to the BIOS definitions.
755  *	For LARI cmd version 11 - bits 0:4 are supported.
756  *	For LARI cmd version 12 - bits 0:6 are supported and bits 7:31 are
757  *	reserved. No need to mask out the reserved bits.
758  * @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
759  *	Each bit represents a set of channels in a specific band that should be
760  *	disabled
761  * @edt_bitmap: Bitmap of energy detection threshold table.
762  *	Disable/enable the EDT optimization method for different band.
763  * @oem_320mhz_allow_bitmap: 320Mhz bandwidth enablement bitmap per MCC.
764  *	bit0: enable 320Mhz in Japan.
765  *	bit1: enable 320Mhz in South Korea.
766  *	bit 2 - 31: reserved.
767  * @oem_11be_allow_bitmap: Bitmap of 11be allowed MCCs. No need to mask out the
768  *	unsupported bits
769  *	bit0: enable 11be in China(CB/CN).
770  *	bit1: enable 11be in South Korea.
771  *	bit 2 - 31: reserved.
772  */
773 struct iwl_lari_config_change_cmd {
774 	__le32 config_bitmap;
775 	__le32 oem_uhb_allow_bitmap;
776 	__le32 oem_11ax_allow_bitmap;
777 	__le32 oem_unii4_allow_bitmap;
778 	__le32 chan_state_active_bitmap;
779 	__le32 force_disable_channels_bitmap;
780 	__le32 edt_bitmap;
781 	__le32 oem_320mhz_allow_bitmap;
782 	__le32 oem_11be_allow_bitmap;
783 } __packed;
784 /* LARI_CHANGE_CONF_CMD_S_VER_11 */
785 /* LARI_CHANGE_CONF_CMD_S_VER_12 */
786 
787 /* Activate UNII-1 (5.2GHz) for World Wide */
788 #define ACTIVATE_5G2_IN_WW_MASK			BIT(4)
789 #define CHAN_STATE_ACTIVE_BITMAP_CMD_V11	0x1F
790 
791 /**
792  * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete
793  * @status: PNVM image loading status
794  */
795 struct iwl_pnvm_init_complete_ntfy {
796 	__le32 status;
797 } __packed; /* PNVM_INIT_COMPLETE_NTFY_S_VER_1 */
798 
799 #define UATS_TABLE_ROW_SIZE	26
800 #define UATS_TABLE_COL_SIZE	13
801 
802 /**
803  * struct iwl_mcc_allowed_ap_type_cmd - struct for MCC_ALLOWED_AP_TYPE_CMD
804  * @offset_map: mapping a mcc to UHB AP type support (UATS) allowed
805  * @reserved: reserved
806  */
807 struct iwl_mcc_allowed_ap_type_cmd {
808 	u8 offset_map[UATS_TABLE_ROW_SIZE][UATS_TABLE_COL_SIZE];
809 	__le16 reserved;
810 } __packed; /* MCC_ALLOWED_AP_TYPE_CMD_API_S_VER_1 */
811 
812 #endif /* __iwl_fw_api_nvm_reg_h__ */
813