blob: a1cce18460bb4d66bf5d5e5b2e52854fbd111d99 [file] [log] [blame]
Johannes Berg8ca151b2013-01-24 14:25:36 +01001/******************************************************************************
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 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +02008 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Avraham Sternee9219b2015-03-23 15:09:27 +02009 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
Golan Ben-Amibdccdb82016-11-15 14:45:29 +020010 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010011 *
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
Emmanuel Grumbach410dc5a2013-02-18 09:22:28 +020027 * in the file called COPYING.
Johannes Berg8ca151b2013-01-24 14:25:36 +010028 *
29 * Contact Information:
Emmanuel Grumbachcb2f8272015-11-17 15:39:56 +020030 * Intel Linux Wireless <linuxwifi@intel.com>
Johannes Berg8ca151b2013-01-24 14:25:36 +010031 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 *
33 * BSD LICENSE
34 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +020035 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Avraham Sternee9219b2015-03-23 15:09:27 +020036 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
Golan Ben-Amibdccdb82016-11-15 14:45:29 +020037 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010038 * 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"
Johannes Bergee6dbb22015-09-02 14:53:39 +020072#include "fw-api-rx.h"
Johannes Berg8ca151b2013-01-24 14:25:36 +010073#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"
Emmanuel Grumbach5b7ff612014-03-11 19:27:45 +020078#include "fw-api-coex.h"
Haim Dreyfusse820c2d2014-04-06 11:19:09 +030079#include "fw-api-scan.h"
Johannes Bergd19ac582015-01-14 15:54:18 +010080#include "fw-api-stats.h"
Gregory Greenmance792912015-06-02 18:06:16 +030081#include "fw-api-tof.h"
Johannes Berg8ca151b2013-01-24 14:25:36 +010082
Liad Kaufman24afba72015-07-28 18:56:08 +030083/* Tx queue numbers for non-DQA mode */
Johannes Berg8ca151b2013-01-24 14:25:36 +010084enum {
85 IWL_MVM_OFFCHANNEL_QUEUE = 8,
86 IWL_MVM_CMD_QUEUE = 9,
Johannes Berg8ca151b2013-01-24 14:25:36 +010087};
88
Liad Kaufman24afba72015-07-28 18:56:08 +030089/*
90 * DQA queue numbers
91 *
Liad Kaufman097129c2015-08-09 18:28:43 +030092 * @IWL_MVM_DQA_CMD_QUEUE: a queue reserved for sending HCMDs to the FW
Liad Kaufman28d07932015-09-01 16:36:25 +030093 * @IWL_MVM_DQA_AUX_QUEUE: a queue reserved for aux frames
Liad Kaufman4c965132015-08-09 19:26:56 +030094 * @IWL_MVM_DQA_P2P_DEVICE_QUEUE: a queue reserved for P2P device frames
Liad Kaufman0e0e4422015-08-04 15:13:38 +030095 * @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames
Liad Kaufmand5216a22015-08-09 15:50:51 +030096 * @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.
Liad Kaufman24afba72015-07-28 18:56:08 +030098 * @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
Liad Kaufmande24f632015-08-04 15:19:18 +0300102 * @IWL_MVM_DQA_AP_PROBE_RESP_QUEUE: a queue reserved for P2P GO/SoftAP probe
103 * responses
Liad Kaufman24afba72015-07-28 18:56:08 +0300104 * @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 */
110enum iwl_mvm_dqa_txq {
Liad Kaufman097129c2015-08-09 18:28:43 +0300111 IWL_MVM_DQA_CMD_QUEUE = 0,
Liad Kaufman28d07932015-09-01 16:36:25 +0300112 IWL_MVM_DQA_AUX_QUEUE = 1,
Liad Kaufman4c965132015-08-09 19:26:56 +0300113 IWL_MVM_DQA_P2P_DEVICE_QUEUE = 2,
Liad Kaufman0e0e4422015-08-04 15:13:38 +0300114 IWL_MVM_DQA_GCAST_QUEUE = 3,
Liad Kaufmand5216a22015-08-09 15:50:51 +0300115 IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4,
Liad Kaufman24afba72015-07-28 18:56:08 +0300116 IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
117 IWL_MVM_DQA_MAX_MGMT_QUEUE = 8,
Liad Kaufmande24f632015-08-04 15:19:18 +0300118 IWL_MVM_DQA_AP_PROBE_RESP_QUEUE = 9,
Liad Kaufman24afba72015-07-28 18:56:08 +0300119 IWL_MVM_DQA_MIN_DATA_QUEUE = 10,
120 IWL_MVM_DQA_MAX_DATA_QUEUE = 31,
121};
122
Johannes Bergb2d81db2014-08-01 20:48:25 +0200123enum 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};
Eytan Lifshitz19e737c2013-09-09 13:30:15 +0200131
Arik Nemtsovcf7b4912014-05-15 11:44:40 +0300132
Johannes Berg8ca151b2013-01-24 14:25:36 +0100133/* commands */
Johannes Berg72361c32017-03-09 17:06:45 +0100134enum iwl_legacy_cmds {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100135 MVM_ALIVE = 0x1,
136 REPLY_ERROR = 0x2,
Emmanuel Grumbache5046012015-08-17 10:45:50 +0300137 ECHO_CMD = 0x3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100138
139 INIT_COMPLETE_NOTIF = 0x4,
140
141 /* PHY context commands */
142 PHY_CONTEXT_CMD = 0x8,
143 DBG_CFG = 0x9,
Emmanuel Grumbachb9fae2d2014-02-17 11:24:10 +0200144 ANTENNA_COUPLING_NOTIFICATION = 0xa,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100145
David Spinadeld2496222014-05-20 12:46:37 +0300146 /* UMAC scan commands */
Avraham Sternee9219b2015-03-23 15:09:27 +0200147 SCAN_ITERATION_COMPLETE_UMAC = 0xb5,
David Spinadeld2496222014-05-20 12:46:37 +0300148 SCAN_CFG_CMD = 0xc,
149 SCAN_REQ_UMAC = 0xd,
150 SCAN_ABORT_UMAC = 0xe,
151 SCAN_COMPLETE_UMAC = 0xf,
152
Sara Sharon3af512d62015-07-22 11:38:40 +0300153 BA_WINDOW_STATUS_NOTIFICATION_ID = 0x13,
154
Johannes Berg8ca151b2013-01-24 14:25:36 +0100155 /* station table */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300156 ADD_STA_KEY = 0x17,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100157 ADD_STA = 0x18,
158 REMOVE_STA = 0x19,
159
Matti Gottliebe1120182015-07-19 11:15:07 +0300160 /* paging get item */
161 FW_GET_ITEM_CMD = 0x1a,
162
Johannes Berg8ca151b2013-01-24 14:25:36 +0100163 /* TX */
164 TX_CMD = 0x1c,
165 TXPATH_FLUSH = 0x1e,
166 MGMT_MCAST_KEY = 0x1f,
167
Avri Altman3edf8ff2014-07-30 11:41:01 +0300168 /* scheduler config */
169 SCD_QUEUE_CFG = 0x1d,
170
Johannes Berg8ca151b2013-01-24 14:25:36 +0100171 /* global key */
172 WEP_KEY = 0x20,
173
Liad Kaufman04fd2c22014-12-15 17:54:16 +0200174 /* Memory */
175 SHARED_MEM_CFG = 0x25,
176
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300177 /* TDLS */
178 TDLS_CHANNEL_SWITCH_CMD = 0x27,
179 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
Arik Nemtsov307e4722014-09-15 18:48:59 +0300180 TDLS_CONFIG_CMD = 0xa7,
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300181
Johannes Berg8ca151b2013-01-24 14:25:36 +0100182 /* MAC and Binding commands */
183 MAC_CONTEXT_CMD = 0x28,
184 TIME_EVENT_CMD = 0x29, /* both CMD and response */
185 TIME_EVENT_NOTIFICATION = 0x2a,
186 BINDING_CONTEXT_CMD = 0x2b,
187 TIME_QUOTA_CMD = 0x2c,
Johannes Berg4ac6cb52013-08-08 09:30:13 +0200188 NON_QOS_TX_COUNTER_CMD = 0x2d,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100189
190 LQ_CMD = 0x4e,
191
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300192 /* paging block to FW cpu2 */
193 FW_PAGING_BLOCK_CMD = 0x4f,
194
Johannes Berg8ca151b2013-01-24 14:25:36 +0100195 /* Scan offload */
196 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
197 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300198 HOT_SPOT_CMD = 0x53,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100199 SCAN_OFFLOAD_COMPLETE = 0x6D,
200 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
201 SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
David Spinadel35a000b2013-08-28 09:29:43 +0300202 MATCH_FOUND_NOTIFICATION = 0xd9,
David Spinadelfb98be52014-05-04 12:51:10 +0300203 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100204
205 /* Phy */
206 PHY_CONFIGURATION_CMD = 0x6a,
207 CALIB_RES_NOTIF_PHY_DB = 0x6b,
Sara Sharon176aa602016-08-31 19:03:01 +0300208 PHY_DB_CMD = 0x6c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100209
Gregory Greenmance792912015-06-02 18:06:16 +0300210 /* ToF - 802.11mc FTM */
211 TOF_CMD = 0x10,
212 TOF_NOTIFICATION = 0x11,
213
Alexander Bondare811ada2013-03-10 15:29:44 +0200214 /* Power - legacy power table command */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100215 POWER_TABLE_CMD = 0x77,
Alexander Bondar175a70b2013-04-14 20:59:37 +0300216 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300217 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100218
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300219 /* Thermal Throttling*/
220 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
221
Matti Gottlieb0becb372015-05-31 09:18:30 +0300222 /* Set/Get DC2DC frequency tune */
223 DC2DC_CONFIG_CMD = 0x83,
224
Johannes Berg8ca151b2013-01-24 14:25:36 +0100225 /* NVM */
226 NVM_ACCESS_CMD = 0x88,
227
228 SET_CALIB_DEFAULT_CMD = 0x8e,
229
Ilan Peer571765c2013-03-05 15:26:03 +0200230 BEACON_NOTIFICATION = 0x90,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100231 BEACON_TEMPLATE_CMD = 0x91,
232 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100233 STATISTICS_CMD = 0x9c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100234 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg3e56ead2013-02-15 22:23:18 +0100235 EOSP_NOTIFICATION = 0x9e,
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300236 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100237
238 /* RF-KILL commands and notifications */
239 CARD_STATE_CMD = 0xa0,
240 CARD_STATE_NOTIFICATION = 0xa1,
241
Hila Gonend64048e2013-03-13 18:00:03 +0200242 MISSED_BEACONS_NOTIFICATION = 0xa2,
243
Alexander Bondare811ada2013-03-10 15:29:44 +0200244 /* Power - new power table command */
245 MAC_PM_POWER_TABLE = 0xa9,
246
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200247 MFUART_LOAD_NOTIFICATION = 0xb1,
248
Sara Sharon43413a92015-12-31 11:49:18 +0200249 RSS_CONFIG_CMD = 0xb3,
250
Johannes Berg8ca151b2013-01-24 14:25:36 +0100251 REPLY_RX_PHY_CMD = 0xc0,
252 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg13555e82015-09-02 16:16:49 +0200253 FRAME_RELEASE = 0xc3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100254 BA_NOTIF = 0xc5,
255
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200256 /* Location Aware Regulatory */
257 MCC_UPDATE_CMD = 0xc8,
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200258 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200259
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300260 MARKER_CMD = 0xcb,
261
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200262 /* BT Coex */
263 BT_COEX_PRIO_TABLE = 0xcc,
264 BT_COEX_PROT_ENV = 0xcd,
265 BT_PROFILE_NOTIFICATION = 0xce,
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300266 BT_CONFIG = 0x9b,
267 BT_COEX_UPDATE_SW_BOOST = 0x5a,
268 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
269 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300270 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200271
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200272 REPLY_SF_CFG_CMD = 0xd1,
Hila Gonen7df15b12012-12-12 11:16:19 +0200273 REPLY_BEACON_FILTERING_CMD = 0xd2,
274
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300275 /* DTS measurements */
276 CMD_DTS_MEASUREMENT_TRIGGER = 0xdc,
277 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
278
Johannes Berg8ca151b2013-01-24 14:25:36 +0100279 REPLY_DEBUG_CMD = 0xf0,
Golan Ben Ami321c2102015-07-27 17:02:35 +0300280 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100281 DEBUG_LOG_MSG = 0xf7,
282
Eliad Pellerc87163b2014-01-08 10:11:11 +0200283 BCAST_FILTER_CMD = 0xcf,
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300284 MCAST_FILTER_CMD = 0xd0,
285
Johannes Berg8ca151b2013-01-24 14:25:36 +0100286 /* D3 commands/notifications */
287 D3_CONFIG_CMD = 0xd3,
288 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
289 OFFLOADS_QUERY_CMD = 0xd5,
290 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300291 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100292
293 /* for WoWLAN in particular */
294 WOWLAN_PATTERNS = 0xe0,
295 WOWLAN_CONFIGURATION = 0xe1,
296 WOWLAN_TSC_RSC_PARAM = 0xe2,
297 WOWLAN_TKIP_PARAM = 0xe3,
298 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
299 WOWLAN_GET_STATUSES = 0xe5,
300 WOWLAN_TX_POWER_PER_DB = 0xe6,
301
302 /* and for NetDetect */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200303 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
304 SCAN_OFFLOAD_HOTSPOTS_CONFIG_CMD = 0x58,
305 SCAN_OFFLOAD_HOTSPOTS_QUERY_CMD = 0x59,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100306
307 REPLY_MAX = 0xff,
308};
309
Sharon Dvir39bdb172015-10-15 18:18:09 +0300310/* Please keep this enum *SORTED* by hex value.
311 * Needed for binary search, otherwise a warning will be triggered.
312 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200313enum iwl_mac_conf_subcmd_ids {
314 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
315 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200316 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200317};
318
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300319enum iwl_phy_ops_subcmd_ids {
320 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200321 CTDP_CONFIG_CMD = 0x03,
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200322 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200323 GEO_TX_POWER_LIMIT = 0x05,
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200324 CT_KILL_NOTIFICATION = 0xFE,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300325 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
326};
327
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200328enum iwl_system_subcmd_ids {
329 SHARED_MEM_CFG_CMD = 0x0,
Sara Sharon4399caa2016-12-11 10:32:42 +0200330 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200331};
332
Sara Sharona07a8f32015-11-15 11:11:59 +0200333enum iwl_data_path_subcmd_ids {
Liad Kaufman97d5be72015-08-31 14:33:23 +0300334 DQA_ENABLE_CMD = 0x0,
Sara Sharona07a8f32015-11-15 11:11:59 +0200335 UPDATE_MU_GROUPS_CMD = 0x1,
Sara Sharon94bb4482015-12-16 18:48:28 +0200336 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg65e25482016-04-13 14:24:22 +0200337 STA_PM_NOTIF = 0xFD,
Sara Sharonf92659a2016-02-03 15:04:49 +0200338 MU_GROUP_MGMT_NOTIF = 0xFE,
Sara Sharon94bb4482015-12-16 18:48:28 +0200339 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200340};
341
Sara Sharon0db056d2015-12-29 11:07:15 +0200342enum iwl_prot_offload_subcmd_ids {
343 STORED_BEACON_NTF = 0xFF,
344};
345
Sara Sharon1f370652016-08-31 18:13:57 +0300346enum iwl_regulatory_and_nvm_subcmd_ids {
347 NVM_ACCESS_COMPLETE = 0x0,
Sara Sharone9e1ba32017-01-08 16:46:14 +0200348 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300349};
350
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200351enum iwl_debug_cmds {
Ido Yariv2b55f432016-08-23 14:44:59 -0400352 LMAC_RD_WR = 0x0,
353 UMAC_RD_WR = 0x1,
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200354 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400355};
356
Johannes Berg72361c32017-03-09 17:06:45 +0100357/**
358 * enum iwl_mvm_command_groups - command groups for the firmware
359 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
360 * @LONG_GROUP: legacy group with long header, also uses command IDs
361 * from &enum iwl_legacy_cmds
362 * @SYSTEM_GROUP: system group, uses command IDs from
363 * &enum iwl_system_subcmd_ids
364 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
365 * &enum iwl_mac_conf_subcmd_ids
366 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
367 * &enum iwl_phy_ops_subcmd_ids
368 * @DATA_PATH_GROUP: data path group, uses command IDs from
369 * &enum iwl_data_path_subcmd_ids
370 * @SCAN_GROUP: scan group, uses command IDs from &enum iwl_scan_subcmd_ids
371 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
372 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
373 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
374 * &enum iwl_prot_offload_subcmd_ids
375 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
376 * &enum iwl_regulatory_and_nvm_subcmd_ids
377 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
378 */
379enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300380 LEGACY_GROUP = 0x0,
381 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200382 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200383 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300384 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200385 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200386 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300387 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400388 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300389};
390
Johannes Berg8ca151b2013-01-24 14:25:36 +0100391/**
392 * struct iwl_cmd_response - generic response struct for most commands
393 * @status: status of the command asked, changes for each one
394 */
395struct iwl_cmd_response {
396 __le32 status;
397};
398
399/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300400 * struct iwl_dqa_enable_cmd
401 * @cmd_queue: the TXQ number of the command queue
402 */
403struct iwl_dqa_enable_cmd {
404 __le32 cmd_queue;
405} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
406
407/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100408 * struct iwl_tx_ant_cfg_cmd
409 * @valid: valid antenna configuration
410 */
411struct iwl_tx_ant_cfg_cmd {
412 __le32 valid;
413} __packed;
414
415/*
416 * Calibration control struct.
417 * Sent as part of the phy configuration command.
418 * @flow_trigger: bitmap for which calibrations to perform according to
419 * flow triggers.
420 * @event_trigger: bitmap for which calibrations to perform according to
421 * event triggers.
422 */
423struct iwl_calib_ctrl {
424 __le32 flow_trigger;
425 __le32 event_trigger;
426} __packed;
427
428/* This enum defines the bitmap of various calibrations to enable in both
429 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
430 */
431enum iwl_calib_cfg {
432 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
433 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
434 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
435 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
436 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
437 IWL_CALIB_CFG_DC_IDX = BIT(5),
438 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
439 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
440 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
441 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
442 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
443 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
444 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
445 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
446 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
447 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
448 IWL_CALIB_CFG_DAC_IDX = BIT(16),
449 IWL_CALIB_CFG_ABS_IDX = BIT(17),
450 IWL_CALIB_CFG_AGC_IDX = BIT(18),
451};
452
453/*
454 * Phy configuration command.
455 */
456struct iwl_phy_cfg_cmd {
457 __le32 phy_cfg;
458 struct iwl_calib_ctrl calib_control;
459} __packed;
460
461#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
462#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
463#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
464#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
465#define PHY_CFG_TX_CHAIN_A BIT(8)
466#define PHY_CFG_TX_CHAIN_B BIT(9)
467#define PHY_CFG_TX_CHAIN_C BIT(10)
468#define PHY_CFG_RX_CHAIN_A BIT(12)
469#define PHY_CFG_RX_CHAIN_B BIT(13)
470#define PHY_CFG_RX_CHAIN_C BIT(14)
471
472
473/* Target of the NVM_ACCESS_CMD */
474enum {
475 NVM_ACCESS_TARGET_CACHE = 0,
476 NVM_ACCESS_TARGET_OTP = 1,
477 NVM_ACCESS_TARGET_EEPROM = 2,
478};
479
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200480/* Section types for NVM_ACCESS_CMD */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100481enum {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200482 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200483 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200484 NVM_SECTION_TYPE_CALIBRATION = 4,
485 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200486 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200487 NVM_SECTION_TYPE_PHY_SKU = 12,
488 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100489};
490
491/**
492 * struct iwl_nvm_access_cmd_ver2 - Request the device to send an NVM section
493 * @op_code: 0 - read, 1 - write
494 * @target: NVM_ACCESS_TARGET_*
495 * @type: NVM_SECTION_TYPE_*
496 * @offset: offset in bytes into the section
497 * @length: in bytes, to read/write
498 * @data: if write operation, the data to write. On read its empty
499 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200500struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100501 u8 op_code;
502 u8 target;
503 __le16 type;
504 __le16 offset;
505 __le16 length;
506 u8 data[];
507} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
508
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300509#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
510
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100511/**
512 * struct iwl_fw_paging_cmd_v1 - paging layout
513 *
514 * (FW_PAGING_BLOCK_CMD = 0x4f)
515 *
516 * Send to FW the paging layout in the driver.
517 *
518 * @flags: various flags for the command
519 * @block_size: the block size in powers of 2
520 * @block_num: number of blocks specified in the command.
521 * @device_phy_addr: virtual addresses from device side
522 */
523struct iwl_fw_paging_cmd_v1 {
524 __le32 flags;
525 __le32 block_size;
526 __le32 block_num;
527 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
528} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
529
530/**
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300531 * struct iwl_fw_paging_cmd - paging layout
532 *
533 * (FW_PAGING_BLOCK_CMD = 0x4f)
534 *
535 * Send to FW the paging layout in the driver.
536 *
537 * @flags: various flags for the command
538 * @block_size: the block size in powers of 2
539 * @block_num: number of blocks specified in the command.
540 * @device_phy_addr: virtual addresses from device side
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100541 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300542struct iwl_fw_paging_cmd {
543 __le32 flags;
544 __le32 block_size;
545 __le32 block_num;
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100546 __le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
Sara Sharond975d722016-07-04 11:52:07 +0300547} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300548
Matti Gottliebe1120182015-07-19 11:15:07 +0300549/*
550 * Fw items ID's
551 *
552 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
553 * download
554 */
555enum iwl_fw_item_id {
556 IWL_FW_ITEM_ID_PAGING = 3,
557};
558
559/*
560 * struct iwl_fw_get_item_cmd - get an item from the fw
561 */
562struct iwl_fw_get_item_cmd {
563 __le32 item_id;
564} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
565
Golan Ben Ami321c2102015-07-27 17:02:35 +0300566#define CONT_REC_COMMAND_SIZE 80
567#define ENABLE_CONT_RECORDING 0x15
568#define DISABLE_CONT_RECORDING 0x16
569
570/*
571 * struct iwl_continuous_record_mode - recording mode
572 */
573struct iwl_continuous_record_mode {
574 __le16 enable_recording;
575} __packed;
576
577/*
578 * struct iwl_continuous_record_cmd - enable/disable continuous recording
579 */
580struct iwl_continuous_record_cmd {
581 struct iwl_continuous_record_mode record_mode;
582 u8 pad[CONT_REC_COMMAND_SIZE -
583 sizeof(struct iwl_continuous_record_mode)];
584} __packed;
585
Matti Gottliebe1120182015-07-19 11:15:07 +0300586struct iwl_fw_get_item_resp {
587 __le32 item_id;
588 __le32 item_byte_cnt;
589 __le32 item_val;
590} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
591
Johannes Berg8ca151b2013-01-24 14:25:36 +0100592/**
593 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
594 * @offset: offset in bytes into the section
595 * @length: in bytes, either how much was written or read
596 * @type: NVM_SECTION_TYPE_*
597 * @status: 0 for success, fail otherwise
598 * @data: if read operation, the data returned. Empty on write.
599 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200600struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100601 __le16 offset;
602 __le16 length;
603 __le16 type;
604 __le16 status;
605 u8 data[];
606} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
607
608/* MVM_ALIVE 0x1 */
609
610/* alive response is_valid values */
611#define ALIVE_RESP_UCODE_OK BIT(0)
612#define ALIVE_RESP_RFKILL BIT(1)
613
614/* alive response ver_type values */
615enum {
616 FW_TYPE_HW = 0,
617 FW_TYPE_PROT = 1,
618 FW_TYPE_AP = 2,
619 FW_TYPE_WOWLAN = 3,
620 FW_TYPE_TIMING = 4,
621 FW_TYPE_WIPAN = 5
622};
623
624/* alive response ver_subtype values */
625enum {
626 FW_SUBTYPE_FULL_FEATURE = 0,
627 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
628 FW_SUBTYPE_REDUCED = 2,
629 FW_SUBTYPE_ALIVE_ONLY = 3,
630 FW_SUBTYPE_WOWLAN = 4,
631 FW_SUBTYPE_AP_SUBTYPE = 5,
632 FW_SUBTYPE_WIPAN = 6,
633 FW_SUBTYPE_INITIALIZE = 9
634};
635
636#define IWL_ALIVE_STATUS_ERR 0xDEAD
637#define IWL_ALIVE_STATUS_OK 0xCAFE
638
639#define IWL_ALIVE_FLG_RFKILL BIT(0)
640
Sara Sharon5c228d62016-11-24 13:48:27 +0200641struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200642 __le32 ucode_minor;
643 __le32 ucode_major;
644 u8 ver_subtype;
645 u8 ver_type;
646 u8 mac;
647 u8 opt;
648 __le32 timestamp;
649 __le32 error_event_table_ptr; /* SRAM address for error log */
650 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
651 __le32 cpu_register_ptr;
652 __le32 dbgm_config_ptr;
653 __le32 alive_counter_ptr;
654 __le32 scd_base_ptr; /* SRAM address for SCD */
655 __le32 st_fwrd_addr; /* pointer to Store and forward */
656 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +0200657} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
658
659struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200660 __le32 umac_minor; /* UMAC version: minor */
661 __le32 umac_major; /* UMAC version: major */
662 __le32 error_info_addr; /* SRAM address for UMAC error log */
663 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +0200664} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
665
666struct mvm_alive_resp_v3 {
667 __le16 status;
668 __le16 flags;
669 struct iwl_lmac_alive lmac_data;
670 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200671} __packed; /* ALIVE_RES_API_S_VER_3 */
672
Sara Sharon5c228d62016-11-24 13:48:27 +0200673struct mvm_alive_resp {
674 __le16 status;
675 __le16 flags;
676 struct iwl_lmac_alive lmac_data[2];
677 struct iwl_umac_alive umac_data;
678} __packed; /* ALIVE_RES_API_S_VER_4 */
679
Johannes Berg8ca151b2013-01-24 14:25:36 +0100680/* Error response/notification */
681enum {
682 FW_ERR_UNKNOWN_CMD = 0x0,
683 FW_ERR_INVALID_CMD_PARAM = 0x1,
684 FW_ERR_SERVICE = 0x2,
685 FW_ERR_ARC_MEMORY = 0x3,
686 FW_ERR_ARC_CODE = 0x4,
687 FW_ERR_WATCH_DOG = 0x5,
688 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
689 FW_ERR_WEP_KEY_SIZE = 0x11,
690 FW_ERR_OBSOLETE_FUNC = 0x12,
691 FW_ERR_UNEXPECTED = 0xFE,
692 FW_ERR_FATAL = 0xFF
693};
694
695/**
696 * struct iwl_error_resp - FW error indication
697 * ( REPLY_ERROR = 0x2 )
698 * @error_type: one of FW_ERR_*
699 * @cmd_id: the command ID for which the error occured
700 * @bad_cmd_seq_num: sequence number of the erroneous command
701 * @error_service: which service created the error, applicable only if
702 * error_type = 2, otherwise 0
703 * @timestamp: TSF in usecs.
704 */
705struct iwl_error_resp {
706 __le32 error_type;
707 u8 cmd_id;
708 u8 reserved1;
709 __le16 bad_cmd_seq_num;
710 __le32 error_service;
711 __le64 timestamp;
712} __packed;
713
714
715/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100716#define MAX_MACS_IN_BINDING (3)
717#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +0100718
719/* Used to extract ID and color from the context dword */
720#define FW_CTXT_ID_POS (0)
721#define FW_CTXT_ID_MSK (0xff << FW_CTXT_ID_POS)
722#define FW_CTXT_COLOR_POS (8)
723#define FW_CTXT_COLOR_MSK (0xff << FW_CTXT_COLOR_POS)
724#define FW_CTXT_INVALID (0xffffffff)
725
726#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
727 (_color << FW_CTXT_COLOR_POS))
728
729/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +0200730enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100731 FW_CTXT_ACTION_STUB = 0,
732 FW_CTXT_ACTION_ADD,
733 FW_CTXT_ACTION_MODIFY,
734 FW_CTXT_ACTION_REMOVE,
735 FW_CTXT_ACTION_NUM
736}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
737
738/* Time Events */
739
740/* Time Event types, according to MAC type */
741enum iwl_time_event_type {
742 /* BSS Station Events */
743 TE_BSS_STA_AGGRESSIVE_ASSOC,
744 TE_BSS_STA_ASSOC,
745 TE_BSS_EAP_DHCP_PROT,
746 TE_BSS_QUIET_PERIOD,
747
748 /* P2P Device Events */
749 TE_P2P_DEVICE_DISCOVERABLE,
750 TE_P2P_DEVICE_LISTEN,
751 TE_P2P_DEVICE_ACTION_SCAN,
752 TE_P2P_DEVICE_FULL_SCAN,
753
754 /* P2P Client Events */
755 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
756 TE_P2P_CLIENT_ASSOC,
757 TE_P2P_CLIENT_QUIET_PERIOD,
758
759 /* P2P GO Events */
760 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200761 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100762 TE_P2P_GO_CT_WINDOW,
763
764 /* WiDi Sync Events */
765 TE_WIDI_TX_SYNC,
766
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +0300767 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +0300768 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +0300769
Johannes Berg8ca151b2013-01-24 14:25:36 +0100770 TE_MAX
771}; /* MAC_EVENT_TYPE_API_E_VER_1 */
772
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300773
774
775/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100776
777/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300778 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
779 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
780 * the first fragment is scheduled.
781 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
782 * the first 2 fragments are scheduled.
783 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
784 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100785 *
786 * Other than the constant defined above, specifying a fragmentation value 'x'
787 * means that the event can be fragmented but only the first 'x' will be
788 * scheduled.
789 */
790enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300791 TE_V1_FRAG_NONE = 0,
792 TE_V1_FRAG_SINGLE = 1,
793 TE_V1_FRAG_DUAL = 2,
794 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +0100795};
796
Johannes Berg8ca151b2013-01-24 14:25:36 +0100797/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300798#define TE_V1_FRAG_MAX_MSK 0x0fffffff
799/* Repeat the time event endlessly (until removed) */
800#define TE_V1_REPEAT_ENDLESS 0xffffffff
801/* If a Time Event has bounded repetitions, this is the maximal value */
802#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
803
804/* Time Event dependencies: none, on another TE, or in a specific time */
805enum {
806 TE_V1_INDEPENDENT = 0,
807 TE_V1_DEP_OTHER = BIT(0),
808 TE_V1_DEP_TSF = BIT(1),
809 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
810}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
811
812/*
813 * @TE_V1_NOTIF_NONE: no notifications
814 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
815 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
816 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
817 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
818 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
819 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
820 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
821 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
822 *
823 * Supported Time event notifications configuration.
824 * A notification (both event and fragment) includes a status indicating weather
825 * the FW was able to schedule the event or not. For fragment start/end
826 * notification the status is always success. There is no start/end fragment
827 * notification for monolithic events.
828 */
829enum {
830 TE_V1_NOTIF_NONE = 0,
831 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
832 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
833 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
834 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
835 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
836 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
837 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
838 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
839}; /* MAC_EVENT_ACTION_API_E_VER_2 */
840
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300841/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300842
843/*
844 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
845 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
846 * the first fragment is scheduled.
847 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
848 * the first 2 fragments are scheduled.
849 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
850 * number of fragments are valid.
851 *
852 * Other than the constant defined above, specifying a fragmentation value 'x'
853 * means that the event can be fragmented but only the first 'x' will be
854 * scheduled.
855 */
856enum {
857 TE_V2_FRAG_NONE = 0,
858 TE_V2_FRAG_SINGLE = 1,
859 TE_V2_FRAG_DUAL = 2,
860 TE_V2_FRAG_MAX = 0xfe,
861 TE_V2_FRAG_ENDLESS = 0xff
862};
863
864/* Repeat the time event endlessly (until removed) */
865#define TE_V2_REPEAT_ENDLESS 0xff
866/* If a Time Event has bounded repetitions, this is the maximal value */
867#define TE_V2_REPEAT_MAX 0xfe
868
869#define TE_V2_PLACEMENT_POS 12
870#define TE_V2_ABSENCE_POS 15
871
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300872/* Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300873 * A notification (both event and fragment) includes a status indicating weather
874 * the FW was able to schedule the event or not. For fragment start/end
875 * notification the status is always success. There is no start/end fragment
876 * notification for monolithic events.
877 *
878 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
879 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
880 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
881 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
882 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
883 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
884 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
885 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
886 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
887 * @TE_V2_DEP_OTHER: depends on another time event
888 * @TE_V2_DEP_TSF: depends on a specific time
889 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
890 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
891 */
892enum {
893 TE_V2_DEFAULT_POLICY = 0x0,
894
895 /* notifications (event start/stop, fragment start/stop) */
896 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
897 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
898 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
899 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
900
901 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
902 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
903 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
904 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +0200905 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300906
907 TE_V2_NOTIF_MSK = 0xff,
908
909 /* placement characteristics */
910 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
911 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
912 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
913
914 /* are we present or absent during the Time Event. */
915 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
916};
917
918/**
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300919 * struct iwl_time_event_cmd_api - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300920 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
921 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
922 * ( TIME_EVENT_CMD = 0x29 )
923 * @id_and_color: ID and color of the relevant MAC
924 * @action: action to perform, one of FW_CTXT_ACTION_*
925 * @id: this field has two meanings, depending on the action:
926 * If the action is ADD, then it means the type of event to add.
927 * For all other actions it is the unique event ID assigned when the
928 * event was added by the FW.
929 * @apply_time: When to start the Time Event (in GP2)
930 * @max_delay: maximum delay to event's start (apply time), in TU
931 * @depends_on: the unique ID of the event we depend on (if any)
932 * @interval: interval between repetitions, in TU
933 * @duration: duration of event in TU
934 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
935 * @max_frags: maximal number of fragments the Time Event can be divided to
936 * @policy: defines whether uCode shall notify the host or other uCode modules
937 * on event and/or fragment start and/or end
938 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
939 * TE_EVENT_SOCIOPATHIC
940 * using TE_ABSENCE and using TE_NOTIF_*
941 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300942struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300943 /* COMMON_INDEX_HDR_API_S_VER_1 */
944 __le32 id_and_color;
945 __le32 action;
946 __le32 id;
947 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
948 __le32 apply_time;
949 __le32 max_delay;
950 __le32 depends_on;
951 __le32 interval;
952 __le32 duration;
953 u8 repeat;
954 u8 max_frags;
955 __le16 policy;
956} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
957
Johannes Berg8ca151b2013-01-24 14:25:36 +0100958/**
959 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
960 * @status: bit 0 indicates success, all others specify errors
961 * @id: the Time Event type
962 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
963 * @id_and_color: ID and color of the relevant MAC
964 */
965struct iwl_time_event_resp {
966 __le32 status;
967 __le32 id;
968 __le32 unique_id;
969 __le32 id_and_color;
970} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
971
972/**
973 * struct iwl_time_event_notif - notifications of time event start/stop
974 * ( TIME_EVENT_NOTIFICATION = 0x2a )
975 * @timestamp: action timestamp in GP2
976 * @session_id: session's unique id
977 * @unique_id: unique id of the Time Event itself
978 * @id_and_color: ID and color of the relevant MAC
979 * @action: one of TE_NOTIF_START or TE_NOTIF_END
980 * @status: true if scheduled, false otherwise (not executed)
981 */
982struct iwl_time_event_notif {
983 __le32 timestamp;
984 __le32 session_id;
985 __le32 unique_id;
986 __le32 id_and_color;
987 __le32 action;
988 __le32 status;
989} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
990
991
992/* Bindings and Time Quota */
993
994/**
995 * struct iwl_binding_cmd - configuring bindings
996 * ( BINDING_CONTEXT_CMD = 0x2b )
997 * @id_and_color: ID and color of the relevant Binding
998 * @action: action to perform, one of FW_CTXT_ACTION_*
999 * @macs: array of MAC id and colors which belong to the binding
1000 * @phy: PHY id and color which belongs to the binding
Sara Sharon9415af72016-11-17 13:57:32 +02001001 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001002 */
1003struct iwl_binding_cmd {
1004 /* COMMON_INDEX_HDR_API_S_VER_1 */
1005 __le32 id_and_color;
1006 __le32 action;
1007 /* BINDING_DATA_API_S_VER_1 */
1008 __le32 macs[MAX_MACS_IN_BINDING];
1009 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001010 /* BINDING_CMD_API_S_VER_1 */
1011 __le32 lmac_id;
1012} __packed; /* BINDING_CMD_API_S_VER_2 */
1013
1014#define IWL_BINDING_CMD_SIZE_V1 offsetof(struct iwl_binding_cmd, lmac_id)
1015#define IWL_LMAC_24G_INDEX 0
1016#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001017
Ilan Peer35adfd62013-02-04 13:16:24 +02001018/* The maximal number of fragments in the FW's schedule session */
1019#define IWL_MVM_MAX_QUOTA 128
1020
Johannes Berg8ca151b2013-01-24 14:25:36 +01001021/**
1022 * struct iwl_time_quota_data - configuration of time quota per binding
1023 * @id_and_color: ID and color of the relevant Binding
1024 * @quota: absolute time quota in TU. The scheduler will try to divide the
1025 * remainig quota (after Time Events) according to this quota.
1026 * @max_duration: max uninterrupted context duration in TU
1027 */
1028struct iwl_time_quota_data {
1029 __le32 id_and_color;
1030 __le32 quota;
1031 __le32 max_duration;
1032} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1033
1034/**
1035 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1036 * ( TIME_QUOTA_CMD = 0x2c )
1037 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001038 * Note: on non-CDB the fourth one is the auxilary mac and is
1039 * essentially zero.
1040 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001041 */
1042struct iwl_time_quota_cmd {
1043 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1044} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1045
1046
1047/* PHY context */
1048
1049/* Supported bands */
1050#define PHY_BAND_5 (0)
1051#define PHY_BAND_24 (1)
1052
1053/* Supported channel width, vary if there is VHT support */
1054#define PHY_VHT_CHANNEL_MODE20 (0x0)
1055#define PHY_VHT_CHANNEL_MODE40 (0x1)
1056#define PHY_VHT_CHANNEL_MODE80 (0x2)
1057#define PHY_VHT_CHANNEL_MODE160 (0x3)
1058
1059/*
1060 * Control channel position:
1061 * For legacy set bit means upper channel, otherwise lower.
1062 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1063 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1064 * center_freq
1065 * |
1066 * 40Mhz |_______|_______|
1067 * 80Mhz |_______|_______|_______|_______|
1068 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1069 * code 011 010 001 000 | 100 101 110 111
1070 */
1071#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1072#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1073#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1074#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1075#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1076#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1077#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1078#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1079
1080/*
1081 * @band: PHY_BAND_*
1082 * @channel: channel number
1083 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1084 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1085 */
1086struct iwl_fw_channel_info {
1087 u8 band;
1088 u8 channel;
1089 u8 width;
1090 u8 ctrl_pos;
1091} __packed;
1092
1093#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1094#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1095 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1096#define PHY_RX_CHAIN_VALID_POS (1)
1097#define PHY_RX_CHAIN_VALID_MSK \
1098 (0x7 << PHY_RX_CHAIN_VALID_POS)
1099#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1100#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1101 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1102#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1103#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1104 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1105#define PHY_RX_CHAIN_CNT_POS (10)
1106#define PHY_RX_CHAIN_CNT_MSK \
1107 (0x3 << PHY_RX_CHAIN_CNT_POS)
1108#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1109#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1110 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1111#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1112#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1113 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1114
1115/* TODO: fix the value, make it depend on firmware at runtime? */
1116#define NUM_PHY_CTX 3
1117
1118/* TODO: complete missing documentation */
1119/**
1120 * struct iwl_phy_context_cmd - config of the PHY context
1121 * ( PHY_CONTEXT_CMD = 0x8 )
1122 * @id_and_color: ID and color of the relevant Binding
1123 * @action: action to perform, one of FW_CTXT_ACTION_*
1124 * @apply_time: 0 means immediate apply and context switch.
1125 * other value means apply new params after X usecs
1126 * @tx_param_color: ???
1127 * @channel_info:
1128 * @txchain_info: ???
1129 * @rxchain_info: ???
1130 * @acquisition_data: ???
1131 * @dsp_cfg_flags: set to 0
1132 */
1133struct iwl_phy_context_cmd {
1134 /* COMMON_INDEX_HDR_API_S_VER_1 */
1135 __le32 id_and_color;
1136 __le32 action;
1137 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1138 __le32 apply_time;
1139 __le32 tx_param_color;
1140 struct iwl_fw_channel_info ci;
1141 __le32 txchain_info;
1142 __le32 rxchain_info;
1143 __le32 acquisition_data;
1144 __le32 dsp_cfg_flags;
1145} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1146
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001147/*
1148 * Aux ROC command
1149 *
1150 * Command requests the firmware to create a time event for a certain duration
1151 * and remain on the given channel. This is done by using the Aux framework in
1152 * the FW.
1153 * The command was first used for Hot Spot issues - but can be used regardless
1154 * to Hot Spot.
1155 *
1156 * ( HOT_SPOT_CMD 0x53 )
1157 *
1158 * @id_and_color: ID and color of the MAC
1159 * @action: action to perform, one of FW_CTXT_ACTION_*
1160 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1161 * event_unique_id should be the id of the time event assigned by ucode.
1162 * Otherwise ignore the event_unique_id.
1163 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1164 * activity.
1165 * @channel_info: channel info
1166 * @node_addr: Our MAC Address
1167 * @reserved: reserved for alignment
1168 * @apply_time: GP2 value to start (should always be the current GP2 value)
1169 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1170 * time by which start of the event is allowed to be postponed.
1171 * @duration: event duration in TU To calculate event duration:
1172 * timeEventDuration = min(duration, remainingQuota)
1173 */
1174struct iwl_hs20_roc_req {
1175 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1176 __le32 id_and_color;
1177 __le32 action;
1178 __le32 event_unique_id;
1179 __le32 sta_id_and_color;
1180 struct iwl_fw_channel_info channel_info;
1181 u8 node_addr[ETH_ALEN];
1182 __le16 reserved;
1183 __le32 apply_time;
1184 __le32 apply_time_max_delay;
1185 __le32 duration;
1186} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1187
1188/*
1189 * values for AUX ROC result values
1190 */
1191enum iwl_mvm_hot_spot {
1192 HOT_SPOT_RSP_STATUS_OK,
1193 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1194 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1195};
1196
1197/*
1198 * Aux ROC command response
1199 *
1200 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1201 * driver the uid of the timevent.
1202 *
1203 * ( HOT_SPOT_CMD 0x53 )
1204 *
1205 * @event_unique_id: Unique ID of time event assigned by ucode
1206 * @status: Return status 0 is success, all the rest used for specific errors
1207 */
1208struct iwl_hs20_roc_res {
1209 __le32 event_unique_id;
1210 __le32 status;
1211} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1212
Johannes Berg8ca151b2013-01-24 14:25:36 +01001213/**
1214 * struct iwl_radio_version_notif - information on the radio version
1215 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
1216 * @radio_flavor:
1217 * @radio_step:
1218 * @radio_dash:
1219 */
1220struct iwl_radio_version_notif {
1221 __le32 radio_flavor;
1222 __le32 radio_step;
1223 __le32 radio_dash;
1224} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1225
1226enum iwl_card_state_flags {
1227 CARD_ENABLED = 0x00,
1228 HW_CARD_DISABLED = 0x01,
1229 SW_CARD_DISABLED = 0x02,
1230 CT_KILL_CARD_DISABLED = 0x04,
1231 HALT_CARD_DISABLED = 0x08,
1232 CARD_DISABLED_MSK = 0x0f,
1233 CARD_IS_RX_ON = 0x10,
1234};
1235
1236/**
1237 * struct iwl_radio_version_notif - information on the radio version
1238 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1239 * @flags: %iwl_card_state_flags
1240 */
1241struct iwl_card_state_notif {
1242 __le32 flags;
1243} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1244
1245/**
Hila Gonend64048e2013-03-13 18:00:03 +02001246 * struct iwl_missed_beacons_notif - information on missed beacons
1247 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1248 * @mac_id: interface ID
1249 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1250 * beacons since last RX.
1251 * @consec_missed_beacons: number of consecutive missed beacons
1252 * @num_expected_beacons:
1253 * @num_recvd_beacons:
1254 */
1255struct iwl_missed_beacons_notif {
1256 __le32 mac_id;
1257 __le32 consec_missed_beacons_since_last_rx;
1258 __le32 consec_missed_beacons;
1259 __le32 num_expected_beacons;
1260 __le32 num_recvd_beacons;
1261} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1262
1263/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001264 * struct iwl_mfuart_load_notif - mfuart image version & status
1265 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1266 * @installed_ver: installed image version
1267 * @external_ver: external image version
1268 * @status: MFUART loading status
1269 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001270 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001271*/
1272struct iwl_mfuart_load_notif {
1273 __le32 installed_ver;
1274 __le32 external_ver;
1275 __le32 status;
1276 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001277 /* image size valid only in v2 of the command */
1278 __le32 image_size;
1279} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001280
1281/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001282 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1283 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1284 * @assert_id: mfuart assert id that cause the notif
1285 * @curr_reset_num: number of asserts since uptime
1286 * @index_num: current chunk id
1287 * @parts_num: total number of chunks
1288 * @data_size: number of data bytes sent
1289 * @data: data buffer
1290 */
1291struct iwl_mfu_assert_dump_notif {
1292 __le32 assert_id;
1293 __le32 curr_reset_num;
1294 __le16 index_num;
1295 __le16 parts_num;
1296 __le32 data_size;
1297 __le32 data[0];
1298} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1299
1300/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001301 * struct iwl_set_calib_default_cmd - set default value for calibration.
1302 * ( SET_CALIB_DEFAULT_CMD = 0x8e )
1303 * @calib_index: the calibration to set value for
1304 * @length: of data
1305 * @data: the value to set for the calibration result
1306 */
1307struct iwl_set_calib_default_cmd {
1308 __le16 calib_index;
1309 __le16 length;
1310 u8 data[0];
1311} __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
1312
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001313#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001314#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001315
1316/**
1317 * struct iwl_mcast_filter_cmd - configure multicast filter.
1318 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1319 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1320 * to identify network interface adopted in host-device IF.
1321 * It is used by FW as index in array of addresses. This array has
1322 * MAX_PORT_ID_NUM members.
1323 * @count: Number of MAC addresses in the array
1324 * @pass_all: Set 1 to pass all multicast packets.
1325 * @bssid: current association BSSID.
1326 * @addr_list: Place holder for array of MAC addresses.
1327 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1328 */
1329struct iwl_mcast_filter_cmd {
1330 u8 filter_own;
1331 u8 port_id;
1332 u8 count;
1333 u8 pass_all;
1334 u8 bssid[6];
1335 u8 reserved[2];
1336 u8 addr_list[0];
1337} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1338
Eliad Pellerc87163b2014-01-08 10:11:11 +02001339#define MAX_BCAST_FILTERS 8
1340#define MAX_BCAST_FILTER_ATTRS 2
1341
1342/**
1343 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1344 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1345 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1346 * start of ip payload).
1347 */
1348enum iwl_mvm_bcast_filter_attr_offset {
1349 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1350 BCAST_FILTER_OFFSET_IP_END = 1,
1351};
1352
1353/**
1354 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1355 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1356 * @offset: starting offset of this pattern.
1357 * @val: value to match - big endian (MSB is the first
1358 * byte to match from offset pos).
1359 * @mask: mask to match (big endian).
1360 */
1361struct iwl_fw_bcast_filter_attr {
1362 u8 offset_type;
1363 u8 offset;
1364 __le16 reserved1;
1365 __be32 val;
1366 __be32 mask;
1367} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1368
1369/**
1370 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1371 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1372 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1373 */
1374enum iwl_mvm_bcast_filter_frame_type {
1375 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1376 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1377};
1378
1379/**
1380 * struct iwl_fw_bcast_filter - broadcast filter
1381 * @discard: discard frame (1) or let it pass (0).
1382 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
1383 * @num_attrs: number of valid attributes in this filter.
1384 * @attrs: attributes of this filter. a filter is considered matched
1385 * only when all its attributes are matched (i.e. AND relationship)
1386 */
1387struct iwl_fw_bcast_filter {
1388 u8 discard;
1389 u8 frame_type;
1390 u8 num_attrs;
1391 u8 reserved1;
1392 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1393} __packed; /* BCAST_FILTER_S_VER_1 */
1394
Sara Sharon3af512d62015-07-22 11:38:40 +03001395#define BA_WINDOW_STREAMS_MAX 16
1396#define BA_WINDOW_STATUS_TID_MSK 0x000F
1397#define BA_WINDOW_STATUS_STA_ID_POS 4
1398#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1399#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1400
1401/**
1402 * struct iwl_ba_window_status_notif - reordering window's status notification
1403 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1404 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1405 * @start_seq_num: the start sequence number of the bitmap
1406 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1407 */
1408struct iwl_ba_window_status_notif {
1409 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1410 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1411 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1412 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1413} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1414
Eliad Pellerc87163b2014-01-08 10:11:11 +02001415/**
1416 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1417 * @default_discard: default action for this mac (discard (1) / pass (0)).
1418 * @attached_filters: bitmap of relevant filters for this mac.
1419 */
1420struct iwl_fw_bcast_mac {
1421 u8 default_discard;
1422 u8 reserved1;
1423 __le16 attached_filters;
1424} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1425
1426/**
1427 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1428 * @disable: enable (0) / disable (1)
1429 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1430 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
1431 * @filters: broadcast filters
1432 * @macs: broadcast filtering configuration per-mac
1433 */
1434struct iwl_bcast_filter_cmd {
1435 u8 disable;
1436 u8 max_bcast_filters;
1437 u8 max_macs;
1438 u8 reserved1;
1439 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1440 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1441} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1442
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001443/*
1444 * enum iwl_mvm_marker_id - maker ids
1445 *
1446 * The ids for different type of markers to insert into the usniffer logs
1447 */
1448enum iwl_mvm_marker_id {
1449 MARKER_ID_TX_FRAME_LATENCY = 1,
1450}; /* MARKER_ID_API_E_VER_1 */
1451
1452/**
1453 * struct iwl_mvm_marker - mark info into the usniffer logs
1454 *
1455 * (MARKER_CMD = 0xcb)
1456 *
1457 * Mark the UTC time stamp into the usniffer logs together with additional
1458 * metadata, so the usniffer output can be parsed.
1459 * In the command response the ucode will return the GP2 time.
1460 *
1461 * @dw_len: The amount of dwords following this byte including this byte.
1462 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1463 * @reserved: reserved.
1464 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1465 * @metadata: additional meta data that will be written to the unsiffer log
1466 */
1467struct iwl_mvm_marker {
1468 u8 dwLen;
1469 u8 markerId;
1470 __le16 reserved;
1471 __le64 timestamp;
1472 __le32 metadata[0];
1473} __packed; /* MARKER_API_S_VER_1 */
1474
Matti Gottlieb0becb372015-05-31 09:18:30 +03001475/*
1476 * enum iwl_dc2dc_config_id - flag ids
1477 *
1478 * Ids of dc2dc configuration flags
1479 */
1480enum iwl_dc2dc_config_id {
1481 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1482 DCDC_FREQ_TUNE_SET = 0x2,
1483}; /* MARKER_ID_API_E_VER_1 */
1484
1485/**
1486 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1487 *
1488 * (DC2DC_CONFIG_CMD = 0x83)
1489 *
1490 * Set/Get & configure dc2dc values.
1491 * The command always returns the current dc2dc values.
1492 *
1493 * @flags: set/get dc2dc
1494 * @enable_low_power_mode: not used.
1495 * @dc2dc_freq_tune0: frequency divider - digital domain
1496 * @dc2dc_freq_tune1: frequency divider - analog domain
1497 */
1498struct iwl_dc2dc_config_cmd {
1499 __le32 flags;
1500 __le32 enable_low_power_mode; /* not used */
1501 __le32 dc2dc_freq_tune0;
1502 __le32 dc2dc_freq_tune1;
1503} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1504
1505/**
1506 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1507 *
1508 * Current dc2dc values returned by the FW.
1509 *
1510 * @dc2dc_freq_tune0: frequency divider - digital domain
1511 * @dc2dc_freq_tune1: frequency divider - analog domain
1512 */
1513struct iwl_dc2dc_config_resp {
1514 __le32 dc2dc_freq_tune0;
1515 __le32 dc2dc_freq_tune1;
1516} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1517
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001518/***********************************
1519 * Smart Fifo API
1520 ***********************************/
1521/* Smart Fifo state */
1522enum iwl_sf_state {
1523 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1524 SF_FULL_ON,
1525 SF_UNINIT,
1526 SF_INIT_OFF,
1527 SF_HW_NUM_STATES
1528};
1529
1530/* Smart Fifo possible scenario */
1531enum iwl_sf_scenario {
1532 SF_SCENARIO_SINGLE_UNICAST,
1533 SF_SCENARIO_AGG_UNICAST,
1534 SF_SCENARIO_MULTICAST,
1535 SF_SCENARIO_BA_RESP,
1536 SF_SCENARIO_TX_RESP,
1537 SF_NUM_SCENARIO
1538};
1539
1540#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
1541#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
1542
1543/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02001544#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001545#define SF_W_MARK_MIMO2 8192
1546#define SF_W_MARK_MIMO3 6144
1547#define SF_W_MARK_LEGACY 4096
1548#define SF_W_MARK_SCAN 4096
1549
Eran Hararyf4a3ee42015-02-08 13:58:50 +02001550/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
1551#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1552#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1553#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1554#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1555#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
1556#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1557#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
1558#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
1559#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
1560#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
1561
1562/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001563#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1564#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1565#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1566#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1567#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
1568#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
1569#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
1570#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
1571#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
1572#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
1573
1574#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
1575
Eran Harary161bdb72014-07-27 08:03:06 +03001576#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
1577
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001578/**
1579 * Smart Fifo configuration command.
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001580 * @state: smart fifo state, types listed in enum %iwl_sf_sate.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001581 * @watermark: Minimum allowed availabe free space in RXF for transient state.
1582 * @long_delay_timeouts: aging and idle timer values for each scenario
1583 * in long delay state.
1584 * @full_on_timeouts: timer values for each scenario in full on state.
1585 */
1586struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001587 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001588 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
1589 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1590 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1591} __packed; /* SF_CFG_API_S_VER_2 */
1592
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001593/***********************************
1594 * Location Aware Regulatory (LAR) API - MCC updates
1595 ***********************************/
1596
1597/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001598 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001599 * regulatory profile according to the given MCC (Mobile Country Code).
1600 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1601 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1602 * MCC in the cmd response will be the relevant MCC in the NVM.
1603 * @mcc: given mobile country code
1604 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1605 * @reserved: reserved for alignment
1606 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001607struct iwl_mcc_update_cmd_v1 {
1608 __le16 mcc;
1609 u8 source_id;
1610 u8 reserved;
1611} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
1612
1613/**
1614 * struct iwl_mcc_update_cmd - Request the device to update geographic
1615 * regulatory profile according to the given MCC (Mobile Country Code).
1616 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1617 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1618 * MCC in the cmd response will be the relevant MCC in the NVM.
1619 * @mcc: given mobile country code
1620 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1621 * @reserved: reserved for alignment
1622 * @key: integrity key for MCC API OEM testing
1623 * @reserved2: reserved
1624 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001625struct iwl_mcc_update_cmd {
1626 __le16 mcc;
1627 u8 source_id;
1628 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001629 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01001630 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001631} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001632
1633/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001634 * iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001635 * Contains the new channel control profile map, if changed, and the new MCC
1636 * (mobile country code).
1637 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02001638 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001639 * @mcc: the new applied MCC
1640 * @cap: capabilities for all channels which matches the MCC
1641 * @source_id: the MCC source, see iwl_mcc_source
1642 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1643 * channels, depending on platform)
1644 * @channels: channel control data map, DWORD for each channel. Only the first
1645 * 16bits are used.
1646 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001647struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001648 __le32 status;
1649 __le16 mcc;
1650 u8 cap;
1651 u8 source_id;
1652 __le32 n_channels;
1653 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001654} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
1655
1656/**
1657 * iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
1658 * Contains the new channel control profile map, if changed, and the new MCC
1659 * (mobile country code).
1660 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
1661 * @status: see &enum iwl_mcc_update_status
1662 * @mcc: the new applied MCC
1663 * @cap: capabilities for all channels which matches the MCC
1664 * @source_id: the MCC source, see iwl_mcc_source
1665 * @time: time elapsed from the MCC test start (in 30 seconds TU)
1666 * @reserved: reserved.
1667 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1668 * channels, depending on platform)
1669 * @channels: channel control data map, DWORD for each channel. Only the first
1670 * 16bits are used.
1671 */
1672struct iwl_mcc_update_resp {
1673 __le32 status;
1674 __le16 mcc;
1675 u8 cap;
1676 u8 source_id;
1677 __le16 time;
1678 __le16 reserved;
1679 __le32 n_channels;
1680 __le32 channels[0];
1681} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001682
1683/**
1684 * struct iwl_mcc_chub_notif - chub notifies of mcc change
1685 * (MCC_CHUB_UPDATE_CMD = 0xc9)
1686 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
1687 * the cellular and connectivity cores that gets updates of the mcc, and
1688 * notifies the ucode directly of any mcc change.
1689 * The ucode requests the driver to request the device to update geographic
1690 * regulatory profile according to the given MCC (Mobile Country Code).
1691 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1692 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1693 * MCC in the cmd response will be the relevant MCC in the NVM.
1694 * @mcc: given mobile country code
1695 * @source_id: identity of the change originator, see iwl_mcc_source
1696 * @reserved1: reserved for alignment
1697 */
1698struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01001699 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001700 u8 source_id;
1701 u8 reserved1;
1702} __packed; /* LAR_MCC_NOTIFY_S */
1703
1704enum iwl_mcc_update_status {
1705 MCC_RESP_NEW_CHAN_PROFILE,
1706 MCC_RESP_SAME_CHAN_PROFILE,
1707 MCC_RESP_INVALID,
1708 MCC_RESP_NVM_DISABLED,
1709 MCC_RESP_ILLEGAL,
1710 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001711 MCC_RESP_TEST_MODE_ACTIVE,
1712 MCC_RESP_TEST_MODE_NOT_ACTIVE,
1713 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001714};
1715
1716enum iwl_mcc_source {
1717 MCC_SOURCE_OLD_FW = 0,
1718 MCC_SOURCE_ME = 1,
1719 MCC_SOURCE_BIOS = 2,
1720 MCC_SOURCE_3G_LTE_HOST = 3,
1721 MCC_SOURCE_3G_LTE_DEVICE = 4,
1722 MCC_SOURCE_WIFI = 5,
1723 MCC_SOURCE_RESERVED = 6,
1724 MCC_SOURCE_DEFAULT = 7,
1725 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001726 MCC_SOURCE_MCC_API = 9,
1727 MCC_SOURCE_GET_CURRENT = 0x10,
1728 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001729};
1730
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001731/* DTS measurements */
1732
1733enum iwl_dts_measurement_flags {
1734 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
1735 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
1736};
1737
1738/**
1739 * iwl_dts_measurement_cmd - request DTS temperature and/or voltage measurements
1740 *
1741 * @flags: indicates which measurements we want as specified in &enum
1742 * iwl_dts_measurement_flags
1743 */
1744struct iwl_dts_measurement_cmd {
1745 __le32 flags;
1746} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
1747
1748/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03001749* enum iwl_dts_control_measurement_mode - DTS measurement type
1750* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
1751* back (latest value. Not waiting for new value). Use automatic
1752* SW DTS configuration.
1753* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
1754* trigger DTS reading and provide read back temperature read
1755* when available.
1756* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
1757* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
1758* without measurement trigger.
1759*/
1760enum iwl_dts_control_measurement_mode {
1761 DTS_AUTOMATIC = 0,
1762 DTS_REQUEST_READ = 1,
1763 DTS_OVER_WRITE = 2,
1764 DTS_DIRECT_WITHOUT_MEASURE = 3,
1765};
1766
1767/**
1768* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
1769* @DTS_USE_TOP: Top
1770* @DTS_USE_CHAIN_A: chain A
1771* @DTS_USE_CHAIN_B: chain B
1772* @DTS_USE_CHAIN_C: chain C
1773* @XTAL_TEMPERATURE - read temperature from xtal
1774*/
1775enum iwl_dts_used {
1776 DTS_USE_TOP = 0,
1777 DTS_USE_CHAIN_A = 1,
1778 DTS_USE_CHAIN_B = 2,
1779 DTS_USE_CHAIN_C = 3,
1780 XTAL_TEMPERATURE = 4,
1781};
1782
1783/**
1784* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
1785* @DTS_BIT6_MODE: bit 6 mode
1786* @DTS_BIT8_MODE: bit 8 mode
1787*/
1788enum iwl_dts_bit_mode {
1789 DTS_BIT6_MODE = 0,
1790 DTS_BIT8_MODE = 1,
1791};
1792
1793/**
1794 * iwl_ext_dts_measurement_cmd - request extended DTS temperature measurements
1795 * @control_mode: see &enum iwl_dts_control_measurement_mode
1796 * @temperature: used when over write DTS mode is selected
1797 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
1798 * @avg_factor: average factor to DTS in request DTS read mode
1799 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
1800 * @step_duration: step duration for the DTS
1801 */
1802struct iwl_ext_dts_measurement_cmd {
1803 __le32 control_mode;
1804 __le32 temperature;
1805 __le32 sensor;
1806 __le32 avg_factor;
1807 __le32 bit_mode;
1808 __le32 step_duration;
1809} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
1810
1811/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02001812 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001813 *
1814 * @temp: the measured temperature
1815 * @voltage: the measured voltage
1816 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02001817struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001818 __le32 temp;
1819 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02001820} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
1821
1822/**
1823 * struct iwl_dts_measurement_notif_v2 - measurements notification
1824 *
1825 * @temp: the measured temperature
1826 * @voltage: the measured voltage
1827 * @threshold_idx: the trip index that was crossed
1828 */
1829struct iwl_dts_measurement_notif_v2 {
1830 __le32 temp;
1831 __le32 voltage;
1832 __le32 threshold_idx;
1833} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001834
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02001835/**
1836 * struct ct_kill_notif - CT-kill entry notification
1837 *
1838 * @temperature: the current temperature in celsius
1839 * @reserved: reserved
1840 */
1841struct ct_kill_notif {
1842 __le16 temperature;
1843 __le16 reserved;
1844} __packed; /* GRP_PHY_CT_KILL_NTF */
1845
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02001846/**
1847* enum ctdp_cmd_operation - CTDP command operations
1848* @CTDP_CMD_OPERATION_START: update the current budget
1849* @CTDP_CMD_OPERATION_STOP: stop ctdp
1850* @CTDP_CMD_OPERATION_REPORT: get the avgerage budget
1851*/
1852enum iwl_mvm_ctdp_cmd_operation {
1853 CTDP_CMD_OPERATION_START = 0x1,
1854 CTDP_CMD_OPERATION_STOP = 0x2,
1855 CTDP_CMD_OPERATION_REPORT = 0x4,
1856};/* CTDP_CMD_OPERATION_TYPE_E */
1857
1858/**
1859 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
1860 *
1861 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
1862 * @budget: the budget in milliwatt
1863 * @window_size: defined in API but not used
1864 */
1865struct iwl_mvm_ctdp_cmd {
1866 __le32 operation;
1867 __le32 budget;
1868 __le32 window_size;
1869} __packed;
1870
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02001871#define IWL_MAX_DTS_TRIPS 8
1872
1873/**
1874 * struct iwl_temp_report_ths_cmd - set temperature thresholds
1875 *
1876 * @num_temps: number of temperature thresholds passed
1877 * @thresholds: array with the thresholds to be configured
1878 */
1879struct temp_report_ths_cmd {
1880 __le32 num_temps;
1881 __le16 thresholds[IWL_MAX_DTS_TRIPS];
1882} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
1883
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03001884/***********************************
1885 * TDLS API
1886 ***********************************/
1887
1888/* Type of TDLS request */
1889enum iwl_tdls_channel_switch_type {
1890 TDLS_SEND_CHAN_SW_REQ = 0,
1891 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
1892 TDLS_MOVE_CH,
1893}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
1894
1895/**
1896 * Switch timing sub-element in a TDLS channel-switch command
1897 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
1898 * received from peer
1899 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
1900 * to the TDLS off-channel communication. For instance if the DTIM is
1901 * 200TU and the TDLS peer is to be given 25% of the time, the value
1902 * given will be 50TU, or 50 * 1024 if translated into microseconds.
1903 * @switch_time: switch time the peer sent in its channel switch timing IE
1904 * @switch_timout: switch timeout the peer sent in its channel switch timing IE
1905 */
1906struct iwl_tdls_channel_switch_timing {
1907 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
1908 __le32 max_offchan_duration; /* given in micro-seconds */
1909 __le32 switch_time; /* given in micro-seconds */
1910 __le32 switch_timeout; /* given in micro-seconds */
1911} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
1912
1913#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
1914
1915/**
1916 * TDLS channel switch frame template
1917 *
1918 * A template representing a TDLS channel-switch request or response frame
1919 *
1920 * @switch_time_offset: offset to the channel switch timing IE in the template
1921 * @tx_cmd: Tx parameters for the frame
1922 * @data: frame data
1923 */
1924struct iwl_tdls_channel_switch_frame {
1925 __le32 switch_time_offset;
1926 struct iwl_tx_cmd tx_cmd;
1927 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
1928} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
1929
1930/**
1931 * TDLS channel switch command
1932 *
1933 * The command is sent to initiate a channel switch and also in response to
1934 * incoming TDLS channel-switch request/response packets from remote peers.
1935 *
1936 * @switch_type: see &enum iwl_tdls_channel_switch_type
1937 * @peer_sta_id: station id of TDLS peer
1938 * @ci: channel we switch to
1939 * @timing: timing related data for command
1940 * @frame: channel-switch request/response template, depending to switch_type
1941 */
1942struct iwl_tdls_channel_switch_cmd {
1943 u8 switch_type;
1944 __le32 peer_sta_id;
1945 struct iwl_fw_channel_info ci;
1946 struct iwl_tdls_channel_switch_timing timing;
1947 struct iwl_tdls_channel_switch_frame frame;
1948} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
1949
1950/**
1951 * TDLS channel switch start notification
1952 *
1953 * @status: non-zero on success
1954 * @offchannel_duration: duration given in microseconds
1955 * @sta_id: peer currently performing the channel-switch with
1956 */
1957struct iwl_tdls_channel_switch_notif {
1958 __le32 status;
1959 __le32 offchannel_duration;
1960 __le32 sta_id;
1961} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
1962
Arik Nemtsov307e4722014-09-15 18:48:59 +03001963/**
1964 * TDLS station info
1965 *
1966 * @sta_id: station id of the TDLS peer
1967 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
1968 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
1969 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
1970 */
1971struct iwl_tdls_sta_info {
1972 u8 sta_id;
1973 u8 tx_to_peer_tid;
1974 __le16 tx_to_peer_ssn;
1975 __le32 is_initiator;
1976} __packed; /* TDLS_STA_INFO_VER_1 */
1977
1978/**
1979 * TDLS basic config command
1980 *
1981 * @id_and_color: MAC id and color being configured
1982 * @tdls_peer_count: amount of currently connected TDLS peers
1983 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
1984 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
1985 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
1986 * @pti_req_data_offset: offset of network-level data for the PTI template
1987 * @pti_req_tx_cmd: Tx parameters for PTI request template
1988 * @pti_req_template: PTI request template data
1989 */
1990struct iwl_tdls_config_cmd {
1991 __le32 id_and_color; /* mac id and color */
1992 u8 tdls_peer_count;
1993 u8 tx_to_ap_tid;
1994 __le16 tx_to_ap_ssn;
1995 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
1996
1997 __le32 pti_req_data_offset;
1998 struct iwl_tx_cmd pti_req_tx_cmd;
1999 u8 pti_req_template[0];
2000} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2001
2002/**
2003 * TDLS per-station config information from FW
2004 *
2005 * @sta_id: station id of the TDLS peer
2006 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2007 * the peer
2008 */
2009struct iwl_tdls_config_sta_info_res {
2010 __le16 sta_id;
2011 __le16 tx_to_peer_last_seq;
2012} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2013
2014/**
2015 * TDLS config information from FW
2016 *
2017 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2018 * @sta_info: per-station TDLS config information
2019 */
2020struct iwl_tdls_config_res {
2021 __le32 tx_to_ap_last_seq;
2022 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2023} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2024
Sara Sharondb06f042016-07-05 17:37:58 +03002025#define TX_FIFO_MAX_NUM_9000 8
2026#define TX_FIFO_MAX_NUM 15
2027#define RX_FIFO_MAX_NUM 2
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002028#define TX_FIFO_INTERNAL_MAX_NUM 6
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002029
2030/**
2031 * Shared memory configuration information from the FW
2032 *
2033 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2034 * accessible)
2035 * @shared_mem_size: shared memory size
2036 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2037 * 0x0 as accessible only via DBGM RDAT)
2038 * @sample_buff_size: internal sample buff size
2039 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2040 * 8000 HW set to 0x0 as not accessible)
2041 * @txfifo_size: size of TXF0 ... TXF7
2042 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2043 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2044 * when paging is not supported this should be 0
2045 * @page_buff_size: size of %page_buff_addr
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002046 * @rxfifo_addr: Start address of rxFifo
2047 * @internal_txfifo_addr: start address of internalFifo
2048 * @internal_txfifo_size: internal fifos' size
2049 *
2050 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2051 * set, the last 3 members don't exist.
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002052 */
Sara Sharondb06f042016-07-05 17:37:58 +03002053struct iwl_shared_mem_cfg_v1 {
2054 __le32 shared_mem_addr;
2055 __le32 shared_mem_size;
2056 __le32 sample_buff_addr;
2057 __le32 sample_buff_size;
2058 __le32 txfifo_addr;
2059 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2060 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2061 __le32 page_buff_addr;
2062 __le32 page_buff_size;
2063 __le32 rxfifo_addr;
2064 __le32 internal_txfifo_addr;
2065 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2066} __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2067
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002068/**
2069 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2070 *
2071 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2072 * @txfifo_size: size of TX FIFOs
2073 * @rxfifo1_addr: RXF1 addr
2074 * @rxfifo1_size: RXF1 size
2075 */
2076struct iwl_shared_mem_lmac_cfg {
2077 __le32 txfifo_addr;
2078 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2079 __le32 rxfifo1_addr;
2080 __le32 rxfifo1_size;
2081
2082} __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2083
2084/**
2085 * Shared memory configuration information from the FW
2086 *
2087 * @shared_mem_addr: shared memory address
2088 * @shared_mem_size: shared memory size
2089 * @sample_buff_addr: internal sample (mon/adc) buff addr
2090 * @sample_buff_size: internal sample buff size
2091 * @rxfifo2_addr: start addr of RXF2
2092 * @rxfifo2_size: size of RXF2
2093 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2094 * when paging is not supported this should be 0
2095 * @page_buff_size: size of %page_buff_addr
2096 * @lmac_num: number of LMACs (1 or 2)
2097 * @lmac_smem: per - LMAC smem data
2098 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002099struct iwl_shared_mem_cfg {
2100 __le32 shared_mem_addr;
2101 __le32 shared_mem_size;
2102 __le32 sample_buff_addr;
2103 __le32 sample_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002104 __le32 rxfifo2_addr;
2105 __le32 rxfifo2_size;
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002106 __le32 page_buff_addr;
2107 __le32 page_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002108 __le32 lmac_num;
2109 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
Sara Sharondb06f042016-07-05 17:37:58 +03002110} __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002111
Sara Sharona07a8f32015-11-15 11:11:59 +02002112/**
2113 * VHT MU-MIMO group configuration
2114 *
2115 * @membership_status: a bitmap of MU groups
2116 * @user_position:the position of station in a group. If the station is in the
2117 * group then bits (group * 2) is the position -1
2118 */
2119struct iwl_mu_group_mgmt_cmd {
2120 __le32 reserved;
2121 __le32 membership_status[2];
2122 __le32 user_position[4];
2123} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2124
Sara Sharonf92659a2016-02-03 15:04:49 +02002125/**
2126 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2127 *
2128 * @membership_status: a bitmap of MU groups
2129 * @user_position: the position of station in a group. If the station is in the
2130 * group then bits (group * 2) is the position -1
2131 */
2132struct iwl_mu_group_mgmt_notif {
2133 __le32 membership_status[2];
2134 __le32 user_position[4];
2135} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2136
Sara Sharon0db056d2015-12-29 11:07:15 +02002137#define MAX_STORED_BEACON_SIZE 600
2138
2139/**
2140 * Stored beacon notification
2141 *
2142 * @system_time: system time on air rise
2143 * @tsf: TSF on air rise
2144 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002145 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002146 * @channel: channel this beacon was received on
2147 * @rates: rate in ucode internal format
2148 * @byte_count: frame's byte count
2149 */
2150struct iwl_stored_beacon_notif {
2151 __le32 system_time;
2152 __le64 tsf;
2153 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002154 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002155 __le16 channel;
2156 __le32 rates;
2157 __le32 byte_count;
2158 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002159} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002160
Aviya Erenfeld03098262016-02-18 14:09:33 +02002161#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2162
2163enum iwl_lqm_cmd_operatrions {
2164 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2165 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2166};
2167
2168enum iwl_lqm_status {
2169 LQM_STATUS_SUCCESS = 0,
2170 LQM_STATUS_TIMEOUT = 1,
2171 LQM_STATUS_ABORT = 2,
2172};
2173
2174/**
2175 * Link Quality Measurement command
2176 * @cmd_operatrion: command operation to be performed (start or stop)
2177 * as defined above.
2178 * @mac_id: MAC ID the measurement applies to.
2179 * @measurement_time: time of the total measurement to be performed, in uSec.
2180 * @timeout: maximum time allowed until a response is sent, in uSec.
2181 */
2182struct iwl_link_qual_msrmnt_cmd {
2183 __le32 cmd_operation;
2184 __le32 mac_id;
2185 __le32 measurement_time;
2186 __le32 timeout;
2187} __packed /* LQM_CMD_API_S_VER_1 */;
2188
2189/**
2190 * Link Quality Measurement notification
2191 *
2192 * @frequent_stations_air_time: an array containing the total air time
2193 * (in uSec) used by the most frequently transmitting stations.
2194 * @number_of_stations: the number of uniqe stations included in the array
2195 * (a number between 0 to 16)
2196 * @total_air_time_other_stations: the total air time (uSec) used by all the
2197 * stations which are not included in the above report.
2198 * @time_in_measurement_window: the total time in uSec in which a measurement
2199 * took place.
2200 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2201 * measurement
2202 * @mac_id: MAC ID the measurement applies to.
2203 * @status: return status. may be one of the LQM_STATUS_* defined above.
2204 * @reserved: reserved.
2205 */
2206struct iwl_link_qual_msrmnt_notif {
2207 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2208 __le32 number_of_stations;
2209 __le32 total_air_time_other_stations;
2210 __le32 time_in_measurement_window;
2211 __le32 tx_frame_dropped;
2212 __le32 mac_id;
2213 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002214 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002215} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2216
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002217/**
2218 * Channel switch NOA notification
2219 *
2220 * @id_and_color: ID and color of the MAC
2221 */
2222struct iwl_channel_switch_noa_notif {
2223 __le32 id_and_color;
2224} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2225
Ido Yariv2b55f432016-08-23 14:44:59 -04002226/* Operation types for the debug mem access */
2227enum {
2228 DEBUG_MEM_OP_READ = 0,
2229 DEBUG_MEM_OP_WRITE = 1,
2230 DEBUG_MEM_OP_WRITE_BYTES = 2,
2231};
2232
2233#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2234
2235/**
2236 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2237 * @op: DEBUG_MEM_OP_*
2238 * @addr: address to read/write from/to
2239 * @len: in dwords, to read/write
2240 * @data: for write opeations, contains the source buffer
2241 */
2242struct iwl_dbg_mem_access_cmd {
2243 __le32 op;
2244 __le32 addr;
2245 __le32 len;
2246 __le32 data[];
2247} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2248
2249/* Status responses for the debug mem access */
2250enum {
2251 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2252 DEBUG_MEM_STATUS_FAILED = 0x1,
2253 DEBUG_MEM_STATUS_LOCKED = 0x2,
2254 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2255 DEBUG_MEM_STATUS_LENGTH = 0x4,
2256};
2257
2258/**
2259 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2260 * @status: DEBUG_MEM_STATUS_*
2261 * @len: read dwords (0 for write operations)
2262 * @data: contains the read DWs
2263 */
2264struct iwl_dbg_mem_access_rsp {
2265 __le32 status;
2266 __le32 len;
2267 __le32 data[];
2268} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2269
Sara Sharon1f370652016-08-31 18:13:57 +03002270/**
2271 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
2272 */
2273struct iwl_nvm_access_complete_cmd {
2274 __le32 reserved;
2275} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2276
Sara Sharon4399caa2016-12-11 10:32:42 +02002277/**
2278 * enum iwl_extended_cfg_flag - commands driver may send before
2279 * finishing init flow
2280 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2281 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2282 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2283 */
2284enum iwl_extended_cfg_flags {
2285 IWL_INIT_DEBUG_CFG,
2286 IWL_INIT_NVM,
2287 IWL_INIT_PHY,
2288};
2289
2290/**
2291 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2292 * before finishing init flows
2293 * @init_flags: values from iwl_extended_cfg_flags
2294 */
2295struct iwl_init_extended_cfg_cmd {
2296 __le32 init_flags;
2297} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2298
Sara Sharone9e1ba32017-01-08 16:46:14 +02002299/*
2300 * struct iwl_nvm_get_info - request to get NVM data
2301 */
2302struct iwl_nvm_get_info {
2303 __le32 reserved;
2304} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2305
2306/**
2307 * struct iwl_nvm_get_info_general - general NVM data
2308 * @flags: 1 - empty, 0 - valid
2309 * @nvm_version: nvm version
2310 * @board_type: board type
2311 */
2312struct iwl_nvm_get_info_general {
2313 __le32 flags;
2314 __le16 nvm_version;
2315 u8 board_type;
2316 u8 reserved;
2317} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2318
2319/**
2320 * struct iwl_nvm_get_info_sku - mac information
2321 * @enable_24g: band 2.4G enabled
2322 * @enable_5g: band 5G enabled
2323 * @enable_11n: 11n enabled
2324 * @enable_11ac: 11ac enabled
2325 * @mimo_disable: MIMO enabled
2326 * @ext_crypto: Extended crypto enabled
2327 */
2328struct iwl_nvm_get_info_sku {
2329 __le32 enable_24g;
2330 __le32 enable_5g;
2331 __le32 enable_11n;
2332 __le32 enable_11ac;
2333 __le32 mimo_disable;
2334 __le32 ext_crypto;
2335} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2336
2337/**
2338 * struct iwl_nvm_get_info_phy - phy information
2339 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2340 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2341 */
2342struct iwl_nvm_get_info_phy {
2343 __le32 tx_chains;
2344 __le32 rx_chains;
2345} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2346
2347#define IWL_NUM_CHANNELS (51)
2348
2349/**
2350 * struct iwl_nvm_get_info_regulatory - regulatory information
2351 * @lar_enabled: is LAR enabled
2352 * @channel_profile: regulatory data of this channel
2353 * @regulatory: regulatory data, see &enum iwl_nvm_channel_flags for data
2354 */
2355struct iwl_nvm_get_info_regulatory {
2356 __le32 lar_enabled;
2357 __le16 channel_profile[IWL_NUM_CHANNELS];
2358 __le16 reserved;
2359} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2360
2361/**
2362 * struct iwl_nvm_get_info_rsp - response to get NVM data
2363 * @general: general NVM data
2364 * @mac_sku: data relating to MAC sku
2365 * @phy_sku: data relating to PHY sku
2366 * @regulatory: regulatory data
2367 */
2368struct iwl_nvm_get_info_rsp {
2369 struct iwl_nvm_get_info_general general;
2370 struct iwl_nvm_get_info_sku mac_sku;
2371 struct iwl_nvm_get_info_phy phy_sku;
2372 struct iwl_nvm_get_info_regulatory regulatory;
2373} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2374
Johannes Berg8ca151b2013-01-24 14:25:36 +01002375#endif /* __fw_api_h__ */