blob: 3e297c95e8ff16a248f431caa8e50cb1d2dfd8fd [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 Berg15fc1962017-03-10 14:01:42 +0100133/**
134 * enum iwl_legacy_cmds - legacy group command IDs
135 */
Johannes Berg72361c32017-03-09 17:06:45 +0100136enum iwl_legacy_cmds {
Johannes Berg15fc1962017-03-10 14:01:42 +0100137 /**
138 * @MVM_ALIVE:
139 * Alive data from the firmware, as described in
140 * &struct mvm_alive_resp_v3 or &struct mvm_alive_resp.
141 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100142 MVM_ALIVE = 0x1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100143
144 /**
145 * @REPLY_ERROR: Cause an error in the firmware, for testing purposes.
146 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100147 REPLY_ERROR = 0x2,
Johannes Berg15fc1962017-03-10 14:01:42 +0100148
149 /**
150 * @ECHO_CMD: Send data to the device to have it returned immediately.
151 */
Emmanuel Grumbache5046012015-08-17 10:45:50 +0300152 ECHO_CMD = 0x3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100153
Johannes Berg15fc1962017-03-10 14:01:42 +0100154 /**
155 * @INIT_COMPLETE_NOTIF: Notification that initialization is complete.
156 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100157 INIT_COMPLETE_NOTIF = 0x4,
158
Johannes Berg15fc1962017-03-10 14:01:42 +0100159 /**
160 * @PHY_CONTEXT_CMD:
161 * Add/modify/remove a PHY context, using &struct iwl_phy_context_cmd.
162 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100163 PHY_CONTEXT_CMD = 0x8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100164
165 /**
166 * @DBG_CFG: Debug configuration command.
167 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100168 DBG_CFG = 0x9,
Johannes Berg15fc1962017-03-10 14:01:42 +0100169
170 /**
171 * @ANTENNA_COUPLING_NOTIFICATION:
172 * Antenna coupling data, &struct iwl_mvm_antenna_coupling_notif
173 */
Emmanuel Grumbachb9fae2d2014-02-17 11:24:10 +0200174 ANTENNA_COUPLING_NOTIFICATION = 0xa,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100175
Johannes Berg15fc1962017-03-10 14:01:42 +0100176 /**
177 * @SCAN_ITERATION_COMPLETE_UMAC:
178 * Firmware indicates a scan iteration completed, using
179 * &struct iwl_umac_scan_iter_complete_notif.
180 */
Avraham Sternee9219b2015-03-23 15:09:27 +0200181 SCAN_ITERATION_COMPLETE_UMAC = 0xb5,
Johannes Berg15fc1962017-03-10 14:01:42 +0100182
183 /**
184 * @SCAN_CFG_CMD:
185 * uses &struct iwl_scan_config_v1 or &struct iwl_scan_config
186 */
David Spinadeld2496222014-05-20 12:46:37 +0300187 SCAN_CFG_CMD = 0xc,
Johannes Berg358631b2017-05-16 15:14:19 +0200188
189 /**
190 * @SCAN_REQ_UMAC: uses &struct iwl_scan_req_umac
191 */
David Spinadeld2496222014-05-20 12:46:37 +0300192 SCAN_REQ_UMAC = 0xd,
Johannes Berg358631b2017-05-16 15:14:19 +0200193
194 /**
195 * @SCAN_ABORT_UMAC: uses &struct iwl_umac_scan_abort
196 */
David Spinadeld2496222014-05-20 12:46:37 +0300197 SCAN_ABORT_UMAC = 0xe,
Johannes Berg15fc1962017-03-10 14:01:42 +0100198
199 /**
200 * @SCAN_COMPLETE_UMAC: uses &struct iwl_umac_scan_complete
201 */
David Spinadeld2496222014-05-20 12:46:37 +0300202 SCAN_COMPLETE_UMAC = 0xf,
203
Johannes Berg358631b2017-05-16 15:14:19 +0200204 /**
205 * @BA_WINDOW_STATUS_NOTIFICATION_ID:
206 * uses &struct iwl_ba_window_status_notif
207 */
Sara Sharon3af512d62015-07-22 11:38:40 +0300208 BA_WINDOW_STATUS_NOTIFICATION_ID = 0x13,
209
Johannes Berg15fc1962017-03-10 14:01:42 +0100210 /**
211 * @ADD_STA_KEY:
212 * &struct iwl_mvm_add_sta_key_cmd_v1 or
213 * &struct iwl_mvm_add_sta_key_cmd.
214 */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300215 ADD_STA_KEY = 0x17,
Johannes Berg15fc1962017-03-10 14:01:42 +0100216
217 /**
218 * @ADD_STA:
219 * &struct iwl_mvm_add_sta_cmd or &struct iwl_mvm_add_sta_cmd_v7.
220 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100221 ADD_STA = 0x18,
Johannes Berg358631b2017-05-16 15:14:19 +0200222
Johannes Berg15fc1962017-03-10 14:01:42 +0100223 /**
224 * @REMOVE_STA: &struct iwl_mvm_rm_sta_cmd
225 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100226 REMOVE_STA = 0x19,
227
Johannes Berg358631b2017-05-16 15:14:19 +0200228 /**
229 * @FW_GET_ITEM_CMD: uses &struct iwl_fw_get_item_cmd
230 */
Matti Gottliebe1120182015-07-19 11:15:07 +0300231 FW_GET_ITEM_CMD = 0x1a,
232
Johannes Berge8226a52017-03-31 11:25:52 +0200233 /**
Johannes Berg7b7cab72017-05-02 13:01:49 +0200234 * @TX_CMD: uses &struct iwl_tx_cmd or &struct iwl_tx_cmd_gen2,
Johannes Berga6a62192017-05-03 21:56:04 +0200235 * response in &struct iwl_mvm_tx_resp or
236 * &struct iwl_mvm_tx_resp_v3
Johannes Berge8226a52017-03-31 11:25:52 +0200237 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100238 TX_CMD = 0x1c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100239
240 /**
241 * @TXPATH_FLUSH: &struct iwl_tx_path_flush_cmd
242 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100243 TXPATH_FLUSH = 0x1e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100244
245 /**
246 * @MGMT_MCAST_KEY:
247 * &struct iwl_mvm_mgmt_mcast_key_cmd or
248 * &struct iwl_mvm_mgmt_mcast_key_cmd_v1
249 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100250 MGMT_MCAST_KEY = 0x1f,
251
Avri Altman3edf8ff2014-07-30 11:41:01 +0300252 /* scheduler config */
Johannes Berg15fc1962017-03-10 14:01:42 +0100253 /**
Johannes Berge153c1e2017-03-30 14:23:21 +0200254 * @SCD_QUEUE_CFG: &struct iwl_scd_txq_cfg_cmd for older hardware,
255 * &struct iwl_tx_queue_cfg_cmd with &struct iwl_tx_queue_cfg_rsp
256 * for newer (A000) hardware.
Johannes Berg15fc1962017-03-10 14:01:42 +0100257 */
Avri Altman3edf8ff2014-07-30 11:41:01 +0300258 SCD_QUEUE_CFG = 0x1d,
259
Johannes Berg358631b2017-05-16 15:14:19 +0200260 /**
261 * @WEP_KEY: uses &struct iwl_mvm_wep_key_cmd
262 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100263 WEP_KEY = 0x20,
264
Johannes Berg358631b2017-05-16 15:14:19 +0200265 /**
266 * @SHARED_MEM_CFG:
267 * retrieve shared memory configuration - response in
268 * &struct iwl_shared_mem_cfg
269 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +0200270 SHARED_MEM_CFG = 0x25,
271
Johannes Berg358631b2017-05-16 15:14:19 +0200272 /**
273 * @TDLS_CHANNEL_SWITCH_CMD: uses &struct iwl_tdls_channel_switch_cmd
274 */
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300275 TDLS_CHANNEL_SWITCH_CMD = 0x27,
Johannes Berg358631b2017-05-16 15:14:19 +0200276
277 /**
278 * @TDLS_CHANNEL_SWITCH_NOTIFICATION:
279 * uses &struct iwl_tdls_channel_switch_notif
280 */
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300281 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
Johannes Berg358631b2017-05-16 15:14:19 +0200282
283 /**
284 * @TDLS_CONFIG_CMD:
285 * &struct iwl_tdls_config_cmd, response in &struct iwl_tdls_config_res
286 */
Arik Nemtsov307e4722014-09-15 18:48:59 +0300287 TDLS_CONFIG_CMD = 0xa7,
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300288
Johannes Berg15fc1962017-03-10 14:01:42 +0100289 /**
290 * @MAC_CONTEXT_CMD: &struct iwl_mac_ctx_cmd
291 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100292 MAC_CONTEXT_CMD = 0x28,
Johannes Berg15fc1962017-03-10 14:01:42 +0100293
294 /**
295 * @TIME_EVENT_CMD:
296 * &struct iwl_time_event_cmd, response in &struct iwl_time_event_resp
297 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100298 TIME_EVENT_CMD = 0x29, /* both CMD and response */
Johannes Berg358631b2017-05-16 15:14:19 +0200299
Johannes Berg15fc1962017-03-10 14:01:42 +0100300 /**
301 * @TIME_EVENT_NOTIFICATION: &struct iwl_time_event_notif
302 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100303 TIME_EVENT_NOTIFICATION = 0x2a,
Johannes Berg358631b2017-05-16 15:14:19 +0200304
Johannes Berg15fc1962017-03-10 14:01:42 +0100305 /**
306 * @BINDING_CONTEXT_CMD:
307 * &struct iwl_binding_cmd or &struct iwl_binding_cmd_v1
308 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100309 BINDING_CONTEXT_CMD = 0x2b,
Johannes Berg358631b2017-05-16 15:14:19 +0200310
Johannes Berg15fc1962017-03-10 14:01:42 +0100311 /**
312 * @TIME_QUOTA_CMD: &struct iwl_time_quota_cmd
313 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100314 TIME_QUOTA_CMD = 0x2c,
Johannes Berg358631b2017-05-16 15:14:19 +0200315
316 /**
317 * @NON_QOS_TX_COUNTER_CMD:
318 * command is &struct iwl_nonqos_seq_query_cmd
319 */
Johannes Berg4ac6cb52013-08-08 09:30:13 +0200320 NON_QOS_TX_COUNTER_CMD = 0x2d,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100321
Johannes Berg15fc1962017-03-10 14:01:42 +0100322 /**
323 * @LQ_CMD: using &struct iwl_lq_cmd
324 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100325 LQ_CMD = 0x4e,
326
Johannes Berg15fc1962017-03-10 14:01:42 +0100327 /**
328 * @FW_PAGING_BLOCK_CMD:
Johannes Berg4f2210e2017-06-01 11:37:25 +0200329 * &struct iwl_fw_paging_cmd
Johannes Berg15fc1962017-03-10 14:01:42 +0100330 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300331 FW_PAGING_BLOCK_CMD = 0x4f,
332
Johannes Berg358631b2017-05-16 15:14:19 +0200333 /**
334 * @SCAN_OFFLOAD_REQUEST_CMD: uses &struct iwl_scan_req_lmac
335 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100336 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
Johannes Berg358631b2017-05-16 15:14:19 +0200337
338 /**
339 * @SCAN_OFFLOAD_ABORT_CMD: abort the scan - no further contents
340 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100341 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Johannes Berg358631b2017-05-16 15:14:19 +0200342
343 /**
344 * @HOT_SPOT_CMD: uses &struct iwl_hs20_roc_req
345 */
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300346 HOT_SPOT_CMD = 0x53,
Johannes Berg358631b2017-05-16 15:14:19 +0200347
348 /**
349 * @SCAN_OFFLOAD_COMPLETE:
350 * notification, &struct iwl_periodic_scan_complete
351 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100352 SCAN_OFFLOAD_COMPLETE = 0x6D,
Johannes Berg358631b2017-05-16 15:14:19 +0200353
354 /**
355 * @SCAN_OFFLOAD_UPDATE_PROFILES_CMD:
356 * update scan offload (scheduled scan) profiles/blacklist/etc.
357 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100358 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
Johannes Berg358631b2017-05-16 15:14:19 +0200359
360 /**
361 * @MATCH_FOUND_NOTIFICATION: scan match found
362 */
David Spinadel35a000b2013-08-28 09:29:43 +0300363 MATCH_FOUND_NOTIFICATION = 0xd9,
Johannes Berg358631b2017-05-16 15:14:19 +0200364
365 /**
366 * @SCAN_ITERATION_COMPLETE:
367 * uses &struct iwl_lmac_scan_complete_notif
368 */
David Spinadelfb98be52014-05-04 12:51:10 +0300369 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100370
371 /* Phy */
Johannes Berg15fc1962017-03-10 14:01:42 +0100372 /**
373 * @PHY_CONFIGURATION_CMD: &struct iwl_phy_cfg_cmd
374 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100375 PHY_CONFIGURATION_CMD = 0x6a,
Johannes Berg358631b2017-05-16 15:14:19 +0200376
377 /**
378 * @CALIB_RES_NOTIF_PHY_DB: &struct iwl_calib_res_notif_phy_db
379 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100380 CALIB_RES_NOTIF_PHY_DB = 0x6b,
Johannes Berg358631b2017-05-16 15:14:19 +0200381
382 /**
383 * @PHY_DB_CMD: &struct iwl_phy_db_cmd
384 */
Sara Sharon176aa602016-08-31 19:03:01 +0300385 PHY_DB_CMD = 0x6c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100386
Johannes Berg358631b2017-05-16 15:14:19 +0200387 /**
388 * @TOF_CMD: &struct iwl_tof_config_cmd
389 */
Gregory Greenmance792912015-06-02 18:06:16 +0300390 TOF_CMD = 0x10,
Johannes Berg358631b2017-05-16 15:14:19 +0200391
392 /**
393 * @TOF_NOTIFICATION: &struct iwl_tof_gen_resp_cmd
394 */
Gregory Greenmance792912015-06-02 18:06:16 +0300395 TOF_NOTIFICATION = 0x11,
396
Johannes Berg15fc1962017-03-10 14:01:42 +0100397 /**
398 * @POWER_TABLE_CMD: &struct iwl_device_power_cmd
399 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100400 POWER_TABLE_CMD = 0x77,
Johannes Berg358631b2017-05-16 15:14:19 +0200401
402 /**
403 * @PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION:
404 * &struct iwl_uapsd_misbehaving_ap_notif
405 */
Alexander Bondar175a70b2013-04-14 20:59:37 +0300406 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Johannes Berg358631b2017-05-16 15:14:19 +0200407
408 /**
409 * @LTR_CONFIG: &struct iwl_ltr_config_cmd
410 */
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300411 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100412
Johannes Berg358631b2017-05-16 15:14:19 +0200413 /**
414 * @REPLY_THERMAL_MNG_BACKOFF:
415 * Thermal throttling command
416 */
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300417 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
418
Johannes Berg358631b2017-05-16 15:14:19 +0200419 /**
420 * @DC2DC_CONFIG_CMD:
421 * Set/Get DC2DC frequency tune
422 * Command is &struct iwl_dc2dc_config_cmd,
423 * response is &struct iwl_dc2dc_config_resp
424 */
Matti Gottlieb0becb372015-05-31 09:18:30 +0300425 DC2DC_CONFIG_CMD = 0x83,
426
Johannes Berg15fc1962017-03-10 14:01:42 +0100427 /**
428 * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd
429 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100430 NVM_ACCESS_CMD = 0x88,
431
Johannes Berg358631b2017-05-16 15:14:19 +0200432 /**
433 * @BEACON_NOTIFICATION: &struct iwl_extended_beacon_notif
434 */
Ilan Peer571765c2013-03-05 15:26:03 +0200435 BEACON_NOTIFICATION = 0x90,
Johannes Berg358631b2017-05-16 15:14:19 +0200436
Johannes Bergb7bea642017-03-31 10:48:17 +0200437 /**
438 * @BEACON_TEMPLATE_CMD:
439 * Uses one of &struct iwl_mac_beacon_cmd_v6,
440 * &struct iwl_mac_beacon_cmd_v7 or &struct iwl_mac_beacon_cmd
441 * depending on the device version.
442 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100443 BEACON_TEMPLATE_CMD = 0x91,
Johannes Berg15fc1962017-03-10 14:01:42 +0100444 /**
445 * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
446 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100447 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg15fc1962017-03-10 14:01:42 +0100448
449 /**
450 * @STATISTICS_CMD: &struct iwl_statistics_cmd
451 */
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100452 STATISTICS_CMD = 0x9c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100453
454 /**
455 * @STATISTICS_NOTIFICATION:
456 * one of &struct iwl_notif_statistics_v10,
457 * &struct iwl_notif_statistics_v11,
458 * &struct iwl_notif_statistics_cdb
459 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100460 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg358631b2017-05-16 15:14:19 +0200461
462 /**
463 * @EOSP_NOTIFICATION:
464 * Notify that a service period ended,
465 * &struct iwl_mvm_eosp_notification
466 */
Johannes Berg3e56ead2013-02-15 22:23:18 +0100467 EOSP_NOTIFICATION = 0x9e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100468
469 /**
470 * @REDUCE_TX_POWER_CMD:
471 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
472 */
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300473 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100474
Johannes Berg358631b2017-05-16 15:14:19 +0200475 /**
476 * @CARD_STATE_NOTIFICATION:
477 * Card state (RF/CT kill) notification,
478 * uses &struct iwl_card_state_notif
479 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100480 CARD_STATE_NOTIFICATION = 0xa1,
481
Johannes Berg358631b2017-05-16 15:14:19 +0200482 /**
483 * @MISSED_BEACONS_NOTIFICATION: &struct iwl_missed_beacons_notif
484 */
Hila Gonend64048e2013-03-13 18:00:03 +0200485 MISSED_BEACONS_NOTIFICATION = 0xa2,
486
Johannes Berg15fc1962017-03-10 14:01:42 +0100487 /**
488 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
489 */
Alexander Bondare811ada2013-03-10 15:29:44 +0200490 MAC_PM_POWER_TABLE = 0xa9,
491
Johannes Berg15fc1962017-03-10 14:01:42 +0100492 /**
493 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
494 */
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200495 MFUART_LOAD_NOTIFICATION = 0xb1,
496
Johannes Berg15fc1962017-03-10 14:01:42 +0100497 /**
498 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
499 */
Sara Sharon43413a92015-12-31 11:49:18 +0200500 RSS_CONFIG_CMD = 0xb3,
501
Johannes Berg6857df82017-03-15 14:06:53 +0100502 /**
503 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
504 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100505 REPLY_RX_PHY_CMD = 0xc0,
Johannes Berg6857df82017-03-15 14:06:53 +0100506
507 /**
508 * @REPLY_RX_MPDU_CMD:
509 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
510 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100511 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg358631b2017-05-16 15:14:19 +0200512
513 /**
514 * @FRAME_RELEASE:
515 * Frame release (reorder helper) notification, uses
516 * &struct iwl_frame_release
517 */
Johannes Berg13555e82015-09-02 16:16:49 +0200518 FRAME_RELEASE = 0xc3,
Johannes Berg358631b2017-05-16 15:14:19 +0200519
520 /**
521 * @BA_NOTIF:
522 * BlockAck notification, uses &struct iwl_mvm_compressed_ba_notif
523 * or &struct iwl_mvm_ba_notif depending on the HW
524 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100525 BA_NOTIF = 0xc5,
526
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200527 /* Location Aware Regulatory */
Johannes Berg15fc1962017-03-10 14:01:42 +0100528 /**
529 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
530 */
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200531 MCC_UPDATE_CMD = 0xc8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100532
533 /**
534 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
535 */
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200536 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200537
Johannes Berg358631b2017-05-16 15:14:19 +0200538 /**
539 * @MARKER_CMD: trace marker command, uses &struct iwl_mvm_marker
540 */
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300541 MARKER_CMD = 0xcb,
542
Johannes Berg15fc1962017-03-10 14:01:42 +0100543 /**
544 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
545 */
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200546 BT_PROFILE_NOTIFICATION = 0xce,
Johannes Berg358631b2017-05-16 15:14:19 +0200547
Johannes Berg15fc1962017-03-10 14:01:42 +0100548 /**
549 * @BT_CONFIG: &struct iwl_bt_coex_cmd
550 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300551 BT_CONFIG = 0x9b,
Johannes Berg358631b2017-05-16 15:14:19 +0200552
553 /**
554 * @BT_COEX_UPDATE_CORUN_LUT:
555 * &struct iwl_bt_coex_corun_lut_update_cmd
556 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300557 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
Johannes Berg358631b2017-05-16 15:14:19 +0200558
559 /**
560 * @BT_COEX_UPDATE_REDUCED_TXP:
561 * &struct iwl_bt_coex_reduced_txp_update_cmd
562 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300563 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Johannes Berg358631b2017-05-16 15:14:19 +0200564
Johannes Berg15fc1962017-03-10 14:01:42 +0100565 /**
566 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
567 */
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300568 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200569
Johannes Berg15fc1962017-03-10 14:01:42 +0100570 /**
571 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
572 */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200573 REPLY_SF_CFG_CMD = 0xd1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100574 /**
575 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
576 */
Hila Gonen7df15b12012-12-12 11:16:19 +0200577 REPLY_BEACON_FILTERING_CMD = 0xd2,
578
Johannes Berg358631b2017-05-16 15:14:19 +0200579 /**
580 * @DTS_MEASUREMENT_NOTIFICATION:
581 * &struct iwl_dts_measurement_notif_v1 or
582 * &struct iwl_dts_measurement_notif_v2
583 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300584 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
585
Johannes Berg358631b2017-05-16 15:14:19 +0200586 /**
587 * @LDBG_CONFIG_CMD: configure continuous trace recording
588 */
Golan Ben Ami321c2102015-07-27 17:02:35 +0300589 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg358631b2017-05-16 15:14:19 +0200590
591 /**
592 * @DEBUG_LOG_MSG: Debugging log data from firmware
593 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100594 DEBUG_LOG_MSG = 0xf7,
595
Johannes Berg358631b2017-05-16 15:14:19 +0200596 /**
597 * @BCAST_FILTER_CMD: &struct iwl_bcast_filter_cmd
598 */
Eliad Pellerc87163b2014-01-08 10:11:11 +0200599 BCAST_FILTER_CMD = 0xcf,
Johannes Berg358631b2017-05-16 15:14:19 +0200600
601 /**
602 * @MCAST_FILTER_CMD: &struct iwl_mcast_filter_cmd
603 */
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300604 MCAST_FILTER_CMD = 0xd0,
605
Johannes Berg15fc1962017-03-10 14:01:42 +0100606 /**
607 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
608 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100609 D3_CONFIG_CMD = 0xd3,
Johannes Berg358631b2017-05-16 15:14:19 +0200610
611 /**
612 * @PROT_OFFLOAD_CONFIG_CMD: Depending on firmware, uses one of
613 * &struct iwl_proto_offload_cmd_v1, &struct iwl_proto_offload_cmd_v2,
614 * &struct iwl_proto_offload_cmd_v3_small,
615 * &struct iwl_proto_offload_cmd_v3_large
616 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100617 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
Johannes Berg358631b2017-05-16 15:14:19 +0200618
619 /**
620 * @OFFLOADS_QUERY_CMD:
621 * No data in command, response in &struct iwl_wowlan_status
622 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100623 OFFLOADS_QUERY_CMD = 0xd5,
Johannes Berg358631b2017-05-16 15:14:19 +0200624
625 /**
626 * @REMOTE_WAKE_CONFIG_CMD: &struct iwl_wowlan_remote_wake_config
627 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100628 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Johannes Berg358631b2017-05-16 15:14:19 +0200629
630 /**
631 * @D0I3_END_CMD: End D0i3/D3 state, no command data
632 */
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300633 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100634
Johannes Berg15fc1962017-03-10 14:01:42 +0100635 /**
636 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
637 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100638 WOWLAN_PATTERNS = 0xe0,
Johannes Berg15fc1962017-03-10 14:01:42 +0100639
640 /**
641 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
642 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100643 WOWLAN_CONFIGURATION = 0xe1,
Johannes Berg358631b2017-05-16 15:14:19 +0200644
Johannes Berg15fc1962017-03-10 14:01:42 +0100645 /**
646 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
647 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100648 WOWLAN_TSC_RSC_PARAM = 0xe2,
Johannes Berg358631b2017-05-16 15:14:19 +0200649
Johannes Berg15fc1962017-03-10 14:01:42 +0100650 /**
651 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
652 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100653 WOWLAN_TKIP_PARAM = 0xe3,
Johannes Berg358631b2017-05-16 15:14:19 +0200654
Johannes Berg15fc1962017-03-10 14:01:42 +0100655 /**
656 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
657 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100658 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
Johannes Berg358631b2017-05-16 15:14:19 +0200659
Johannes Berg15fc1962017-03-10 14:01:42 +0100660 /**
661 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
662 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100663 WOWLAN_GET_STATUSES = 0xe5,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100664
Johannes Berg358631b2017-05-16 15:14:19 +0200665 /**
666 * @SCAN_OFFLOAD_PROFILES_QUERY_CMD:
667 * No command data, response is &struct iwl_scan_offload_profiles_query
668 */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200669 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100670};
671
Sharon Dvir39bdb172015-10-15 18:18:09 +0300672/* Please keep this enum *SORTED* by hex value.
673 * Needed for binary search, otherwise a warning will be triggered.
674 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200675enum iwl_mac_conf_subcmd_ids {
676 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
677 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200678 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200679};
680
Johannes Berg15fc1962017-03-10 14:01:42 +0100681/**
682 * enum iwl_phy_ops_subcmd_ids - PHY group commands
683 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300684enum iwl_phy_ops_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200685 /**
686 * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
687 * Uses either &struct iwl_dts_measurement_cmd or
688 * &struct iwl_ext_dts_measurement_cmd
689 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300690 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200691
692 /**
693 * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
694 */
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200695 CTDP_CONFIG_CMD = 0x03,
Johannes Berg15fc1962017-03-10 14:01:42 +0100696
697 /**
698 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
699 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200700 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Johannes Berg358631b2017-05-16 15:14:19 +0200701
702 /**
703 * @GEO_TX_POWER_LIMIT: &struct iwl_geo_tx_power_profiles_cmd
704 */
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200705 GEO_TX_POWER_LIMIT = 0x05,
Johannes Berg358631b2017-05-16 15:14:19 +0200706
707 /**
708 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
709 */
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200710 CT_KILL_NOTIFICATION = 0xFE,
Johannes Berg358631b2017-05-16 15:14:19 +0200711
712 /**
713 * @DTS_MEASUREMENT_NOTIF_WIDE:
714 * &struct iwl_dts_measurement_notif_v1 or
715 * &struct iwl_dts_measurement_notif_v2
716 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300717 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
718};
719
Johannes Berg15fc1962017-03-10 14:01:42 +0100720/**
721 * enum iwl_system_subcmd_ids - system group command IDs
722 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200723enum iwl_system_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100724 /**
725 * @SHARED_MEM_CFG_CMD:
726 * response in &struct iwl_shared_mem_cfg or
Johannes Bergb4f48982017-06-01 09:06:11 +0200727 * &struct iwl_shared_mem_cfg_v2
Johannes Berg15fc1962017-03-10 14:01:42 +0100728 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200729 SHARED_MEM_CFG_CMD = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200730
731 /**
732 * @INIT_EXTENDED_CFG_CMD: &struct iwl_init_extended_cfg_cmd
733 */
Sara Sharon4399caa2016-12-11 10:32:42 +0200734 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200735};
736
Johannes Berg15fc1962017-03-10 14:01:42 +0100737/**
738 * enum iwl_data_path_subcmd_ids - data path group commands
739 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200740enum iwl_data_path_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100741 /**
742 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
743 */
Liad Kaufman97d5be72015-08-31 14:33:23 +0300744 DQA_ENABLE_CMD = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200745
746 /**
747 * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd
748 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200749 UPDATE_MU_GROUPS_CMD = 0x1,
Johannes Berg358631b2017-05-16 15:14:19 +0200750
751 /**
752 * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd
753 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200754 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg358631b2017-05-16 15:14:19 +0200755
756 /**
757 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
758 */
Johannes Berg65e25482016-04-13 14:24:22 +0200759 STA_PM_NOTIF = 0xFD,
Johannes Berg358631b2017-05-16 15:14:19 +0200760
761 /**
762 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
763 */
Sara Sharonf92659a2016-02-03 15:04:49 +0200764 MU_GROUP_MGMT_NOTIF = 0xFE,
Johannes Berg358631b2017-05-16 15:14:19 +0200765
766 /**
767 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
768 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200769 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200770};
771
Johannes Berg358631b2017-05-16 15:14:19 +0200772/**
773 * enum iwl_prot_offload_subcmd_ids - protocol offload commands
774 */
Sara Sharon0db056d2015-12-29 11:07:15 +0200775enum iwl_prot_offload_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200776 /**
777 * @STORED_BEACON_NTF: &struct iwl_stored_beacon_notif
778 */
Sara Sharon0db056d2015-12-29 11:07:15 +0200779 STORED_BEACON_NTF = 0xFF,
780};
781
Johannes Berg358631b2017-05-16 15:14:19 +0200782/**
783 * enum iwl_regulatory_and_nvm_subcmd_ids - regulatory/NVM commands
784 */
Sara Sharon1f370652016-08-31 18:13:57 +0300785enum iwl_regulatory_and_nvm_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200786 /**
787 * @NVM_ACCESS_COMPLETE: &struct iwl_nvm_access_complete_cmd
788 */
Sara Sharon1f370652016-08-31 18:13:57 +0300789 NVM_ACCESS_COMPLETE = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200790
791 /**
792 * @NVM_GET_INFO:
793 * Command is &struct iwl_nvm_get_info,
794 * response is &struct iwl_nvm_get_info_rsp
795 */
Sara Sharone9e1ba32017-01-08 16:46:14 +0200796 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300797};
798
Johannes Berge6138c92017-05-04 10:00:03 +0200799/**
800 * enum iwl_debug_cmds - debug commands
801 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200802enum iwl_debug_cmds {
Johannes Berge6138c92017-05-04 10:00:03 +0200803 /**
804 * @LMAC_RD_WR:
805 * LMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
806 * &struct iwl_dbg_mem_access_rsp
807 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400808 LMAC_RD_WR = 0x0,
Johannes Berge6138c92017-05-04 10:00:03 +0200809 /**
810 * @UMAC_RD_WR:
811 * UMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
812 * &struct iwl_dbg_mem_access_rsp
813 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400814 UMAC_RD_WR = 0x1,
Johannes Berge6138c92017-05-04 10:00:03 +0200815 /**
816 * @MFU_ASSERT_DUMP_NTF:
817 * &struct iwl_mfu_assert_dump_notif
818 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200819 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400820};
821
Johannes Berg72361c32017-03-09 17:06:45 +0100822/**
823 * enum iwl_mvm_command_groups - command groups for the firmware
824 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
825 * @LONG_GROUP: legacy group with long header, also uses command IDs
826 * from &enum iwl_legacy_cmds
827 * @SYSTEM_GROUP: system group, uses command IDs from
828 * &enum iwl_system_subcmd_ids
829 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
830 * &enum iwl_mac_conf_subcmd_ids
831 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
832 * &enum iwl_phy_ops_subcmd_ids
833 * @DATA_PATH_GROUP: data path group, uses command IDs from
834 * &enum iwl_data_path_subcmd_ids
Johannes Berg72361c32017-03-09 17:06:45 +0100835 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
836 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
837 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
838 * &enum iwl_prot_offload_subcmd_ids
839 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
840 * &enum iwl_regulatory_and_nvm_subcmd_ids
841 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
842 */
843enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300844 LEGACY_GROUP = 0x0,
845 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200846 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200847 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300848 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200849 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200850 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300851 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400852 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300853};
854
Johannes Berg8ca151b2013-01-24 14:25:36 +0100855/**
856 * struct iwl_cmd_response - generic response struct for most commands
857 * @status: status of the command asked, changes for each one
858 */
859struct iwl_cmd_response {
860 __le32 status;
861};
862
863/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300864 * struct iwl_dqa_enable_cmd
865 * @cmd_queue: the TXQ number of the command queue
866 */
867struct iwl_dqa_enable_cmd {
868 __le32 cmd_queue;
869} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
870
871/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100872 * struct iwl_tx_ant_cfg_cmd
873 * @valid: valid antenna configuration
874 */
875struct iwl_tx_ant_cfg_cmd {
876 __le32 valid;
877} __packed;
878
Johannes Berg31a658b2017-03-09 15:56:57 +0100879/**
880 * struct iwl_calib_ctrl - Calibration control struct.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100881 * Sent as part of the phy configuration command.
882 * @flow_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100883 * flow triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100884 * @event_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100885 * event triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100886 */
887struct iwl_calib_ctrl {
888 __le32 flow_trigger;
889 __le32 event_trigger;
890} __packed;
891
892/* This enum defines the bitmap of various calibrations to enable in both
893 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
894 */
895enum iwl_calib_cfg {
896 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
897 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
898 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
899 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
900 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
901 IWL_CALIB_CFG_DC_IDX = BIT(5),
902 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
903 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
904 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
905 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
906 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
907 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
908 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
909 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
910 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
911 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
912 IWL_CALIB_CFG_DAC_IDX = BIT(16),
913 IWL_CALIB_CFG_ABS_IDX = BIT(17),
914 IWL_CALIB_CFG_AGC_IDX = BIT(18),
915};
916
Johannes Berg31a658b2017-03-09 15:56:57 +0100917/**
918 * struct iwl_phy_cfg_cmd - Phy configuration command
919 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
920 * @calib_control: calibration control data
Johannes Berg8ca151b2013-01-24 14:25:36 +0100921 */
922struct iwl_phy_cfg_cmd {
923 __le32 phy_cfg;
924 struct iwl_calib_ctrl calib_control;
925} __packed;
926
927#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
928#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
929#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
930#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
931#define PHY_CFG_TX_CHAIN_A BIT(8)
932#define PHY_CFG_TX_CHAIN_B BIT(9)
933#define PHY_CFG_TX_CHAIN_C BIT(10)
934#define PHY_CFG_RX_CHAIN_A BIT(12)
935#define PHY_CFG_RX_CHAIN_B BIT(13)
936#define PHY_CFG_RX_CHAIN_C BIT(14)
937
938
Johannes Bergd69f0a22017-03-14 10:58:16 +0100939/**
940 * enum iwl_nvm_access_op - NVM access opcode
941 * @IWL_NVM_READ: read NVM
942 * @IWL_NVM_WRITE: write NVM
943 */
944enum iwl_nvm_access_op {
945 IWL_NVM_READ = 0,
946 IWL_NVM_WRITE = 1,
947};
948
949/**
950 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
951 * @NVM_ACCESS_TARGET_CACHE: access the cache
952 * @NVM_ACCESS_TARGET_OTP: access the OTP
953 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
954 */
955enum iwl_nvm_access_target {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100956 NVM_ACCESS_TARGET_CACHE = 0,
957 NVM_ACCESS_TARGET_OTP = 1,
958 NVM_ACCESS_TARGET_EEPROM = 2,
959};
960
Johannes Bergd69f0a22017-03-14 10:58:16 +0100961/**
962 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
963 * @NVM_SECTION_TYPE_SW: software section
964 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
965 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
966 * @NVM_SECTION_TYPE_PRODUCTION: production section
967 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
968 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
969 * @NVM_MAX_NUM_SECTIONS: number of sections
970 */
971enum iwl_nvm_section_type {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200972 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200973 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200974 NVM_SECTION_TYPE_CALIBRATION = 4,
975 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200976 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200977 NVM_SECTION_TYPE_PHY_SKU = 12,
978 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100979};
980
981/**
Johannes Berg67625862017-03-14 11:01:27 +0100982 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
983 * @op_code: &enum iwl_nvm_access_op
984 * @target: &enum iwl_nvm_access_target
985 * @type: &enum iwl_nvm_section_type
Johannes Berg8ca151b2013-01-24 14:25:36 +0100986 * @offset: offset in bytes into the section
987 * @length: in bytes, to read/write
988 * @data: if write operation, the data to write. On read its empty
989 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200990struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100991 u8 op_code;
992 u8 target;
993 __le16 type;
994 __le16 offset;
995 __le16 length;
996 u8 data[];
997} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
998
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300999#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
1000
Johannes Berg3b43fbc2017-03-13 21:48:39 +01001001/**
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001002 * struct iwl_fw_paging_cmd - paging layout
1003 *
1004 * (FW_PAGING_BLOCK_CMD = 0x4f)
1005 *
1006 * Send to FW the paging layout in the driver.
1007 *
1008 * @flags: various flags for the command
1009 * @block_size: the block size in powers of 2
1010 * @block_num: number of blocks specified in the command.
1011 * @device_phy_addr: virtual addresses from device side
Johannes Berg3b43fbc2017-03-13 21:48:39 +01001012 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001013struct iwl_fw_paging_cmd {
1014 __le32 flags;
1015 __le32 block_size;
1016 __le32 block_num;
Johannes Berg4f2210e2017-06-01 11:37:25 +02001017 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
1018} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001019
Matti Gottliebe1120182015-07-19 11:15:07 +03001020/*
1021 * Fw items ID's
1022 *
1023 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
1024 * download
1025 */
1026enum iwl_fw_item_id {
1027 IWL_FW_ITEM_ID_PAGING = 3,
1028};
1029
1030/*
1031 * struct iwl_fw_get_item_cmd - get an item from the fw
1032 */
1033struct iwl_fw_get_item_cmd {
1034 __le32 item_id;
1035} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
1036
Golan Ben Ami321c2102015-07-27 17:02:35 +03001037#define CONT_REC_COMMAND_SIZE 80
1038#define ENABLE_CONT_RECORDING 0x15
1039#define DISABLE_CONT_RECORDING 0x16
1040
1041/*
1042 * struct iwl_continuous_record_mode - recording mode
1043 */
1044struct iwl_continuous_record_mode {
1045 __le16 enable_recording;
1046} __packed;
1047
1048/*
1049 * struct iwl_continuous_record_cmd - enable/disable continuous recording
1050 */
1051struct iwl_continuous_record_cmd {
1052 struct iwl_continuous_record_mode record_mode;
1053 u8 pad[CONT_REC_COMMAND_SIZE -
1054 sizeof(struct iwl_continuous_record_mode)];
1055} __packed;
1056
Matti Gottliebe1120182015-07-19 11:15:07 +03001057struct iwl_fw_get_item_resp {
1058 __le32 item_id;
1059 __le32 item_byte_cnt;
1060 __le32 item_val;
1061} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
1062
Johannes Berg8ca151b2013-01-24 14:25:36 +01001063/**
1064 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
1065 * @offset: offset in bytes into the section
1066 * @length: in bytes, either how much was written or read
1067 * @type: NVM_SECTION_TYPE_*
1068 * @status: 0 for success, fail otherwise
1069 * @data: if read operation, the data returned. Empty on write.
1070 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +02001071struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +01001072 __le16 offset;
1073 __le16 length;
1074 __le16 type;
1075 __le16 status;
1076 u8 data[];
1077} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
1078
1079/* MVM_ALIVE 0x1 */
1080
1081/* alive response is_valid values */
1082#define ALIVE_RESP_UCODE_OK BIT(0)
1083#define ALIVE_RESP_RFKILL BIT(1)
1084
1085/* alive response ver_type values */
1086enum {
1087 FW_TYPE_HW = 0,
1088 FW_TYPE_PROT = 1,
1089 FW_TYPE_AP = 2,
1090 FW_TYPE_WOWLAN = 3,
1091 FW_TYPE_TIMING = 4,
1092 FW_TYPE_WIPAN = 5
1093};
1094
1095/* alive response ver_subtype values */
1096enum {
1097 FW_SUBTYPE_FULL_FEATURE = 0,
1098 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
1099 FW_SUBTYPE_REDUCED = 2,
1100 FW_SUBTYPE_ALIVE_ONLY = 3,
1101 FW_SUBTYPE_WOWLAN = 4,
1102 FW_SUBTYPE_AP_SUBTYPE = 5,
1103 FW_SUBTYPE_WIPAN = 6,
1104 FW_SUBTYPE_INITIALIZE = 9
1105};
1106
1107#define IWL_ALIVE_STATUS_ERR 0xDEAD
1108#define IWL_ALIVE_STATUS_OK 0xCAFE
1109
1110#define IWL_ALIVE_FLG_RFKILL BIT(0)
1111
Sara Sharon5c228d62016-11-24 13:48:27 +02001112struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001113 __le32 ucode_minor;
1114 __le32 ucode_major;
1115 u8 ver_subtype;
1116 u8 ver_type;
1117 u8 mac;
1118 u8 opt;
1119 __le32 timestamp;
1120 __le32 error_event_table_ptr; /* SRAM address for error log */
1121 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
1122 __le32 cpu_register_ptr;
1123 __le32 dbgm_config_ptr;
1124 __le32 alive_counter_ptr;
1125 __le32 scd_base_ptr; /* SRAM address for SCD */
1126 __le32 st_fwrd_addr; /* pointer to Store and forward */
1127 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +02001128} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
1129
1130struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001131 __le32 umac_minor; /* UMAC version: minor */
1132 __le32 umac_major; /* UMAC version: major */
1133 __le32 error_info_addr; /* SRAM address for UMAC error log */
1134 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +02001135} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
1136
1137struct mvm_alive_resp_v3 {
1138 __le16 status;
1139 __le16 flags;
1140 struct iwl_lmac_alive lmac_data;
1141 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001142} __packed; /* ALIVE_RES_API_S_VER_3 */
1143
Sara Sharon5c228d62016-11-24 13:48:27 +02001144struct mvm_alive_resp {
1145 __le16 status;
1146 __le16 flags;
1147 struct iwl_lmac_alive lmac_data[2];
1148 struct iwl_umac_alive umac_data;
1149} __packed; /* ALIVE_RES_API_S_VER_4 */
1150
Johannes Berg8ca151b2013-01-24 14:25:36 +01001151/* Error response/notification */
1152enum {
1153 FW_ERR_UNKNOWN_CMD = 0x0,
1154 FW_ERR_INVALID_CMD_PARAM = 0x1,
1155 FW_ERR_SERVICE = 0x2,
1156 FW_ERR_ARC_MEMORY = 0x3,
1157 FW_ERR_ARC_CODE = 0x4,
1158 FW_ERR_WATCH_DOG = 0x5,
1159 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
1160 FW_ERR_WEP_KEY_SIZE = 0x11,
1161 FW_ERR_OBSOLETE_FUNC = 0x12,
1162 FW_ERR_UNEXPECTED = 0xFE,
1163 FW_ERR_FATAL = 0xFF
1164};
1165
1166/**
1167 * struct iwl_error_resp - FW error indication
1168 * ( REPLY_ERROR = 0x2 )
1169 * @error_type: one of FW_ERR_*
1170 * @cmd_id: the command ID for which the error occured
Johannes Bergacf91dd2017-05-16 16:15:42 +02001171 * @reserved1: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +01001172 * @bad_cmd_seq_num: sequence number of the erroneous command
1173 * @error_service: which service created the error, applicable only if
1174 * error_type = 2, otherwise 0
1175 * @timestamp: TSF in usecs.
1176 */
1177struct iwl_error_resp {
1178 __le32 error_type;
1179 u8 cmd_id;
1180 u8 reserved1;
1181 __le16 bad_cmd_seq_num;
1182 __le32 error_service;
1183 __le64 timestamp;
1184} __packed;
1185
1186
1187/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001188#define MAX_MACS_IN_BINDING (3)
1189#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +01001190
Johannes Bergd69f0a22017-03-14 10:58:16 +01001191/**
1192 * enum iwl_mvm_id_and_color - ID and color fields in context dword
1193 * @FW_CTXT_ID_POS: position of the ID
1194 * @FW_CTXT_ID_MSK: mask of the ID
1195 * @FW_CTXT_COLOR_POS: position of the color
1196 * @FW_CTXT_COLOR_MSK: mask of the color
1197 * @FW_CTXT_INVALID: value used to indicate unused/invalid
1198 */
1199enum iwl_mvm_id_and_color {
1200 FW_CTXT_ID_POS = 0,
1201 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
1202 FW_CTXT_COLOR_POS = 8,
1203 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
1204 FW_CTXT_INVALID = 0xffffffff,
1205};
Johannes Berg8ca151b2013-01-24 14:25:36 +01001206
1207#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
1208 (_color << FW_CTXT_COLOR_POS))
1209
1210/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +02001211enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +01001212 FW_CTXT_ACTION_STUB = 0,
1213 FW_CTXT_ACTION_ADD,
1214 FW_CTXT_ACTION_MODIFY,
1215 FW_CTXT_ACTION_REMOVE,
1216 FW_CTXT_ACTION_NUM
1217}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
1218
1219/* Time Events */
1220
1221/* Time Event types, according to MAC type */
1222enum iwl_time_event_type {
1223 /* BSS Station Events */
1224 TE_BSS_STA_AGGRESSIVE_ASSOC,
1225 TE_BSS_STA_ASSOC,
1226 TE_BSS_EAP_DHCP_PROT,
1227 TE_BSS_QUIET_PERIOD,
1228
1229 /* P2P Device Events */
1230 TE_P2P_DEVICE_DISCOVERABLE,
1231 TE_P2P_DEVICE_LISTEN,
1232 TE_P2P_DEVICE_ACTION_SCAN,
1233 TE_P2P_DEVICE_FULL_SCAN,
1234
1235 /* P2P Client Events */
1236 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
1237 TE_P2P_CLIENT_ASSOC,
1238 TE_P2P_CLIENT_QUIET_PERIOD,
1239
1240 /* P2P GO Events */
1241 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02001242 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +01001243 TE_P2P_GO_CT_WINDOW,
1244
1245 /* WiDi Sync Events */
1246 TE_WIDI_TX_SYNC,
1247
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001248 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +03001249 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001250
Johannes Berg8ca151b2013-01-24 14:25:36 +01001251 TE_MAX
1252}; /* MAC_EVENT_TYPE_API_E_VER_1 */
1253
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001254
1255
1256/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001257
1258/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001259 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1260 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1261 * the first fragment is scheduled.
1262 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1263 * the first 2 fragments are scheduled.
1264 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1265 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001266 *
1267 * Other than the constant defined above, specifying a fragmentation value 'x'
1268 * means that the event can be fragmented but only the first 'x' will be
1269 * scheduled.
1270 */
1271enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001272 TE_V1_FRAG_NONE = 0,
1273 TE_V1_FRAG_SINGLE = 1,
1274 TE_V1_FRAG_DUAL = 2,
1275 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +01001276};
1277
Johannes Berg8ca151b2013-01-24 14:25:36 +01001278/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001279#define TE_V1_FRAG_MAX_MSK 0x0fffffff
1280/* Repeat the time event endlessly (until removed) */
1281#define TE_V1_REPEAT_ENDLESS 0xffffffff
1282/* If a Time Event has bounded repetitions, this is the maximal value */
1283#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1284
1285/* Time Event dependencies: none, on another TE, or in a specific time */
1286enum {
1287 TE_V1_INDEPENDENT = 0,
1288 TE_V1_DEP_OTHER = BIT(0),
1289 TE_V1_DEP_TSF = BIT(1),
1290 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1291}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1292
1293/*
1294 * @TE_V1_NOTIF_NONE: no notifications
1295 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1296 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1297 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1298 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1299 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1300 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1301 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1302 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1303 *
1304 * Supported Time event notifications configuration.
1305 * A notification (both event and fragment) includes a status indicating weather
1306 * the FW was able to schedule the event or not. For fragment start/end
1307 * notification the status is always success. There is no start/end fragment
1308 * notification for monolithic events.
1309 */
1310enum {
1311 TE_V1_NOTIF_NONE = 0,
1312 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1313 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1314 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1315 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1316 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1317 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1318 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1319 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1320}; /* MAC_EVENT_ACTION_API_E_VER_2 */
1321
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001322/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001323
1324/*
1325 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1326 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1327 * the first fragment is scheduled.
1328 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1329 * the first 2 fragments are scheduled.
1330 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1331 * number of fragments are valid.
1332 *
1333 * Other than the constant defined above, specifying a fragmentation value 'x'
1334 * means that the event can be fragmented but only the first 'x' will be
1335 * scheduled.
1336 */
1337enum {
1338 TE_V2_FRAG_NONE = 0,
1339 TE_V2_FRAG_SINGLE = 1,
1340 TE_V2_FRAG_DUAL = 2,
1341 TE_V2_FRAG_MAX = 0xfe,
1342 TE_V2_FRAG_ENDLESS = 0xff
1343};
1344
1345/* Repeat the time event endlessly (until removed) */
1346#define TE_V2_REPEAT_ENDLESS 0xff
1347/* If a Time Event has bounded repetitions, this is the maximal value */
1348#define TE_V2_REPEAT_MAX 0xfe
1349
1350#define TE_V2_PLACEMENT_POS 12
1351#define TE_V2_ABSENCE_POS 15
1352
Johannes Bergd69f0a22017-03-14 10:58:16 +01001353/**
1354 * enum iwl_time_event_policy - Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001355 * A notification (both event and fragment) includes a status indicating weather
1356 * the FW was able to schedule the event or not. For fragment start/end
1357 * notification the status is always success. There is no start/end fragment
1358 * notification for monolithic events.
1359 *
1360 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1361 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1362 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1363 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1364 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1365 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1366 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1367 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1368 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
Johannes Bergd69f0a22017-03-14 10:58:16 +01001369 * @T2_V2_START_IMMEDIATELY: start time event immediately
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001370 * @TE_V2_DEP_OTHER: depends on another time event
1371 * @TE_V2_DEP_TSF: depends on a specific time
1372 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1373 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1374 */
Johannes Bergd69f0a22017-03-14 10:58:16 +01001375enum iwl_time_event_policy {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001376 TE_V2_DEFAULT_POLICY = 0x0,
1377
1378 /* notifications (event start/stop, fragment start/stop) */
1379 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1380 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1381 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1382 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1383
1384 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1385 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1386 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1387 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +02001388 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001389
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001390 /* placement characteristics */
1391 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1392 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1393 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1394
1395 /* are we present or absent during the Time Event. */
1396 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1397};
1398
1399/**
Johannes Berg67625862017-03-14 11:01:27 +01001400 * struct iwl_time_event_cmd - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001401 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1402 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1403 * ( TIME_EVENT_CMD = 0x29 )
Johannes Berg67625862017-03-14 11:01:27 +01001404 * @id_and_color: ID and color of the relevant MAC,
1405 * &enum iwl_mvm_id_and_color
1406 * @action: action to perform, one of &enum iwl_phy_ctxt_action
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001407 * @id: this field has two meanings, depending on the action:
1408 * If the action is ADD, then it means the type of event to add.
1409 * For all other actions it is the unique event ID assigned when the
1410 * event was added by the FW.
1411 * @apply_time: When to start the Time Event (in GP2)
1412 * @max_delay: maximum delay to event's start (apply time), in TU
1413 * @depends_on: the unique ID of the event we depend on (if any)
1414 * @interval: interval between repetitions, in TU
1415 * @duration: duration of event in TU
1416 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1417 * @max_frags: maximal number of fragments the Time Event can be divided to
1418 * @policy: defines whether uCode shall notify the host or other uCode modules
1419 * on event and/or fragment start and/or end
1420 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1421 * TE_EVENT_SOCIOPATHIC
Johannes Berg67625862017-03-14 11:01:27 +01001422 * using TE_ABSENCE and using TE_NOTIF_*,
1423 * &enum iwl_time_event_policy
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001424 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001425struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001426 /* COMMON_INDEX_HDR_API_S_VER_1 */
1427 __le32 id_and_color;
1428 __le32 action;
1429 __le32 id;
1430 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1431 __le32 apply_time;
1432 __le32 max_delay;
1433 __le32 depends_on;
1434 __le32 interval;
1435 __le32 duration;
1436 u8 repeat;
1437 u8 max_frags;
1438 __le16 policy;
1439} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1440
Johannes Berg8ca151b2013-01-24 14:25:36 +01001441/**
1442 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1443 * @status: bit 0 indicates success, all others specify errors
1444 * @id: the Time Event type
1445 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
Johannes Berg67625862017-03-14 11:01:27 +01001446 * @id_and_color: ID and color of the relevant MAC,
1447 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001448 */
1449struct iwl_time_event_resp {
1450 __le32 status;
1451 __le32 id;
1452 __le32 unique_id;
1453 __le32 id_and_color;
1454} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1455
1456/**
1457 * struct iwl_time_event_notif - notifications of time event start/stop
1458 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1459 * @timestamp: action timestamp in GP2
1460 * @session_id: session's unique id
1461 * @unique_id: unique id of the Time Event itself
1462 * @id_and_color: ID and color of the relevant MAC
Johannes Berg67625862017-03-14 11:01:27 +01001463 * @action: &enum iwl_time_event_policy
Johannes Berg8ca151b2013-01-24 14:25:36 +01001464 * @status: true if scheduled, false otherwise (not executed)
1465 */
1466struct iwl_time_event_notif {
1467 __le32 timestamp;
1468 __le32 session_id;
1469 __le32 unique_id;
1470 __le32 id_and_color;
1471 __le32 action;
1472 __le32 status;
1473} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1474
1475
1476/* Bindings and Time Quota */
1477
1478/**
Johannes Berg4d151c22017-03-14 11:04:06 +01001479 * struct iwl_binding_cmd_v1 - configuring bindings
1480 * ( BINDING_CONTEXT_CMD = 0x2b )
1481 * @id_and_color: ID and color of the relevant Binding,
1482 * &enum iwl_mvm_id_and_color
1483 * @action: action to perform, one of FW_CTXT_ACTION_*
1484 * @macs: array of MAC id and colors which belong to the binding,
1485 * &enum iwl_mvm_id_and_color
1486 * @phy: PHY id and color which belongs to the binding,
1487 * &enum iwl_mvm_id_and_color
1488 */
1489struct iwl_binding_cmd_v1 {
1490 /* COMMON_INDEX_HDR_API_S_VER_1 */
1491 __le32 id_and_color;
1492 __le32 action;
1493 /* BINDING_DATA_API_S_VER_1 */
1494 __le32 macs[MAX_MACS_IN_BINDING];
1495 __le32 phy;
1496} __packed; /* BINDING_CMD_API_S_VER_1 */
1497
1498/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001499 * struct iwl_binding_cmd - configuring bindings
1500 * ( BINDING_CONTEXT_CMD = 0x2b )
Johannes Berg67625862017-03-14 11:01:27 +01001501 * @id_and_color: ID and color of the relevant Binding,
1502 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001503 * @action: action to perform, one of FW_CTXT_ACTION_*
1504 * @macs: array of MAC id and colors which belong to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001505 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001506 * @phy: PHY id and color which belongs to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001507 * &enum iwl_mvm_id_and_color
Sara Sharon9415af72016-11-17 13:57:32 +02001508 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001509 */
1510struct iwl_binding_cmd {
1511 /* COMMON_INDEX_HDR_API_S_VER_1 */
1512 __le32 id_and_color;
1513 __le32 action;
1514 /* BINDING_DATA_API_S_VER_1 */
1515 __le32 macs[MAX_MACS_IN_BINDING];
1516 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001517 __le32 lmac_id;
1518} __packed; /* BINDING_CMD_API_S_VER_2 */
1519
Johannes Berg4d151c22017-03-14 11:04:06 +01001520#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
Sara Sharon9415af72016-11-17 13:57:32 +02001521#define IWL_LMAC_24G_INDEX 0
1522#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001523
Ilan Peer35adfd62013-02-04 13:16:24 +02001524/* The maximal number of fragments in the FW's schedule session */
1525#define IWL_MVM_MAX_QUOTA 128
1526
Johannes Berg8ca151b2013-01-24 14:25:36 +01001527/**
1528 * struct iwl_time_quota_data - configuration of time quota per binding
Johannes Berg67625862017-03-14 11:01:27 +01001529 * @id_and_color: ID and color of the relevant Binding,
1530 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001531 * @quota: absolute time quota in TU. The scheduler will try to divide the
1532 * remainig quota (after Time Events) according to this quota.
1533 * @max_duration: max uninterrupted context duration in TU
1534 */
1535struct iwl_time_quota_data {
1536 __le32 id_and_color;
1537 __le32 quota;
1538 __le32 max_duration;
1539} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1540
1541/**
1542 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1543 * ( TIME_QUOTA_CMD = 0x2c )
1544 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001545 * Note: on non-CDB the fourth one is the auxilary mac and is
1546 * essentially zero.
1547 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001548 */
1549struct iwl_time_quota_cmd {
1550 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1551} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1552
1553
1554/* PHY context */
1555
1556/* Supported bands */
1557#define PHY_BAND_5 (0)
1558#define PHY_BAND_24 (1)
1559
1560/* Supported channel width, vary if there is VHT support */
1561#define PHY_VHT_CHANNEL_MODE20 (0x0)
1562#define PHY_VHT_CHANNEL_MODE40 (0x1)
1563#define PHY_VHT_CHANNEL_MODE80 (0x2)
1564#define PHY_VHT_CHANNEL_MODE160 (0x3)
1565
1566/*
1567 * Control channel position:
1568 * For legacy set bit means upper channel, otherwise lower.
1569 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1570 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1571 * center_freq
1572 * |
1573 * 40Mhz |_______|_______|
1574 * 80Mhz |_______|_______|_______|_______|
1575 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1576 * code 011 010 001 000 | 100 101 110 111
1577 */
1578#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1579#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1580#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1581#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1582#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1583#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1584#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1585#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1586
1587/*
1588 * @band: PHY_BAND_*
1589 * @channel: channel number
1590 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1591 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1592 */
1593struct iwl_fw_channel_info {
1594 u8 band;
1595 u8 channel;
1596 u8 width;
1597 u8 ctrl_pos;
1598} __packed;
1599
1600#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1601#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1602 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1603#define PHY_RX_CHAIN_VALID_POS (1)
1604#define PHY_RX_CHAIN_VALID_MSK \
1605 (0x7 << PHY_RX_CHAIN_VALID_POS)
1606#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1607#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1608 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1609#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1610#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1611 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1612#define PHY_RX_CHAIN_CNT_POS (10)
1613#define PHY_RX_CHAIN_CNT_MSK \
1614 (0x3 << PHY_RX_CHAIN_CNT_POS)
1615#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1616#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1617 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1618#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1619#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1620 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1621
1622/* TODO: fix the value, make it depend on firmware at runtime? */
1623#define NUM_PHY_CTX 3
1624
1625/* TODO: complete missing documentation */
1626/**
1627 * struct iwl_phy_context_cmd - config of the PHY context
1628 * ( PHY_CONTEXT_CMD = 0x8 )
1629 * @id_and_color: ID and color of the relevant Binding
1630 * @action: action to perform, one of FW_CTXT_ACTION_*
1631 * @apply_time: 0 means immediate apply and context switch.
1632 * other value means apply new params after X usecs
1633 * @tx_param_color: ???
Johannes Bergacf91dd2017-05-16 16:15:42 +02001634 * @ci: channel info
Johannes Berg8ca151b2013-01-24 14:25:36 +01001635 * @txchain_info: ???
1636 * @rxchain_info: ???
1637 * @acquisition_data: ???
1638 * @dsp_cfg_flags: set to 0
1639 */
1640struct iwl_phy_context_cmd {
1641 /* COMMON_INDEX_HDR_API_S_VER_1 */
1642 __le32 id_and_color;
1643 __le32 action;
1644 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1645 __le32 apply_time;
1646 __le32 tx_param_color;
1647 struct iwl_fw_channel_info ci;
1648 __le32 txchain_info;
1649 __le32 rxchain_info;
1650 __le32 acquisition_data;
1651 __le32 dsp_cfg_flags;
1652} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1653
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001654/*
1655 * Aux ROC command
1656 *
1657 * Command requests the firmware to create a time event for a certain duration
1658 * and remain on the given channel. This is done by using the Aux framework in
1659 * the FW.
1660 * The command was first used for Hot Spot issues - but can be used regardless
1661 * to Hot Spot.
1662 *
1663 * ( HOT_SPOT_CMD 0x53 )
1664 *
1665 * @id_and_color: ID and color of the MAC
1666 * @action: action to perform, one of FW_CTXT_ACTION_*
1667 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1668 * event_unique_id should be the id of the time event assigned by ucode.
1669 * Otherwise ignore the event_unique_id.
1670 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1671 * activity.
1672 * @channel_info: channel info
1673 * @node_addr: Our MAC Address
1674 * @reserved: reserved for alignment
1675 * @apply_time: GP2 value to start (should always be the current GP2 value)
1676 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1677 * time by which start of the event is allowed to be postponed.
1678 * @duration: event duration in TU To calculate event duration:
1679 * timeEventDuration = min(duration, remainingQuota)
1680 */
1681struct iwl_hs20_roc_req {
1682 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1683 __le32 id_and_color;
1684 __le32 action;
1685 __le32 event_unique_id;
1686 __le32 sta_id_and_color;
1687 struct iwl_fw_channel_info channel_info;
1688 u8 node_addr[ETH_ALEN];
1689 __le16 reserved;
1690 __le32 apply_time;
1691 __le32 apply_time_max_delay;
1692 __le32 duration;
1693} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1694
1695/*
1696 * values for AUX ROC result values
1697 */
1698enum iwl_mvm_hot_spot {
1699 HOT_SPOT_RSP_STATUS_OK,
1700 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1701 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1702};
1703
1704/*
1705 * Aux ROC command response
1706 *
1707 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1708 * driver the uid of the timevent.
1709 *
1710 * ( HOT_SPOT_CMD 0x53 )
1711 *
1712 * @event_unique_id: Unique ID of time event assigned by ucode
1713 * @status: Return status 0 is success, all the rest used for specific errors
1714 */
1715struct iwl_hs20_roc_res {
1716 __le32 event_unique_id;
1717 __le32 status;
1718} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1719
Johannes Berg8ca151b2013-01-24 14:25:36 +01001720/**
1721 * struct iwl_radio_version_notif - information on the radio version
1722 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
Johannes Bergacf91dd2017-05-16 16:15:42 +02001723 * @radio_flavor: radio flavor
1724 * @radio_step: radio version step
1725 * @radio_dash: radio version dash
Johannes Berg8ca151b2013-01-24 14:25:36 +01001726 */
1727struct iwl_radio_version_notif {
1728 __le32 radio_flavor;
1729 __le32 radio_step;
1730 __le32 radio_dash;
1731} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1732
1733enum iwl_card_state_flags {
1734 CARD_ENABLED = 0x00,
1735 HW_CARD_DISABLED = 0x01,
1736 SW_CARD_DISABLED = 0x02,
1737 CT_KILL_CARD_DISABLED = 0x04,
1738 HALT_CARD_DISABLED = 0x08,
1739 CARD_DISABLED_MSK = 0x0f,
1740 CARD_IS_RX_ON = 0x10,
1741};
1742
1743/**
1744 * struct iwl_radio_version_notif - information on the radio version
1745 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1746 * @flags: %iwl_card_state_flags
1747 */
1748struct iwl_card_state_notif {
1749 __le32 flags;
1750} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1751
1752/**
Hila Gonend64048e2013-03-13 18:00:03 +02001753 * struct iwl_missed_beacons_notif - information on missed beacons
1754 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1755 * @mac_id: interface ID
1756 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1757 * beacons since last RX.
1758 * @consec_missed_beacons: number of consecutive missed beacons
Johannes Bergacf91dd2017-05-16 16:15:42 +02001759 * @num_expected_beacons: number of expected beacons
1760 * @num_recvd_beacons: number of received beacons
Hila Gonend64048e2013-03-13 18:00:03 +02001761 */
1762struct iwl_missed_beacons_notif {
1763 __le32 mac_id;
1764 __le32 consec_missed_beacons_since_last_rx;
1765 __le32 consec_missed_beacons;
1766 __le32 num_expected_beacons;
1767 __le32 num_recvd_beacons;
1768} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1769
1770/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001771 * struct iwl_mfuart_load_notif - mfuart image version & status
1772 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1773 * @installed_ver: installed image version
1774 * @external_ver: external image version
1775 * @status: MFUART loading status
1776 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001777 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001778*/
1779struct iwl_mfuart_load_notif {
1780 __le32 installed_ver;
1781 __le32 external_ver;
1782 __le32 status;
1783 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001784 /* image size valid only in v2 of the command */
1785 __le32 image_size;
1786} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001787
1788/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001789 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1790 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1791 * @assert_id: mfuart assert id that cause the notif
1792 * @curr_reset_num: number of asserts since uptime
1793 * @index_num: current chunk id
1794 * @parts_num: total number of chunks
1795 * @data_size: number of data bytes sent
1796 * @data: data buffer
1797 */
1798struct iwl_mfu_assert_dump_notif {
1799 __le32 assert_id;
1800 __le32 curr_reset_num;
1801 __le16 index_num;
1802 __le16 parts_num;
1803 __le32 data_size;
1804 __le32 data[0];
1805} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1806
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001807#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001808#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001809
1810/**
1811 * struct iwl_mcast_filter_cmd - configure multicast filter.
1812 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1813 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1814 * to identify network interface adopted in host-device IF.
1815 * It is used by FW as index in array of addresses. This array has
1816 * MAX_PORT_ID_NUM members.
1817 * @count: Number of MAC addresses in the array
1818 * @pass_all: Set 1 to pass all multicast packets.
1819 * @bssid: current association BSSID.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001820 * @reserved: reserved
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001821 * @addr_list: Place holder for array of MAC addresses.
1822 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1823 */
1824struct iwl_mcast_filter_cmd {
1825 u8 filter_own;
1826 u8 port_id;
1827 u8 count;
1828 u8 pass_all;
1829 u8 bssid[6];
1830 u8 reserved[2];
1831 u8 addr_list[0];
1832} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1833
Eliad Pellerc87163b2014-01-08 10:11:11 +02001834#define MAX_BCAST_FILTERS 8
1835#define MAX_BCAST_FILTER_ATTRS 2
1836
1837/**
1838 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1839 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1840 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1841 * start of ip payload).
1842 */
1843enum iwl_mvm_bcast_filter_attr_offset {
1844 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1845 BCAST_FILTER_OFFSET_IP_END = 1,
1846};
1847
1848/**
1849 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1850 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1851 * @offset: starting offset of this pattern.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001852 * @reserved1: reserved
1853 * @val: value to match - big endian (MSB is the first
Eliad Pellerc87163b2014-01-08 10:11:11 +02001854 * byte to match from offset pos).
1855 * @mask: mask to match (big endian).
1856 */
1857struct iwl_fw_bcast_filter_attr {
1858 u8 offset_type;
1859 u8 offset;
1860 __le16 reserved1;
1861 __be32 val;
1862 __be32 mask;
1863} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1864
1865/**
1866 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1867 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1868 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1869 */
1870enum iwl_mvm_bcast_filter_frame_type {
1871 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1872 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1873};
1874
1875/**
1876 * struct iwl_fw_bcast_filter - broadcast filter
1877 * @discard: discard frame (1) or let it pass (0).
1878 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001879 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001880 * @num_attrs: number of valid attributes in this filter.
1881 * @attrs: attributes of this filter. a filter is considered matched
1882 * only when all its attributes are matched (i.e. AND relationship)
1883 */
1884struct iwl_fw_bcast_filter {
1885 u8 discard;
1886 u8 frame_type;
1887 u8 num_attrs;
1888 u8 reserved1;
1889 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1890} __packed; /* BCAST_FILTER_S_VER_1 */
1891
Sara Sharon3af512d62015-07-22 11:38:40 +03001892#define BA_WINDOW_STREAMS_MAX 16
1893#define BA_WINDOW_STATUS_TID_MSK 0x000F
1894#define BA_WINDOW_STATUS_STA_ID_POS 4
1895#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1896#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1897
1898/**
1899 * struct iwl_ba_window_status_notif - reordering window's status notification
1900 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1901 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1902 * @start_seq_num: the start sequence number of the bitmap
1903 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1904 */
1905struct iwl_ba_window_status_notif {
1906 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1907 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1908 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1909 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1910} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1911
Eliad Pellerc87163b2014-01-08 10:11:11 +02001912/**
1913 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1914 * @default_discard: default action for this mac (discard (1) / pass (0)).
Johannes Bergacf91dd2017-05-16 16:15:42 +02001915 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001916 * @attached_filters: bitmap of relevant filters for this mac.
1917 */
1918struct iwl_fw_bcast_mac {
1919 u8 default_discard;
1920 u8 reserved1;
1921 __le16 attached_filters;
1922} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1923
1924/**
1925 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1926 * @disable: enable (0) / disable (1)
1927 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1928 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
Johannes Bergacf91dd2017-05-16 16:15:42 +02001929 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001930 * @filters: broadcast filters
1931 * @macs: broadcast filtering configuration per-mac
1932 */
1933struct iwl_bcast_filter_cmd {
1934 u8 disable;
1935 u8 max_bcast_filters;
1936 u8 max_macs;
1937 u8 reserved1;
1938 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1939 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1940} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1941
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001942/*
1943 * enum iwl_mvm_marker_id - maker ids
1944 *
1945 * The ids for different type of markers to insert into the usniffer logs
1946 */
1947enum iwl_mvm_marker_id {
1948 MARKER_ID_TX_FRAME_LATENCY = 1,
1949}; /* MARKER_ID_API_E_VER_1 */
1950
1951/**
1952 * struct iwl_mvm_marker - mark info into the usniffer logs
1953 *
1954 * (MARKER_CMD = 0xcb)
1955 *
1956 * Mark the UTC time stamp into the usniffer logs together with additional
1957 * metadata, so the usniffer output can be parsed.
1958 * In the command response the ucode will return the GP2 time.
1959 *
1960 * @dw_len: The amount of dwords following this byte including this byte.
1961 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1962 * @reserved: reserved.
1963 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1964 * @metadata: additional meta data that will be written to the unsiffer log
1965 */
1966struct iwl_mvm_marker {
Johannes Berg1644be92017-05-16 13:21:52 +02001967 u8 dw_len;
1968 u8 marker_id;
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001969 __le16 reserved;
1970 __le64 timestamp;
1971 __le32 metadata[0];
1972} __packed; /* MARKER_API_S_VER_1 */
1973
Matti Gottlieb0becb372015-05-31 09:18:30 +03001974/*
1975 * enum iwl_dc2dc_config_id - flag ids
1976 *
1977 * Ids of dc2dc configuration flags
1978 */
1979enum iwl_dc2dc_config_id {
1980 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1981 DCDC_FREQ_TUNE_SET = 0x2,
1982}; /* MARKER_ID_API_E_VER_1 */
1983
1984/**
1985 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1986 *
1987 * (DC2DC_CONFIG_CMD = 0x83)
1988 *
1989 * Set/Get & configure dc2dc values.
1990 * The command always returns the current dc2dc values.
1991 *
1992 * @flags: set/get dc2dc
1993 * @enable_low_power_mode: not used.
1994 * @dc2dc_freq_tune0: frequency divider - digital domain
1995 * @dc2dc_freq_tune1: frequency divider - analog domain
1996 */
1997struct iwl_dc2dc_config_cmd {
1998 __le32 flags;
1999 __le32 enable_low_power_mode; /* not used */
2000 __le32 dc2dc_freq_tune0;
2001 __le32 dc2dc_freq_tune1;
2002} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
2003
2004/**
2005 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
2006 *
2007 * Current dc2dc values returned by the FW.
2008 *
2009 * @dc2dc_freq_tune0: frequency divider - digital domain
2010 * @dc2dc_freq_tune1: frequency divider - analog domain
2011 */
2012struct iwl_dc2dc_config_resp {
2013 __le32 dc2dc_freq_tune0;
2014 __le32 dc2dc_freq_tune1;
2015} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
2016
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002017/***********************************
2018 * Smart Fifo API
2019 ***********************************/
2020/* Smart Fifo state */
2021enum iwl_sf_state {
2022 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
2023 SF_FULL_ON,
2024 SF_UNINIT,
2025 SF_INIT_OFF,
2026 SF_HW_NUM_STATES
2027};
2028
2029/* Smart Fifo possible scenario */
2030enum iwl_sf_scenario {
2031 SF_SCENARIO_SINGLE_UNICAST,
2032 SF_SCENARIO_AGG_UNICAST,
2033 SF_SCENARIO_MULTICAST,
2034 SF_SCENARIO_BA_RESP,
2035 SF_SCENARIO_TX_RESP,
2036 SF_NUM_SCENARIO
2037};
2038
2039#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
2040#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
2041
2042/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02002043#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002044#define SF_W_MARK_MIMO2 8192
2045#define SF_W_MARK_MIMO3 6144
2046#define SF_W_MARK_LEGACY 4096
2047#define SF_W_MARK_SCAN 4096
2048
Eran Hararyf4a3ee42015-02-08 13:58:50 +02002049/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
2050#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
2051#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2052#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
2053#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2054#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
2055#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2056#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
2057#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
2058#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
2059#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
2060
2061/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002062#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
2063#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
2064#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
2065#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
2066#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
2067#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
2068#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
2069#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
2070#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
2071#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
2072
2073#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
2074
Eran Harary161bdb72014-07-27 08:03:06 +03002075#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
2076
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002077/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002078 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
2079 * @state: smart fifo state, types listed in &enum iwl_sf_state.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002080 * @watermark: Minimum allowed availabe free space in RXF for transient state.
2081 * @long_delay_timeouts: aging and idle timer values for each scenario
2082 * in long delay state.
2083 * @full_on_timeouts: timer values for each scenario in full on state.
2084 */
2085struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03002086 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002087 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
2088 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
2089 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
2090} __packed; /* SF_CFG_API_S_VER_2 */
2091
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002092/***********************************
2093 * Location Aware Regulatory (LAR) API - MCC updates
2094 ***********************************/
2095
2096/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002097 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002098 * regulatory profile according to the given MCC (Mobile Country Code).
2099 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2100 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2101 * MCC in the cmd response will be the relevant MCC in the NVM.
2102 * @mcc: given mobile country code
2103 * @source_id: the source from where we got the MCC, see iwl_mcc_source
2104 * @reserved: reserved for alignment
2105 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002106struct iwl_mcc_update_cmd_v1 {
2107 __le16 mcc;
2108 u8 source_id;
2109 u8 reserved;
2110} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
2111
2112/**
2113 * struct iwl_mcc_update_cmd - Request the device to update geographic
2114 * regulatory profile according to the given MCC (Mobile Country Code).
2115 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2116 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2117 * MCC in the cmd response will be the relevant MCC in the NVM.
2118 * @mcc: given mobile country code
2119 * @source_id: the source from where we got the MCC, see iwl_mcc_source
2120 * @reserved: reserved for alignment
2121 * @key: integrity key for MCC API OEM testing
2122 * @reserved2: reserved
2123 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002124struct iwl_mcc_update_cmd {
2125 __le16 mcc;
2126 u8 source_id;
2127 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002128 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01002129 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002130} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002131
2132/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002133 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002134 * Contains the new channel control profile map, if changed, and the new MCC
2135 * (mobile country code).
2136 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02002137 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002138 * @mcc: the new applied MCC
2139 * @cap: capabilities for all channels which matches the MCC
2140 * @source_id: the MCC source, see iwl_mcc_source
2141 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
2142 * channels, depending on platform)
2143 * @channels: channel control data map, DWORD for each channel. Only the first
2144 * 16bits are used.
2145 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002146struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002147 __le32 status;
2148 __le16 mcc;
2149 u8 cap;
2150 u8 source_id;
2151 __le32 n_channels;
2152 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002153} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
2154
2155/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002156 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002157 * Contains the new channel control profile map, if changed, and the new MCC
2158 * (mobile country code).
2159 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
2160 * @status: see &enum iwl_mcc_update_status
2161 * @mcc: the new applied MCC
2162 * @cap: capabilities for all channels which matches the MCC
2163 * @source_id: the MCC source, see iwl_mcc_source
2164 * @time: time elapsed from the MCC test start (in 30 seconds TU)
2165 * @reserved: reserved.
2166 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
2167 * channels, depending on platform)
2168 * @channels: channel control data map, DWORD for each channel. Only the first
2169 * 16bits are used.
2170 */
2171struct iwl_mcc_update_resp {
2172 __le32 status;
2173 __le16 mcc;
2174 u8 cap;
2175 u8 source_id;
2176 __le16 time;
2177 __le16 reserved;
2178 __le32 n_channels;
2179 __le32 channels[0];
2180} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002181
2182/**
2183 * struct iwl_mcc_chub_notif - chub notifies of mcc change
2184 * (MCC_CHUB_UPDATE_CMD = 0xc9)
2185 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
2186 * the cellular and connectivity cores that gets updates of the mcc, and
2187 * notifies the ucode directly of any mcc change.
2188 * The ucode requests the driver to request the device to update geographic
2189 * regulatory profile according to the given MCC (Mobile Country Code).
2190 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2191 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2192 * MCC in the cmd response will be the relevant MCC in the NVM.
2193 * @mcc: given mobile country code
2194 * @source_id: identity of the change originator, see iwl_mcc_source
2195 * @reserved1: reserved for alignment
2196 */
2197struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01002198 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002199 u8 source_id;
2200 u8 reserved1;
2201} __packed; /* LAR_MCC_NOTIFY_S */
2202
2203enum iwl_mcc_update_status {
2204 MCC_RESP_NEW_CHAN_PROFILE,
2205 MCC_RESP_SAME_CHAN_PROFILE,
2206 MCC_RESP_INVALID,
2207 MCC_RESP_NVM_DISABLED,
2208 MCC_RESP_ILLEGAL,
2209 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002210 MCC_RESP_TEST_MODE_ACTIVE,
2211 MCC_RESP_TEST_MODE_NOT_ACTIVE,
2212 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002213};
2214
2215enum iwl_mcc_source {
2216 MCC_SOURCE_OLD_FW = 0,
2217 MCC_SOURCE_ME = 1,
2218 MCC_SOURCE_BIOS = 2,
2219 MCC_SOURCE_3G_LTE_HOST = 3,
2220 MCC_SOURCE_3G_LTE_DEVICE = 4,
2221 MCC_SOURCE_WIFI = 5,
2222 MCC_SOURCE_RESERVED = 6,
2223 MCC_SOURCE_DEFAULT = 7,
2224 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002225 MCC_SOURCE_MCC_API = 9,
2226 MCC_SOURCE_GET_CURRENT = 0x10,
2227 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002228};
2229
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002230/* DTS measurements */
2231
2232enum iwl_dts_measurement_flags {
2233 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
2234 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
2235};
2236
2237/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002238 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002239 *
Johannes Berg31a658b2017-03-09 15:56:57 +01002240 * @flags: indicates which measurements we want as specified in
2241 * &enum iwl_dts_measurement_flags
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002242 */
2243struct iwl_dts_measurement_cmd {
2244 __le32 flags;
2245} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2246
2247/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03002248* enum iwl_dts_control_measurement_mode - DTS measurement type
2249* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2250* back (latest value. Not waiting for new value). Use automatic
2251* SW DTS configuration.
2252* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2253* trigger DTS reading and provide read back temperature read
2254* when available.
2255* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2256* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2257* without measurement trigger.
2258*/
2259enum iwl_dts_control_measurement_mode {
2260 DTS_AUTOMATIC = 0,
2261 DTS_REQUEST_READ = 1,
2262 DTS_OVER_WRITE = 2,
2263 DTS_DIRECT_WITHOUT_MEASURE = 3,
2264};
2265
2266/**
2267* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2268* @DTS_USE_TOP: Top
2269* @DTS_USE_CHAIN_A: chain A
2270* @DTS_USE_CHAIN_B: chain B
2271* @DTS_USE_CHAIN_C: chain C
Johannes Bergacf91dd2017-05-16 16:15:42 +02002272* @XTAL_TEMPERATURE: read temperature from xtal
Arik Nemtsov78efc702015-10-06 12:22:47 +03002273*/
2274enum iwl_dts_used {
2275 DTS_USE_TOP = 0,
2276 DTS_USE_CHAIN_A = 1,
2277 DTS_USE_CHAIN_B = 2,
2278 DTS_USE_CHAIN_C = 3,
2279 XTAL_TEMPERATURE = 4,
2280};
2281
2282/**
2283* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2284* @DTS_BIT6_MODE: bit 6 mode
2285* @DTS_BIT8_MODE: bit 8 mode
2286*/
2287enum iwl_dts_bit_mode {
2288 DTS_BIT6_MODE = 0,
2289 DTS_BIT8_MODE = 1,
2290};
2291
2292/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002293 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
Arik Nemtsov78efc702015-10-06 12:22:47 +03002294 * @control_mode: see &enum iwl_dts_control_measurement_mode
2295 * @temperature: used when over write DTS mode is selected
2296 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2297 * @avg_factor: average factor to DTS in request DTS read mode
2298 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2299 * @step_duration: step duration for the DTS
2300 */
2301struct iwl_ext_dts_measurement_cmd {
2302 __le32 control_mode;
2303 __le32 temperature;
2304 __le32 sensor;
2305 __le32 avg_factor;
2306 __le32 bit_mode;
2307 __le32 step_duration;
2308} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2309
2310/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002311 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002312 *
2313 * @temp: the measured temperature
2314 * @voltage: the measured voltage
2315 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002316struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002317 __le32 temp;
2318 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002319} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2320
2321/**
2322 * struct iwl_dts_measurement_notif_v2 - measurements notification
2323 *
2324 * @temp: the measured temperature
2325 * @voltage: the measured voltage
2326 * @threshold_idx: the trip index that was crossed
2327 */
2328struct iwl_dts_measurement_notif_v2 {
2329 __le32 temp;
2330 __le32 voltage;
2331 __le32 threshold_idx;
2332} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002333
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02002334/**
2335 * struct ct_kill_notif - CT-kill entry notification
2336 *
2337 * @temperature: the current temperature in celsius
2338 * @reserved: reserved
2339 */
2340struct ct_kill_notif {
2341 __le16 temperature;
2342 __le16 reserved;
2343} __packed; /* GRP_PHY_CT_KILL_NTF */
2344
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002345/**
2346* enum ctdp_cmd_operation - CTDP command operations
2347* @CTDP_CMD_OPERATION_START: update the current budget
2348* @CTDP_CMD_OPERATION_STOP: stop ctdp
Chaya Rachel Ivgi3b9449b2017-05-08 15:14:01 +03002349* @CTDP_CMD_OPERATION_REPORT: get the average budget
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002350*/
2351enum iwl_mvm_ctdp_cmd_operation {
2352 CTDP_CMD_OPERATION_START = 0x1,
2353 CTDP_CMD_OPERATION_STOP = 0x2,
2354 CTDP_CMD_OPERATION_REPORT = 0x4,
2355};/* CTDP_CMD_OPERATION_TYPE_E */
2356
2357/**
2358 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2359 *
2360 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2361 * @budget: the budget in milliwatt
2362 * @window_size: defined in API but not used
2363 */
2364struct iwl_mvm_ctdp_cmd {
2365 __le32 operation;
2366 __le32 budget;
2367 __le32 window_size;
2368} __packed;
2369
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002370#define IWL_MAX_DTS_TRIPS 8
2371
2372/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002373 * struct temp_report_ths_cmd - set temperature thresholds
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002374 *
2375 * @num_temps: number of temperature thresholds passed
2376 * @thresholds: array with the thresholds to be configured
2377 */
2378struct temp_report_ths_cmd {
2379 __le32 num_temps;
2380 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2381} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2382
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002383/***********************************
2384 * TDLS API
2385 ***********************************/
2386
2387/* Type of TDLS request */
2388enum iwl_tdls_channel_switch_type {
2389 TDLS_SEND_CHAN_SW_REQ = 0,
2390 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2391 TDLS_MOVE_CH,
2392}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2393
2394/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002395 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002396 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2397 * received from peer
2398 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2399 * to the TDLS off-channel communication. For instance if the DTIM is
2400 * 200TU and the TDLS peer is to be given 25% of the time, the value
2401 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2402 * @switch_time: switch time the peer sent in its channel switch timing IE
Johannes Berg83b03192017-05-16 13:28:53 +02002403 * @switch_timeout: switch timeout the peer sent in its channel switch timing IE
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002404 */
2405struct iwl_tdls_channel_switch_timing {
2406 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2407 __le32 max_offchan_duration; /* given in micro-seconds */
2408 __le32 switch_time; /* given in micro-seconds */
2409 __le32 switch_timeout; /* given in micro-seconds */
2410} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2411
2412#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2413
2414/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002415 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002416 *
2417 * A template representing a TDLS channel-switch request or response frame
2418 *
2419 * @switch_time_offset: offset to the channel switch timing IE in the template
2420 * @tx_cmd: Tx parameters for the frame
2421 * @data: frame data
2422 */
2423struct iwl_tdls_channel_switch_frame {
2424 __le32 switch_time_offset;
2425 struct iwl_tx_cmd tx_cmd;
2426 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2427} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2428
2429/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002430 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002431 *
2432 * The command is sent to initiate a channel switch and also in response to
2433 * incoming TDLS channel-switch request/response packets from remote peers.
2434 *
2435 * @switch_type: see &enum iwl_tdls_channel_switch_type
2436 * @peer_sta_id: station id of TDLS peer
2437 * @ci: channel we switch to
2438 * @timing: timing related data for command
2439 * @frame: channel-switch request/response template, depending to switch_type
2440 */
2441struct iwl_tdls_channel_switch_cmd {
2442 u8 switch_type;
2443 __le32 peer_sta_id;
2444 struct iwl_fw_channel_info ci;
2445 struct iwl_tdls_channel_switch_timing timing;
2446 struct iwl_tdls_channel_switch_frame frame;
2447} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2448
2449/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002450 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002451 *
2452 * @status: non-zero on success
2453 * @offchannel_duration: duration given in microseconds
2454 * @sta_id: peer currently performing the channel-switch with
2455 */
2456struct iwl_tdls_channel_switch_notif {
2457 __le32 status;
2458 __le32 offchannel_duration;
2459 __le32 sta_id;
2460} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2461
Arik Nemtsov307e4722014-09-15 18:48:59 +03002462/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002463 * struct iwl_tdls_sta_info - TDLS station info
Arik Nemtsov307e4722014-09-15 18:48:59 +03002464 *
2465 * @sta_id: station id of the TDLS peer
2466 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2467 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2468 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2469 */
2470struct iwl_tdls_sta_info {
2471 u8 sta_id;
2472 u8 tx_to_peer_tid;
2473 __le16 tx_to_peer_ssn;
2474 __le32 is_initiator;
2475} __packed; /* TDLS_STA_INFO_VER_1 */
2476
2477/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002478 * struct iwl_tdls_config_cmd - TDLS basic config command
Arik Nemtsov307e4722014-09-15 18:48:59 +03002479 *
2480 * @id_and_color: MAC id and color being configured
2481 * @tdls_peer_count: amount of currently connected TDLS peers
2482 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2483 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2484 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2485 * @pti_req_data_offset: offset of network-level data for the PTI template
2486 * @pti_req_tx_cmd: Tx parameters for PTI request template
2487 * @pti_req_template: PTI request template data
2488 */
2489struct iwl_tdls_config_cmd {
2490 __le32 id_and_color; /* mac id and color */
2491 u8 tdls_peer_count;
2492 u8 tx_to_ap_tid;
2493 __le16 tx_to_ap_ssn;
2494 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2495
2496 __le32 pti_req_data_offset;
2497 struct iwl_tx_cmd pti_req_tx_cmd;
2498 u8 pti_req_template[0];
2499} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2500
2501/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002502 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
Arik Nemtsov307e4722014-09-15 18:48:59 +03002503 *
2504 * @sta_id: station id of the TDLS peer
2505 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2506 * the peer
2507 */
2508struct iwl_tdls_config_sta_info_res {
2509 __le16 sta_id;
2510 __le16 tx_to_peer_last_seq;
2511} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2512
2513/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002514 * struct iwl_tdls_config_res - TDLS config information from FW
Arik Nemtsov307e4722014-09-15 18:48:59 +03002515 *
2516 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2517 * @sta_info: per-station TDLS config information
2518 */
2519struct iwl_tdls_config_res {
2520 __le32 tx_to_ap_last_seq;
2521 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2522} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2523
Sara Sharondb06f042016-07-05 17:37:58 +03002524#define TX_FIFO_MAX_NUM_9000 8
2525#define TX_FIFO_MAX_NUM 15
2526#define RX_FIFO_MAX_NUM 2
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002527#define TX_FIFO_INTERNAL_MAX_NUM 6
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002528
2529/**
Johannes Bergb4f48982017-06-01 09:06:11 +02002530 * struct iwl_shared_mem_cfg_v2 - Shared memory configuration information
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002531 *
2532 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2533 * accessible)
2534 * @shared_mem_size: shared memory size
2535 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2536 * 0x0 as accessible only via DBGM RDAT)
2537 * @sample_buff_size: internal sample buff size
2538 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2539 * 8000 HW set to 0x0 as not accessible)
2540 * @txfifo_size: size of TXF0 ... TXF7
2541 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2542 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2543 * when paging is not supported this should be 0
2544 * @page_buff_size: size of %page_buff_addr
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002545 * @rxfifo_addr: Start address of rxFifo
2546 * @internal_txfifo_addr: start address of internalFifo
2547 * @internal_txfifo_size: internal fifos' size
2548 *
2549 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2550 * set, the last 3 members don't exist.
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002551 */
Johannes Bergb4f48982017-06-01 09:06:11 +02002552struct iwl_shared_mem_cfg_v2 {
Sara Sharondb06f042016-07-05 17:37:58 +03002553 __le32 shared_mem_addr;
2554 __le32 shared_mem_size;
2555 __le32 sample_buff_addr;
2556 __le32 sample_buff_size;
2557 __le32 txfifo_addr;
2558 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2559 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2560 __le32 page_buff_addr;
2561 __le32 page_buff_size;
2562 __le32 rxfifo_addr;
2563 __le32 internal_txfifo_addr;
2564 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2565} __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2566
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002567/**
2568 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2569 *
2570 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2571 * @txfifo_size: size of TX FIFOs
2572 * @rxfifo1_addr: RXF1 addr
2573 * @rxfifo1_size: RXF1 size
2574 */
2575struct iwl_shared_mem_lmac_cfg {
2576 __le32 txfifo_addr;
2577 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2578 __le32 rxfifo1_addr;
2579 __le32 rxfifo1_size;
2580
2581} __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2582
2583/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002584 * struct iwl_shared_mem_cfg - Shared memory configuration information
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002585 *
2586 * @shared_mem_addr: shared memory address
2587 * @shared_mem_size: shared memory size
2588 * @sample_buff_addr: internal sample (mon/adc) buff addr
2589 * @sample_buff_size: internal sample buff size
2590 * @rxfifo2_addr: start addr of RXF2
2591 * @rxfifo2_size: size of RXF2
2592 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2593 * when paging is not supported this should be 0
2594 * @page_buff_size: size of %page_buff_addr
2595 * @lmac_num: number of LMACs (1 or 2)
2596 * @lmac_smem: per - LMAC smem data
2597 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002598struct iwl_shared_mem_cfg {
2599 __le32 shared_mem_addr;
2600 __le32 shared_mem_size;
2601 __le32 sample_buff_addr;
2602 __le32 sample_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002603 __le32 rxfifo2_addr;
2604 __le32 rxfifo2_size;
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002605 __le32 page_buff_addr;
2606 __le32 page_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002607 __le32 lmac_num;
2608 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
Sara Sharondb06f042016-07-05 17:37:58 +03002609} __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002610
Sara Sharona07a8f32015-11-15 11:11:59 +02002611/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002612 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
Sara Sharona07a8f32015-11-15 11:11:59 +02002613 *
Johannes Bergacf91dd2017-05-16 16:15:42 +02002614 * @reserved: reserved
Sara Sharona07a8f32015-11-15 11:11:59 +02002615 * @membership_status: a bitmap of MU groups
2616 * @user_position:the position of station in a group. If the station is in the
2617 * group then bits (group * 2) is the position -1
2618 */
2619struct iwl_mu_group_mgmt_cmd {
2620 __le32 reserved;
2621 __le32 membership_status[2];
2622 __le32 user_position[4];
2623} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2624
Sara Sharonf92659a2016-02-03 15:04:49 +02002625/**
2626 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2627 *
2628 * @membership_status: a bitmap of MU groups
2629 * @user_position: the position of station in a group. If the station is in the
2630 * group then bits (group * 2) is the position -1
2631 */
2632struct iwl_mu_group_mgmt_notif {
2633 __le32 membership_status[2];
2634 __le32 user_position[4];
2635} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2636
Sara Sharon0db056d2015-12-29 11:07:15 +02002637#define MAX_STORED_BEACON_SIZE 600
2638
2639/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002640 * struct iwl_stored_beacon_notif - Stored beacon notification
Sara Sharon0db056d2015-12-29 11:07:15 +02002641 *
2642 * @system_time: system time on air rise
2643 * @tsf: TSF on air rise
2644 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002645 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002646 * @channel: channel this beacon was received on
2647 * @rates: rate in ucode internal format
2648 * @byte_count: frame's byte count
Johannes Bergacf91dd2017-05-16 16:15:42 +02002649 * @data: beacon data, length in @byte_count
Sara Sharon0db056d2015-12-29 11:07:15 +02002650 */
2651struct iwl_stored_beacon_notif {
2652 __le32 system_time;
2653 __le64 tsf;
2654 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002655 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002656 __le16 channel;
2657 __le32 rates;
2658 __le32 byte_count;
2659 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002660} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002661
Aviya Erenfeld03098262016-02-18 14:09:33 +02002662#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2663
2664enum iwl_lqm_cmd_operatrions {
2665 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2666 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2667};
2668
2669enum iwl_lqm_status {
2670 LQM_STATUS_SUCCESS = 0,
2671 LQM_STATUS_TIMEOUT = 1,
2672 LQM_STATUS_ABORT = 2,
2673};
2674
2675/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002676 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
Johannes Berg83b03192017-05-16 13:28:53 +02002677 * @cmd_operation: command operation to be performed (start or stop)
Aviya Erenfeld03098262016-02-18 14:09:33 +02002678 * as defined above.
2679 * @mac_id: MAC ID the measurement applies to.
2680 * @measurement_time: time of the total measurement to be performed, in uSec.
2681 * @timeout: maximum time allowed until a response is sent, in uSec.
2682 */
2683struct iwl_link_qual_msrmnt_cmd {
2684 __le32 cmd_operation;
2685 __le32 mac_id;
2686 __le32 measurement_time;
2687 __le32 timeout;
2688} __packed /* LQM_CMD_API_S_VER_1 */;
2689
2690/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002691 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
Aviya Erenfeld03098262016-02-18 14:09:33 +02002692 *
2693 * @frequent_stations_air_time: an array containing the total air time
2694 * (in uSec) used by the most frequently transmitting stations.
2695 * @number_of_stations: the number of uniqe stations included in the array
2696 * (a number between 0 to 16)
2697 * @total_air_time_other_stations: the total air time (uSec) used by all the
2698 * stations which are not included in the above report.
2699 * @time_in_measurement_window: the total time in uSec in which a measurement
2700 * took place.
2701 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2702 * measurement
2703 * @mac_id: MAC ID the measurement applies to.
2704 * @status: return status. may be one of the LQM_STATUS_* defined above.
2705 * @reserved: reserved.
2706 */
2707struct iwl_link_qual_msrmnt_notif {
2708 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2709 __le32 number_of_stations;
2710 __le32 total_air_time_other_stations;
2711 __le32 time_in_measurement_window;
2712 __le32 tx_frame_dropped;
2713 __le32 mac_id;
2714 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002715 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002716} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2717
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002718/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002719 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002720 *
2721 * @id_and_color: ID and color of the MAC
2722 */
2723struct iwl_channel_switch_noa_notif {
2724 __le32 id_and_color;
2725} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2726
Ido Yariv2b55f432016-08-23 14:44:59 -04002727/* Operation types for the debug mem access */
2728enum {
2729 DEBUG_MEM_OP_READ = 0,
2730 DEBUG_MEM_OP_WRITE = 1,
2731 DEBUG_MEM_OP_WRITE_BYTES = 2,
2732};
2733
2734#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2735
2736/**
2737 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2738 * @op: DEBUG_MEM_OP_*
2739 * @addr: address to read/write from/to
2740 * @len: in dwords, to read/write
2741 * @data: for write opeations, contains the source buffer
2742 */
2743struct iwl_dbg_mem_access_cmd {
2744 __le32 op;
2745 __le32 addr;
2746 __le32 len;
2747 __le32 data[];
2748} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2749
2750/* Status responses for the debug mem access */
2751enum {
2752 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2753 DEBUG_MEM_STATUS_FAILED = 0x1,
2754 DEBUG_MEM_STATUS_LOCKED = 0x2,
2755 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2756 DEBUG_MEM_STATUS_LENGTH = 0x4,
2757};
2758
2759/**
2760 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2761 * @status: DEBUG_MEM_STATUS_*
2762 * @len: read dwords (0 for write operations)
2763 * @data: contains the read DWs
2764 */
2765struct iwl_dbg_mem_access_rsp {
2766 __le32 status;
2767 __le32 len;
2768 __le32 data[];
2769} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2770
Sara Sharon1f370652016-08-31 18:13:57 +03002771/**
2772 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
Johannes Bergacf91dd2017-05-16 16:15:42 +02002773 * @reserved: reserved
Sara Sharon1f370652016-08-31 18:13:57 +03002774 */
2775struct iwl_nvm_access_complete_cmd {
2776 __le32 reserved;
2777} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2778
Sara Sharon4399caa2016-12-11 10:32:42 +02002779/**
2780 * enum iwl_extended_cfg_flag - commands driver may send before
2781 * finishing init flow
2782 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2783 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2784 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2785 */
2786enum iwl_extended_cfg_flags {
2787 IWL_INIT_DEBUG_CFG,
2788 IWL_INIT_NVM,
2789 IWL_INIT_PHY,
2790};
2791
2792/**
2793 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2794 * before finishing init flows
2795 * @init_flags: values from iwl_extended_cfg_flags
2796 */
2797struct iwl_init_extended_cfg_cmd {
2798 __le32 init_flags;
2799} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2800
Sara Sharone9e1ba32017-01-08 16:46:14 +02002801/*
2802 * struct iwl_nvm_get_info - request to get NVM data
2803 */
2804struct iwl_nvm_get_info {
2805 __le32 reserved;
2806} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2807
2808/**
2809 * struct iwl_nvm_get_info_general - general NVM data
2810 * @flags: 1 - empty, 0 - valid
2811 * @nvm_version: nvm version
2812 * @board_type: board type
Johannes Bergacf91dd2017-05-16 16:15:42 +02002813 * @reserved: reserved
Sara Sharone9e1ba32017-01-08 16:46:14 +02002814 */
2815struct iwl_nvm_get_info_general {
2816 __le32 flags;
2817 __le16 nvm_version;
2818 u8 board_type;
2819 u8 reserved;
2820} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2821
2822/**
2823 * struct iwl_nvm_get_info_sku - mac information
2824 * @enable_24g: band 2.4G enabled
2825 * @enable_5g: band 5G enabled
2826 * @enable_11n: 11n enabled
2827 * @enable_11ac: 11ac enabled
2828 * @mimo_disable: MIMO enabled
2829 * @ext_crypto: Extended crypto enabled
2830 */
2831struct iwl_nvm_get_info_sku {
2832 __le32 enable_24g;
2833 __le32 enable_5g;
2834 __le32 enable_11n;
2835 __le32 enable_11ac;
2836 __le32 mimo_disable;
2837 __le32 ext_crypto;
2838} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2839
2840/**
2841 * struct iwl_nvm_get_info_phy - phy information
2842 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2843 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2844 */
2845struct iwl_nvm_get_info_phy {
2846 __le32 tx_chains;
2847 __le32 rx_chains;
2848} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2849
2850#define IWL_NUM_CHANNELS (51)
2851
2852/**
2853 * struct iwl_nvm_get_info_regulatory - regulatory information
2854 * @lar_enabled: is LAR enabled
2855 * @channel_profile: regulatory data of this channel
Johannes Berg358631b2017-05-16 15:14:19 +02002856 * @reserved: reserved
Sara Sharone9e1ba32017-01-08 16:46:14 +02002857 */
2858struct iwl_nvm_get_info_regulatory {
2859 __le32 lar_enabled;
2860 __le16 channel_profile[IWL_NUM_CHANNELS];
2861 __le16 reserved;
2862} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2863
2864/**
2865 * struct iwl_nvm_get_info_rsp - response to get NVM data
2866 * @general: general NVM data
2867 * @mac_sku: data relating to MAC sku
2868 * @phy_sku: data relating to PHY sku
2869 * @regulatory: regulatory data
2870 */
2871struct iwl_nvm_get_info_rsp {
2872 struct iwl_nvm_get_info_general general;
2873 struct iwl_nvm_get_info_sku mac_sku;
2874 struct iwl_nvm_get_info_phy phy_sku;
2875 struct iwl_nvm_get_info_regulatory regulatory;
2876} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2877
Johannes Berg15fc1962017-03-10 14:01:42 +01002878/**
2879 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2880 * @isolation: antenna isolation value
2881 */
2882struct iwl_mvm_antenna_coupling_notif {
2883 __le32 isolation;
2884} __packed;
2885
Johannes Berg8ca151b2013-01-24 14:25:36 +01002886#endif /* __fw_api_h__ */