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