1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 /* 3 * Copyright (C) 2012-2014, 2018-2022 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_datapath_h__ 8 #define __iwl_fw_api_datapath_h__ 9 10 /** 11 * enum iwl_data_path_subcmd_ids - data path group commands 12 */ 13 enum iwl_data_path_subcmd_ids { 14 /** 15 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd 16 */ 17 DQA_ENABLE_CMD = 0x0, 18 19 /** 20 * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd 21 */ 22 UPDATE_MU_GROUPS_CMD = 0x1, 23 24 /** 25 * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd 26 */ 27 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2, 28 29 /** 30 * @WNM_PLATFORM_PTM_REQUEST_CMD: &struct iwl_time_sync_cfg_cmd 31 */ 32 WNM_PLATFORM_PTM_REQUEST_CMD = 0x3, 33 34 /** 35 * @STA_HE_CTXT_CMD: &struct iwl_he_sta_context_cmd 36 */ 37 STA_HE_CTXT_CMD = 0x7, 38 39 /** 40 * @RLC_CONFIG_CMD: &struct iwl_rlc_config_cmd 41 */ 42 RLC_CONFIG_CMD = 0x8, 43 44 /** 45 * @RFH_QUEUE_CONFIG_CMD: &struct iwl_rfh_queue_config 46 */ 47 RFH_QUEUE_CONFIG_CMD = 0xD, 48 49 /** 50 * @TLC_MNG_CONFIG_CMD: &struct iwl_tlc_config_cmd_v4 51 */ 52 TLC_MNG_CONFIG_CMD = 0xF, 53 54 /** 55 * @HE_AIR_SNIFFER_CONFIG_CMD: &struct iwl_he_monitor_cmd 56 */ 57 HE_AIR_SNIFFER_CONFIG_CMD = 0x13, 58 59 /** 60 * @CHEST_COLLECTOR_FILTER_CONFIG_CMD: Configure the CSI 61 * matrix collection, uses &struct iwl_channel_estimation_cfg 62 */ 63 CHEST_COLLECTOR_FILTER_CONFIG_CMD = 0x14, 64 65 /** 66 * @RX_BAID_ALLOCATION_CONFIG_CMD: Allocate/deallocate a BAID for an RX 67 * blockack session, uses &struct iwl_rx_baid_cfg_cmd for the 68 * command, and &struct iwl_rx_baid_cfg_resp as a response. 69 */ 70 RX_BAID_ALLOCATION_CONFIG_CMD = 0x16, 71 72 /** 73 * @SCD_QUEUE_CONFIG_CMD: new scheduler queue allocation/config/removal 74 * command, uses &struct iwl_scd_queue_cfg_cmd and the response 75 * is (same as before) &struct iwl_tx_queue_cfg_rsp. 76 */ 77 SCD_QUEUE_CONFIG_CMD = 0x17, 78 79 /** 80 * @SEC_KEY_CMD: security key command, uses &struct iwl_sec_key_cmd 81 */ 82 SEC_KEY_CMD = 0x18, 83 84 /** 85 * @MONITOR_NOTIF: Datapath monitoring notification, using 86 * &struct iwl_datapath_monitor_notif 87 */ 88 MONITOR_NOTIF = 0xF4, 89 90 /** 91 * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data or &struct iwl_rx_no_data_ver_3 92 */ 93 RX_NO_DATA_NOTIF = 0xF5, 94 95 /** 96 * @THERMAL_DUAL_CHAIN_DISABLE_REQ: firmware request for SMPS mode, 97 * &struct iwl_thermal_dual_chain_request 98 */ 99 THERMAL_DUAL_CHAIN_REQUEST = 0xF6, 100 101 /** 102 * @TLC_MNG_UPDATE_NOTIF: &struct iwl_tlc_update_notif 103 */ 104 TLC_MNG_UPDATE_NOTIF = 0xF7, 105 106 /** 107 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification 108 */ 109 STA_PM_NOTIF = 0xFD, 110 111 /** 112 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif 113 */ 114 MU_GROUP_MGMT_NOTIF = 0xFE, 115 116 /** 117 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification 118 */ 119 RX_QUEUES_NOTIFICATION = 0xFF, 120 }; 121 122 /** 123 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration 124 * 125 * @reserved: reserved 126 * @membership_status: a bitmap of MU groups 127 * @user_position:the position of station in a group. If the station is in the 128 * group then bits (group * 2) is the position -1 129 */ 130 struct iwl_mu_group_mgmt_cmd { 131 __le32 reserved; 132 __le32 membership_status[2]; 133 __le32 user_position[4]; 134 } __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */ 135 136 /** 137 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification 138 * 139 * @membership_status: a bitmap of MU groups 140 * @user_position: the position of station in a group. If the station is in the 141 * group then bits (group * 2) is the position -1 142 */ 143 struct iwl_mu_group_mgmt_notif { 144 __le32 membership_status[2]; 145 __le32 user_position[4]; 146 } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */ 147 148 enum iwl_channel_estimation_flags { 149 IWL_CHANNEL_ESTIMATION_ENABLE = BIT(0), 150 IWL_CHANNEL_ESTIMATION_TIMER = BIT(1), 151 IWL_CHANNEL_ESTIMATION_COUNTER = BIT(2), 152 }; 153 154 /** 155 * enum iwl_synced_time_operation - PTM request options 156 * 157 * @IWL_SYNCED_TIME_OPERATION_READ_ARTB: read only the ARTB time 158 * @IWL_SYNCED_TIME_OPERATION_READ_GP2: read only the GP2 time 159 * @IWL_SYNCED_TIME_OPERATION_READ_BOTH: latch the ARTB and GP2 clocks and 160 * provide timestamps from both clocks for the same time point 161 */ 162 enum iwl_synced_time_operation { 163 IWL_SYNCED_TIME_OPERATION_READ_ARTB = 1, 164 IWL_SYNCED_TIME_OPERATION_READ_GP2, 165 IWL_SYNCED_TIME_OPERATION_READ_BOTH, 166 }; 167 168 /** 169 * struct iwl_synced_time_cmd - request synced GP2/ARTB timestamps 170 * 171 * @operation: one of &enum iwl_synced_time_operation 172 */ 173 struct iwl_synced_time_cmd { 174 __le32 operation; 175 } __packed; /* WNM_80211V_TIMING_CMD_API_S_VER_1 */ 176 177 /** 178 * struct iwl_synced_time_rsp - response to iwl_synced_time_cmd 179 * 180 * @operation: one of &enum iwl_synced_time_operation 181 * @platform_timestamp_hi: high DWORD of the ARTB clock timestamp in nanoseconds 182 * @platform_timestamp_lo: low DWORD of the ARTB clock timestamp in nanoseconds 183 * @gp2_timestamp_hi: high DWORD of the GP2 clock timestamp in 10's of 184 * nanoseconds 185 * @gp2_timestamp_lo: low DWORD of the GP2 clock timestamp in 10's of 186 * nanoseconds 187 */ 188 struct iwl_synced_time_rsp { 189 __le32 operation; 190 __le32 platform_timestamp_hi; 191 __le32 platform_timestamp_lo; 192 __le32 gp2_timestamp_hi; 193 __le32 gp2_timestamp_lo; 194 } __packed; /* WNM_80211V_TIMING_RSP_API_S_VER_1 */ 195 196 /** 197 * struct iwl_channel_estimation_cfg - channel estimation reporting config 198 */ 199 struct iwl_channel_estimation_cfg { 200 /** 201 * @flags: flags, see &enum iwl_channel_estimation_flags 202 */ 203 __le32 flags; 204 /** 205 * @timer: if enabled via flags, automatically disable after this many 206 * microseconds 207 */ 208 __le32 timer; 209 /** 210 * @count: if enabled via flags, automatically disable after this many 211 * frames with channel estimation matrix were captured 212 */ 213 __le32 count; 214 /** 215 * @rate_n_flags_mask: only try to record the channel estimation matrix 216 * if the rate_n_flags value for the received frame (let's call 217 * that rx_rnf) matches the mask/value given here like this: 218 * (rx_rnf & rate_n_flags_mask) == rate_n_flags_val. 219 */ 220 __le32 rate_n_flags_mask; 221 /** 222 * @rate_n_flags_val: see @rate_n_flags_mask 223 */ 224 __le32 rate_n_flags_val; 225 /** 226 * @reserved: reserved (for alignment) 227 */ 228 __le32 reserved; 229 /** 230 * @frame_types: bitmap of frame types to capture, the received frame's 231 * subtype|type takes 6 bits in the frame and the corresponding bit 232 * in this field must be set to 1 to capture channel estimation for 233 * that frame type. Set to all-ones to enable capturing for all 234 * frame types. 235 */ 236 __le64 frame_types; 237 } __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */ 238 239 enum iwl_datapath_monitor_notif_type { 240 IWL_DP_MON_NOTIF_TYPE_EXT_CCA, 241 }; 242 243 struct iwl_datapath_monitor_notif { 244 __le32 type; 245 u8 mac_id; 246 u8 reserved[3]; 247 } __packed; /* MONITOR_NTF_API_S_VER_1 */ 248 249 /** 250 * enum iwl_thermal_dual_chain_req_events - firmware SMPS request event 251 * @THERMAL_DUAL_CHAIN_REQ_ENABLE: (re-)enable dual-chain operation 252 * (subject to other constraints) 253 * @THERMAL_DUAL_CHAIN_REQ_DISABLE: disable dual-chain operation 254 * (static SMPS) 255 */ 256 enum iwl_thermal_dual_chain_req_events { 257 THERMAL_DUAL_CHAIN_REQ_ENABLE, 258 THERMAL_DUAL_CHAIN_REQ_DISABLE, 259 }; /* THERMAL_DUAL_CHAIN_DISABLE_STATE_API_E_VER_1 */ 260 261 /** 262 * struct iwl_thermal_dual_chain_request - SMPS request 263 * @event: the type of request, see &enum iwl_thermal_dual_chain_req_events 264 */ 265 struct iwl_thermal_dual_chain_request { 266 __le32 event; 267 } __packed; /* THERMAL_DUAL_CHAIN_DISABLE_REQ_NTFY_API_S_VER_1 */ 268 269 enum iwl_rlc_chain_info { 270 IWL_RLC_CHAIN_INFO_DRIVER_FORCE = BIT(0), 271 IWL_RLC_CHAIN_INFO_VALID = 0x000e, 272 IWL_RLC_CHAIN_INFO_FORCE = 0x0070, 273 IWL_RLC_CHAIN_INFO_FORCE_MIMO = 0x0380, 274 IWL_RLC_CHAIN_INFO_COUNT = 0x0c00, 275 IWL_RLC_CHAIN_INFO_MIMO_COUNT = 0x3000, 276 }; 277 278 /** 279 * struct iwl_rlc_properties - RLC properties 280 * @rx_chain_info: RX chain info, &enum iwl_rlc_chain_info 281 * @reserved: reserved 282 */ 283 struct iwl_rlc_properties { 284 __le32 rx_chain_info; 285 __le32 reserved; 286 } __packed; /* RLC_PROPERTIES_S_VER_1 */ 287 288 enum iwl_sad_mode { 289 IWL_SAD_MODE_ENABLED = BIT(0), 290 IWL_SAD_MODE_DEFAULT_ANT_MSK = 0x6, 291 IWL_SAD_MODE_DEFAULT_ANT_FW = 0x0, 292 IWL_SAD_MODE_DEFAULT_ANT_A = 0x2, 293 IWL_SAD_MODE_DEFAULT_ANT_B = 0x4, 294 }; 295 296 /** 297 * struct iwl_sad_properties - SAD properties 298 * @chain_a_sad_mode: chain A SAD mode, &enum iwl_sad_mode 299 * @chain_b_sad_mode: chain B SAD mode, &enum iwl_sad_mode 300 * @mac_id: MAC index 301 * @reserved: reserved 302 */ 303 struct iwl_sad_properties { 304 __le32 chain_a_sad_mode; 305 __le32 chain_b_sad_mode; 306 __le32 mac_id; 307 __le32 reserved; 308 } __packed; 309 310 /** 311 * struct iwl_rlc_config_cmd - RLC configuration 312 * @phy_id: PHY index 313 * @rlc: RLC properties, &struct iwl_rlc_properties 314 * @sad: SAD (single antenna diversity) options, &struct iwl_sad_properties 315 * @flags: flags, &enum iwl_rlc_flags 316 * @reserved: reserved 317 */ 318 struct iwl_rlc_config_cmd { 319 __le32 phy_id; 320 struct iwl_rlc_properties rlc; 321 struct iwl_sad_properties sad; 322 u8 flags; 323 u8 reserved[3]; 324 } __packed; /* RLC_CONFIG_CMD_API_S_VER_2 */ 325 326 #define IWL_MAX_BAID_OLD 16 /* MAX_IMMEDIATE_BA_API_D_VER_2 */ 327 #define IWL_MAX_BAID 32 /* MAX_IMMEDIATE_BA_API_D_VER_3 */ 328 329 /** 330 * enum iwl_rx_baid_action - BAID allocation/config action 331 * @IWL_RX_BAID_ACTION_ADD: add a new BAID session 332 * @IWL_RX_BAID_ACTION_MODIFY: modify the BAID session 333 * @IWL_RX_BAID_ACTION_REMOVE: remove the BAID session 334 */ 335 enum iwl_rx_baid_action { 336 IWL_RX_BAID_ACTION_ADD, 337 IWL_RX_BAID_ACTION_MODIFY, 338 IWL_RX_BAID_ACTION_REMOVE, 339 }; /* RX_BAID_ALLOCATION_ACTION_E_VER_1 */ 340 341 /** 342 * struct iwl_rx_baid_cfg_cmd_alloc - BAID allocation data 343 * @sta_id_mask: station ID mask 344 * @tid: the TID for this session 345 * @reserved: reserved 346 * @ssn: the starting sequence number 347 * @win_size: RX BA session window size 348 */ 349 struct iwl_rx_baid_cfg_cmd_alloc { 350 __le32 sta_id_mask; 351 u8 tid; 352 u8 reserved[3]; 353 __le16 ssn; 354 __le16 win_size; 355 } __packed; /* RX_BAID_ALLOCATION_ADD_CMD_API_S_VER_1 */ 356 357 /** 358 * struct iwl_rx_baid_cfg_cmd_modify - BAID modification data 359 * @old_sta_id_mask: old station ID mask 360 * @new_sta_id_mask: new station ID mask 361 * @tid: TID of the BAID 362 */ 363 struct iwl_rx_baid_cfg_cmd_modify { 364 __le32 old_sta_id_mask; 365 __le32 new_sta_id_mask; 366 __le32 tid; 367 } __packed; /* RX_BAID_ALLOCATION_MODIFY_CMD_API_S_VER_2 */ 368 369 /** 370 * struct iwl_rx_baid_cfg_cmd_remove_v1 - BAID removal data 371 * @baid: the BAID to remove 372 */ 373 struct iwl_rx_baid_cfg_cmd_remove_v1 { 374 __le32 baid; 375 } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_1 */ 376 377 /** 378 * struct iwl_rx_baid_cfg_cmd_remove - BAID removal data 379 * @sta_id_mask: the station mask of the BAID to remove 380 * @tid: the TID of the BAID to remove 381 */ 382 struct iwl_rx_baid_cfg_cmd_remove { 383 __le32 sta_id_mask; 384 __le32 tid; 385 } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_2 */ 386 387 /** 388 * struct iwl_rx_baid_cfg_cmd - BAID allocation/config command 389 * @action: the action, from &enum iwl_rx_baid_action 390 */ 391 struct iwl_rx_baid_cfg_cmd { 392 __le32 action; 393 union { 394 struct iwl_rx_baid_cfg_cmd_alloc alloc; 395 struct iwl_rx_baid_cfg_cmd_modify modify; 396 struct iwl_rx_baid_cfg_cmd_remove_v1 remove_v1; 397 struct iwl_rx_baid_cfg_cmd_remove remove; 398 }; /* RX_BAID_ALLOCATION_OPERATION_API_U_VER_2 */ 399 } __packed; /* RX_BAID_ALLOCATION_CONFIG_CMD_API_S_VER_2 */ 400 401 /** 402 * struct iwl_rx_baid_cfg_resp - BAID allocation response 403 * @baid: the allocated BAID 404 */ 405 struct iwl_rx_baid_cfg_resp { 406 __le32 baid; 407 }; /* RX_BAID_ALLOCATION_RESPONSE_API_S_VER_1 */ 408 409 /** 410 * enum iwl_scd_queue_cfg_operation - scheduler queue operation 411 * @IWL_SCD_QUEUE_ADD: allocate a new queue 412 * @IWL_SCD_QUEUE_REMOVE: remove a queue 413 * @IWL_SCD_QUEUE_MODIFY: modify a queue 414 */ 415 enum iwl_scd_queue_cfg_operation { 416 IWL_SCD_QUEUE_ADD = 0, 417 IWL_SCD_QUEUE_REMOVE = 1, 418 IWL_SCD_QUEUE_MODIFY = 2, 419 }; 420 421 /** 422 * struct iwl_scd_queue_cfg_cmd - scheduler queue allocation command 423 * @operation: the operation, see &enum iwl_scd_queue_cfg_operation 424 * @u.add.sta_mask: station mask 425 * @u.add.tid: TID 426 * @u.add.reserved: reserved 427 * @u.add.flags: flags from &enum iwl_tx_queue_cfg_actions, except 428 * %TX_QUEUE_CFG_ENABLE_QUEUE is not valid 429 * @u.add.cb_size: size code 430 * @u.add.bc_dram_addr: byte-count table IOVA 431 * @u.add.tfdq_dram_addr: TFD queue IOVA 432 * @u.remove.sta_mask: station mask of queue to remove 433 * @u.remove.tid: TID of queue to remove 434 * @u.modify.old_sta_mask: old station mask for modify 435 * @u.modify.tid: TID of queue to modify 436 * @u.modify.new_sta_mask: new station mask for modify 437 */ 438 struct iwl_scd_queue_cfg_cmd { 439 __le32 operation; 440 union { 441 struct { 442 __le32 sta_mask; 443 u8 tid; 444 u8 reserved[3]; 445 __le32 flags; 446 __le32 cb_size; 447 __le64 bc_dram_addr; 448 __le64 tfdq_dram_addr; 449 } __packed add; /* TX_QUEUE_CFG_CMD_ADD_API_S_VER_1 */ 450 struct { 451 __le32 sta_mask; 452 __le32 tid; 453 } __packed remove; /* TX_QUEUE_CFG_CMD_REMOVE_API_S_VER_1 */ 454 struct { 455 __le32 old_sta_mask; 456 __le32 tid; 457 __le32 new_sta_mask; 458 } __packed modify; /* TX_QUEUE_CFG_CMD_MODIFY_API_S_VER_1 */ 459 } __packed u; /* TX_QUEUE_CFG_CMD_OPERATION_API_U_VER_1 */ 460 } __packed; /* TX_QUEUE_CFG_CMD_API_S_VER_3 */ 461 462 /** 463 * enum iwl_sec_key_flags - security key command key flags 464 * @IWL_SEC_KEY_FLAG_CIPHER_MASK: cipher mask 465 * @IWL_SEC_KEY_FLAG_CIPHER_WEP: WEP cipher 466 * @IWL_SEC_KEY_FLAG_CIPHER_CCMP: CCMP/CMAC cipher 467 * @IWL_SEC_KEY_FLAG_CIPHER_TKIP: TKIP cipher 468 * @IWL_SEC_KEY_FLAG_CIPHER_GCMP: GCMP/GMAC cipher 469 * @IWL_SEC_KEY_FLAG_NO_TX: don't install for TX 470 * @IWL_SEC_KEY_FLAG_KEY_SIZE: large key size (WEP-104, GCMP-256, GMAC-256) 471 * @IWL_SEC_KEY_FLAG_MFP: MFP is in used for this key 472 * @IWL_SEC_KEY_FLAG_MCAST_KEY: this is a multicast key 473 * @IWL_SEC_KEY_FLAG_SPP_AMSDU: SPP A-MSDU should be used 474 */ 475 enum iwl_sec_key_flags { 476 IWL_SEC_KEY_FLAG_CIPHER_MASK = 0x07, 477 IWL_SEC_KEY_FLAG_CIPHER_WEP = 0x01, 478 IWL_SEC_KEY_FLAG_CIPHER_CCMP = 0x02, 479 IWL_SEC_KEY_FLAG_CIPHER_TKIP = 0x03, 480 IWL_SEC_KEY_FLAG_CIPHER_GCMP = 0x05, 481 IWL_SEC_KEY_FLAG_NO_TX = 0x08, 482 IWL_SEC_KEY_FLAG_KEY_SIZE = 0x10, 483 IWL_SEC_KEY_FLAG_MFP = 0x20, 484 IWL_SEC_KEY_FLAG_MCAST_KEY = 0x40, 485 IWL_SEC_KEY_FLAG_SPP_AMSDU = 0x80, 486 }; 487 488 #define IWL_SEC_WEP_KEY_OFFSET 3 489 490 /** 491 * struct iwl_sec_key_cmd - security key command 492 * @action: action from &enum iwl_ctxt_action 493 * @u.add.sta_mask: station mask for the new key 494 * @u.add.key_id: key ID (0-7) for the new key 495 * @u.add.key_flags: key flags per &enum iwl_sec_key_flags 496 * @u.add.key: key material. WEP keys should start from &IWL_SEC_WEP_KEY_OFFSET. 497 * @u.add.tkip_mic_rx_key: TKIP MIC RX key 498 * @u.add.tkip_mic_tx_key: TKIP MIC TX key 499 * @u.add.rx_seq: RX sequence counter value 500 * @u.add.tx_seq: TX sequence counter value 501 * @u.modify.old_sta_mask: old station mask 502 * @u.modify.new_sta_mask: new station mask 503 * @u.modify.key_id: key ID 504 * @u.modify.key_flags: new key flags 505 * @u.remove.sta_mask: station mask 506 * @u.remove.key_id: key ID 507 * @u.remove.key_flags: key flags 508 */ 509 struct iwl_sec_key_cmd { 510 __le32 action; 511 union { 512 struct { 513 __le32 sta_mask; 514 __le32 key_id; 515 __le32 key_flags; 516 u8 key[32]; 517 u8 tkip_mic_rx_key[8]; 518 u8 tkip_mic_tx_key[8]; 519 __le64 rx_seq; 520 __le64 tx_seq; 521 } __packed add; /* SEC_KEY_ADD_CMD_API_S_VER_1 */ 522 struct { 523 __le32 old_sta_mask; 524 __le32 new_sta_mask; 525 __le32 key_id; 526 __le32 key_flags; 527 } __packed modify; /* SEC_KEY_MODIFY_CMD_API_S_VER_1 */ 528 struct { 529 __le32 sta_mask; 530 __le32 key_id; 531 __le32 key_flags; 532 } __packed remove; /* SEC_KEY_REMOVE_CMD_API_S_VER_1 */ 533 } __packed u; /* SEC_KEY_OPERATION_API_U_VER_1 */ 534 } __packed; /* SEC_KEY_CMD_API_S_VER_1 */ 535 536 #endif /* __iwl_fw_api_datapath_h__ */ 537