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