]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blob - drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
iwlwifi: mvm: disentangle union in TX status struct
[mirror_ubuntu-hirsute-kernel.git] / drivers / net / wireless / intel / iwlwifi / mvm / fw-api.h
1 /******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * USA
25 *
26 * The full GNU General Public License is included in this distribution
27 * in the file called COPYING.
28 *
29 * Contact Information:
30 * Intel Linux Wireless <linuxwifi@intel.com>
31 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 *
33 * BSD LICENSE
34 *
35 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
36 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
37 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
38 * All rights reserved.
39 *
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
42 * are met:
43 *
44 * * Redistributions of source code must retain the above copyright
45 * notice, this list of conditions and the following disclaimer.
46 * * Redistributions in binary form must reproduce the above copyright
47 * notice, this list of conditions and the following disclaimer in
48 * the documentation and/or other materials provided with the
49 * distribution.
50 * * Neither the name Intel Corporation nor the names of its
51 * contributors may be used to endorse or promote products derived
52 * from this software without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
56 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
64 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 *
66 *****************************************************************************/
67
68 #ifndef __fw_api_h__
69 #define __fw_api_h__
70
71 #include "fw-api-rs.h"
72 #include "fw-api-rx.h"
73 #include "fw-api-tx.h"
74 #include "fw-api-sta.h"
75 #include "fw-api-mac.h"
76 #include "fw-api-power.h"
77 #include "fw-api-d3.h"
78 #include "fw-api-coex.h"
79 #include "fw-api-scan.h"
80 #include "fw-api-stats.h"
81 #include "fw-api-tof.h"
82
83 /* Tx queue numbers for non-DQA mode */
84 enum {
85 IWL_MVM_OFFCHANNEL_QUEUE = 8,
86 IWL_MVM_CMD_QUEUE = 9,
87 };
88
89 /*
90 * DQA queue numbers
91 *
92 * @IWL_MVM_DQA_CMD_QUEUE: a queue reserved for sending HCMDs to the FW
93 * @IWL_MVM_DQA_AUX_QUEUE: a queue reserved for aux frames
94 * @IWL_MVM_DQA_P2P_DEVICE_QUEUE: a queue reserved for P2P device frames
95 * @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames
96 * @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure
97 * that we are never left without the possibility to connect to an AP.
98 * @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames.
99 * Each MGMT queue is mapped to a single STA
100 * MGMT frames are frames that return true on ieee80211_is_mgmt()
101 * @IWL_MVM_DQA_MAX_MGMT_QUEUE: last TXQ in pool for MGMT frames
102 * @IWL_MVM_DQA_AP_PROBE_RESP_QUEUE: a queue reserved for P2P GO/SoftAP probe
103 * responses
104 * @IWL_MVM_DQA_MIN_DATA_QUEUE: first TXQ in pool for DATA frames.
105 * DATA frames are intended for !ieee80211_is_mgmt() frames, but if
106 * the MGMT TXQ pool is exhausted, mgmt frames can be sent on DATA queues
107 * as well
108 * @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames
109 */
110 enum iwl_mvm_dqa_txq {
111 IWL_MVM_DQA_CMD_QUEUE = 0,
112 IWL_MVM_DQA_AUX_QUEUE = 1,
113 IWL_MVM_DQA_P2P_DEVICE_QUEUE = 2,
114 IWL_MVM_DQA_GCAST_QUEUE = 3,
115 IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4,
116 IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
117 IWL_MVM_DQA_MAX_MGMT_QUEUE = 8,
118 IWL_MVM_DQA_AP_PROBE_RESP_QUEUE = 9,
119 IWL_MVM_DQA_MIN_DATA_QUEUE = 10,
120 IWL_MVM_DQA_MAX_DATA_QUEUE = 31,
121 };
122
123 enum iwl_mvm_tx_fifo {
124 IWL_MVM_TX_FIFO_BK = 0,
125 IWL_MVM_TX_FIFO_BE,
126 IWL_MVM_TX_FIFO_VI,
127 IWL_MVM_TX_FIFO_VO,
128 IWL_MVM_TX_FIFO_MCAST = 5,
129 IWL_MVM_TX_FIFO_CMD = 7,
130 };
131
132
133 /**
134 * enum iwl_legacy_cmds - legacy group command IDs
135 */
136 enum iwl_legacy_cmds {
137 /**
138 * @MVM_ALIVE:
139 * Alive data from the firmware, as described in
140 * &struct mvm_alive_resp_v3 or &struct mvm_alive_resp.
141 */
142 MVM_ALIVE = 0x1,
143
144 /**
145 * @REPLY_ERROR: Cause an error in the firmware, for testing purposes.
146 */
147 REPLY_ERROR = 0x2,
148
149 /**
150 * @ECHO_CMD: Send data to the device to have it returned immediately.
151 */
152 ECHO_CMD = 0x3,
153
154 /**
155 * @INIT_COMPLETE_NOTIF: Notification that initialization is complete.
156 */
157 INIT_COMPLETE_NOTIF = 0x4,
158
159 /**
160 * @PHY_CONTEXT_CMD:
161 * Add/modify/remove a PHY context, using &struct iwl_phy_context_cmd.
162 */
163 PHY_CONTEXT_CMD = 0x8,
164
165 /**
166 * @DBG_CFG: Debug configuration command.
167 */
168 DBG_CFG = 0x9,
169
170 /**
171 * @ANTENNA_COUPLING_NOTIFICATION:
172 * Antenna coupling data, &struct iwl_mvm_antenna_coupling_notif
173 */
174 ANTENNA_COUPLING_NOTIFICATION = 0xa,
175
176 /**
177 * @SCAN_ITERATION_COMPLETE_UMAC:
178 * Firmware indicates a scan iteration completed, using
179 * &struct iwl_umac_scan_iter_complete_notif.
180 */
181 SCAN_ITERATION_COMPLETE_UMAC = 0xb5,
182
183 /**
184 * @SCAN_CFG_CMD:
185 * uses &struct iwl_scan_config_v1 or &struct iwl_scan_config
186 */
187 SCAN_CFG_CMD = 0xc,
188 SCAN_REQ_UMAC = 0xd,
189 SCAN_ABORT_UMAC = 0xe,
190
191 /**
192 * @SCAN_COMPLETE_UMAC: uses &struct iwl_umac_scan_complete
193 */
194 SCAN_COMPLETE_UMAC = 0xf,
195
196 BA_WINDOW_STATUS_NOTIFICATION_ID = 0x13,
197
198 /**
199 * @ADD_STA_KEY:
200 * &struct iwl_mvm_add_sta_key_cmd_v1 or
201 * &struct iwl_mvm_add_sta_key_cmd.
202 */
203 ADD_STA_KEY = 0x17,
204
205 /**
206 * @ADD_STA:
207 * &struct iwl_mvm_add_sta_cmd or &struct iwl_mvm_add_sta_cmd_v7.
208 */
209 ADD_STA = 0x18,
210 /**
211 * @REMOVE_STA: &struct iwl_mvm_rm_sta_cmd
212 */
213 REMOVE_STA = 0x19,
214
215 /* paging get item */
216 FW_GET_ITEM_CMD = 0x1a,
217
218 /**
219 * @TX_CMD: uses &struct iwl_tx_cmd or &struct iwl_tx_cmd_gen2,
220 * response in &struct iwl_mvm_tx_resp or
221 * &struct iwl_mvm_tx_resp_v3
222 */
223 TX_CMD = 0x1c,
224
225 /**
226 * @TXPATH_FLUSH: &struct iwl_tx_path_flush_cmd
227 */
228 TXPATH_FLUSH = 0x1e,
229
230 /**
231 * @MGMT_MCAST_KEY:
232 * &struct iwl_mvm_mgmt_mcast_key_cmd or
233 * &struct iwl_mvm_mgmt_mcast_key_cmd_v1
234 */
235 MGMT_MCAST_KEY = 0x1f,
236
237 /* scheduler config */
238 /**
239 * @SCD_QUEUE_CFG: &struct iwl_scd_txq_cfg_cmd for older hardware,
240 * &struct iwl_tx_queue_cfg_cmd with &struct iwl_tx_queue_cfg_rsp
241 * for newer (A000) hardware.
242 */
243 SCD_QUEUE_CFG = 0x1d,
244
245 /* global key */
246 WEP_KEY = 0x20,
247
248 /* Memory */
249 SHARED_MEM_CFG = 0x25,
250
251 /* TDLS */
252 TDLS_CHANNEL_SWITCH_CMD = 0x27,
253 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
254 TDLS_CONFIG_CMD = 0xa7,
255
256 /**
257 * @MAC_CONTEXT_CMD: &struct iwl_mac_ctx_cmd
258 */
259 MAC_CONTEXT_CMD = 0x28,
260
261 /**
262 * @TIME_EVENT_CMD:
263 * &struct iwl_time_event_cmd, response in &struct iwl_time_event_resp
264 */
265 TIME_EVENT_CMD = 0x29, /* both CMD and response */
266 /**
267 * @TIME_EVENT_NOTIFICATION: &struct iwl_time_event_notif
268 */
269 TIME_EVENT_NOTIFICATION = 0x2a,
270 /**
271 * @BINDING_CONTEXT_CMD:
272 * &struct iwl_binding_cmd or &struct iwl_binding_cmd_v1
273 */
274 BINDING_CONTEXT_CMD = 0x2b,
275 /**
276 * @TIME_QUOTA_CMD: &struct iwl_time_quota_cmd
277 */
278 TIME_QUOTA_CMD = 0x2c,
279 NON_QOS_TX_COUNTER_CMD = 0x2d,
280
281 /**
282 * @LQ_CMD: using &struct iwl_lq_cmd
283 */
284 LQ_CMD = 0x4e,
285
286 /**
287 * @FW_PAGING_BLOCK_CMD:
288 * &struct iwl_fw_paging_cmd or &struct iwl_fw_paging_cmd_v1
289 */
290 FW_PAGING_BLOCK_CMD = 0x4f,
291
292 /* Scan offload */
293 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
294 SCAN_OFFLOAD_ABORT_CMD = 0x52,
295 HOT_SPOT_CMD = 0x53,
296 SCAN_OFFLOAD_COMPLETE = 0x6D,
297 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
298 SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
299 MATCH_FOUND_NOTIFICATION = 0xd9,
300 SCAN_ITERATION_COMPLETE = 0xe7,
301
302 /* Phy */
303 /**
304 * @PHY_CONFIGURATION_CMD: &struct iwl_phy_cfg_cmd
305 */
306 PHY_CONFIGURATION_CMD = 0x6a,
307 CALIB_RES_NOTIF_PHY_DB = 0x6b,
308 PHY_DB_CMD = 0x6c,
309
310 /* ToF - 802.11mc FTM */
311 TOF_CMD = 0x10,
312 TOF_NOTIFICATION = 0x11,
313
314 /**
315 * @POWER_TABLE_CMD: &struct iwl_device_power_cmd
316 */
317 POWER_TABLE_CMD = 0x77,
318 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
319 LTR_CONFIG = 0xee,
320
321 /* Thermal Throttling*/
322 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
323
324 /* Set/Get DC2DC frequency tune */
325 DC2DC_CONFIG_CMD = 0x83,
326
327 /**
328 * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd
329 */
330 NVM_ACCESS_CMD = 0x88,
331
332 SET_CALIB_DEFAULT_CMD = 0x8e,
333
334 BEACON_NOTIFICATION = 0x90,
335 /**
336 * @BEACON_TEMPLATE_CMD:
337 * Uses one of &struct iwl_mac_beacon_cmd_v6,
338 * &struct iwl_mac_beacon_cmd_v7 or &struct iwl_mac_beacon_cmd
339 * depending on the device version.
340 */
341 BEACON_TEMPLATE_CMD = 0x91,
342 /**
343 * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
344 */
345 TX_ANT_CONFIGURATION_CMD = 0x98,
346
347 /**
348 * @STATISTICS_CMD: &struct iwl_statistics_cmd
349 */
350 STATISTICS_CMD = 0x9c,
351
352 /**
353 * @STATISTICS_NOTIFICATION:
354 * one of &struct iwl_notif_statistics_v10,
355 * &struct iwl_notif_statistics_v11,
356 * &struct iwl_notif_statistics_cdb
357 */
358 STATISTICS_NOTIFICATION = 0x9d,
359 EOSP_NOTIFICATION = 0x9e,
360
361 /**
362 * @REDUCE_TX_POWER_CMD:
363 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
364 */
365 REDUCE_TX_POWER_CMD = 0x9f,
366
367 /* RF-KILL commands and notifications */
368 CARD_STATE_CMD = 0xa0,
369 CARD_STATE_NOTIFICATION = 0xa1,
370
371 MISSED_BEACONS_NOTIFICATION = 0xa2,
372
373 /**
374 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
375 */
376 MAC_PM_POWER_TABLE = 0xa9,
377
378 /**
379 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
380 */
381 MFUART_LOAD_NOTIFICATION = 0xb1,
382
383 /**
384 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
385 */
386 RSS_CONFIG_CMD = 0xb3,
387
388 /**
389 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
390 */
391 REPLY_RX_PHY_CMD = 0xc0,
392
393 /**
394 * @REPLY_RX_MPDU_CMD:
395 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
396 */
397 REPLY_RX_MPDU_CMD = 0xc1,
398 FRAME_RELEASE = 0xc3,
399 BA_NOTIF = 0xc5,
400
401 /* Location Aware Regulatory */
402 /**
403 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
404 */
405 MCC_UPDATE_CMD = 0xc8,
406
407 /**
408 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
409 */
410 MCC_CHUB_UPDATE_CMD = 0xc9,
411
412 MARKER_CMD = 0xcb,
413
414 /* BT Coex */
415 BT_COEX_PRIO_TABLE = 0xcc,
416 BT_COEX_PROT_ENV = 0xcd,
417 /**
418 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
419 */
420 BT_PROFILE_NOTIFICATION = 0xce,
421 /**
422 * @BT_CONFIG: &struct iwl_bt_coex_cmd
423 */
424 BT_CONFIG = 0x9b,
425 BT_COEX_UPDATE_SW_BOOST = 0x5a,
426 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
427 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
428 /**
429 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
430 */
431 BT_COEX_CI = 0x5d,
432
433 /**
434 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
435 */
436 REPLY_SF_CFG_CMD = 0xd1,
437 /**
438 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
439 */
440 REPLY_BEACON_FILTERING_CMD = 0xd2,
441
442 /* DTS measurements */
443 CMD_DTS_MEASUREMENT_TRIGGER = 0xdc,
444 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
445
446 REPLY_DEBUG_CMD = 0xf0,
447 LDBG_CONFIG_CMD = 0xf6,
448 DEBUG_LOG_MSG = 0xf7,
449
450 BCAST_FILTER_CMD = 0xcf,
451 MCAST_FILTER_CMD = 0xd0,
452
453 /**
454 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
455 */
456 D3_CONFIG_CMD = 0xd3,
457 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
458 OFFLOADS_QUERY_CMD = 0xd5,
459 REMOTE_WAKE_CONFIG_CMD = 0xd6,
460 D0I3_END_CMD = 0xed,
461
462 /**
463 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
464 */
465 WOWLAN_PATTERNS = 0xe0,
466
467 /**
468 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
469 */
470 WOWLAN_CONFIGURATION = 0xe1,
471 /**
472 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
473 */
474 WOWLAN_TSC_RSC_PARAM = 0xe2,
475 /**
476 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
477 */
478 WOWLAN_TKIP_PARAM = 0xe3,
479 /**
480 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
481 */
482 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
483 /**
484 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
485 */
486 WOWLAN_GET_STATUSES = 0xe5,
487 WOWLAN_TX_POWER_PER_DB = 0xe6,
488
489 /* and for NetDetect */
490 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
491 SCAN_OFFLOAD_HOTSPOTS_CONFIG_CMD = 0x58,
492 SCAN_OFFLOAD_HOTSPOTS_QUERY_CMD = 0x59,
493 };
494
495 /* Please keep this enum *SORTED* by hex value.
496 * Needed for binary search, otherwise a warning will be triggered.
497 */
498 enum iwl_mac_conf_subcmd_ids {
499 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
500 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
501 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
502 };
503
504 /**
505 * enum iwl_phy_ops_subcmd_ids - PHY group commands
506 */
507 enum iwl_phy_ops_subcmd_ids {
508 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
509 CTDP_CONFIG_CMD = 0x03,
510
511 /**
512 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
513 */
514 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
515 GEO_TX_POWER_LIMIT = 0x05,
516 CT_KILL_NOTIFICATION = 0xFE,
517 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
518 };
519
520 /**
521 * enum iwl_system_subcmd_ids - system group command IDs
522 */
523 enum iwl_system_subcmd_ids {
524 /**
525 * @SHARED_MEM_CFG_CMD:
526 * response in &struct iwl_shared_mem_cfg or
527 * &struct iwl_shared_mem_cfg_v1
528 */
529 SHARED_MEM_CFG_CMD = 0x0,
530 INIT_EXTENDED_CFG_CMD = 0x03,
531 };
532
533 /**
534 * enum iwl_data_path_subcmd_ids - data path group commands
535 */
536 enum iwl_data_path_subcmd_ids {
537 /**
538 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
539 */
540 DQA_ENABLE_CMD = 0x0,
541 UPDATE_MU_GROUPS_CMD = 0x1,
542 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
543 STA_PM_NOTIF = 0xFD,
544 MU_GROUP_MGMT_NOTIF = 0xFE,
545 RX_QUEUES_NOTIFICATION = 0xFF,
546 };
547
548 enum iwl_prot_offload_subcmd_ids {
549 STORED_BEACON_NTF = 0xFF,
550 };
551
552 enum iwl_regulatory_and_nvm_subcmd_ids {
553 NVM_ACCESS_COMPLETE = 0x0,
554 NVM_GET_INFO = 0x2,
555 };
556
557 enum iwl_debug_cmds {
558 LMAC_RD_WR = 0x0,
559 UMAC_RD_WR = 0x1,
560 MFU_ASSERT_DUMP_NTF = 0xFE,
561 };
562
563 /**
564 * enum iwl_mvm_command_groups - command groups for the firmware
565 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
566 * @LONG_GROUP: legacy group with long header, also uses command IDs
567 * from &enum iwl_legacy_cmds
568 * @SYSTEM_GROUP: system group, uses command IDs from
569 * &enum iwl_system_subcmd_ids
570 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
571 * &enum iwl_mac_conf_subcmd_ids
572 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
573 * &enum iwl_phy_ops_subcmd_ids
574 * @DATA_PATH_GROUP: data path group, uses command IDs from
575 * &enum iwl_data_path_subcmd_ids
576 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
577 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
578 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
579 * &enum iwl_prot_offload_subcmd_ids
580 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
581 * &enum iwl_regulatory_and_nvm_subcmd_ids
582 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
583 */
584 enum iwl_mvm_command_groups {
585 LEGACY_GROUP = 0x0,
586 LONG_GROUP = 0x1,
587 SYSTEM_GROUP = 0x2,
588 MAC_CONF_GROUP = 0x3,
589 PHY_OPS_GROUP = 0x4,
590 DATA_PATH_GROUP = 0x5,
591 PROT_OFFLOAD_GROUP = 0xb,
592 REGULATORY_AND_NVM_GROUP = 0xc,
593 DEBUG_GROUP = 0xf,
594 };
595
596 /**
597 * struct iwl_cmd_response - generic response struct for most commands
598 * @status: status of the command asked, changes for each one
599 */
600 struct iwl_cmd_response {
601 __le32 status;
602 };
603
604 /*
605 * struct iwl_dqa_enable_cmd
606 * @cmd_queue: the TXQ number of the command queue
607 */
608 struct iwl_dqa_enable_cmd {
609 __le32 cmd_queue;
610 } __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
611
612 /*
613 * struct iwl_tx_ant_cfg_cmd
614 * @valid: valid antenna configuration
615 */
616 struct iwl_tx_ant_cfg_cmd {
617 __le32 valid;
618 } __packed;
619
620 /**
621 * struct iwl_calib_ctrl - Calibration control struct.
622 * Sent as part of the phy configuration command.
623 * @flow_trigger: bitmap for which calibrations to perform according to
624 * flow triggers, using &enum iwl_calib_cfg
625 * @event_trigger: bitmap for which calibrations to perform according to
626 * event triggers, using &enum iwl_calib_cfg
627 */
628 struct iwl_calib_ctrl {
629 __le32 flow_trigger;
630 __le32 event_trigger;
631 } __packed;
632
633 /* This enum defines the bitmap of various calibrations to enable in both
634 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
635 */
636 enum iwl_calib_cfg {
637 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
638 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
639 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
640 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
641 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
642 IWL_CALIB_CFG_DC_IDX = BIT(5),
643 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
644 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
645 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
646 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
647 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
648 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
649 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
650 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
651 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
652 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
653 IWL_CALIB_CFG_DAC_IDX = BIT(16),
654 IWL_CALIB_CFG_ABS_IDX = BIT(17),
655 IWL_CALIB_CFG_AGC_IDX = BIT(18),
656 };
657
658 /**
659 * struct iwl_phy_cfg_cmd - Phy configuration command
660 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
661 * @calib_control: calibration control data
662 */
663 struct iwl_phy_cfg_cmd {
664 __le32 phy_cfg;
665 struct iwl_calib_ctrl calib_control;
666 } __packed;
667
668 #define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
669 #define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
670 #define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
671 #define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
672 #define PHY_CFG_TX_CHAIN_A BIT(8)
673 #define PHY_CFG_TX_CHAIN_B BIT(9)
674 #define PHY_CFG_TX_CHAIN_C BIT(10)
675 #define PHY_CFG_RX_CHAIN_A BIT(12)
676 #define PHY_CFG_RX_CHAIN_B BIT(13)
677 #define PHY_CFG_RX_CHAIN_C BIT(14)
678
679
680 /**
681 * enum iwl_nvm_access_op - NVM access opcode
682 * @IWL_NVM_READ: read NVM
683 * @IWL_NVM_WRITE: write NVM
684 */
685 enum iwl_nvm_access_op {
686 IWL_NVM_READ = 0,
687 IWL_NVM_WRITE = 1,
688 };
689
690 /**
691 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
692 * @NVM_ACCESS_TARGET_CACHE: access the cache
693 * @NVM_ACCESS_TARGET_OTP: access the OTP
694 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
695 */
696 enum iwl_nvm_access_target {
697 NVM_ACCESS_TARGET_CACHE = 0,
698 NVM_ACCESS_TARGET_OTP = 1,
699 NVM_ACCESS_TARGET_EEPROM = 2,
700 };
701
702 /**
703 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
704 * @NVM_SECTION_TYPE_SW: software section
705 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
706 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
707 * @NVM_SECTION_TYPE_PRODUCTION: production section
708 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
709 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
710 * @NVM_MAX_NUM_SECTIONS: number of sections
711 */
712 enum iwl_nvm_section_type {
713 NVM_SECTION_TYPE_SW = 1,
714 NVM_SECTION_TYPE_REGULATORY = 3,
715 NVM_SECTION_TYPE_CALIBRATION = 4,
716 NVM_SECTION_TYPE_PRODUCTION = 5,
717 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
718 NVM_SECTION_TYPE_PHY_SKU = 12,
719 NVM_MAX_NUM_SECTIONS = 13,
720 };
721
722 /**
723 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
724 * @op_code: &enum iwl_nvm_access_op
725 * @target: &enum iwl_nvm_access_target
726 * @type: &enum iwl_nvm_section_type
727 * @offset: offset in bytes into the section
728 * @length: in bytes, to read/write
729 * @data: if write operation, the data to write. On read its empty
730 */
731 struct iwl_nvm_access_cmd {
732 u8 op_code;
733 u8 target;
734 __le16 type;
735 __le16 offset;
736 __le16 length;
737 u8 data[];
738 } __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
739
740 #define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
741
742 /**
743 * struct iwl_fw_paging_cmd_v1 - paging layout
744 *
745 * (FW_PAGING_BLOCK_CMD = 0x4f)
746 *
747 * Send to FW the paging layout in the driver.
748 *
749 * @flags: various flags for the command
750 * @block_size: the block size in powers of 2
751 * @block_num: number of blocks specified in the command.
752 * @device_phy_addr: virtual addresses from device side
753 */
754 struct iwl_fw_paging_cmd_v1 {
755 __le32 flags;
756 __le32 block_size;
757 __le32 block_num;
758 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
759 } __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
760
761 /**
762 * struct iwl_fw_paging_cmd - paging layout
763 *
764 * (FW_PAGING_BLOCK_CMD = 0x4f)
765 *
766 * Send to FW the paging layout in the driver.
767 *
768 * @flags: various flags for the command
769 * @block_size: the block size in powers of 2
770 * @block_num: number of blocks specified in the command.
771 * @device_phy_addr: virtual addresses from device side
772 */
773 struct iwl_fw_paging_cmd {
774 __le32 flags;
775 __le32 block_size;
776 __le32 block_num;
777 __le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
778 } __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
779
780 /*
781 * Fw items ID's
782 *
783 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
784 * download
785 */
786 enum iwl_fw_item_id {
787 IWL_FW_ITEM_ID_PAGING = 3,
788 };
789
790 /*
791 * struct iwl_fw_get_item_cmd - get an item from the fw
792 */
793 struct iwl_fw_get_item_cmd {
794 __le32 item_id;
795 } __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
796
797 #define CONT_REC_COMMAND_SIZE 80
798 #define ENABLE_CONT_RECORDING 0x15
799 #define DISABLE_CONT_RECORDING 0x16
800
801 /*
802 * struct iwl_continuous_record_mode - recording mode
803 */
804 struct iwl_continuous_record_mode {
805 __le16 enable_recording;
806 } __packed;
807
808 /*
809 * struct iwl_continuous_record_cmd - enable/disable continuous recording
810 */
811 struct iwl_continuous_record_cmd {
812 struct iwl_continuous_record_mode record_mode;
813 u8 pad[CONT_REC_COMMAND_SIZE -
814 sizeof(struct iwl_continuous_record_mode)];
815 } __packed;
816
817 struct iwl_fw_get_item_resp {
818 __le32 item_id;
819 __le32 item_byte_cnt;
820 __le32 item_val;
821 } __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
822
823 /**
824 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
825 * @offset: offset in bytes into the section
826 * @length: in bytes, either how much was written or read
827 * @type: NVM_SECTION_TYPE_*
828 * @status: 0 for success, fail otherwise
829 * @data: if read operation, the data returned. Empty on write.
830 */
831 struct iwl_nvm_access_resp {
832 __le16 offset;
833 __le16 length;
834 __le16 type;
835 __le16 status;
836 u8 data[];
837 } __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
838
839 /* MVM_ALIVE 0x1 */
840
841 /* alive response is_valid values */
842 #define ALIVE_RESP_UCODE_OK BIT(0)
843 #define ALIVE_RESP_RFKILL BIT(1)
844
845 /* alive response ver_type values */
846 enum {
847 FW_TYPE_HW = 0,
848 FW_TYPE_PROT = 1,
849 FW_TYPE_AP = 2,
850 FW_TYPE_WOWLAN = 3,
851 FW_TYPE_TIMING = 4,
852 FW_TYPE_WIPAN = 5
853 };
854
855 /* alive response ver_subtype values */
856 enum {
857 FW_SUBTYPE_FULL_FEATURE = 0,
858 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
859 FW_SUBTYPE_REDUCED = 2,
860 FW_SUBTYPE_ALIVE_ONLY = 3,
861 FW_SUBTYPE_WOWLAN = 4,
862 FW_SUBTYPE_AP_SUBTYPE = 5,
863 FW_SUBTYPE_WIPAN = 6,
864 FW_SUBTYPE_INITIALIZE = 9
865 };
866
867 #define IWL_ALIVE_STATUS_ERR 0xDEAD
868 #define IWL_ALIVE_STATUS_OK 0xCAFE
869
870 #define IWL_ALIVE_FLG_RFKILL BIT(0)
871
872 struct iwl_lmac_alive {
873 __le32 ucode_minor;
874 __le32 ucode_major;
875 u8 ver_subtype;
876 u8 ver_type;
877 u8 mac;
878 u8 opt;
879 __le32 timestamp;
880 __le32 error_event_table_ptr; /* SRAM address for error log */
881 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
882 __le32 cpu_register_ptr;
883 __le32 dbgm_config_ptr;
884 __le32 alive_counter_ptr;
885 __le32 scd_base_ptr; /* SRAM address for SCD */
886 __le32 st_fwrd_addr; /* pointer to Store and forward */
887 __le32 st_fwrd_size;
888 } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
889
890 struct iwl_umac_alive {
891 __le32 umac_minor; /* UMAC version: minor */
892 __le32 umac_major; /* UMAC version: major */
893 __le32 error_info_addr; /* SRAM address for UMAC error log */
894 __le32 dbg_print_buff_addr;
895 } __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
896
897 struct mvm_alive_resp_v3 {
898 __le16 status;
899 __le16 flags;
900 struct iwl_lmac_alive lmac_data;
901 struct iwl_umac_alive umac_data;
902 } __packed; /* ALIVE_RES_API_S_VER_3 */
903
904 struct mvm_alive_resp {
905 __le16 status;
906 __le16 flags;
907 struct iwl_lmac_alive lmac_data[2];
908 struct iwl_umac_alive umac_data;
909 } __packed; /* ALIVE_RES_API_S_VER_4 */
910
911 /* Error response/notification */
912 enum {
913 FW_ERR_UNKNOWN_CMD = 0x0,
914 FW_ERR_INVALID_CMD_PARAM = 0x1,
915 FW_ERR_SERVICE = 0x2,
916 FW_ERR_ARC_MEMORY = 0x3,
917 FW_ERR_ARC_CODE = 0x4,
918 FW_ERR_WATCH_DOG = 0x5,
919 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
920 FW_ERR_WEP_KEY_SIZE = 0x11,
921 FW_ERR_OBSOLETE_FUNC = 0x12,
922 FW_ERR_UNEXPECTED = 0xFE,
923 FW_ERR_FATAL = 0xFF
924 };
925
926 /**
927 * struct iwl_error_resp - FW error indication
928 * ( REPLY_ERROR = 0x2 )
929 * @error_type: one of FW_ERR_*
930 * @cmd_id: the command ID for which the error occured
931 * @bad_cmd_seq_num: sequence number of the erroneous command
932 * @error_service: which service created the error, applicable only if
933 * error_type = 2, otherwise 0
934 * @timestamp: TSF in usecs.
935 */
936 struct iwl_error_resp {
937 __le32 error_type;
938 u8 cmd_id;
939 u8 reserved1;
940 __le16 bad_cmd_seq_num;
941 __le32 error_service;
942 __le64 timestamp;
943 } __packed;
944
945
946 /* Common PHY, MAC and Bindings definitions */
947 #define MAX_MACS_IN_BINDING (3)
948 #define MAX_BINDINGS (4)
949
950 /**
951 * enum iwl_mvm_id_and_color - ID and color fields in context dword
952 * @FW_CTXT_ID_POS: position of the ID
953 * @FW_CTXT_ID_MSK: mask of the ID
954 * @FW_CTXT_COLOR_POS: position of the color
955 * @FW_CTXT_COLOR_MSK: mask of the color
956 * @FW_CTXT_INVALID: value used to indicate unused/invalid
957 */
958 enum iwl_mvm_id_and_color {
959 FW_CTXT_ID_POS = 0,
960 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
961 FW_CTXT_COLOR_POS = 8,
962 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
963 FW_CTXT_INVALID = 0xffffffff,
964 };
965
966 #define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
967 (_color << FW_CTXT_COLOR_POS))
968
969 /* Possible actions on PHYs, MACs and Bindings */
970 enum iwl_phy_ctxt_action {
971 FW_CTXT_ACTION_STUB = 0,
972 FW_CTXT_ACTION_ADD,
973 FW_CTXT_ACTION_MODIFY,
974 FW_CTXT_ACTION_REMOVE,
975 FW_CTXT_ACTION_NUM
976 }; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
977
978 /* Time Events */
979
980 /* Time Event types, according to MAC type */
981 enum iwl_time_event_type {
982 /* BSS Station Events */
983 TE_BSS_STA_AGGRESSIVE_ASSOC,
984 TE_BSS_STA_ASSOC,
985 TE_BSS_EAP_DHCP_PROT,
986 TE_BSS_QUIET_PERIOD,
987
988 /* P2P Device Events */
989 TE_P2P_DEVICE_DISCOVERABLE,
990 TE_P2P_DEVICE_LISTEN,
991 TE_P2P_DEVICE_ACTION_SCAN,
992 TE_P2P_DEVICE_FULL_SCAN,
993
994 /* P2P Client Events */
995 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
996 TE_P2P_CLIENT_ASSOC,
997 TE_P2P_CLIENT_QUIET_PERIOD,
998
999 /* P2P GO Events */
1000 TE_P2P_GO_ASSOC_PROT,
1001 TE_P2P_GO_REPETITIVET_NOA,
1002 TE_P2P_GO_CT_WINDOW,
1003
1004 /* WiDi Sync Events */
1005 TE_WIDI_TX_SYNC,
1006
1007 /* Channel Switch NoA */
1008 TE_CHANNEL_SWITCH_PERIOD,
1009
1010 TE_MAX
1011 }; /* MAC_EVENT_TYPE_API_E_VER_1 */
1012
1013
1014
1015 /* Time event - defines for command API v1 */
1016
1017 /*
1018 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1019 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1020 * the first fragment is scheduled.
1021 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1022 * the first 2 fragments are scheduled.
1023 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1024 * number of fragments are valid.
1025 *
1026 * Other than the constant defined above, specifying a fragmentation value 'x'
1027 * means that the event can be fragmented but only the first 'x' will be
1028 * scheduled.
1029 */
1030 enum {
1031 TE_V1_FRAG_NONE = 0,
1032 TE_V1_FRAG_SINGLE = 1,
1033 TE_V1_FRAG_DUAL = 2,
1034 TE_V1_FRAG_ENDLESS = 0xffffffff
1035 };
1036
1037 /* If a Time Event can be fragmented, this is the max number of fragments */
1038 #define TE_V1_FRAG_MAX_MSK 0x0fffffff
1039 /* Repeat the time event endlessly (until removed) */
1040 #define TE_V1_REPEAT_ENDLESS 0xffffffff
1041 /* If a Time Event has bounded repetitions, this is the maximal value */
1042 #define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1043
1044 /* Time Event dependencies: none, on another TE, or in a specific time */
1045 enum {
1046 TE_V1_INDEPENDENT = 0,
1047 TE_V1_DEP_OTHER = BIT(0),
1048 TE_V1_DEP_TSF = BIT(1),
1049 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1050 }; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1051
1052 /*
1053 * @TE_V1_NOTIF_NONE: no notifications
1054 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1055 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1056 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1057 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1058 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1059 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1060 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1061 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1062 *
1063 * Supported Time event notifications configuration.
1064 * A notification (both event and fragment) includes a status indicating weather
1065 * the FW was able to schedule the event or not. For fragment start/end
1066 * notification the status is always success. There is no start/end fragment
1067 * notification for monolithic events.
1068 */
1069 enum {
1070 TE_V1_NOTIF_NONE = 0,
1071 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1072 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1073 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1074 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1075 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1076 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1077 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1078 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1079 }; /* MAC_EVENT_ACTION_API_E_VER_2 */
1080
1081 /* Time event - defines for command API */
1082
1083 /*
1084 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1085 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1086 * the first fragment is scheduled.
1087 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1088 * the first 2 fragments are scheduled.
1089 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1090 * number of fragments are valid.
1091 *
1092 * Other than the constant defined above, specifying a fragmentation value 'x'
1093 * means that the event can be fragmented but only the first 'x' will be
1094 * scheduled.
1095 */
1096 enum {
1097 TE_V2_FRAG_NONE = 0,
1098 TE_V2_FRAG_SINGLE = 1,
1099 TE_V2_FRAG_DUAL = 2,
1100 TE_V2_FRAG_MAX = 0xfe,
1101 TE_V2_FRAG_ENDLESS = 0xff
1102 };
1103
1104 /* Repeat the time event endlessly (until removed) */
1105 #define TE_V2_REPEAT_ENDLESS 0xff
1106 /* If a Time Event has bounded repetitions, this is the maximal value */
1107 #define TE_V2_REPEAT_MAX 0xfe
1108
1109 #define TE_V2_PLACEMENT_POS 12
1110 #define TE_V2_ABSENCE_POS 15
1111
1112 /**
1113 * enum iwl_time_event_policy - Time event policy values
1114 * A notification (both event and fragment) includes a status indicating weather
1115 * the FW was able to schedule the event or not. For fragment start/end
1116 * notification the status is always success. There is no start/end fragment
1117 * notification for monolithic events.
1118 *
1119 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1120 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1121 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1122 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1123 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1124 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1125 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1126 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1127 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
1128 * @T2_V2_START_IMMEDIATELY: start time event immediately
1129 * @TE_V2_DEP_OTHER: depends on another time event
1130 * @TE_V2_DEP_TSF: depends on a specific time
1131 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1132 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1133 */
1134 enum iwl_time_event_policy {
1135 TE_V2_DEFAULT_POLICY = 0x0,
1136
1137 /* notifications (event start/stop, fragment start/stop) */
1138 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1139 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1140 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1141 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1142
1143 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1144 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1145 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1146 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
1147 T2_V2_START_IMMEDIATELY = BIT(11),
1148
1149 /* placement characteristics */
1150 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1151 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1152 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1153
1154 /* are we present or absent during the Time Event. */
1155 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1156 };
1157
1158 /**
1159 * struct iwl_time_event_cmd - configuring Time Events
1160 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1161 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1162 * ( TIME_EVENT_CMD = 0x29 )
1163 * @id_and_color: ID and color of the relevant MAC,
1164 * &enum iwl_mvm_id_and_color
1165 * @action: action to perform, one of &enum iwl_phy_ctxt_action
1166 * @id: this field has two meanings, depending on the action:
1167 * If the action is ADD, then it means the type of event to add.
1168 * For all other actions it is the unique event ID assigned when the
1169 * event was added by the FW.
1170 * @apply_time: When to start the Time Event (in GP2)
1171 * @max_delay: maximum delay to event's start (apply time), in TU
1172 * @depends_on: the unique ID of the event we depend on (if any)
1173 * @interval: interval between repetitions, in TU
1174 * @duration: duration of event in TU
1175 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1176 * @max_frags: maximal number of fragments the Time Event can be divided to
1177 * @policy: defines whether uCode shall notify the host or other uCode modules
1178 * on event and/or fragment start and/or end
1179 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1180 * TE_EVENT_SOCIOPATHIC
1181 * using TE_ABSENCE and using TE_NOTIF_*,
1182 * &enum iwl_time_event_policy
1183 */
1184 struct iwl_time_event_cmd {
1185 /* COMMON_INDEX_HDR_API_S_VER_1 */
1186 __le32 id_and_color;
1187 __le32 action;
1188 __le32 id;
1189 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1190 __le32 apply_time;
1191 __le32 max_delay;
1192 __le32 depends_on;
1193 __le32 interval;
1194 __le32 duration;
1195 u8 repeat;
1196 u8 max_frags;
1197 __le16 policy;
1198 } __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1199
1200 /**
1201 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1202 * @status: bit 0 indicates success, all others specify errors
1203 * @id: the Time Event type
1204 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
1205 * @id_and_color: ID and color of the relevant MAC,
1206 * &enum iwl_mvm_id_and_color
1207 */
1208 struct iwl_time_event_resp {
1209 __le32 status;
1210 __le32 id;
1211 __le32 unique_id;
1212 __le32 id_and_color;
1213 } __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1214
1215 /**
1216 * struct iwl_time_event_notif - notifications of time event start/stop
1217 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1218 * @timestamp: action timestamp in GP2
1219 * @session_id: session's unique id
1220 * @unique_id: unique id of the Time Event itself
1221 * @id_and_color: ID and color of the relevant MAC
1222 * @action: &enum iwl_time_event_policy
1223 * @status: true if scheduled, false otherwise (not executed)
1224 */
1225 struct iwl_time_event_notif {
1226 __le32 timestamp;
1227 __le32 session_id;
1228 __le32 unique_id;
1229 __le32 id_and_color;
1230 __le32 action;
1231 __le32 status;
1232 } __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1233
1234
1235 /* Bindings and Time Quota */
1236
1237 /**
1238 * struct iwl_binding_cmd_v1 - configuring bindings
1239 * ( BINDING_CONTEXT_CMD = 0x2b )
1240 * @id_and_color: ID and color of the relevant Binding,
1241 * &enum iwl_mvm_id_and_color
1242 * @action: action to perform, one of FW_CTXT_ACTION_*
1243 * @macs: array of MAC id and colors which belong to the binding,
1244 * &enum iwl_mvm_id_and_color
1245 * @phy: PHY id and color which belongs to the binding,
1246 * &enum iwl_mvm_id_and_color
1247 */
1248 struct iwl_binding_cmd_v1 {
1249 /* COMMON_INDEX_HDR_API_S_VER_1 */
1250 __le32 id_and_color;
1251 __le32 action;
1252 /* BINDING_DATA_API_S_VER_1 */
1253 __le32 macs[MAX_MACS_IN_BINDING];
1254 __le32 phy;
1255 } __packed; /* BINDING_CMD_API_S_VER_1 */
1256
1257 /**
1258 * struct iwl_binding_cmd - configuring bindings
1259 * ( BINDING_CONTEXT_CMD = 0x2b )
1260 * @id_and_color: ID and color of the relevant Binding,
1261 * &enum iwl_mvm_id_and_color
1262 * @action: action to perform, one of FW_CTXT_ACTION_*
1263 * @macs: array of MAC id and colors which belong to the binding
1264 * &enum iwl_mvm_id_and_color
1265 * @phy: PHY id and color which belongs to the binding
1266 * &enum iwl_mvm_id_and_color
1267 * @lmac_id: the lmac id the binding belongs to
1268 */
1269 struct iwl_binding_cmd {
1270 /* COMMON_INDEX_HDR_API_S_VER_1 */
1271 __le32 id_and_color;
1272 __le32 action;
1273 /* BINDING_DATA_API_S_VER_1 */
1274 __le32 macs[MAX_MACS_IN_BINDING];
1275 __le32 phy;
1276 __le32 lmac_id;
1277 } __packed; /* BINDING_CMD_API_S_VER_2 */
1278
1279 #define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
1280 #define IWL_LMAC_24G_INDEX 0
1281 #define IWL_LMAC_5G_INDEX 1
1282
1283 /* The maximal number of fragments in the FW's schedule session */
1284 #define IWL_MVM_MAX_QUOTA 128
1285
1286 /**
1287 * struct iwl_time_quota_data - configuration of time quota per binding
1288 * @id_and_color: ID and color of the relevant Binding,
1289 * &enum iwl_mvm_id_and_color
1290 * @quota: absolute time quota in TU. The scheduler will try to divide the
1291 * remainig quota (after Time Events) according to this quota.
1292 * @max_duration: max uninterrupted context duration in TU
1293 */
1294 struct iwl_time_quota_data {
1295 __le32 id_and_color;
1296 __le32 quota;
1297 __le32 max_duration;
1298 } __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1299
1300 /**
1301 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1302 * ( TIME_QUOTA_CMD = 0x2c )
1303 * @quotas: allocations per binding
1304 * Note: on non-CDB the fourth one is the auxilary mac and is
1305 * essentially zero.
1306 * On CDB the fourth one is a regular binding.
1307 */
1308 struct iwl_time_quota_cmd {
1309 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1310 } __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1311
1312
1313 /* PHY context */
1314
1315 /* Supported bands */
1316 #define PHY_BAND_5 (0)
1317 #define PHY_BAND_24 (1)
1318
1319 /* Supported channel width, vary if there is VHT support */
1320 #define PHY_VHT_CHANNEL_MODE20 (0x0)
1321 #define PHY_VHT_CHANNEL_MODE40 (0x1)
1322 #define PHY_VHT_CHANNEL_MODE80 (0x2)
1323 #define PHY_VHT_CHANNEL_MODE160 (0x3)
1324
1325 /*
1326 * Control channel position:
1327 * For legacy set bit means upper channel, otherwise lower.
1328 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1329 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1330 * center_freq
1331 * |
1332 * 40Mhz |_______|_______|
1333 * 80Mhz |_______|_______|_______|_______|
1334 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1335 * code 011 010 001 000 | 100 101 110 111
1336 */
1337 #define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1338 #define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1339 #define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1340 #define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1341 #define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1342 #define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1343 #define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1344 #define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1345
1346 /*
1347 * @band: PHY_BAND_*
1348 * @channel: channel number
1349 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1350 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1351 */
1352 struct iwl_fw_channel_info {
1353 u8 band;
1354 u8 channel;
1355 u8 width;
1356 u8 ctrl_pos;
1357 } __packed;
1358
1359 #define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1360 #define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1361 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1362 #define PHY_RX_CHAIN_VALID_POS (1)
1363 #define PHY_RX_CHAIN_VALID_MSK \
1364 (0x7 << PHY_RX_CHAIN_VALID_POS)
1365 #define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1366 #define PHY_RX_CHAIN_FORCE_SEL_MSK \
1367 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1368 #define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1369 #define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1370 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1371 #define PHY_RX_CHAIN_CNT_POS (10)
1372 #define PHY_RX_CHAIN_CNT_MSK \
1373 (0x3 << PHY_RX_CHAIN_CNT_POS)
1374 #define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1375 #define PHY_RX_CHAIN_MIMO_CNT_MSK \
1376 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1377 #define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1378 #define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1379 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1380
1381 /* TODO: fix the value, make it depend on firmware at runtime? */
1382 #define NUM_PHY_CTX 3
1383
1384 /* TODO: complete missing documentation */
1385 /**
1386 * struct iwl_phy_context_cmd - config of the PHY context
1387 * ( PHY_CONTEXT_CMD = 0x8 )
1388 * @id_and_color: ID and color of the relevant Binding
1389 * @action: action to perform, one of FW_CTXT_ACTION_*
1390 * @apply_time: 0 means immediate apply and context switch.
1391 * other value means apply new params after X usecs
1392 * @tx_param_color: ???
1393 * @channel_info:
1394 * @txchain_info: ???
1395 * @rxchain_info: ???
1396 * @acquisition_data: ???
1397 * @dsp_cfg_flags: set to 0
1398 */
1399 struct iwl_phy_context_cmd {
1400 /* COMMON_INDEX_HDR_API_S_VER_1 */
1401 __le32 id_and_color;
1402 __le32 action;
1403 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1404 __le32 apply_time;
1405 __le32 tx_param_color;
1406 struct iwl_fw_channel_info ci;
1407 __le32 txchain_info;
1408 __le32 rxchain_info;
1409 __le32 acquisition_data;
1410 __le32 dsp_cfg_flags;
1411 } __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1412
1413 /*
1414 * Aux ROC command
1415 *
1416 * Command requests the firmware to create a time event for a certain duration
1417 * and remain on the given channel. This is done by using the Aux framework in
1418 * the FW.
1419 * The command was first used for Hot Spot issues - but can be used regardless
1420 * to Hot Spot.
1421 *
1422 * ( HOT_SPOT_CMD 0x53 )
1423 *
1424 * @id_and_color: ID and color of the MAC
1425 * @action: action to perform, one of FW_CTXT_ACTION_*
1426 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1427 * event_unique_id should be the id of the time event assigned by ucode.
1428 * Otherwise ignore the event_unique_id.
1429 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1430 * activity.
1431 * @channel_info: channel info
1432 * @node_addr: Our MAC Address
1433 * @reserved: reserved for alignment
1434 * @apply_time: GP2 value to start (should always be the current GP2 value)
1435 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1436 * time by which start of the event is allowed to be postponed.
1437 * @duration: event duration in TU To calculate event duration:
1438 * timeEventDuration = min(duration, remainingQuota)
1439 */
1440 struct iwl_hs20_roc_req {
1441 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1442 __le32 id_and_color;
1443 __le32 action;
1444 __le32 event_unique_id;
1445 __le32 sta_id_and_color;
1446 struct iwl_fw_channel_info channel_info;
1447 u8 node_addr[ETH_ALEN];
1448 __le16 reserved;
1449 __le32 apply_time;
1450 __le32 apply_time_max_delay;
1451 __le32 duration;
1452 } __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1453
1454 /*
1455 * values for AUX ROC result values
1456 */
1457 enum iwl_mvm_hot_spot {
1458 HOT_SPOT_RSP_STATUS_OK,
1459 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1460 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1461 };
1462
1463 /*
1464 * Aux ROC command response
1465 *
1466 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1467 * driver the uid of the timevent.
1468 *
1469 * ( HOT_SPOT_CMD 0x53 )
1470 *
1471 * @event_unique_id: Unique ID of time event assigned by ucode
1472 * @status: Return status 0 is success, all the rest used for specific errors
1473 */
1474 struct iwl_hs20_roc_res {
1475 __le32 event_unique_id;
1476 __le32 status;
1477 } __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1478
1479 /**
1480 * struct iwl_radio_version_notif - information on the radio version
1481 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
1482 * @radio_flavor:
1483 * @radio_step:
1484 * @radio_dash:
1485 */
1486 struct iwl_radio_version_notif {
1487 __le32 radio_flavor;
1488 __le32 radio_step;
1489 __le32 radio_dash;
1490 } __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1491
1492 enum iwl_card_state_flags {
1493 CARD_ENABLED = 0x00,
1494 HW_CARD_DISABLED = 0x01,
1495 SW_CARD_DISABLED = 0x02,
1496 CT_KILL_CARD_DISABLED = 0x04,
1497 HALT_CARD_DISABLED = 0x08,
1498 CARD_DISABLED_MSK = 0x0f,
1499 CARD_IS_RX_ON = 0x10,
1500 };
1501
1502 /**
1503 * struct iwl_radio_version_notif - information on the radio version
1504 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1505 * @flags: %iwl_card_state_flags
1506 */
1507 struct iwl_card_state_notif {
1508 __le32 flags;
1509 } __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1510
1511 /**
1512 * struct iwl_missed_beacons_notif - information on missed beacons
1513 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1514 * @mac_id: interface ID
1515 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1516 * beacons since last RX.
1517 * @consec_missed_beacons: number of consecutive missed beacons
1518 * @num_expected_beacons:
1519 * @num_recvd_beacons:
1520 */
1521 struct iwl_missed_beacons_notif {
1522 __le32 mac_id;
1523 __le32 consec_missed_beacons_since_last_rx;
1524 __le32 consec_missed_beacons;
1525 __le32 num_expected_beacons;
1526 __le32 num_recvd_beacons;
1527 } __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1528
1529 /**
1530 * struct iwl_mfuart_load_notif - mfuart image version & status
1531 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1532 * @installed_ver: installed image version
1533 * @external_ver: external image version
1534 * @status: MFUART loading status
1535 * @duration: MFUART loading time
1536 * @image_size: MFUART image size in bytes
1537 */
1538 struct iwl_mfuart_load_notif {
1539 __le32 installed_ver;
1540 __le32 external_ver;
1541 __le32 status;
1542 __le32 duration;
1543 /* image size valid only in v2 of the command */
1544 __le32 image_size;
1545 } __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
1546
1547 /**
1548 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1549 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1550 * @assert_id: mfuart assert id that cause the notif
1551 * @curr_reset_num: number of asserts since uptime
1552 * @index_num: current chunk id
1553 * @parts_num: total number of chunks
1554 * @data_size: number of data bytes sent
1555 * @data: data buffer
1556 */
1557 struct iwl_mfu_assert_dump_notif {
1558 __le32 assert_id;
1559 __le32 curr_reset_num;
1560 __le16 index_num;
1561 __le16 parts_num;
1562 __le32 data_size;
1563 __le32 data[0];
1564 } __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1565
1566 /**
1567 * struct iwl_set_calib_default_cmd - set default value for calibration.
1568 * ( SET_CALIB_DEFAULT_CMD = 0x8e )
1569 * @calib_index: the calibration to set value for
1570 * @length: of data
1571 * @data: the value to set for the calibration result
1572 */
1573 struct iwl_set_calib_default_cmd {
1574 __le16 calib_index;
1575 __le16 length;
1576 u8 data[0];
1577 } __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
1578
1579 #define MAX_PORT_ID_NUM 2
1580 #define MAX_MCAST_FILTERING_ADDRESSES 256
1581
1582 /**
1583 * struct iwl_mcast_filter_cmd - configure multicast filter.
1584 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1585 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1586 * to identify network interface adopted in host-device IF.
1587 * It is used by FW as index in array of addresses. This array has
1588 * MAX_PORT_ID_NUM members.
1589 * @count: Number of MAC addresses in the array
1590 * @pass_all: Set 1 to pass all multicast packets.
1591 * @bssid: current association BSSID.
1592 * @addr_list: Place holder for array of MAC addresses.
1593 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1594 */
1595 struct iwl_mcast_filter_cmd {
1596 u8 filter_own;
1597 u8 port_id;
1598 u8 count;
1599 u8 pass_all;
1600 u8 bssid[6];
1601 u8 reserved[2];
1602 u8 addr_list[0];
1603 } __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1604
1605 #define MAX_BCAST_FILTERS 8
1606 #define MAX_BCAST_FILTER_ATTRS 2
1607
1608 /**
1609 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1610 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1611 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1612 * start of ip payload).
1613 */
1614 enum iwl_mvm_bcast_filter_attr_offset {
1615 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1616 BCAST_FILTER_OFFSET_IP_END = 1,
1617 };
1618
1619 /**
1620 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1621 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1622 * @offset: starting offset of this pattern.
1623 * @val: value to match - big endian (MSB is the first
1624 * byte to match from offset pos).
1625 * @mask: mask to match (big endian).
1626 */
1627 struct iwl_fw_bcast_filter_attr {
1628 u8 offset_type;
1629 u8 offset;
1630 __le16 reserved1;
1631 __be32 val;
1632 __be32 mask;
1633 } __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1634
1635 /**
1636 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1637 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1638 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1639 */
1640 enum iwl_mvm_bcast_filter_frame_type {
1641 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1642 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1643 };
1644
1645 /**
1646 * struct iwl_fw_bcast_filter - broadcast filter
1647 * @discard: discard frame (1) or let it pass (0).
1648 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
1649 * @num_attrs: number of valid attributes in this filter.
1650 * @attrs: attributes of this filter. a filter is considered matched
1651 * only when all its attributes are matched (i.e. AND relationship)
1652 */
1653 struct iwl_fw_bcast_filter {
1654 u8 discard;
1655 u8 frame_type;
1656 u8 num_attrs;
1657 u8 reserved1;
1658 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1659 } __packed; /* BCAST_FILTER_S_VER_1 */
1660
1661 #define BA_WINDOW_STREAMS_MAX 16
1662 #define BA_WINDOW_STATUS_TID_MSK 0x000F
1663 #define BA_WINDOW_STATUS_STA_ID_POS 4
1664 #define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1665 #define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1666
1667 /**
1668 * struct iwl_ba_window_status_notif - reordering window's status notification
1669 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1670 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1671 * @start_seq_num: the start sequence number of the bitmap
1672 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1673 */
1674 struct iwl_ba_window_status_notif {
1675 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1676 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1677 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1678 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1679 } __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1680
1681 /**
1682 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1683 * @default_discard: default action for this mac (discard (1) / pass (0)).
1684 * @attached_filters: bitmap of relevant filters for this mac.
1685 */
1686 struct iwl_fw_bcast_mac {
1687 u8 default_discard;
1688 u8 reserved1;
1689 __le16 attached_filters;
1690 } __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1691
1692 /**
1693 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1694 * @disable: enable (0) / disable (1)
1695 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1696 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
1697 * @filters: broadcast filters
1698 * @macs: broadcast filtering configuration per-mac
1699 */
1700 struct iwl_bcast_filter_cmd {
1701 u8 disable;
1702 u8 max_bcast_filters;
1703 u8 max_macs;
1704 u8 reserved1;
1705 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1706 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1707 } __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1708
1709 /*
1710 * enum iwl_mvm_marker_id - maker ids
1711 *
1712 * The ids for different type of markers to insert into the usniffer logs
1713 */
1714 enum iwl_mvm_marker_id {
1715 MARKER_ID_TX_FRAME_LATENCY = 1,
1716 }; /* MARKER_ID_API_E_VER_1 */
1717
1718 /**
1719 * struct iwl_mvm_marker - mark info into the usniffer logs
1720 *
1721 * (MARKER_CMD = 0xcb)
1722 *
1723 * Mark the UTC time stamp into the usniffer logs together with additional
1724 * metadata, so the usniffer output can be parsed.
1725 * In the command response the ucode will return the GP2 time.
1726 *
1727 * @dw_len: The amount of dwords following this byte including this byte.
1728 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1729 * @reserved: reserved.
1730 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1731 * @metadata: additional meta data that will be written to the unsiffer log
1732 */
1733 struct iwl_mvm_marker {
1734 u8 dwLen;
1735 u8 markerId;
1736 __le16 reserved;
1737 __le64 timestamp;
1738 __le32 metadata[0];
1739 } __packed; /* MARKER_API_S_VER_1 */
1740
1741 /*
1742 * enum iwl_dc2dc_config_id - flag ids
1743 *
1744 * Ids of dc2dc configuration flags
1745 */
1746 enum iwl_dc2dc_config_id {
1747 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1748 DCDC_FREQ_TUNE_SET = 0x2,
1749 }; /* MARKER_ID_API_E_VER_1 */
1750
1751 /**
1752 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1753 *
1754 * (DC2DC_CONFIG_CMD = 0x83)
1755 *
1756 * Set/Get & configure dc2dc values.
1757 * The command always returns the current dc2dc values.
1758 *
1759 * @flags: set/get dc2dc
1760 * @enable_low_power_mode: not used.
1761 * @dc2dc_freq_tune0: frequency divider - digital domain
1762 * @dc2dc_freq_tune1: frequency divider - analog domain
1763 */
1764 struct iwl_dc2dc_config_cmd {
1765 __le32 flags;
1766 __le32 enable_low_power_mode; /* not used */
1767 __le32 dc2dc_freq_tune0;
1768 __le32 dc2dc_freq_tune1;
1769 } __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1770
1771 /**
1772 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1773 *
1774 * Current dc2dc values returned by the FW.
1775 *
1776 * @dc2dc_freq_tune0: frequency divider - digital domain
1777 * @dc2dc_freq_tune1: frequency divider - analog domain
1778 */
1779 struct iwl_dc2dc_config_resp {
1780 __le32 dc2dc_freq_tune0;
1781 __le32 dc2dc_freq_tune1;
1782 } __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1783
1784 /***********************************
1785 * Smart Fifo API
1786 ***********************************/
1787 /* Smart Fifo state */
1788 enum iwl_sf_state {
1789 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1790 SF_FULL_ON,
1791 SF_UNINIT,
1792 SF_INIT_OFF,
1793 SF_HW_NUM_STATES
1794 };
1795
1796 /* Smart Fifo possible scenario */
1797 enum iwl_sf_scenario {
1798 SF_SCENARIO_SINGLE_UNICAST,
1799 SF_SCENARIO_AGG_UNICAST,
1800 SF_SCENARIO_MULTICAST,
1801 SF_SCENARIO_BA_RESP,
1802 SF_SCENARIO_TX_RESP,
1803 SF_NUM_SCENARIO
1804 };
1805
1806 #define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
1807 #define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
1808
1809 /* smart FIFO default values */
1810 #define SF_W_MARK_SISO 6144
1811 #define SF_W_MARK_MIMO2 8192
1812 #define SF_W_MARK_MIMO3 6144
1813 #define SF_W_MARK_LEGACY 4096
1814 #define SF_W_MARK_SCAN 4096
1815
1816 /* SF Scenarios timers for default configuration (aligned to 32 uSec) */
1817 #define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1818 #define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1819 #define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1820 #define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1821 #define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
1822 #define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1823 #define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
1824 #define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
1825 #define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
1826 #define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
1827
1828 /* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
1829 #define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1830 #define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1831 #define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1832 #define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1833 #define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
1834 #define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
1835 #define SF_BA_IDLE_TIMER 320 /* 300 uSec */
1836 #define SF_BA_AGING_TIMER 2016 /* 2 mSec */
1837 #define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
1838 #define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
1839
1840 #define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
1841
1842 #define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
1843
1844 /**
1845 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
1846 * @state: smart fifo state, types listed in &enum iwl_sf_state.
1847 * @watermark: Minimum allowed availabe free space in RXF for transient state.
1848 * @long_delay_timeouts: aging and idle timer values for each scenario
1849 * in long delay state.
1850 * @full_on_timeouts: timer values for each scenario in full on state.
1851 */
1852 struct iwl_sf_cfg_cmd {
1853 __le32 state;
1854 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
1855 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1856 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1857 } __packed; /* SF_CFG_API_S_VER_2 */
1858
1859 /***********************************
1860 * Location Aware Regulatory (LAR) API - MCC updates
1861 ***********************************/
1862
1863 /**
1864 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
1865 * regulatory profile according to the given MCC (Mobile Country Code).
1866 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1867 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1868 * MCC in the cmd response will be the relevant MCC in the NVM.
1869 * @mcc: given mobile country code
1870 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1871 * @reserved: reserved for alignment
1872 */
1873 struct iwl_mcc_update_cmd_v1 {
1874 __le16 mcc;
1875 u8 source_id;
1876 u8 reserved;
1877 } __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
1878
1879 /**
1880 * struct iwl_mcc_update_cmd - Request the device to update geographic
1881 * regulatory profile according to the given MCC (Mobile Country Code).
1882 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1883 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1884 * MCC in the cmd response will be the relevant MCC in the NVM.
1885 * @mcc: given mobile country code
1886 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1887 * @reserved: reserved for alignment
1888 * @key: integrity key for MCC API OEM testing
1889 * @reserved2: reserved
1890 */
1891 struct iwl_mcc_update_cmd {
1892 __le16 mcc;
1893 u8 source_id;
1894 u8 reserved;
1895 __le32 key;
1896 u8 reserved2[20];
1897 } __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
1898
1899 /**
1900 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
1901 * Contains the new channel control profile map, if changed, and the new MCC
1902 * (mobile country code).
1903 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
1904 * @status: see &enum iwl_mcc_update_status
1905 * @mcc: the new applied MCC
1906 * @cap: capabilities for all channels which matches the MCC
1907 * @source_id: the MCC source, see iwl_mcc_source
1908 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1909 * channels, depending on platform)
1910 * @channels: channel control data map, DWORD for each channel. Only the first
1911 * 16bits are used.
1912 */
1913 struct iwl_mcc_update_resp_v1 {
1914 __le32 status;
1915 __le16 mcc;
1916 u8 cap;
1917 u8 source_id;
1918 __le32 n_channels;
1919 __le32 channels[0];
1920 } __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
1921
1922 /**
1923 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
1924 * Contains the new channel control profile map, if changed, and the new MCC
1925 * (mobile country code).
1926 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
1927 * @status: see &enum iwl_mcc_update_status
1928 * @mcc: the new applied MCC
1929 * @cap: capabilities for all channels which matches the MCC
1930 * @source_id: the MCC source, see iwl_mcc_source
1931 * @time: time elapsed from the MCC test start (in 30 seconds TU)
1932 * @reserved: reserved.
1933 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1934 * channels, depending on platform)
1935 * @channels: channel control data map, DWORD for each channel. Only the first
1936 * 16bits are used.
1937 */
1938 struct iwl_mcc_update_resp {
1939 __le32 status;
1940 __le16 mcc;
1941 u8 cap;
1942 u8 source_id;
1943 __le16 time;
1944 __le16 reserved;
1945 __le32 n_channels;
1946 __le32 channels[0];
1947 } __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
1948
1949 /**
1950 * struct iwl_mcc_chub_notif - chub notifies of mcc change
1951 * (MCC_CHUB_UPDATE_CMD = 0xc9)
1952 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
1953 * the cellular and connectivity cores that gets updates of the mcc, and
1954 * notifies the ucode directly of any mcc change.
1955 * The ucode requests the driver to request the device to update geographic
1956 * regulatory profile according to the given MCC (Mobile Country Code).
1957 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1958 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1959 * MCC in the cmd response will be the relevant MCC in the NVM.
1960 * @mcc: given mobile country code
1961 * @source_id: identity of the change originator, see iwl_mcc_source
1962 * @reserved1: reserved for alignment
1963 */
1964 struct iwl_mcc_chub_notif {
1965 __le16 mcc;
1966 u8 source_id;
1967 u8 reserved1;
1968 } __packed; /* LAR_MCC_NOTIFY_S */
1969
1970 enum iwl_mcc_update_status {
1971 MCC_RESP_NEW_CHAN_PROFILE,
1972 MCC_RESP_SAME_CHAN_PROFILE,
1973 MCC_RESP_INVALID,
1974 MCC_RESP_NVM_DISABLED,
1975 MCC_RESP_ILLEGAL,
1976 MCC_RESP_LOW_PRIORITY,
1977 MCC_RESP_TEST_MODE_ACTIVE,
1978 MCC_RESP_TEST_MODE_NOT_ACTIVE,
1979 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
1980 };
1981
1982 enum iwl_mcc_source {
1983 MCC_SOURCE_OLD_FW = 0,
1984 MCC_SOURCE_ME = 1,
1985 MCC_SOURCE_BIOS = 2,
1986 MCC_SOURCE_3G_LTE_HOST = 3,
1987 MCC_SOURCE_3G_LTE_DEVICE = 4,
1988 MCC_SOURCE_WIFI = 5,
1989 MCC_SOURCE_RESERVED = 6,
1990 MCC_SOURCE_DEFAULT = 7,
1991 MCC_SOURCE_UNINITIALIZED = 8,
1992 MCC_SOURCE_MCC_API = 9,
1993 MCC_SOURCE_GET_CURRENT = 0x10,
1994 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
1995 };
1996
1997 /* DTS measurements */
1998
1999 enum iwl_dts_measurement_flags {
2000 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
2001 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
2002 };
2003
2004 /**
2005 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
2006 *
2007 * @flags: indicates which measurements we want as specified in
2008 * &enum iwl_dts_measurement_flags
2009 */
2010 struct iwl_dts_measurement_cmd {
2011 __le32 flags;
2012 } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2013
2014 /**
2015 * enum iwl_dts_control_measurement_mode - DTS measurement type
2016 * @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2017 * back (latest value. Not waiting for new value). Use automatic
2018 * SW DTS configuration.
2019 * @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2020 * trigger DTS reading and provide read back temperature read
2021 * when available.
2022 * @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2023 * @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2024 * without measurement trigger.
2025 */
2026 enum iwl_dts_control_measurement_mode {
2027 DTS_AUTOMATIC = 0,
2028 DTS_REQUEST_READ = 1,
2029 DTS_OVER_WRITE = 2,
2030 DTS_DIRECT_WITHOUT_MEASURE = 3,
2031 };
2032
2033 /**
2034 * enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2035 * @DTS_USE_TOP: Top
2036 * @DTS_USE_CHAIN_A: chain A
2037 * @DTS_USE_CHAIN_B: chain B
2038 * @DTS_USE_CHAIN_C: chain C
2039 * @XTAL_TEMPERATURE - read temperature from xtal
2040 */
2041 enum iwl_dts_used {
2042 DTS_USE_TOP = 0,
2043 DTS_USE_CHAIN_A = 1,
2044 DTS_USE_CHAIN_B = 2,
2045 DTS_USE_CHAIN_C = 3,
2046 XTAL_TEMPERATURE = 4,
2047 };
2048
2049 /**
2050 * enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2051 * @DTS_BIT6_MODE: bit 6 mode
2052 * @DTS_BIT8_MODE: bit 8 mode
2053 */
2054 enum iwl_dts_bit_mode {
2055 DTS_BIT6_MODE = 0,
2056 DTS_BIT8_MODE = 1,
2057 };
2058
2059 /**
2060 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
2061 * @control_mode: see &enum iwl_dts_control_measurement_mode
2062 * @temperature: used when over write DTS mode is selected
2063 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2064 * @avg_factor: average factor to DTS in request DTS read mode
2065 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2066 * @step_duration: step duration for the DTS
2067 */
2068 struct iwl_ext_dts_measurement_cmd {
2069 __le32 control_mode;
2070 __le32 temperature;
2071 __le32 sensor;
2072 __le32 avg_factor;
2073 __le32 bit_mode;
2074 __le32 step_duration;
2075 } __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2076
2077 /**
2078 * struct iwl_dts_measurement_notif_v1 - measurements notification
2079 *
2080 * @temp: the measured temperature
2081 * @voltage: the measured voltage
2082 */
2083 struct iwl_dts_measurement_notif_v1 {
2084 __le32 temp;
2085 __le32 voltage;
2086 } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2087
2088 /**
2089 * struct iwl_dts_measurement_notif_v2 - measurements notification
2090 *
2091 * @temp: the measured temperature
2092 * @voltage: the measured voltage
2093 * @threshold_idx: the trip index that was crossed
2094 */
2095 struct iwl_dts_measurement_notif_v2 {
2096 __le32 temp;
2097 __le32 voltage;
2098 __le32 threshold_idx;
2099 } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
2100
2101 /**
2102 * struct ct_kill_notif - CT-kill entry notification
2103 *
2104 * @temperature: the current temperature in celsius
2105 * @reserved: reserved
2106 */
2107 struct ct_kill_notif {
2108 __le16 temperature;
2109 __le16 reserved;
2110 } __packed; /* GRP_PHY_CT_KILL_NTF */
2111
2112 /**
2113 * enum ctdp_cmd_operation - CTDP command operations
2114 * @CTDP_CMD_OPERATION_START: update the current budget
2115 * @CTDP_CMD_OPERATION_STOP: stop ctdp
2116 * @CTDP_CMD_OPERATION_REPORT: get the avgerage budget
2117 */
2118 enum iwl_mvm_ctdp_cmd_operation {
2119 CTDP_CMD_OPERATION_START = 0x1,
2120 CTDP_CMD_OPERATION_STOP = 0x2,
2121 CTDP_CMD_OPERATION_REPORT = 0x4,
2122 };/* CTDP_CMD_OPERATION_TYPE_E */
2123
2124 /**
2125 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2126 *
2127 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2128 * @budget: the budget in milliwatt
2129 * @window_size: defined in API but not used
2130 */
2131 struct iwl_mvm_ctdp_cmd {
2132 __le32 operation;
2133 __le32 budget;
2134 __le32 window_size;
2135 } __packed;
2136
2137 #define IWL_MAX_DTS_TRIPS 8
2138
2139 /**
2140 * struct temp_report_ths_cmd - set temperature thresholds
2141 *
2142 * @num_temps: number of temperature thresholds passed
2143 * @thresholds: array with the thresholds to be configured
2144 */
2145 struct temp_report_ths_cmd {
2146 __le32 num_temps;
2147 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2148 } __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2149
2150 /***********************************
2151 * TDLS API
2152 ***********************************/
2153
2154 /* Type of TDLS request */
2155 enum iwl_tdls_channel_switch_type {
2156 TDLS_SEND_CHAN_SW_REQ = 0,
2157 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2158 TDLS_MOVE_CH,
2159 }; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2160
2161 /**
2162 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
2163 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2164 * received from peer
2165 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2166 * to the TDLS off-channel communication. For instance if the DTIM is
2167 * 200TU and the TDLS peer is to be given 25% of the time, the value
2168 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2169 * @switch_time: switch time the peer sent in its channel switch timing IE
2170 * @switch_timout: switch timeout the peer sent in its channel switch timing IE
2171 */
2172 struct iwl_tdls_channel_switch_timing {
2173 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2174 __le32 max_offchan_duration; /* given in micro-seconds */
2175 __le32 switch_time; /* given in micro-seconds */
2176 __le32 switch_timeout; /* given in micro-seconds */
2177 } __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2178
2179 #define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2180
2181 /**
2182 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
2183 *
2184 * A template representing a TDLS channel-switch request or response frame
2185 *
2186 * @switch_time_offset: offset to the channel switch timing IE in the template
2187 * @tx_cmd: Tx parameters for the frame
2188 * @data: frame data
2189 */
2190 struct iwl_tdls_channel_switch_frame {
2191 __le32 switch_time_offset;
2192 struct iwl_tx_cmd tx_cmd;
2193 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2194 } __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2195
2196 /**
2197 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
2198 *
2199 * The command is sent to initiate a channel switch and also in response to
2200 * incoming TDLS channel-switch request/response packets from remote peers.
2201 *
2202 * @switch_type: see &enum iwl_tdls_channel_switch_type
2203 * @peer_sta_id: station id of TDLS peer
2204 * @ci: channel we switch to
2205 * @timing: timing related data for command
2206 * @frame: channel-switch request/response template, depending to switch_type
2207 */
2208 struct iwl_tdls_channel_switch_cmd {
2209 u8 switch_type;
2210 __le32 peer_sta_id;
2211 struct iwl_fw_channel_info ci;
2212 struct iwl_tdls_channel_switch_timing timing;
2213 struct iwl_tdls_channel_switch_frame frame;
2214 } __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2215
2216 /**
2217 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
2218 *
2219 * @status: non-zero on success
2220 * @offchannel_duration: duration given in microseconds
2221 * @sta_id: peer currently performing the channel-switch with
2222 */
2223 struct iwl_tdls_channel_switch_notif {
2224 __le32 status;
2225 __le32 offchannel_duration;
2226 __le32 sta_id;
2227 } __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2228
2229 /**
2230 * struct iwl_tdls_sta_info - TDLS station info
2231 *
2232 * @sta_id: station id of the TDLS peer
2233 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2234 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2235 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2236 */
2237 struct iwl_tdls_sta_info {
2238 u8 sta_id;
2239 u8 tx_to_peer_tid;
2240 __le16 tx_to_peer_ssn;
2241 __le32 is_initiator;
2242 } __packed; /* TDLS_STA_INFO_VER_1 */
2243
2244 /**
2245 * struct iwl_tdls_config_cmd - TDLS basic config command
2246 *
2247 * @id_and_color: MAC id and color being configured
2248 * @tdls_peer_count: amount of currently connected TDLS peers
2249 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2250 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2251 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2252 * @pti_req_data_offset: offset of network-level data for the PTI template
2253 * @pti_req_tx_cmd: Tx parameters for PTI request template
2254 * @pti_req_template: PTI request template data
2255 */
2256 struct iwl_tdls_config_cmd {
2257 __le32 id_and_color; /* mac id and color */
2258 u8 tdls_peer_count;
2259 u8 tx_to_ap_tid;
2260 __le16 tx_to_ap_ssn;
2261 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2262
2263 __le32 pti_req_data_offset;
2264 struct iwl_tx_cmd pti_req_tx_cmd;
2265 u8 pti_req_template[0];
2266 } __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2267
2268 /**
2269 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
2270 *
2271 * @sta_id: station id of the TDLS peer
2272 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2273 * the peer
2274 */
2275 struct iwl_tdls_config_sta_info_res {
2276 __le16 sta_id;
2277 __le16 tx_to_peer_last_seq;
2278 } __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2279
2280 /**
2281 * struct iwl_tdls_config_res - TDLS config information from FW
2282 *
2283 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2284 * @sta_info: per-station TDLS config information
2285 */
2286 struct iwl_tdls_config_res {
2287 __le32 tx_to_ap_last_seq;
2288 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2289 } __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2290
2291 #define TX_FIFO_MAX_NUM_9000 8
2292 #define TX_FIFO_MAX_NUM 15
2293 #define RX_FIFO_MAX_NUM 2
2294 #define TX_FIFO_INTERNAL_MAX_NUM 6
2295
2296 /**
2297 * struct iwl_shared_mem_cfg_v1 - Shared memory configuration information
2298 *
2299 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2300 * accessible)
2301 * @shared_mem_size: shared memory size
2302 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2303 * 0x0 as accessible only via DBGM RDAT)
2304 * @sample_buff_size: internal sample buff size
2305 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2306 * 8000 HW set to 0x0 as not accessible)
2307 * @txfifo_size: size of TXF0 ... TXF7
2308 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2309 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2310 * when paging is not supported this should be 0
2311 * @page_buff_size: size of %page_buff_addr
2312 * @rxfifo_addr: Start address of rxFifo
2313 * @internal_txfifo_addr: start address of internalFifo
2314 * @internal_txfifo_size: internal fifos' size
2315 *
2316 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2317 * set, the last 3 members don't exist.
2318 */
2319 struct iwl_shared_mem_cfg_v1 {
2320 __le32 shared_mem_addr;
2321 __le32 shared_mem_size;
2322 __le32 sample_buff_addr;
2323 __le32 sample_buff_size;
2324 __le32 txfifo_addr;
2325 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2326 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2327 __le32 page_buff_addr;
2328 __le32 page_buff_size;
2329 __le32 rxfifo_addr;
2330 __le32 internal_txfifo_addr;
2331 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2332 } __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2333
2334 /**
2335 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2336 *
2337 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2338 * @txfifo_size: size of TX FIFOs
2339 * @rxfifo1_addr: RXF1 addr
2340 * @rxfifo1_size: RXF1 size
2341 */
2342 struct iwl_shared_mem_lmac_cfg {
2343 __le32 txfifo_addr;
2344 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2345 __le32 rxfifo1_addr;
2346 __le32 rxfifo1_size;
2347
2348 } __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2349
2350 /**
2351 * struct iwl_shared_mem_cfg - Shared memory configuration information
2352 *
2353 * @shared_mem_addr: shared memory address
2354 * @shared_mem_size: shared memory size
2355 * @sample_buff_addr: internal sample (mon/adc) buff addr
2356 * @sample_buff_size: internal sample buff size
2357 * @rxfifo2_addr: start addr of RXF2
2358 * @rxfifo2_size: size of RXF2
2359 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2360 * when paging is not supported this should be 0
2361 * @page_buff_size: size of %page_buff_addr
2362 * @lmac_num: number of LMACs (1 or 2)
2363 * @lmac_smem: per - LMAC smem data
2364 */
2365 struct iwl_shared_mem_cfg {
2366 __le32 shared_mem_addr;
2367 __le32 shared_mem_size;
2368 __le32 sample_buff_addr;
2369 __le32 sample_buff_size;
2370 __le32 rxfifo2_addr;
2371 __le32 rxfifo2_size;
2372 __le32 page_buff_addr;
2373 __le32 page_buff_size;
2374 __le32 lmac_num;
2375 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
2376 } __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
2377
2378 /**
2379 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
2380 *
2381 * @membership_status: a bitmap of MU groups
2382 * @user_position:the position of station in a group. If the station is in the
2383 * group then bits (group * 2) is the position -1
2384 */
2385 struct iwl_mu_group_mgmt_cmd {
2386 __le32 reserved;
2387 __le32 membership_status[2];
2388 __le32 user_position[4];
2389 } __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2390
2391 /**
2392 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2393 *
2394 * @membership_status: a bitmap of MU groups
2395 * @user_position: the position of station in a group. If the station is in the
2396 * group then bits (group * 2) is the position -1
2397 */
2398 struct iwl_mu_group_mgmt_notif {
2399 __le32 membership_status[2];
2400 __le32 user_position[4];
2401 } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2402
2403 #define MAX_STORED_BEACON_SIZE 600
2404
2405 /**
2406 * struct iwl_stored_beacon_notif - Stored beacon notification
2407 *
2408 * @system_time: system time on air rise
2409 * @tsf: TSF on air rise
2410 * @beacon_timestamp: beacon on air rise
2411 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
2412 * @channel: channel this beacon was received on
2413 * @rates: rate in ucode internal format
2414 * @byte_count: frame's byte count
2415 */
2416 struct iwl_stored_beacon_notif {
2417 __le32 system_time;
2418 __le64 tsf;
2419 __le32 beacon_timestamp;
2420 __le16 band;
2421 __le16 channel;
2422 __le32 rates;
2423 __le32 byte_count;
2424 u8 data[MAX_STORED_BEACON_SIZE];
2425 } __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
2426
2427 #define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2428
2429 enum iwl_lqm_cmd_operatrions {
2430 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2431 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2432 };
2433
2434 enum iwl_lqm_status {
2435 LQM_STATUS_SUCCESS = 0,
2436 LQM_STATUS_TIMEOUT = 1,
2437 LQM_STATUS_ABORT = 2,
2438 };
2439
2440 /**
2441 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
2442 * @cmd_operatrion: command operation to be performed (start or stop)
2443 * as defined above.
2444 * @mac_id: MAC ID the measurement applies to.
2445 * @measurement_time: time of the total measurement to be performed, in uSec.
2446 * @timeout: maximum time allowed until a response is sent, in uSec.
2447 */
2448 struct iwl_link_qual_msrmnt_cmd {
2449 __le32 cmd_operation;
2450 __le32 mac_id;
2451 __le32 measurement_time;
2452 __le32 timeout;
2453 } __packed /* LQM_CMD_API_S_VER_1 */;
2454
2455 /**
2456 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
2457 *
2458 * @frequent_stations_air_time: an array containing the total air time
2459 * (in uSec) used by the most frequently transmitting stations.
2460 * @number_of_stations: the number of uniqe stations included in the array
2461 * (a number between 0 to 16)
2462 * @total_air_time_other_stations: the total air time (uSec) used by all the
2463 * stations which are not included in the above report.
2464 * @time_in_measurement_window: the total time in uSec in which a measurement
2465 * took place.
2466 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2467 * measurement
2468 * @mac_id: MAC ID the measurement applies to.
2469 * @status: return status. may be one of the LQM_STATUS_* defined above.
2470 * @reserved: reserved.
2471 */
2472 struct iwl_link_qual_msrmnt_notif {
2473 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2474 __le32 number_of_stations;
2475 __le32 total_air_time_other_stations;
2476 __le32 time_in_measurement_window;
2477 __le32 tx_frame_dropped;
2478 __le32 mac_id;
2479 __le32 status;
2480 u8 reserved[12];
2481 } __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2482
2483 /**
2484 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
2485 *
2486 * @id_and_color: ID and color of the MAC
2487 */
2488 struct iwl_channel_switch_noa_notif {
2489 __le32 id_and_color;
2490 } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2491
2492 /* Operation types for the debug mem access */
2493 enum {
2494 DEBUG_MEM_OP_READ = 0,
2495 DEBUG_MEM_OP_WRITE = 1,
2496 DEBUG_MEM_OP_WRITE_BYTES = 2,
2497 };
2498
2499 #define DEBUG_MEM_MAX_SIZE_DWORDS 32
2500
2501 /**
2502 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2503 * @op: DEBUG_MEM_OP_*
2504 * @addr: address to read/write from/to
2505 * @len: in dwords, to read/write
2506 * @data: for write opeations, contains the source buffer
2507 */
2508 struct iwl_dbg_mem_access_cmd {
2509 __le32 op;
2510 __le32 addr;
2511 __le32 len;
2512 __le32 data[];
2513 } __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2514
2515 /* Status responses for the debug mem access */
2516 enum {
2517 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2518 DEBUG_MEM_STATUS_FAILED = 0x1,
2519 DEBUG_MEM_STATUS_LOCKED = 0x2,
2520 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2521 DEBUG_MEM_STATUS_LENGTH = 0x4,
2522 };
2523
2524 /**
2525 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2526 * @status: DEBUG_MEM_STATUS_*
2527 * @len: read dwords (0 for write operations)
2528 * @data: contains the read DWs
2529 */
2530 struct iwl_dbg_mem_access_rsp {
2531 __le32 status;
2532 __le32 len;
2533 __le32 data[];
2534 } __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2535
2536 /**
2537 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
2538 */
2539 struct iwl_nvm_access_complete_cmd {
2540 __le32 reserved;
2541 } __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2542
2543 /**
2544 * enum iwl_extended_cfg_flag - commands driver may send before
2545 * finishing init flow
2546 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2547 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2548 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2549 */
2550 enum iwl_extended_cfg_flags {
2551 IWL_INIT_DEBUG_CFG,
2552 IWL_INIT_NVM,
2553 IWL_INIT_PHY,
2554 };
2555
2556 /**
2557 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2558 * before finishing init flows
2559 * @init_flags: values from iwl_extended_cfg_flags
2560 */
2561 struct iwl_init_extended_cfg_cmd {
2562 __le32 init_flags;
2563 } __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2564
2565 /*
2566 * struct iwl_nvm_get_info - request to get NVM data
2567 */
2568 struct iwl_nvm_get_info {
2569 __le32 reserved;
2570 } __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2571
2572 /**
2573 * struct iwl_nvm_get_info_general - general NVM data
2574 * @flags: 1 - empty, 0 - valid
2575 * @nvm_version: nvm version
2576 * @board_type: board type
2577 */
2578 struct iwl_nvm_get_info_general {
2579 __le32 flags;
2580 __le16 nvm_version;
2581 u8 board_type;
2582 u8 reserved;
2583 } __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2584
2585 /**
2586 * struct iwl_nvm_get_info_sku - mac information
2587 * @enable_24g: band 2.4G enabled
2588 * @enable_5g: band 5G enabled
2589 * @enable_11n: 11n enabled
2590 * @enable_11ac: 11ac enabled
2591 * @mimo_disable: MIMO enabled
2592 * @ext_crypto: Extended crypto enabled
2593 */
2594 struct iwl_nvm_get_info_sku {
2595 __le32 enable_24g;
2596 __le32 enable_5g;
2597 __le32 enable_11n;
2598 __le32 enable_11ac;
2599 __le32 mimo_disable;
2600 __le32 ext_crypto;
2601 } __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2602
2603 /**
2604 * struct iwl_nvm_get_info_phy - phy information
2605 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2606 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2607 */
2608 struct iwl_nvm_get_info_phy {
2609 __le32 tx_chains;
2610 __le32 rx_chains;
2611 } __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2612
2613 #define IWL_NUM_CHANNELS (51)
2614
2615 /**
2616 * struct iwl_nvm_get_info_regulatory - regulatory information
2617 * @lar_enabled: is LAR enabled
2618 * @channel_profile: regulatory data of this channel
2619 * @regulatory: regulatory data, see &enum iwl_nvm_channel_flags for data
2620 */
2621 struct iwl_nvm_get_info_regulatory {
2622 __le32 lar_enabled;
2623 __le16 channel_profile[IWL_NUM_CHANNELS];
2624 __le16 reserved;
2625 } __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2626
2627 /**
2628 * struct iwl_nvm_get_info_rsp - response to get NVM data
2629 * @general: general NVM data
2630 * @mac_sku: data relating to MAC sku
2631 * @phy_sku: data relating to PHY sku
2632 * @regulatory: regulatory data
2633 */
2634 struct iwl_nvm_get_info_rsp {
2635 struct iwl_nvm_get_info_general general;
2636 struct iwl_nvm_get_info_sku mac_sku;
2637 struct iwl_nvm_get_info_phy phy_sku;
2638 struct iwl_nvm_get_info_regulatory regulatory;
2639 } __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2640
2641 /**
2642 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2643 * @isolation: antenna isolation value
2644 */
2645 struct iwl_mvm_antenna_coupling_notif {
2646 __le32 isolation;
2647 } __packed;
2648
2649 #endif /* __fw_api_h__ */