| 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 iwl_bios_config_hdr - BIOS configuration header |
| 507 |
* @table_source: see &enum bios_source |
| 508 |
* @table_revision: table revision. |
| 509 |
* @reserved: reserved |
| 510 |
*/ |
| 511 |
struct iwl_bios_config_hdr { |
| 512 |
u8 table_source; |
| 513 |
u8 table_revision; |
| 514 |
u8 reserved[2]; |
| 515 |
} __packed; /* BIOS_CONFIG_HDR_API_S_VER_1 */ |
| 516 |
|
| 517 |
/** |
| 518 |
* struct bios_value_u32 - BIOS configuration. |
| 519 |
* @hdr: bios config header |
| 520 |
* @value: value in bios. |
| 521 |
*/ |
| 522 |
struct bios_value_u32 { |
| 523 |
struct iwl_bios_config_hdr hdr; |
| 524 |
__le32 value; |
| 525 |
} __packed; /* BIOS_CONFIG_DATA_U32_API_S_VER_1 */ |
| 526 |
|
| 527 |
/** |
| 528 |
* struct iwl_tas_config_cmd - configures the TAS. |
| 529 |
* @block_list_size: size of relevant field in block_list_array |
| 530 |
* @block_list_array: list of countries where TAS must be disabled |
| 531 |
* @reserved: reserved |
| 532 |
* @tas_config_info: see @struct bios_value_u32 |
| 533 |
*/ |
| 534 |
struct iwl_tas_config_cmd { |
| 535 |
__le16 block_list_size; |
| 536 |
__le16 block_list_array[IWL_WTAS_BLACK_LIST_MAX]; |
| 537 |
u8 reserved[2]; |
| 538 |
struct bios_value_u32 tas_config_info; |
| 539 |
} __packed; /* TAS_CONFIG_CMD_API_S_VER_5 */ |
| 540 |
|
| 541 |
/** |
| 542 |
* enum iwl_lari_config_masks - bit masks for the various LARI config operations |
| 543 |
* @LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK: disable 11ac in ukraine |
| 544 |
* @LARI_CONFIG_CHANGE_ETSI_TO_PASSIVE_MSK: ETSI 5.8GHz SRD passive scan |
| 545 |
* @LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK: ETSI 5.8GHz SRD disabled |
| 546 |
* @LARI_CONFIG_ENABLE_5G2_IN_INDONESIA_MSK: enable 5.15/5.35GHz bands in |
| 547 |
* Indonesia |
| 548 |
* @LARI_CONFIG_ENABLE_CHINA_22_REG_SUPPORT_MSK: enable 2022 china regulatory |
| 549 |
*/ |
| 550 |
enum iwl_lari_config_masks { |
| 551 |
LARI_CONFIG_DISABLE_11AC_UKRAINE_MSK = BIT(0), |
| 552 |
LARI_CONFIG_CHANGE_ETSI_TO_PASSIVE_MSK = BIT(1), |
| 553 |
LARI_CONFIG_CHANGE_ETSI_TO_DISABLED_MSK = BIT(2), |
| 554 |
LARI_CONFIG_ENABLE_5G2_IN_INDONESIA_MSK = BIT(3), |
| 555 |
LARI_CONFIG_ENABLE_CHINA_22_REG_SUPPORT_MSK = BIT(7), |
| 556 |
}; |
| 557 |
|
| 558 |
#define IWL_11AX_UKRAINE_MASK 3 |
| 559 |
#define IWL_11AX_UKRAINE_SHIFT 8 |
| 560 |
|
| 561 |
/** |
| 562 |
* struct iwl_lari_config_change_cmd_v1 - change LARI configuration |
| 563 |
* @config_bitmap: bit map of the config commands. each bit will trigger a |
| 564 |
* different predefined FW config operation |
| 565 |
*/ |
| 566 |
struct iwl_lari_config_change_cmd_v1 { |
| 567 |
__le32 config_bitmap; |
| 568 |
} __packed; /* LARI_CHANGE_CONF_CMD_S_VER_1 */ |
| 569 |
|
| 570 |
/** |
| 571 |
* struct iwl_lari_config_change_cmd_v6 - change LARI configuration |
| 572 |
* @config_bitmap: Bitmap of the config commands. Each bit will trigger a |
| 573 |
* different predefined FW config operation. |
| 574 |
* @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets. |
| 575 |
* @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits |
| 576 |
* per country, one to indicate whether to override and the other to |
| 577 |
* indicate the value to use. |
| 578 |
* @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits |
| 579 |
* per country, one to indicate whether to override and the other to |
| 580 |
* indicate allow/disallow unii4 channels. |
| 581 |
* @chan_state_active_bitmap: Bitmap for overriding channel state to active. |
| 582 |
* Each bit represents a country or region to activate, according to the BIOS |
| 583 |
* definitions. |
| 584 |
* @force_disable_channels_bitmap: Bitmap of disabled bands/channels. |
| 585 |
* Each bit represents a set of channels in a specific band that should be disabled |
| 586 |
*/ |
| 587 |
struct iwl_lari_config_change_cmd_v6 { |
| 588 |
__le32 config_bitmap; |
| 589 |
__le32 oem_uhb_allow_bitmap; |
| 590 |
__le32 oem_11ax_allow_bitmap; |
| 591 |
__le32 oem_unii4_allow_bitmap; |
| 592 |
__le32 chan_state_active_bitmap; |
| 593 |
__le32 force_disable_channels_bitmap; |
| 594 |
} __packed; /* LARI_CHANGE_CONF_CMD_S_VER_6 */ |
| 595 |
|
| 596 |
/** |
| 597 |
* struct iwl_lari_config_change_cmd_v8 - change LARI configuration |
| 598 |
* @config_bitmap: Bitmap of the config commands. Each bit will trigger a |
| 599 |
* different predefined FW config operation. |
| 600 |
* @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets. |
| 601 |
* @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits |
| 602 |
* per country, one to indicate whether to override and the other to |
| 603 |
* indicate the value to use. |
| 604 |
* @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits |
| 605 |
* per country, one to indicate whether to override and the other to |
| 606 |
* indicate allow/disallow unii4 channels. |
| 607 |
* bit 0 - 3: supported. |
| 608 |
* @chan_state_active_bitmap: Bitmap to enable different bands per country |
| 609 |
* or region. |
| 610 |
* Each bit represents a country or region, and a band to activate |
| 611 |
* according to the BIOS definitions. |
| 612 |
* bit 0 - 4: supported. |
| 613 |
* @force_disable_channels_bitmap: Bitmap of disabled bands/channels. |
| 614 |
* Each bit represents a set of channels in a specific band that should be |
| 615 |
* disabled |
| 616 |
* @edt_bitmap: Bitmap of energy detection threshold table. |
| 617 |
* Disable/enable the EDT optimization method for different band. |
| 618 |
*/ |
| 619 |
struct iwl_lari_config_change_cmd_v8 { |
| 620 |
__le32 config_bitmap; |
| 621 |
__le32 oem_uhb_allow_bitmap; |
| 622 |
__le32 oem_11ax_allow_bitmap; |
| 623 |
__le32 oem_unii4_allow_bitmap; |
| 624 |
__le32 chan_state_active_bitmap; |
| 625 |
__le32 force_disable_channels_bitmap; |
| 626 |
__le32 edt_bitmap; |
| 627 |
} __packed; |
| 628 |
/* LARI_CHANGE_CONF_CMD_S_VER_8 */ |
| 629 |
|
| 630 |
|
| 631 |
/** |
| 632 |
* struct iwl_lari_config_change_cmd - change LARI configuration |
| 633 |
* @config_bitmap: Bitmap of the config commands. Each bit will trigger a |
| 634 |
* different predefined FW config operation. |
| 635 |
* @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets. |
| 636 |
* @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits |
| 637 |
* per country, one to indicate whether to override and the other to |
| 638 |
* indicate the value to use. |
| 639 |
* @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits |
| 640 |
* per country, one to indicate whether to override and the other to |
| 641 |
* indicate allow/disallow unii4 channels. |
| 642 |
* @chan_state_active_bitmap: Bitmap to enable different bands per country |
| 643 |
* or region. |
| 644 |
* Each bit represents a country or region, and a band to activate |
| 645 |
* according to the BIOS definitions. |
| 646 |
* bit 0 - 6: supported. |
| 647 |
* @force_disable_channels_bitmap: Bitmap of disabled bands/channels. |
| 648 |
* Each bit represents a set of channels in a specific band that should be |
| 649 |
* disabled |
| 650 |
* @edt_bitmap: Bitmap of energy detection threshold table. |
| 651 |
* Disable/enable the EDT optimization method for different band. |
| 652 |
* @oem_320mhz_allow_bitmap: 320Mhz bandwidth enablement bitmap per MCC. |
| 653 |
* bit0: enable 320Mhz in Japan. |
| 654 |
* bit1: enable 320Mhz in South Korea. |
| 655 |
* bit 2 - 31: reserved. |
| 656 |
* @oem_11be_allow_bitmap: Bitmap of 11be allowed MCCs. No need to mask out the |
| 657 |
* unsupported bits |
| 658 |
* bit0: enable 11be in China(CB/CN). |
| 659 |
* bit1: enable 11be in South Korea. |
| 660 |
* bit 2 - 31: reserved. |
| 661 |
* @oem_11bn_allow_bitmap: Bitmap of 11bn allowed MCCs. The firmware expects to |
| 662 |
* get the data from the BIOS. |
| 663 |
* @oem_unii9_enable: UNII-9 enablement as read from the BIOS |
| 664 |
* @bios_hdr: bios config header |
| 665 |
*/ |
| 666 |
struct iwl_lari_config_change_cmd { |
| 667 |
__le32 config_bitmap; |
| 668 |
__le32 oem_uhb_allow_bitmap; |
| 669 |
__le32 oem_11ax_allow_bitmap; |
| 670 |
__le32 oem_unii4_allow_bitmap; |
| 671 |
__le32 chan_state_active_bitmap; |
| 672 |
__le32 force_disable_channels_bitmap; |
| 673 |
__le32 edt_bitmap; |
| 674 |
__le32 oem_320mhz_allow_bitmap; |
| 675 |
__le32 oem_11be_allow_bitmap; |
| 676 |
/* since version 13 */ |
| 677 |
__le32 oem_11bn_allow_bitmap; |
| 678 |
/* since version 13 */ |
| 679 |
__le32 oem_unii9_enable; |
| 680 |
/* since version 13 */ |
| 681 |
struct iwl_bios_config_hdr bios_hdr; |
| 682 |
} __packed; |
| 683 |
/* LARI_CHANGE_CONF_CMD_S_VER_12 |
| 684 |
* LARI_CHANGE_CONF_CMD_S_VER_13 |
| 685 |
*/ |
| 686 |
|
| 687 |
/* Activate UNII-1 (5.2GHz) for World Wide */ |
| 688 |
#define ACTIVATE_5G2_IN_WW_MASK BIT(4) |
| 689 |
#define CHAN_STATE_ACTIVE_BITMAP_CMD_V8 0x1F |
| 690 |
#define CHAN_STATE_ACTIVE_BITMAP_CMD_V12 0x7F |
| 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 |
* @mcc_to_ap_type_map: mapping an MCC to 6 GHz AP type support (UATS) |
| 706 |
* @reserved: reserved |
| 707 |
*/ |
| 708 |
struct iwl_mcc_allowed_ap_type_cmd { |
| 709 |
u8 mcc_to_ap_type_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__ */ |