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