xref: /linux/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h (revision ff9a79307f89563da6d841da8b7cc4a0afceb0e2)
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 or
27 	 *	&struct iwl_lari_config_change_cmd
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 	 * @MCC_ALLOWED_AP_TYPE_CMD: &struct iwl_mcc_allowed_ap_type_cmd
50 	 */
51 	MCC_ALLOWED_AP_TYPE_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 #define IWL_WTAS_BLACK_LIST_MAX		16
443 /**
444  * struct iwl_tas_config_cmd_common - configures the TAS.
445  * This is also the v2 structure.
446  * @block_list_size: size of relevant field in block_list_array
447  * @block_list_array: list of countries where TAS must be disabled
448  */
449 struct iwl_tas_config_cmd_common {
450 	__le32 block_list_size;
451 	__le32 block_list_array[IWL_WTAS_BLACK_LIST_MAX];
452 } __packed; /* TAS_CONFIG_CMD_API_S_VER_2 */
453 
454 /**
455  * struct iwl_tas_config_cmd_v3 - configures the TAS
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 	__le16 override_tas_iec;
462 	__le16 enable_tas_iec;
463 } __packed; /* TAS_CONFIG_CMD_API_S_VER_3 */
464 
465 /**
466  * struct iwl_tas_config_cmd_v4 - configures the TAS
467  * @override_tas_iec: indicates whether to override default value of IEC regulatory
468  * @enable_tas_iec: in case override_tas_iec is set -
469  *	indicates whether IEC regulatory is enabled or disabled
470  * @usa_tas_uhb_allowed: if set, allow TAS UHB in the USA
471  * @reserved: reserved
472 */
473 struct iwl_tas_config_cmd_v4 {
474 	u8 override_tas_iec;
475 	u8 enable_tas_iec;
476 	u8 usa_tas_uhb_allowed;
477 	u8 reserved;
478 } __packed; /* TAS_CONFIG_CMD_API_S_VER_4 */
479 
480 struct iwl_tas_config_cmd {
481 	struct iwl_tas_config_cmd_common common;
482 	union {
483 		struct iwl_tas_config_cmd_v3 v3;
484 		struct iwl_tas_config_cmd_v4 v4;
485 	};
486 };
487 
488 /**
489  * enum iwl_lari_config_masks - bit masks for the various LARI config operations
490  * @LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK: disable 11ac in ukraine
491  * @LARI_CONFIG_CHANGE_ETSI_TO_PASSIVE_MSK: ETSI 5.8GHz SRD passive scan
492  * @LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK: ETSI 5.8GHz SRD disabled
493  * @LARI_CONFIG_ENABLE_5G2_IN_INDONESIA_MSK: enable 5.15/5.35GHz bands in
494  * 	Indonesia
495  * @LARI_CONFIG_ENABLE_CHINA_22_REG_SUPPORT_MSK: enable 2022 china regulatory
496  */
497 enum iwl_lari_config_masks {
498 	LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK		= BIT(0),
499 	LARI_CONFIG_CHANGE_ETSI_TO_PASSIVE_MSK		= BIT(1),
500 	LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK		= BIT(2),
501 	LARI_CONFIG_ENABLE_5G2_IN_INDONESIA_MSK		= BIT(3),
502 	LARI_CONFIG_ENABLE_CHINA_22_REG_SUPPORT_MSK	= BIT(7),
503 };
504 
505 #define IWL_11AX_UKRAINE_MASK 3
506 #define IWL_11AX_UKRAINE_SHIFT 8
507 
508 /**
509  * struct iwl_lari_config_change_cmd_v1 - change LARI configuration
510  * @config_bitmap: bit map of the config commands. each bit will trigger a
511  * different predefined FW config operation
512  */
513 struct iwl_lari_config_change_cmd_v1 {
514 	__le32 config_bitmap;
515 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_1 */
516 
517 /**
518  * struct iwl_lari_config_change_cmd_v2 - change LARI configuration
519  * @config_bitmap: bit map of the config commands. each bit will trigger a
520  * different predefined FW config operation
521  * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets
522  */
523 struct iwl_lari_config_change_cmd_v2 {
524 	__le32 config_bitmap;
525 	__le32 oem_uhb_allow_bitmap;
526 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_2 */
527 
528 /**
529  * struct iwl_lari_config_change_cmd_v3 - change LARI configuration
530  * @config_bitmap: bit map of the config commands. each bit will trigger a
531  * different predefined FW config operation
532  * @oem_uhb_allow_bitmap: bitmap of UHB enabled MCC sets
533  * @oem_11ax_allow_bitmap: bitmap of 11ax allowed MCCs.
534  * For each supported country, a pair of regulatory override bit and 11ax mode exist
535  * in the bit field.
536  */
537 struct iwl_lari_config_change_cmd_v3 {
538 	__le32 config_bitmap;
539 	__le32 oem_uhb_allow_bitmap;
540 	__le32 oem_11ax_allow_bitmap;
541 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_3 */
542 
543 /**
544  * struct iwl_lari_config_change_cmd_v4 - change LARI configuration
545  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
546  *     different predefined FW config operation.
547  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
548  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
549  *     per country, one to indicate whether to override and the other to
550  *     indicate the value to use.
551  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
552  *     per country, one to indicate whether to override and the other to
553  *     indicate allow/disallow unii4 channels.
554  */
555 struct iwl_lari_config_change_cmd_v4 {
556 	__le32 config_bitmap;
557 	__le32 oem_uhb_allow_bitmap;
558 	__le32 oem_11ax_allow_bitmap;
559 	__le32 oem_unii4_allow_bitmap;
560 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_4 */
561 
562 /**
563  * struct iwl_lari_config_change_cmd_v5 - 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  */
577 struct iwl_lari_config_change_cmd_v5 {
578 	__le32 config_bitmap;
579 	__le32 oem_uhb_allow_bitmap;
580 	__le32 oem_11ax_allow_bitmap;
581 	__le32 oem_unii4_allow_bitmap;
582 	__le32 chan_state_active_bitmap;
583 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_5 */
584 
585 /**
586  * struct iwl_lari_config_change_cmd_v6 - change LARI configuration
587  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
588  *     different predefined FW config operation.
589  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
590  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
591  *     per country, one to indicate whether to override and the other to
592  *     indicate the value to use.
593  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
594  *     per country, one to indicate whether to override and the other to
595  *     indicate allow/disallow unii4 channels.
596  * @chan_state_active_bitmap: Bitmap for overriding channel state to active.
597  *     Each bit represents a country or region to activate, according to the BIOS
598  *     definitions.
599  * @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
600  *     Each bit represents a set of channels in a specific band that should be disabled
601  */
602 struct iwl_lari_config_change_cmd_v6 {
603 	__le32 config_bitmap;
604 	__le32 oem_uhb_allow_bitmap;
605 	__le32 oem_11ax_allow_bitmap;
606 	__le32 oem_unii4_allow_bitmap;
607 	__le32 chan_state_active_bitmap;
608 	__le32 force_disable_channels_bitmap;
609 } __packed; /* LARI_CHANGE_CONF_CMD_S_VER_6 */
610 
611 /**
612  * struct iwl_lari_config_change_cmd_v7 - change LARI configuration
613  * This structure is used also for lari cmd version 8 and 9.
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  *     For LARI cmd version 4 to 8 - bits 0:3 are supported.
624  *     For LARI cmd version 9 - bits 0:5 are supported.
625  * @chan_state_active_bitmap: Bitmap to enable different bands per country
626  *     or region.
627  *     Each bit represents a country or region, and a band to activate
628  *     according to the BIOS definitions.
629  *     For LARI cmd version 7 - bits 0:3 are supported.
630  *     For LARI cmd version 8 - bits 0:4 are supported.
631  * @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
632  *     Each bit represents a set of channels in a specific band that should be
633  *     disabled
634  * @edt_bitmap: Bitmap of energy detection threshold table.
635  *	Disable/enable the EDT optimization method for different band.
636  */
637 struct iwl_lari_config_change_cmd_v7 {
638 	__le32 config_bitmap;
639 	__le32 oem_uhb_allow_bitmap;
640 	__le32 oem_11ax_allow_bitmap;
641 	__le32 oem_unii4_allow_bitmap;
642 	__le32 chan_state_active_bitmap;
643 	__le32 force_disable_channels_bitmap;
644 	__le32 edt_bitmap;
645 } __packed;
646 /* LARI_CHANGE_CONF_CMD_S_VER_7 */
647 /* LARI_CHANGE_CONF_CMD_S_VER_8 */
648 /* LARI_CHANGE_CONF_CMD_S_VER_9 */
649 
650 /**
651  * struct iwl_lari_config_change_cmd - change LARI configuration
652  * @config_bitmap: Bitmap of the config commands. Each bit will trigger a
653  *	different predefined FW config operation.
654  * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
655  * @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits
656  *	per country, one to indicate whether to override and the other to
657  *	indicate the value to use.
658  * @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits
659  *	per country, one to indicate whether to override and the other to
660  *	indicate allow/disallow unii4 channels.
661  *	For LARI cmd version 10 - bits 0:5 are supported.
662  * @chan_state_active_bitmap: Bitmap to enable different bands per country
663  *	or region.
664  *	Each bit represents a country or region, and a band to activate
665  *	according to the BIOS definitions.
666  *	For LARI cmd version 10 - bits 0:4 are supported.
667  * @force_disable_channels_bitmap: Bitmap of disabled bands/channels.
668  *	Each bit represents a set of channels in a specific band that should be
669  *	disabled
670  * @edt_bitmap: Bitmap of energy detection threshold table.
671  *	Disable/enable the EDT optimization method for different band.
672  * @oem_320mhz_allow_bitmap: 320Mhz bandwidth enablement bitmap per MCC.
673  *	bit0: enable 320Mhz in Japan.
674  *	bit1: enable 320Mhz in South Korea.
675  *	bit 2 - 31: reserved.
676  */
677 struct iwl_lari_config_change_cmd {
678 	__le32 config_bitmap;
679 	__le32 oem_uhb_allow_bitmap;
680 	__le32 oem_11ax_allow_bitmap;
681 	__le32 oem_unii4_allow_bitmap;
682 	__le32 chan_state_active_bitmap;
683 	__le32 force_disable_channels_bitmap;
684 	__le32 edt_bitmap;
685 	__le32 oem_320mhz_allow_bitmap;
686 } __packed;
687 /* LARI_CHANGE_CONF_CMD_S_VER_10 */
688 
689 /* Activate UNII-1 (5.2GHz) for World Wide */
690 #define ACTIVATE_5G2_IN_WW_MASK	BIT(4)
691 
692 /**
693  * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete
694  * @status: PNVM image loading status
695  */
696 struct iwl_pnvm_init_complete_ntfy {
697 	__le32 status;
698 } __packed; /* PNVM_INIT_COMPLETE_NTFY_S_VER_1 */
699 
700 #define UATS_TABLE_ROW_SIZE	26
701 #define UATS_TABLE_COL_SIZE	13
702 
703 /**
704  * struct iwl_mcc_allowed_ap_type_cmd - struct for MCC_ALLOWED_AP_TYPE_CMD
705  * @offset_map: mapping a mcc to UHB AP type support (UATS) allowed
706  * @reserved: reserved
707  */
708 struct iwl_mcc_allowed_ap_type_cmd {
709 	u8 offset_map[UATS_TABLE_ROW_SIZE][UATS_TABLE_COL_SIZE];
710 	__le16 reserved;
711 } __packed; /* MCC_ALLOWED_AP_TYPE_CMD_API_S_VER_1 */
712 
713 #endif /* __iwl_fw_api_nvm_reg_h__ */
714