blob: aad265dcfaf52eb944d53c9536f5a30b95f5910e [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 /**
Liad Kaufman678d9b62017-05-18 18:00:49 +0300450 * @STATISTICS_CMD:
451 * one of &struct iwl_statistics_cmd,
452 * &struct iwl_notif_statistics_v11,
453 * &struct iwl_notif_statistics_v10,
454 * &struct iwl_notif_statistics_cdb
Johannes Berg15fc1962017-03-10 14:01:42 +0100455 */
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100456 STATISTICS_CMD = 0x9c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100457
458 /**
459 * @STATISTICS_NOTIFICATION:
460 * one of &struct iwl_notif_statistics_v10,
461 * &struct iwl_notif_statistics_v11,
462 * &struct iwl_notif_statistics_cdb
463 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100464 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg358631b2017-05-16 15:14:19 +0200465
466 /**
467 * @EOSP_NOTIFICATION:
468 * Notify that a service period ended,
469 * &struct iwl_mvm_eosp_notification
470 */
Johannes Berg3e56ead2013-02-15 22:23:18 +0100471 EOSP_NOTIFICATION = 0x9e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100472
473 /**
474 * @REDUCE_TX_POWER_CMD:
475 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
476 */
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300477 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100478
Johannes Berg358631b2017-05-16 15:14:19 +0200479 /**
480 * @CARD_STATE_NOTIFICATION:
481 * Card state (RF/CT kill) notification,
482 * uses &struct iwl_card_state_notif
483 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100484 CARD_STATE_NOTIFICATION = 0xa1,
485
Johannes Berg358631b2017-05-16 15:14:19 +0200486 /**
487 * @MISSED_BEACONS_NOTIFICATION: &struct iwl_missed_beacons_notif
488 */
Hila Gonend64048e2013-03-13 18:00:03 +0200489 MISSED_BEACONS_NOTIFICATION = 0xa2,
490
Johannes Berg15fc1962017-03-10 14:01:42 +0100491 /**
492 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
493 */
Alexander Bondare811ada2013-03-10 15:29:44 +0200494 MAC_PM_POWER_TABLE = 0xa9,
495
Johannes Berg15fc1962017-03-10 14:01:42 +0100496 /**
497 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
498 */
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200499 MFUART_LOAD_NOTIFICATION = 0xb1,
500
Johannes Berg15fc1962017-03-10 14:01:42 +0100501 /**
502 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
503 */
Sara Sharon43413a92015-12-31 11:49:18 +0200504 RSS_CONFIG_CMD = 0xb3,
505
Johannes Berg6857df82017-03-15 14:06:53 +0100506 /**
507 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
508 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100509 REPLY_RX_PHY_CMD = 0xc0,
Johannes Berg6857df82017-03-15 14:06:53 +0100510
511 /**
512 * @REPLY_RX_MPDU_CMD:
513 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
514 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100515 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg358631b2017-05-16 15:14:19 +0200516
517 /**
518 * @FRAME_RELEASE:
519 * Frame release (reorder helper) notification, uses
520 * &struct iwl_frame_release
521 */
Johannes Berg13555e82015-09-02 16:16:49 +0200522 FRAME_RELEASE = 0xc3,
Johannes Berg358631b2017-05-16 15:14:19 +0200523
524 /**
525 * @BA_NOTIF:
526 * BlockAck notification, uses &struct iwl_mvm_compressed_ba_notif
527 * or &struct iwl_mvm_ba_notif depending on the HW
528 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100529 BA_NOTIF = 0xc5,
530
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200531 /* Location Aware Regulatory */
Johannes Berg15fc1962017-03-10 14:01:42 +0100532 /**
533 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
534 */
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200535 MCC_UPDATE_CMD = 0xc8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100536
537 /**
538 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
539 */
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200540 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200541
Johannes Berg358631b2017-05-16 15:14:19 +0200542 /**
543 * @MARKER_CMD: trace marker command, uses &struct iwl_mvm_marker
544 */
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300545 MARKER_CMD = 0xcb,
546
Johannes Berg15fc1962017-03-10 14:01:42 +0100547 /**
548 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
549 */
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200550 BT_PROFILE_NOTIFICATION = 0xce,
Johannes Berg358631b2017-05-16 15:14:19 +0200551
Johannes Berg15fc1962017-03-10 14:01:42 +0100552 /**
553 * @BT_CONFIG: &struct iwl_bt_coex_cmd
554 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300555 BT_CONFIG = 0x9b,
Johannes Berg358631b2017-05-16 15:14:19 +0200556
557 /**
558 * @BT_COEX_UPDATE_CORUN_LUT:
559 * &struct iwl_bt_coex_corun_lut_update_cmd
560 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300561 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
Johannes Berg358631b2017-05-16 15:14:19 +0200562
563 /**
564 * @BT_COEX_UPDATE_REDUCED_TXP:
565 * &struct iwl_bt_coex_reduced_txp_update_cmd
566 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300567 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Johannes Berg358631b2017-05-16 15:14:19 +0200568
Johannes Berg15fc1962017-03-10 14:01:42 +0100569 /**
570 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
571 */
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300572 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200573
Johannes Berg15fc1962017-03-10 14:01:42 +0100574 /**
575 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
576 */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200577 REPLY_SF_CFG_CMD = 0xd1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100578 /**
579 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
580 */
Hila Gonen7df15b12012-12-12 11:16:19 +0200581 REPLY_BEACON_FILTERING_CMD = 0xd2,
582
Johannes Berg358631b2017-05-16 15:14:19 +0200583 /**
584 * @DTS_MEASUREMENT_NOTIFICATION:
585 * &struct iwl_dts_measurement_notif_v1 or
586 * &struct iwl_dts_measurement_notif_v2
587 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300588 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
589
Johannes Berg358631b2017-05-16 15:14:19 +0200590 /**
591 * @LDBG_CONFIG_CMD: configure continuous trace recording
592 */
Golan Ben Ami321c2102015-07-27 17:02:35 +0300593 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg358631b2017-05-16 15:14:19 +0200594
595 /**
596 * @DEBUG_LOG_MSG: Debugging log data from firmware
597 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100598 DEBUG_LOG_MSG = 0xf7,
599
Johannes Berg358631b2017-05-16 15:14:19 +0200600 /**
601 * @BCAST_FILTER_CMD: &struct iwl_bcast_filter_cmd
602 */
Eliad Pellerc87163b2014-01-08 10:11:11 +0200603 BCAST_FILTER_CMD = 0xcf,
Johannes Berg358631b2017-05-16 15:14:19 +0200604
605 /**
606 * @MCAST_FILTER_CMD: &struct iwl_mcast_filter_cmd
607 */
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300608 MCAST_FILTER_CMD = 0xd0,
609
Johannes Berg15fc1962017-03-10 14:01:42 +0100610 /**
611 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
612 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100613 D3_CONFIG_CMD = 0xd3,
Johannes Berg358631b2017-05-16 15:14:19 +0200614
615 /**
616 * @PROT_OFFLOAD_CONFIG_CMD: Depending on firmware, uses one of
617 * &struct iwl_proto_offload_cmd_v1, &struct iwl_proto_offload_cmd_v2,
618 * &struct iwl_proto_offload_cmd_v3_small,
619 * &struct iwl_proto_offload_cmd_v3_large
620 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100621 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
Johannes Berg358631b2017-05-16 15:14:19 +0200622
623 /**
624 * @OFFLOADS_QUERY_CMD:
625 * No data in command, response in &struct iwl_wowlan_status
626 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100627 OFFLOADS_QUERY_CMD = 0xd5,
Johannes Berg358631b2017-05-16 15:14:19 +0200628
629 /**
630 * @REMOTE_WAKE_CONFIG_CMD: &struct iwl_wowlan_remote_wake_config
631 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100632 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Johannes Berg358631b2017-05-16 15:14:19 +0200633
634 /**
635 * @D0I3_END_CMD: End D0i3/D3 state, no command data
636 */
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300637 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100638
Johannes Berg15fc1962017-03-10 14:01:42 +0100639 /**
640 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
641 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100642 WOWLAN_PATTERNS = 0xe0,
Johannes Berg15fc1962017-03-10 14:01:42 +0100643
644 /**
645 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
646 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100647 WOWLAN_CONFIGURATION = 0xe1,
Johannes Berg358631b2017-05-16 15:14:19 +0200648
Johannes Berg15fc1962017-03-10 14:01:42 +0100649 /**
650 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
651 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100652 WOWLAN_TSC_RSC_PARAM = 0xe2,
Johannes Berg358631b2017-05-16 15:14:19 +0200653
Johannes Berg15fc1962017-03-10 14:01:42 +0100654 /**
655 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
656 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100657 WOWLAN_TKIP_PARAM = 0xe3,
Johannes Berg358631b2017-05-16 15:14:19 +0200658
Johannes Berg15fc1962017-03-10 14:01:42 +0100659 /**
660 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
661 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100662 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
Johannes Berg358631b2017-05-16 15:14:19 +0200663
Johannes Berg15fc1962017-03-10 14:01:42 +0100664 /**
665 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
666 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100667 WOWLAN_GET_STATUSES = 0xe5,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100668
Johannes Berg358631b2017-05-16 15:14:19 +0200669 /**
670 * @SCAN_OFFLOAD_PROFILES_QUERY_CMD:
671 * No command data, response is &struct iwl_scan_offload_profiles_query
672 */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200673 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100674};
675
Sharon Dvir39bdb172015-10-15 18:18:09 +0300676/* Please keep this enum *SORTED* by hex value.
677 * Needed for binary search, otherwise a warning will be triggered.
678 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200679enum iwl_mac_conf_subcmd_ids {
680 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
681 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200682 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200683};
684
Johannes Berg15fc1962017-03-10 14:01:42 +0100685/**
686 * enum iwl_phy_ops_subcmd_ids - PHY group commands
687 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300688enum iwl_phy_ops_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200689 /**
690 * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
691 * Uses either &struct iwl_dts_measurement_cmd or
692 * &struct iwl_ext_dts_measurement_cmd
693 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300694 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200695
696 /**
697 * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
698 */
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200699 CTDP_CONFIG_CMD = 0x03,
Johannes Berg15fc1962017-03-10 14:01:42 +0100700
701 /**
702 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
703 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200704 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Johannes Berg358631b2017-05-16 15:14:19 +0200705
706 /**
707 * @GEO_TX_POWER_LIMIT: &struct iwl_geo_tx_power_profiles_cmd
708 */
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200709 GEO_TX_POWER_LIMIT = 0x05,
Johannes Berg358631b2017-05-16 15:14:19 +0200710
711 /**
712 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
713 */
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200714 CT_KILL_NOTIFICATION = 0xFE,
Johannes Berg358631b2017-05-16 15:14:19 +0200715
716 /**
717 * @DTS_MEASUREMENT_NOTIF_WIDE:
718 * &struct iwl_dts_measurement_notif_v1 or
719 * &struct iwl_dts_measurement_notif_v2
720 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300721 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
722};
723
Johannes Berg15fc1962017-03-10 14:01:42 +0100724/**
725 * enum iwl_system_subcmd_ids - system group command IDs
726 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200727enum iwl_system_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100728 /**
729 * @SHARED_MEM_CFG_CMD:
730 * response in &struct iwl_shared_mem_cfg or
Johannes Bergb4f48982017-06-01 09:06:11 +0200731 * &struct iwl_shared_mem_cfg_v2
Johannes Berg15fc1962017-03-10 14:01:42 +0100732 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200733 SHARED_MEM_CFG_CMD = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200734
735 /**
736 * @INIT_EXTENDED_CFG_CMD: &struct iwl_init_extended_cfg_cmd
737 */
Sara Sharon4399caa2016-12-11 10:32:42 +0200738 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200739};
740
Johannes Berg15fc1962017-03-10 14:01:42 +0100741/**
742 * enum iwl_data_path_subcmd_ids - data path group commands
743 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200744enum iwl_data_path_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100745 /**
746 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
747 */
Liad Kaufman97d5be72015-08-31 14:33:23 +0300748 DQA_ENABLE_CMD = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200749
750 /**
751 * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd
752 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200753 UPDATE_MU_GROUPS_CMD = 0x1,
Johannes Berg358631b2017-05-16 15:14:19 +0200754
755 /**
756 * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd
757 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200758 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg358631b2017-05-16 15:14:19 +0200759
760 /**
761 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
762 */
Johannes Berg65e25482016-04-13 14:24:22 +0200763 STA_PM_NOTIF = 0xFD,
Johannes Berg358631b2017-05-16 15:14:19 +0200764
765 /**
766 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
767 */
Sara Sharonf92659a2016-02-03 15:04:49 +0200768 MU_GROUP_MGMT_NOTIF = 0xFE,
Johannes Berg358631b2017-05-16 15:14:19 +0200769
770 /**
771 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
772 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200773 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200774};
775
Johannes Berg358631b2017-05-16 15:14:19 +0200776/**
777 * enum iwl_prot_offload_subcmd_ids - protocol offload commands
778 */
Sara Sharon0db056d2015-12-29 11:07:15 +0200779enum iwl_prot_offload_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200780 /**
781 * @STORED_BEACON_NTF: &struct iwl_stored_beacon_notif
782 */
Sara Sharon0db056d2015-12-29 11:07:15 +0200783 STORED_BEACON_NTF = 0xFF,
784};
785
Johannes Berg358631b2017-05-16 15:14:19 +0200786/**
787 * enum iwl_regulatory_and_nvm_subcmd_ids - regulatory/NVM commands
788 */
Sara Sharon1f370652016-08-31 18:13:57 +0300789enum iwl_regulatory_and_nvm_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200790 /**
791 * @NVM_ACCESS_COMPLETE: &struct iwl_nvm_access_complete_cmd
792 */
Sara Sharon1f370652016-08-31 18:13:57 +0300793 NVM_ACCESS_COMPLETE = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200794
795 /**
796 * @NVM_GET_INFO:
797 * Command is &struct iwl_nvm_get_info,
798 * response is &struct iwl_nvm_get_info_rsp
799 */
Sara Sharone9e1ba32017-01-08 16:46:14 +0200800 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300801};
802
Johannes Berge6138c92017-05-04 10:00:03 +0200803/**
804 * enum iwl_debug_cmds - debug commands
805 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200806enum iwl_debug_cmds {
Johannes Berge6138c92017-05-04 10:00:03 +0200807 /**
808 * @LMAC_RD_WR:
809 * LMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
810 * &struct iwl_dbg_mem_access_rsp
811 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400812 LMAC_RD_WR = 0x0,
Johannes Berge6138c92017-05-04 10:00:03 +0200813 /**
814 * @UMAC_RD_WR:
815 * UMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
816 * &struct iwl_dbg_mem_access_rsp
817 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400818 UMAC_RD_WR = 0x1,
Johannes Berge6138c92017-05-04 10:00:03 +0200819 /**
820 * @MFU_ASSERT_DUMP_NTF:
821 * &struct iwl_mfu_assert_dump_notif
822 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200823 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400824};
825
Johannes Berg72361c32017-03-09 17:06:45 +0100826/**
827 * enum iwl_mvm_command_groups - command groups for the firmware
828 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
829 * @LONG_GROUP: legacy group with long header, also uses command IDs
830 * from &enum iwl_legacy_cmds
831 * @SYSTEM_GROUP: system group, uses command IDs from
832 * &enum iwl_system_subcmd_ids
833 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
834 * &enum iwl_mac_conf_subcmd_ids
835 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
836 * &enum iwl_phy_ops_subcmd_ids
837 * @DATA_PATH_GROUP: data path group, uses command IDs from
838 * &enum iwl_data_path_subcmd_ids
Johannes Berg72361c32017-03-09 17:06:45 +0100839 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
840 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
841 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
842 * &enum iwl_prot_offload_subcmd_ids
843 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
844 * &enum iwl_regulatory_and_nvm_subcmd_ids
845 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
846 */
847enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300848 LEGACY_GROUP = 0x0,
849 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200850 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200851 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300852 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200853 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200854 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300855 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400856 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300857};
858
Johannes Berg8ca151b2013-01-24 14:25:36 +0100859/**
860 * struct iwl_cmd_response - generic response struct for most commands
861 * @status: status of the command asked, changes for each one
862 */
863struct iwl_cmd_response {
864 __le32 status;
865};
866
867/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300868 * struct iwl_dqa_enable_cmd
869 * @cmd_queue: the TXQ number of the command queue
870 */
871struct iwl_dqa_enable_cmd {
872 __le32 cmd_queue;
873} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
874
875/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100876 * struct iwl_tx_ant_cfg_cmd
877 * @valid: valid antenna configuration
878 */
879struct iwl_tx_ant_cfg_cmd {
880 __le32 valid;
881} __packed;
882
Johannes Berg31a658b2017-03-09 15:56:57 +0100883/**
884 * struct iwl_calib_ctrl - Calibration control struct.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100885 * Sent as part of the phy configuration command.
886 * @flow_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100887 * flow triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100888 * @event_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100889 * event triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100890 */
891struct iwl_calib_ctrl {
892 __le32 flow_trigger;
893 __le32 event_trigger;
894} __packed;
895
896/* This enum defines the bitmap of various calibrations to enable in both
897 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
898 */
899enum iwl_calib_cfg {
900 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
901 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
902 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
903 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
904 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
905 IWL_CALIB_CFG_DC_IDX = BIT(5),
906 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
907 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
908 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
909 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
910 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
911 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
912 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
913 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
914 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
915 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
916 IWL_CALIB_CFG_DAC_IDX = BIT(16),
917 IWL_CALIB_CFG_ABS_IDX = BIT(17),
918 IWL_CALIB_CFG_AGC_IDX = BIT(18),
919};
920
Johannes Berg31a658b2017-03-09 15:56:57 +0100921/**
922 * struct iwl_phy_cfg_cmd - Phy configuration command
923 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
924 * @calib_control: calibration control data
Johannes Berg8ca151b2013-01-24 14:25:36 +0100925 */
926struct iwl_phy_cfg_cmd {
927 __le32 phy_cfg;
928 struct iwl_calib_ctrl calib_control;
929} __packed;
930
931#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
932#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
933#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
934#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
935#define PHY_CFG_TX_CHAIN_A BIT(8)
936#define PHY_CFG_TX_CHAIN_B BIT(9)
937#define PHY_CFG_TX_CHAIN_C BIT(10)
938#define PHY_CFG_RX_CHAIN_A BIT(12)
939#define PHY_CFG_RX_CHAIN_B BIT(13)
940#define PHY_CFG_RX_CHAIN_C BIT(14)
941
942
Johannes Bergd69f0a22017-03-14 10:58:16 +0100943/**
944 * enum iwl_nvm_access_op - NVM access opcode
945 * @IWL_NVM_READ: read NVM
946 * @IWL_NVM_WRITE: write NVM
947 */
948enum iwl_nvm_access_op {
949 IWL_NVM_READ = 0,
950 IWL_NVM_WRITE = 1,
951};
952
953/**
954 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
955 * @NVM_ACCESS_TARGET_CACHE: access the cache
956 * @NVM_ACCESS_TARGET_OTP: access the OTP
957 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
958 */
959enum iwl_nvm_access_target {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100960 NVM_ACCESS_TARGET_CACHE = 0,
961 NVM_ACCESS_TARGET_OTP = 1,
962 NVM_ACCESS_TARGET_EEPROM = 2,
963};
964
Johannes Bergd69f0a22017-03-14 10:58:16 +0100965/**
966 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
967 * @NVM_SECTION_TYPE_SW: software section
968 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
969 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
970 * @NVM_SECTION_TYPE_PRODUCTION: production section
971 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
972 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
973 * @NVM_MAX_NUM_SECTIONS: number of sections
974 */
975enum iwl_nvm_section_type {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200976 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200977 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200978 NVM_SECTION_TYPE_CALIBRATION = 4,
979 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200980 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200981 NVM_SECTION_TYPE_PHY_SKU = 12,
982 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100983};
984
985/**
Johannes Berg67625862017-03-14 11:01:27 +0100986 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
987 * @op_code: &enum iwl_nvm_access_op
988 * @target: &enum iwl_nvm_access_target
989 * @type: &enum iwl_nvm_section_type
Johannes Berg8ca151b2013-01-24 14:25:36 +0100990 * @offset: offset in bytes into the section
991 * @length: in bytes, to read/write
992 * @data: if write operation, the data to write. On read its empty
993 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200994struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100995 u8 op_code;
996 u8 target;
997 __le16 type;
998 __le16 offset;
999 __le16 length;
1000 u8 data[];
1001} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
1002
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001003#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
1004
Johannes Berg3b43fbc2017-03-13 21:48:39 +01001005/**
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001006 * struct iwl_fw_paging_cmd - paging layout
1007 *
1008 * (FW_PAGING_BLOCK_CMD = 0x4f)
1009 *
1010 * Send to FW the paging layout in the driver.
1011 *
1012 * @flags: various flags for the command
1013 * @block_size: the block size in powers of 2
1014 * @block_num: number of blocks specified in the command.
1015 * @device_phy_addr: virtual addresses from device side
Johannes Berg3b43fbc2017-03-13 21:48:39 +01001016 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001017struct iwl_fw_paging_cmd {
1018 __le32 flags;
1019 __le32 block_size;
1020 __le32 block_num;
Johannes Berg4f2210e2017-06-01 11:37:25 +02001021 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
1022} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001023
Matti Gottliebe1120182015-07-19 11:15:07 +03001024/*
1025 * Fw items ID's
1026 *
1027 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
1028 * download
1029 */
1030enum iwl_fw_item_id {
1031 IWL_FW_ITEM_ID_PAGING = 3,
1032};
1033
1034/*
1035 * struct iwl_fw_get_item_cmd - get an item from the fw
1036 */
1037struct iwl_fw_get_item_cmd {
1038 __le32 item_id;
1039} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
1040
Golan Ben Ami321c2102015-07-27 17:02:35 +03001041#define CONT_REC_COMMAND_SIZE 80
1042#define ENABLE_CONT_RECORDING 0x15
1043#define DISABLE_CONT_RECORDING 0x16
1044
1045/*
1046 * struct iwl_continuous_record_mode - recording mode
1047 */
1048struct iwl_continuous_record_mode {
1049 __le16 enable_recording;
1050} __packed;
1051
1052/*
1053 * struct iwl_continuous_record_cmd - enable/disable continuous recording
1054 */
1055struct iwl_continuous_record_cmd {
1056 struct iwl_continuous_record_mode record_mode;
1057 u8 pad[CONT_REC_COMMAND_SIZE -
1058 sizeof(struct iwl_continuous_record_mode)];
1059} __packed;
1060
Matti Gottliebe1120182015-07-19 11:15:07 +03001061struct iwl_fw_get_item_resp {
1062 __le32 item_id;
1063 __le32 item_byte_cnt;
1064 __le32 item_val;
1065} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
1066
Johannes Berg8ca151b2013-01-24 14:25:36 +01001067/**
1068 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
1069 * @offset: offset in bytes into the section
1070 * @length: in bytes, either how much was written or read
1071 * @type: NVM_SECTION_TYPE_*
1072 * @status: 0 for success, fail otherwise
1073 * @data: if read operation, the data returned. Empty on write.
1074 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +02001075struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +01001076 __le16 offset;
1077 __le16 length;
1078 __le16 type;
1079 __le16 status;
1080 u8 data[];
1081} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
1082
1083/* MVM_ALIVE 0x1 */
1084
1085/* alive response is_valid values */
1086#define ALIVE_RESP_UCODE_OK BIT(0)
1087#define ALIVE_RESP_RFKILL BIT(1)
1088
1089/* alive response ver_type values */
1090enum {
1091 FW_TYPE_HW = 0,
1092 FW_TYPE_PROT = 1,
1093 FW_TYPE_AP = 2,
1094 FW_TYPE_WOWLAN = 3,
1095 FW_TYPE_TIMING = 4,
1096 FW_TYPE_WIPAN = 5
1097};
1098
1099/* alive response ver_subtype values */
1100enum {
1101 FW_SUBTYPE_FULL_FEATURE = 0,
1102 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
1103 FW_SUBTYPE_REDUCED = 2,
1104 FW_SUBTYPE_ALIVE_ONLY = 3,
1105 FW_SUBTYPE_WOWLAN = 4,
1106 FW_SUBTYPE_AP_SUBTYPE = 5,
1107 FW_SUBTYPE_WIPAN = 6,
1108 FW_SUBTYPE_INITIALIZE = 9
1109};
1110
1111#define IWL_ALIVE_STATUS_ERR 0xDEAD
1112#define IWL_ALIVE_STATUS_OK 0xCAFE
1113
1114#define IWL_ALIVE_FLG_RFKILL BIT(0)
1115
Sara Sharon5c228d62016-11-24 13:48:27 +02001116struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001117 __le32 ucode_minor;
1118 __le32 ucode_major;
1119 u8 ver_subtype;
1120 u8 ver_type;
1121 u8 mac;
1122 u8 opt;
1123 __le32 timestamp;
1124 __le32 error_event_table_ptr; /* SRAM address for error log */
1125 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
1126 __le32 cpu_register_ptr;
1127 __le32 dbgm_config_ptr;
1128 __le32 alive_counter_ptr;
1129 __le32 scd_base_ptr; /* SRAM address for SCD */
1130 __le32 st_fwrd_addr; /* pointer to Store and forward */
1131 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +02001132} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
1133
1134struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001135 __le32 umac_minor; /* UMAC version: minor */
1136 __le32 umac_major; /* UMAC version: major */
1137 __le32 error_info_addr; /* SRAM address for UMAC error log */
1138 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +02001139} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
1140
1141struct mvm_alive_resp_v3 {
1142 __le16 status;
1143 __le16 flags;
1144 struct iwl_lmac_alive lmac_data;
1145 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001146} __packed; /* ALIVE_RES_API_S_VER_3 */
1147
Sara Sharon5c228d62016-11-24 13:48:27 +02001148struct mvm_alive_resp {
1149 __le16 status;
1150 __le16 flags;
1151 struct iwl_lmac_alive lmac_data[2];
1152 struct iwl_umac_alive umac_data;
1153} __packed; /* ALIVE_RES_API_S_VER_4 */
1154
Johannes Berg8ca151b2013-01-24 14:25:36 +01001155/* Error response/notification */
1156enum {
1157 FW_ERR_UNKNOWN_CMD = 0x0,
1158 FW_ERR_INVALID_CMD_PARAM = 0x1,
1159 FW_ERR_SERVICE = 0x2,
1160 FW_ERR_ARC_MEMORY = 0x3,
1161 FW_ERR_ARC_CODE = 0x4,
1162 FW_ERR_WATCH_DOG = 0x5,
1163 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
1164 FW_ERR_WEP_KEY_SIZE = 0x11,
1165 FW_ERR_OBSOLETE_FUNC = 0x12,
1166 FW_ERR_UNEXPECTED = 0xFE,
1167 FW_ERR_FATAL = 0xFF
1168};
1169
1170/**
1171 * struct iwl_error_resp - FW error indication
1172 * ( REPLY_ERROR = 0x2 )
1173 * @error_type: one of FW_ERR_*
1174 * @cmd_id: the command ID for which the error occured
Johannes Bergacf91dd2017-05-16 16:15:42 +02001175 * @reserved1: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +01001176 * @bad_cmd_seq_num: sequence number of the erroneous command
1177 * @error_service: which service created the error, applicable only if
1178 * error_type = 2, otherwise 0
1179 * @timestamp: TSF in usecs.
1180 */
1181struct iwl_error_resp {
1182 __le32 error_type;
1183 u8 cmd_id;
1184 u8 reserved1;
1185 __le16 bad_cmd_seq_num;
1186 __le32 error_service;
1187 __le64 timestamp;
1188} __packed;
1189
1190
1191/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001192#define MAX_MACS_IN_BINDING (3)
1193#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +01001194
Johannes Bergd69f0a22017-03-14 10:58:16 +01001195/**
1196 * enum iwl_mvm_id_and_color - ID and color fields in context dword
1197 * @FW_CTXT_ID_POS: position of the ID
1198 * @FW_CTXT_ID_MSK: mask of the ID
1199 * @FW_CTXT_COLOR_POS: position of the color
1200 * @FW_CTXT_COLOR_MSK: mask of the color
1201 * @FW_CTXT_INVALID: value used to indicate unused/invalid
1202 */
1203enum iwl_mvm_id_and_color {
1204 FW_CTXT_ID_POS = 0,
1205 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
1206 FW_CTXT_COLOR_POS = 8,
1207 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
1208 FW_CTXT_INVALID = 0xffffffff,
1209};
Johannes Berg8ca151b2013-01-24 14:25:36 +01001210
1211#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
1212 (_color << FW_CTXT_COLOR_POS))
1213
1214/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +02001215enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +01001216 FW_CTXT_ACTION_STUB = 0,
1217 FW_CTXT_ACTION_ADD,
1218 FW_CTXT_ACTION_MODIFY,
1219 FW_CTXT_ACTION_REMOVE,
1220 FW_CTXT_ACTION_NUM
1221}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
1222
1223/* Time Events */
1224
1225/* Time Event types, according to MAC type */
1226enum iwl_time_event_type {
1227 /* BSS Station Events */
1228 TE_BSS_STA_AGGRESSIVE_ASSOC,
1229 TE_BSS_STA_ASSOC,
1230 TE_BSS_EAP_DHCP_PROT,
1231 TE_BSS_QUIET_PERIOD,
1232
1233 /* P2P Device Events */
1234 TE_P2P_DEVICE_DISCOVERABLE,
1235 TE_P2P_DEVICE_LISTEN,
1236 TE_P2P_DEVICE_ACTION_SCAN,
1237 TE_P2P_DEVICE_FULL_SCAN,
1238
1239 /* P2P Client Events */
1240 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
1241 TE_P2P_CLIENT_ASSOC,
1242 TE_P2P_CLIENT_QUIET_PERIOD,
1243
1244 /* P2P GO Events */
1245 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02001246 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +01001247 TE_P2P_GO_CT_WINDOW,
1248
1249 /* WiDi Sync Events */
1250 TE_WIDI_TX_SYNC,
1251
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001252 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +03001253 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001254
Johannes Berg8ca151b2013-01-24 14:25:36 +01001255 TE_MAX
1256}; /* MAC_EVENT_TYPE_API_E_VER_1 */
1257
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001258
1259
1260/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001261
1262/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001263 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1264 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1265 * the first fragment is scheduled.
1266 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1267 * the first 2 fragments are scheduled.
1268 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1269 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001270 *
1271 * Other than the constant defined above, specifying a fragmentation value 'x'
1272 * means that the event can be fragmented but only the first 'x' will be
1273 * scheduled.
1274 */
1275enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001276 TE_V1_FRAG_NONE = 0,
1277 TE_V1_FRAG_SINGLE = 1,
1278 TE_V1_FRAG_DUAL = 2,
1279 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +01001280};
1281
Johannes Berg8ca151b2013-01-24 14:25:36 +01001282/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001283#define TE_V1_FRAG_MAX_MSK 0x0fffffff
1284/* Repeat the time event endlessly (until removed) */
1285#define TE_V1_REPEAT_ENDLESS 0xffffffff
1286/* If a Time Event has bounded repetitions, this is the maximal value */
1287#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1288
1289/* Time Event dependencies: none, on another TE, or in a specific time */
1290enum {
1291 TE_V1_INDEPENDENT = 0,
1292 TE_V1_DEP_OTHER = BIT(0),
1293 TE_V1_DEP_TSF = BIT(1),
1294 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1295}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1296
1297/*
1298 * @TE_V1_NOTIF_NONE: no notifications
1299 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1300 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1301 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1302 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1303 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1304 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1305 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1306 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1307 *
1308 * Supported Time event notifications configuration.
1309 * A notification (both event and fragment) includes a status indicating weather
1310 * the FW was able to schedule the event or not. For fragment start/end
1311 * notification the status is always success. There is no start/end fragment
1312 * notification for monolithic events.
1313 */
1314enum {
1315 TE_V1_NOTIF_NONE = 0,
1316 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1317 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1318 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1319 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1320 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1321 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1322 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1323 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1324}; /* MAC_EVENT_ACTION_API_E_VER_2 */
1325
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001326/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001327
1328/*
1329 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1330 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1331 * the first fragment is scheduled.
1332 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1333 * the first 2 fragments are scheduled.
1334 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1335 * number of fragments are valid.
1336 *
1337 * Other than the constant defined above, specifying a fragmentation value 'x'
1338 * means that the event can be fragmented but only the first 'x' will be
1339 * scheduled.
1340 */
1341enum {
1342 TE_V2_FRAG_NONE = 0,
1343 TE_V2_FRAG_SINGLE = 1,
1344 TE_V2_FRAG_DUAL = 2,
1345 TE_V2_FRAG_MAX = 0xfe,
1346 TE_V2_FRAG_ENDLESS = 0xff
1347};
1348
1349/* Repeat the time event endlessly (until removed) */
1350#define TE_V2_REPEAT_ENDLESS 0xff
1351/* If a Time Event has bounded repetitions, this is the maximal value */
1352#define TE_V2_REPEAT_MAX 0xfe
1353
1354#define TE_V2_PLACEMENT_POS 12
1355#define TE_V2_ABSENCE_POS 15
1356
Johannes Bergd69f0a22017-03-14 10:58:16 +01001357/**
1358 * enum iwl_time_event_policy - Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001359 * A notification (both event and fragment) includes a status indicating weather
1360 * the FW was able to schedule the event or not. For fragment start/end
1361 * notification the status is always success. There is no start/end fragment
1362 * notification for monolithic events.
1363 *
1364 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1365 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1366 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1367 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1368 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1369 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1370 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1371 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1372 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
Johannes Bergd69f0a22017-03-14 10:58:16 +01001373 * @T2_V2_START_IMMEDIATELY: start time event immediately
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001374 * @TE_V2_DEP_OTHER: depends on another time event
1375 * @TE_V2_DEP_TSF: depends on a specific time
1376 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1377 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1378 */
Johannes Bergd69f0a22017-03-14 10:58:16 +01001379enum iwl_time_event_policy {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001380 TE_V2_DEFAULT_POLICY = 0x0,
1381
1382 /* notifications (event start/stop, fragment start/stop) */
1383 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1384 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1385 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1386 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1387
1388 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1389 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1390 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1391 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +02001392 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001393
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001394 /* placement characteristics */
1395 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1396 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1397 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1398
1399 /* are we present or absent during the Time Event. */
1400 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1401};
1402
1403/**
Johannes Berg67625862017-03-14 11:01:27 +01001404 * struct iwl_time_event_cmd - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001405 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1406 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1407 * ( TIME_EVENT_CMD = 0x29 )
Johannes Berg67625862017-03-14 11:01:27 +01001408 * @id_and_color: ID and color of the relevant MAC,
1409 * &enum iwl_mvm_id_and_color
1410 * @action: action to perform, one of &enum iwl_phy_ctxt_action
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001411 * @id: this field has two meanings, depending on the action:
1412 * If the action is ADD, then it means the type of event to add.
1413 * For all other actions it is the unique event ID assigned when the
1414 * event was added by the FW.
1415 * @apply_time: When to start the Time Event (in GP2)
1416 * @max_delay: maximum delay to event's start (apply time), in TU
1417 * @depends_on: the unique ID of the event we depend on (if any)
1418 * @interval: interval between repetitions, in TU
1419 * @duration: duration of event in TU
1420 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1421 * @max_frags: maximal number of fragments the Time Event can be divided to
1422 * @policy: defines whether uCode shall notify the host or other uCode modules
1423 * on event and/or fragment start and/or end
1424 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1425 * TE_EVENT_SOCIOPATHIC
Johannes Berg67625862017-03-14 11:01:27 +01001426 * using TE_ABSENCE and using TE_NOTIF_*,
1427 * &enum iwl_time_event_policy
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001428 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001429struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001430 /* COMMON_INDEX_HDR_API_S_VER_1 */
1431 __le32 id_and_color;
1432 __le32 action;
1433 __le32 id;
1434 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1435 __le32 apply_time;
1436 __le32 max_delay;
1437 __le32 depends_on;
1438 __le32 interval;
1439 __le32 duration;
1440 u8 repeat;
1441 u8 max_frags;
1442 __le16 policy;
1443} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1444
Johannes Berg8ca151b2013-01-24 14:25:36 +01001445/**
1446 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1447 * @status: bit 0 indicates success, all others specify errors
1448 * @id: the Time Event type
1449 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
Johannes Berg67625862017-03-14 11:01:27 +01001450 * @id_and_color: ID and color of the relevant MAC,
1451 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001452 */
1453struct iwl_time_event_resp {
1454 __le32 status;
1455 __le32 id;
1456 __le32 unique_id;
1457 __le32 id_and_color;
1458} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1459
1460/**
1461 * struct iwl_time_event_notif - notifications of time event start/stop
1462 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1463 * @timestamp: action timestamp in GP2
1464 * @session_id: session's unique id
1465 * @unique_id: unique id of the Time Event itself
1466 * @id_and_color: ID and color of the relevant MAC
Johannes Berg67625862017-03-14 11:01:27 +01001467 * @action: &enum iwl_time_event_policy
Johannes Berg8ca151b2013-01-24 14:25:36 +01001468 * @status: true if scheduled, false otherwise (not executed)
1469 */
1470struct iwl_time_event_notif {
1471 __le32 timestamp;
1472 __le32 session_id;
1473 __le32 unique_id;
1474 __le32 id_and_color;
1475 __le32 action;
1476 __le32 status;
1477} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1478
1479
1480/* Bindings and Time Quota */
1481
1482/**
Johannes Berg4d151c22017-03-14 11:04:06 +01001483 * struct iwl_binding_cmd_v1 - configuring bindings
1484 * ( BINDING_CONTEXT_CMD = 0x2b )
1485 * @id_and_color: ID and color of the relevant Binding,
1486 * &enum iwl_mvm_id_and_color
1487 * @action: action to perform, one of FW_CTXT_ACTION_*
1488 * @macs: array of MAC id and colors which belong to the binding,
1489 * &enum iwl_mvm_id_and_color
1490 * @phy: PHY id and color which belongs to the binding,
1491 * &enum iwl_mvm_id_and_color
1492 */
1493struct iwl_binding_cmd_v1 {
1494 /* COMMON_INDEX_HDR_API_S_VER_1 */
1495 __le32 id_and_color;
1496 __le32 action;
1497 /* BINDING_DATA_API_S_VER_1 */
1498 __le32 macs[MAX_MACS_IN_BINDING];
1499 __le32 phy;
1500} __packed; /* BINDING_CMD_API_S_VER_1 */
1501
1502/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001503 * struct iwl_binding_cmd - configuring bindings
1504 * ( BINDING_CONTEXT_CMD = 0x2b )
Johannes Berg67625862017-03-14 11:01:27 +01001505 * @id_and_color: ID and color of the relevant Binding,
1506 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001507 * @action: action to perform, one of FW_CTXT_ACTION_*
1508 * @macs: array of MAC id and colors which belong to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001509 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001510 * @phy: PHY id and color which belongs to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001511 * &enum iwl_mvm_id_and_color
Sara Sharon9415af72016-11-17 13:57:32 +02001512 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001513 */
1514struct iwl_binding_cmd {
1515 /* COMMON_INDEX_HDR_API_S_VER_1 */
1516 __le32 id_and_color;
1517 __le32 action;
1518 /* BINDING_DATA_API_S_VER_1 */
1519 __le32 macs[MAX_MACS_IN_BINDING];
1520 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001521 __le32 lmac_id;
1522} __packed; /* BINDING_CMD_API_S_VER_2 */
1523
Johannes Berg4d151c22017-03-14 11:04:06 +01001524#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
Sara Sharon9415af72016-11-17 13:57:32 +02001525#define IWL_LMAC_24G_INDEX 0
1526#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001527
Ilan Peer35adfd62013-02-04 13:16:24 +02001528/* The maximal number of fragments in the FW's schedule session */
1529#define IWL_MVM_MAX_QUOTA 128
1530
Johannes Berg8ca151b2013-01-24 14:25:36 +01001531/**
1532 * struct iwl_time_quota_data - configuration of time quota per binding
Johannes Berg67625862017-03-14 11:01:27 +01001533 * @id_and_color: ID and color of the relevant Binding,
1534 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001535 * @quota: absolute time quota in TU. The scheduler will try to divide the
1536 * remainig quota (after Time Events) according to this quota.
1537 * @max_duration: max uninterrupted context duration in TU
1538 */
1539struct iwl_time_quota_data {
1540 __le32 id_and_color;
1541 __le32 quota;
1542 __le32 max_duration;
1543} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1544
1545/**
1546 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1547 * ( TIME_QUOTA_CMD = 0x2c )
1548 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001549 * Note: on non-CDB the fourth one is the auxilary mac and is
1550 * essentially zero.
1551 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001552 */
1553struct iwl_time_quota_cmd {
1554 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1555} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1556
1557
1558/* PHY context */
1559
1560/* Supported bands */
1561#define PHY_BAND_5 (0)
1562#define PHY_BAND_24 (1)
1563
1564/* Supported channel width, vary if there is VHT support */
1565#define PHY_VHT_CHANNEL_MODE20 (0x0)
1566#define PHY_VHT_CHANNEL_MODE40 (0x1)
1567#define PHY_VHT_CHANNEL_MODE80 (0x2)
1568#define PHY_VHT_CHANNEL_MODE160 (0x3)
1569
1570/*
1571 * Control channel position:
1572 * For legacy set bit means upper channel, otherwise lower.
1573 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1574 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1575 * center_freq
1576 * |
1577 * 40Mhz |_______|_______|
1578 * 80Mhz |_______|_______|_______|_______|
1579 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1580 * code 011 010 001 000 | 100 101 110 111
1581 */
1582#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1583#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1584#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1585#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1586#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1587#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1588#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1589#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1590
1591/*
1592 * @band: PHY_BAND_*
1593 * @channel: channel number
1594 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1595 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1596 */
1597struct iwl_fw_channel_info {
1598 u8 band;
1599 u8 channel;
1600 u8 width;
1601 u8 ctrl_pos;
1602} __packed;
1603
1604#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1605#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1606 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1607#define PHY_RX_CHAIN_VALID_POS (1)
1608#define PHY_RX_CHAIN_VALID_MSK \
1609 (0x7 << PHY_RX_CHAIN_VALID_POS)
1610#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1611#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1612 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1613#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1614#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1615 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1616#define PHY_RX_CHAIN_CNT_POS (10)
1617#define PHY_RX_CHAIN_CNT_MSK \
1618 (0x3 << PHY_RX_CHAIN_CNT_POS)
1619#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1620#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1621 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1622#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1623#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1624 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1625
1626/* TODO: fix the value, make it depend on firmware at runtime? */
1627#define NUM_PHY_CTX 3
1628
1629/* TODO: complete missing documentation */
1630/**
1631 * struct iwl_phy_context_cmd - config of the PHY context
1632 * ( PHY_CONTEXT_CMD = 0x8 )
1633 * @id_and_color: ID and color of the relevant Binding
1634 * @action: action to perform, one of FW_CTXT_ACTION_*
1635 * @apply_time: 0 means immediate apply and context switch.
1636 * other value means apply new params after X usecs
1637 * @tx_param_color: ???
Johannes Bergacf91dd2017-05-16 16:15:42 +02001638 * @ci: channel info
Johannes Berg8ca151b2013-01-24 14:25:36 +01001639 * @txchain_info: ???
1640 * @rxchain_info: ???
1641 * @acquisition_data: ???
1642 * @dsp_cfg_flags: set to 0
1643 */
1644struct iwl_phy_context_cmd {
1645 /* COMMON_INDEX_HDR_API_S_VER_1 */
1646 __le32 id_and_color;
1647 __le32 action;
1648 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1649 __le32 apply_time;
1650 __le32 tx_param_color;
1651 struct iwl_fw_channel_info ci;
1652 __le32 txchain_info;
1653 __le32 rxchain_info;
1654 __le32 acquisition_data;
1655 __le32 dsp_cfg_flags;
1656} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1657
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001658/*
1659 * Aux ROC command
1660 *
1661 * Command requests the firmware to create a time event for a certain duration
1662 * and remain on the given channel. This is done by using the Aux framework in
1663 * the FW.
1664 * The command was first used for Hot Spot issues - but can be used regardless
1665 * to Hot Spot.
1666 *
1667 * ( HOT_SPOT_CMD 0x53 )
1668 *
1669 * @id_and_color: ID and color of the MAC
1670 * @action: action to perform, one of FW_CTXT_ACTION_*
1671 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1672 * event_unique_id should be the id of the time event assigned by ucode.
1673 * Otherwise ignore the event_unique_id.
1674 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1675 * activity.
1676 * @channel_info: channel info
1677 * @node_addr: Our MAC Address
1678 * @reserved: reserved for alignment
1679 * @apply_time: GP2 value to start (should always be the current GP2 value)
1680 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1681 * time by which start of the event is allowed to be postponed.
1682 * @duration: event duration in TU To calculate event duration:
1683 * timeEventDuration = min(duration, remainingQuota)
1684 */
1685struct iwl_hs20_roc_req {
1686 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1687 __le32 id_and_color;
1688 __le32 action;
1689 __le32 event_unique_id;
1690 __le32 sta_id_and_color;
1691 struct iwl_fw_channel_info channel_info;
1692 u8 node_addr[ETH_ALEN];
1693 __le16 reserved;
1694 __le32 apply_time;
1695 __le32 apply_time_max_delay;
1696 __le32 duration;
1697} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1698
1699/*
1700 * values for AUX ROC result values
1701 */
1702enum iwl_mvm_hot_spot {
1703 HOT_SPOT_RSP_STATUS_OK,
1704 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1705 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1706};
1707
1708/*
1709 * Aux ROC command response
1710 *
1711 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1712 * driver the uid of the timevent.
1713 *
1714 * ( HOT_SPOT_CMD 0x53 )
1715 *
1716 * @event_unique_id: Unique ID of time event assigned by ucode
1717 * @status: Return status 0 is success, all the rest used for specific errors
1718 */
1719struct iwl_hs20_roc_res {
1720 __le32 event_unique_id;
1721 __le32 status;
1722} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1723
Johannes Berg8ca151b2013-01-24 14:25:36 +01001724/**
1725 * struct iwl_radio_version_notif - information on the radio version
1726 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
Johannes Bergacf91dd2017-05-16 16:15:42 +02001727 * @radio_flavor: radio flavor
1728 * @radio_step: radio version step
1729 * @radio_dash: radio version dash
Johannes Berg8ca151b2013-01-24 14:25:36 +01001730 */
1731struct iwl_radio_version_notif {
1732 __le32 radio_flavor;
1733 __le32 radio_step;
1734 __le32 radio_dash;
1735} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1736
1737enum iwl_card_state_flags {
1738 CARD_ENABLED = 0x00,
1739 HW_CARD_DISABLED = 0x01,
1740 SW_CARD_DISABLED = 0x02,
1741 CT_KILL_CARD_DISABLED = 0x04,
1742 HALT_CARD_DISABLED = 0x08,
1743 CARD_DISABLED_MSK = 0x0f,
1744 CARD_IS_RX_ON = 0x10,
1745};
1746
1747/**
1748 * struct iwl_radio_version_notif - information on the radio version
1749 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1750 * @flags: %iwl_card_state_flags
1751 */
1752struct iwl_card_state_notif {
1753 __le32 flags;
1754} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1755
1756/**
Hila Gonend64048e2013-03-13 18:00:03 +02001757 * struct iwl_missed_beacons_notif - information on missed beacons
1758 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1759 * @mac_id: interface ID
1760 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1761 * beacons since last RX.
1762 * @consec_missed_beacons: number of consecutive missed beacons
Johannes Bergacf91dd2017-05-16 16:15:42 +02001763 * @num_expected_beacons: number of expected beacons
1764 * @num_recvd_beacons: number of received beacons
Hila Gonend64048e2013-03-13 18:00:03 +02001765 */
1766struct iwl_missed_beacons_notif {
1767 __le32 mac_id;
1768 __le32 consec_missed_beacons_since_last_rx;
1769 __le32 consec_missed_beacons;
1770 __le32 num_expected_beacons;
1771 __le32 num_recvd_beacons;
1772} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1773
1774/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001775 * struct iwl_mfuart_load_notif - mfuart image version & status
1776 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1777 * @installed_ver: installed image version
1778 * @external_ver: external image version
1779 * @status: MFUART loading status
1780 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001781 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001782*/
1783struct iwl_mfuart_load_notif {
1784 __le32 installed_ver;
1785 __le32 external_ver;
1786 __le32 status;
1787 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001788 /* image size valid only in v2 of the command */
1789 __le32 image_size;
1790} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001791
1792/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001793 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1794 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1795 * @assert_id: mfuart assert id that cause the notif
1796 * @curr_reset_num: number of asserts since uptime
1797 * @index_num: current chunk id
1798 * @parts_num: total number of chunks
1799 * @data_size: number of data bytes sent
1800 * @data: data buffer
1801 */
1802struct iwl_mfu_assert_dump_notif {
1803 __le32 assert_id;
1804 __le32 curr_reset_num;
1805 __le16 index_num;
1806 __le16 parts_num;
1807 __le32 data_size;
1808 __le32 data[0];
1809} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1810
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001811#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001812#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001813
1814/**
1815 * struct iwl_mcast_filter_cmd - configure multicast filter.
1816 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1817 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1818 * to identify network interface adopted in host-device IF.
1819 * It is used by FW as index in array of addresses. This array has
1820 * MAX_PORT_ID_NUM members.
1821 * @count: Number of MAC addresses in the array
1822 * @pass_all: Set 1 to pass all multicast packets.
1823 * @bssid: current association BSSID.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001824 * @reserved: reserved
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001825 * @addr_list: Place holder for array of MAC addresses.
1826 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1827 */
1828struct iwl_mcast_filter_cmd {
1829 u8 filter_own;
1830 u8 port_id;
1831 u8 count;
1832 u8 pass_all;
1833 u8 bssid[6];
1834 u8 reserved[2];
1835 u8 addr_list[0];
1836} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1837
Eliad Pellerc87163b2014-01-08 10:11:11 +02001838#define MAX_BCAST_FILTERS 8
1839#define MAX_BCAST_FILTER_ATTRS 2
1840
1841/**
1842 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1843 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1844 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1845 * start of ip payload).
1846 */
1847enum iwl_mvm_bcast_filter_attr_offset {
1848 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1849 BCAST_FILTER_OFFSET_IP_END = 1,
1850};
1851
1852/**
1853 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1854 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1855 * @offset: starting offset of this pattern.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001856 * @reserved1: reserved
1857 * @val: value to match - big endian (MSB is the first
Eliad Pellerc87163b2014-01-08 10:11:11 +02001858 * byte to match from offset pos).
1859 * @mask: mask to match (big endian).
1860 */
1861struct iwl_fw_bcast_filter_attr {
1862 u8 offset_type;
1863 u8 offset;
1864 __le16 reserved1;
1865 __be32 val;
1866 __be32 mask;
1867} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1868
1869/**
1870 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1871 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1872 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1873 */
1874enum iwl_mvm_bcast_filter_frame_type {
1875 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1876 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1877};
1878
1879/**
1880 * struct iwl_fw_bcast_filter - broadcast filter
1881 * @discard: discard frame (1) or let it pass (0).
1882 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001883 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001884 * @num_attrs: number of valid attributes in this filter.
1885 * @attrs: attributes of this filter. a filter is considered matched
1886 * only when all its attributes are matched (i.e. AND relationship)
1887 */
1888struct iwl_fw_bcast_filter {
1889 u8 discard;
1890 u8 frame_type;
1891 u8 num_attrs;
1892 u8 reserved1;
1893 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1894} __packed; /* BCAST_FILTER_S_VER_1 */
1895
Sara Sharon3af512d62015-07-22 11:38:40 +03001896#define BA_WINDOW_STREAMS_MAX 16
1897#define BA_WINDOW_STATUS_TID_MSK 0x000F
1898#define BA_WINDOW_STATUS_STA_ID_POS 4
1899#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1900#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1901
1902/**
1903 * struct iwl_ba_window_status_notif - reordering window's status notification
1904 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1905 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1906 * @start_seq_num: the start sequence number of the bitmap
1907 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1908 */
1909struct iwl_ba_window_status_notif {
1910 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1911 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1912 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1913 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1914} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1915
Eliad Pellerc87163b2014-01-08 10:11:11 +02001916/**
1917 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1918 * @default_discard: default action for this mac (discard (1) / pass (0)).
Johannes Bergacf91dd2017-05-16 16:15:42 +02001919 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001920 * @attached_filters: bitmap of relevant filters for this mac.
1921 */
1922struct iwl_fw_bcast_mac {
1923 u8 default_discard;
1924 u8 reserved1;
1925 __le16 attached_filters;
1926} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1927
1928/**
1929 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1930 * @disable: enable (0) / disable (1)
1931 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1932 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
Johannes Bergacf91dd2017-05-16 16:15:42 +02001933 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001934 * @filters: broadcast filters
1935 * @macs: broadcast filtering configuration per-mac
1936 */
1937struct iwl_bcast_filter_cmd {
1938 u8 disable;
1939 u8 max_bcast_filters;
1940 u8 max_macs;
1941 u8 reserved1;
1942 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1943 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1944} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1945
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001946/*
1947 * enum iwl_mvm_marker_id - maker ids
1948 *
1949 * The ids for different type of markers to insert into the usniffer logs
1950 */
1951enum iwl_mvm_marker_id {
1952 MARKER_ID_TX_FRAME_LATENCY = 1,
1953}; /* MARKER_ID_API_E_VER_1 */
1954
1955/**
1956 * struct iwl_mvm_marker - mark info into the usniffer logs
1957 *
1958 * (MARKER_CMD = 0xcb)
1959 *
1960 * Mark the UTC time stamp into the usniffer logs together with additional
1961 * metadata, so the usniffer output can be parsed.
1962 * In the command response the ucode will return the GP2 time.
1963 *
1964 * @dw_len: The amount of dwords following this byte including this byte.
1965 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1966 * @reserved: reserved.
1967 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1968 * @metadata: additional meta data that will be written to the unsiffer log
1969 */
1970struct iwl_mvm_marker {
Johannes Berg1644be92017-05-16 13:21:52 +02001971 u8 dw_len;
1972 u8 marker_id;
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001973 __le16 reserved;
1974 __le64 timestamp;
1975 __le32 metadata[0];
1976} __packed; /* MARKER_API_S_VER_1 */
1977
Matti Gottlieb0becb372015-05-31 09:18:30 +03001978/*
1979 * enum iwl_dc2dc_config_id - flag ids
1980 *
1981 * Ids of dc2dc configuration flags
1982 */
1983enum iwl_dc2dc_config_id {
1984 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1985 DCDC_FREQ_TUNE_SET = 0x2,
1986}; /* MARKER_ID_API_E_VER_1 */
1987
1988/**
1989 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1990 *
1991 * (DC2DC_CONFIG_CMD = 0x83)
1992 *
1993 * Set/Get & configure dc2dc values.
1994 * The command always returns the current dc2dc values.
1995 *
1996 * @flags: set/get dc2dc
1997 * @enable_low_power_mode: not used.
1998 * @dc2dc_freq_tune0: frequency divider - digital domain
1999 * @dc2dc_freq_tune1: frequency divider - analog domain
2000 */
2001struct iwl_dc2dc_config_cmd {
2002 __le32 flags;
2003 __le32 enable_low_power_mode; /* not used */
2004 __le32 dc2dc_freq_tune0;
2005 __le32 dc2dc_freq_tune1;
2006} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
2007
2008/**
2009 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
2010 *
2011 * Current dc2dc values returned by the FW.
2012 *
2013 * @dc2dc_freq_tune0: frequency divider - digital domain
2014 * @dc2dc_freq_tune1: frequency divider - analog domain
2015 */
2016struct iwl_dc2dc_config_resp {
2017 __le32 dc2dc_freq_tune0;
2018 __le32 dc2dc_freq_tune1;
2019} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
2020
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002021/***********************************
2022 * Smart Fifo API
2023 ***********************************/
2024/* Smart Fifo state */
2025enum iwl_sf_state {
2026 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
2027 SF_FULL_ON,
2028 SF_UNINIT,
2029 SF_INIT_OFF,
2030 SF_HW_NUM_STATES
2031};
2032
2033/* Smart Fifo possible scenario */
2034enum iwl_sf_scenario {
2035 SF_SCENARIO_SINGLE_UNICAST,
2036 SF_SCENARIO_AGG_UNICAST,
2037 SF_SCENARIO_MULTICAST,
2038 SF_SCENARIO_BA_RESP,
2039 SF_SCENARIO_TX_RESP,
2040 SF_NUM_SCENARIO
2041};
2042
2043#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
2044#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
2045
2046/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02002047#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002048#define SF_W_MARK_MIMO2 8192
2049#define SF_W_MARK_MIMO3 6144
2050#define SF_W_MARK_LEGACY 4096
2051#define SF_W_MARK_SCAN 4096
2052
Eran Hararyf4a3ee42015-02-08 13:58:50 +02002053/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
2054#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
2055#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2056#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
2057#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2058#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
2059#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2060#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
2061#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
2062#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
2063#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
2064
2065/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002066#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
2067#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
2068#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
2069#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
2070#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
2071#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
2072#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
2073#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
2074#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
2075#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
2076
2077#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
2078
Eran Harary161bdb72014-07-27 08:03:06 +03002079#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
2080
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002081/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002082 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
2083 * @state: smart fifo state, types listed in &enum iwl_sf_state.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002084 * @watermark: Minimum allowed availabe free space in RXF for transient state.
2085 * @long_delay_timeouts: aging and idle timer values for each scenario
2086 * in long delay state.
2087 * @full_on_timeouts: timer values for each scenario in full on state.
2088 */
2089struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03002090 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002091 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
2092 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
2093 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
2094} __packed; /* SF_CFG_API_S_VER_2 */
2095
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002096/***********************************
2097 * Location Aware Regulatory (LAR) API - MCC updates
2098 ***********************************/
2099
2100/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002101 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002102 * regulatory profile according to the given MCC (Mobile Country Code).
2103 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2104 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2105 * MCC in the cmd response will be the relevant MCC in the NVM.
2106 * @mcc: given mobile country code
2107 * @source_id: the source from where we got the MCC, see iwl_mcc_source
2108 * @reserved: reserved for alignment
2109 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002110struct iwl_mcc_update_cmd_v1 {
2111 __le16 mcc;
2112 u8 source_id;
2113 u8 reserved;
2114} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
2115
2116/**
2117 * struct iwl_mcc_update_cmd - Request the device to update geographic
2118 * regulatory profile according to the given MCC (Mobile Country Code).
2119 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2120 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2121 * MCC in the cmd response will be the relevant MCC in the NVM.
2122 * @mcc: given mobile country code
2123 * @source_id: the source from where we got the MCC, see iwl_mcc_source
2124 * @reserved: reserved for alignment
2125 * @key: integrity key for MCC API OEM testing
2126 * @reserved2: reserved
2127 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002128struct iwl_mcc_update_cmd {
2129 __le16 mcc;
2130 u8 source_id;
2131 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002132 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01002133 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002134} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002135
2136/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002137 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002138 * Contains the new channel control profile map, if changed, and the new MCC
2139 * (mobile country code).
2140 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02002141 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002142 * @mcc: the new applied MCC
2143 * @cap: capabilities for all channels which matches the MCC
2144 * @source_id: the MCC source, see iwl_mcc_source
2145 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
2146 * channels, depending on platform)
2147 * @channels: channel control data map, DWORD for each channel. Only the first
2148 * 16bits are used.
2149 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002150struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002151 __le32 status;
2152 __le16 mcc;
2153 u8 cap;
2154 u8 source_id;
2155 __le32 n_channels;
2156 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002157} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
2158
2159/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002160 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002161 * Contains the new channel control profile map, if changed, and the new MCC
2162 * (mobile country code).
2163 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
2164 * @status: see &enum iwl_mcc_update_status
2165 * @mcc: the new applied MCC
2166 * @cap: capabilities for all channels which matches the MCC
2167 * @source_id: the MCC source, see iwl_mcc_source
2168 * @time: time elapsed from the MCC test start (in 30 seconds TU)
2169 * @reserved: reserved.
2170 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
2171 * channels, depending on platform)
2172 * @channels: channel control data map, DWORD for each channel. Only the first
2173 * 16bits are used.
2174 */
2175struct iwl_mcc_update_resp {
2176 __le32 status;
2177 __le16 mcc;
2178 u8 cap;
2179 u8 source_id;
2180 __le16 time;
2181 __le16 reserved;
2182 __le32 n_channels;
2183 __le32 channels[0];
2184} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002185
2186/**
2187 * struct iwl_mcc_chub_notif - chub notifies of mcc change
2188 * (MCC_CHUB_UPDATE_CMD = 0xc9)
2189 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
2190 * the cellular and connectivity cores that gets updates of the mcc, and
2191 * notifies the ucode directly of any mcc change.
2192 * The ucode requests the driver to request the device to update geographic
2193 * regulatory profile according to the given MCC (Mobile Country Code).
2194 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2195 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2196 * MCC in the cmd response will be the relevant MCC in the NVM.
2197 * @mcc: given mobile country code
2198 * @source_id: identity of the change originator, see iwl_mcc_source
2199 * @reserved1: reserved for alignment
2200 */
2201struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01002202 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002203 u8 source_id;
2204 u8 reserved1;
2205} __packed; /* LAR_MCC_NOTIFY_S */
2206
2207enum iwl_mcc_update_status {
2208 MCC_RESP_NEW_CHAN_PROFILE,
2209 MCC_RESP_SAME_CHAN_PROFILE,
2210 MCC_RESP_INVALID,
2211 MCC_RESP_NVM_DISABLED,
2212 MCC_RESP_ILLEGAL,
2213 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002214 MCC_RESP_TEST_MODE_ACTIVE,
2215 MCC_RESP_TEST_MODE_NOT_ACTIVE,
2216 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002217};
2218
2219enum iwl_mcc_source {
2220 MCC_SOURCE_OLD_FW = 0,
2221 MCC_SOURCE_ME = 1,
2222 MCC_SOURCE_BIOS = 2,
2223 MCC_SOURCE_3G_LTE_HOST = 3,
2224 MCC_SOURCE_3G_LTE_DEVICE = 4,
2225 MCC_SOURCE_WIFI = 5,
2226 MCC_SOURCE_RESERVED = 6,
2227 MCC_SOURCE_DEFAULT = 7,
2228 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002229 MCC_SOURCE_MCC_API = 9,
2230 MCC_SOURCE_GET_CURRENT = 0x10,
2231 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002232};
2233
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002234/* DTS measurements */
2235
2236enum iwl_dts_measurement_flags {
2237 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
2238 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
2239};
2240
2241/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002242 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002243 *
Johannes Berg31a658b2017-03-09 15:56:57 +01002244 * @flags: indicates which measurements we want as specified in
2245 * &enum iwl_dts_measurement_flags
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002246 */
2247struct iwl_dts_measurement_cmd {
2248 __le32 flags;
2249} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2250
2251/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03002252* enum iwl_dts_control_measurement_mode - DTS measurement type
2253* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2254* back (latest value. Not waiting for new value). Use automatic
2255* SW DTS configuration.
2256* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2257* trigger DTS reading and provide read back temperature read
2258* when available.
2259* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2260* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2261* without measurement trigger.
2262*/
2263enum iwl_dts_control_measurement_mode {
2264 DTS_AUTOMATIC = 0,
2265 DTS_REQUEST_READ = 1,
2266 DTS_OVER_WRITE = 2,
2267 DTS_DIRECT_WITHOUT_MEASURE = 3,
2268};
2269
2270/**
2271* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2272* @DTS_USE_TOP: Top
2273* @DTS_USE_CHAIN_A: chain A
2274* @DTS_USE_CHAIN_B: chain B
2275* @DTS_USE_CHAIN_C: chain C
Johannes Bergacf91dd2017-05-16 16:15:42 +02002276* @XTAL_TEMPERATURE: read temperature from xtal
Arik Nemtsov78efc702015-10-06 12:22:47 +03002277*/
2278enum iwl_dts_used {
2279 DTS_USE_TOP = 0,
2280 DTS_USE_CHAIN_A = 1,
2281 DTS_USE_CHAIN_B = 2,
2282 DTS_USE_CHAIN_C = 3,
2283 XTAL_TEMPERATURE = 4,
2284};
2285
2286/**
2287* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2288* @DTS_BIT6_MODE: bit 6 mode
2289* @DTS_BIT8_MODE: bit 8 mode
2290*/
2291enum iwl_dts_bit_mode {
2292 DTS_BIT6_MODE = 0,
2293 DTS_BIT8_MODE = 1,
2294};
2295
2296/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002297 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
Arik Nemtsov78efc702015-10-06 12:22:47 +03002298 * @control_mode: see &enum iwl_dts_control_measurement_mode
2299 * @temperature: used when over write DTS mode is selected
2300 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2301 * @avg_factor: average factor to DTS in request DTS read mode
2302 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2303 * @step_duration: step duration for the DTS
2304 */
2305struct iwl_ext_dts_measurement_cmd {
2306 __le32 control_mode;
2307 __le32 temperature;
2308 __le32 sensor;
2309 __le32 avg_factor;
2310 __le32 bit_mode;
2311 __le32 step_duration;
2312} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2313
2314/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002315 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002316 *
2317 * @temp: the measured temperature
2318 * @voltage: the measured voltage
2319 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002320struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002321 __le32 temp;
2322 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002323} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2324
2325/**
2326 * struct iwl_dts_measurement_notif_v2 - measurements notification
2327 *
2328 * @temp: the measured temperature
2329 * @voltage: the measured voltage
2330 * @threshold_idx: the trip index that was crossed
2331 */
2332struct iwl_dts_measurement_notif_v2 {
2333 __le32 temp;
2334 __le32 voltage;
2335 __le32 threshold_idx;
2336} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002337
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02002338/**
2339 * struct ct_kill_notif - CT-kill entry notification
2340 *
2341 * @temperature: the current temperature in celsius
2342 * @reserved: reserved
2343 */
2344struct ct_kill_notif {
2345 __le16 temperature;
2346 __le16 reserved;
2347} __packed; /* GRP_PHY_CT_KILL_NTF */
2348
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002349/**
2350* enum ctdp_cmd_operation - CTDP command operations
2351* @CTDP_CMD_OPERATION_START: update the current budget
2352* @CTDP_CMD_OPERATION_STOP: stop ctdp
Chaya Rachel Ivgi3b9449b2017-05-08 15:14:01 +03002353* @CTDP_CMD_OPERATION_REPORT: get the average budget
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002354*/
2355enum iwl_mvm_ctdp_cmd_operation {
2356 CTDP_CMD_OPERATION_START = 0x1,
2357 CTDP_CMD_OPERATION_STOP = 0x2,
2358 CTDP_CMD_OPERATION_REPORT = 0x4,
2359};/* CTDP_CMD_OPERATION_TYPE_E */
2360
2361/**
2362 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2363 *
2364 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2365 * @budget: the budget in milliwatt
2366 * @window_size: defined in API but not used
2367 */
2368struct iwl_mvm_ctdp_cmd {
2369 __le32 operation;
2370 __le32 budget;
2371 __le32 window_size;
2372} __packed;
2373
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002374#define IWL_MAX_DTS_TRIPS 8
2375
2376/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002377 * struct temp_report_ths_cmd - set temperature thresholds
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002378 *
2379 * @num_temps: number of temperature thresholds passed
2380 * @thresholds: array with the thresholds to be configured
2381 */
2382struct temp_report_ths_cmd {
2383 __le32 num_temps;
2384 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2385} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2386
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002387/***********************************
2388 * TDLS API
2389 ***********************************/
2390
2391/* Type of TDLS request */
2392enum iwl_tdls_channel_switch_type {
2393 TDLS_SEND_CHAN_SW_REQ = 0,
2394 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2395 TDLS_MOVE_CH,
2396}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2397
2398/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002399 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002400 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2401 * received from peer
2402 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2403 * to the TDLS off-channel communication. For instance if the DTIM is
2404 * 200TU and the TDLS peer is to be given 25% of the time, the value
2405 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2406 * @switch_time: switch time the peer sent in its channel switch timing IE
Johannes Berg83b03192017-05-16 13:28:53 +02002407 * @switch_timeout: switch timeout the peer sent in its channel switch timing IE
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002408 */
2409struct iwl_tdls_channel_switch_timing {
2410 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2411 __le32 max_offchan_duration; /* given in micro-seconds */
2412 __le32 switch_time; /* given in micro-seconds */
2413 __le32 switch_timeout; /* given in micro-seconds */
2414} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2415
2416#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2417
2418/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002419 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002420 *
2421 * A template representing a TDLS channel-switch request or response frame
2422 *
2423 * @switch_time_offset: offset to the channel switch timing IE in the template
2424 * @tx_cmd: Tx parameters for the frame
2425 * @data: frame data
2426 */
2427struct iwl_tdls_channel_switch_frame {
2428 __le32 switch_time_offset;
2429 struct iwl_tx_cmd tx_cmd;
2430 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2431} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2432
2433/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002434 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002435 *
2436 * The command is sent to initiate a channel switch and also in response to
2437 * incoming TDLS channel-switch request/response packets from remote peers.
2438 *
2439 * @switch_type: see &enum iwl_tdls_channel_switch_type
2440 * @peer_sta_id: station id of TDLS peer
2441 * @ci: channel we switch to
2442 * @timing: timing related data for command
2443 * @frame: channel-switch request/response template, depending to switch_type
2444 */
2445struct iwl_tdls_channel_switch_cmd {
2446 u8 switch_type;
2447 __le32 peer_sta_id;
2448 struct iwl_fw_channel_info ci;
2449 struct iwl_tdls_channel_switch_timing timing;
2450 struct iwl_tdls_channel_switch_frame frame;
2451} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2452
2453/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002454 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002455 *
2456 * @status: non-zero on success
2457 * @offchannel_duration: duration given in microseconds
2458 * @sta_id: peer currently performing the channel-switch with
2459 */
2460struct iwl_tdls_channel_switch_notif {
2461 __le32 status;
2462 __le32 offchannel_duration;
2463 __le32 sta_id;
2464} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2465
Arik Nemtsov307e4722014-09-15 18:48:59 +03002466/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002467 * struct iwl_tdls_sta_info - TDLS station info
Arik Nemtsov307e4722014-09-15 18:48:59 +03002468 *
2469 * @sta_id: station id of the TDLS peer
2470 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2471 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2472 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2473 */
2474struct iwl_tdls_sta_info {
2475 u8 sta_id;
2476 u8 tx_to_peer_tid;
2477 __le16 tx_to_peer_ssn;
2478 __le32 is_initiator;
2479} __packed; /* TDLS_STA_INFO_VER_1 */
2480
2481/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002482 * struct iwl_tdls_config_cmd - TDLS basic config command
Arik Nemtsov307e4722014-09-15 18:48:59 +03002483 *
2484 * @id_and_color: MAC id and color being configured
2485 * @tdls_peer_count: amount of currently connected TDLS peers
2486 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2487 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2488 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2489 * @pti_req_data_offset: offset of network-level data for the PTI template
2490 * @pti_req_tx_cmd: Tx parameters for PTI request template
2491 * @pti_req_template: PTI request template data
2492 */
2493struct iwl_tdls_config_cmd {
2494 __le32 id_and_color; /* mac id and color */
2495 u8 tdls_peer_count;
2496 u8 tx_to_ap_tid;
2497 __le16 tx_to_ap_ssn;
2498 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2499
2500 __le32 pti_req_data_offset;
2501 struct iwl_tx_cmd pti_req_tx_cmd;
2502 u8 pti_req_template[0];
2503} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2504
2505/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002506 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
Arik Nemtsov307e4722014-09-15 18:48:59 +03002507 *
2508 * @sta_id: station id of the TDLS peer
2509 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2510 * the peer
2511 */
2512struct iwl_tdls_config_sta_info_res {
2513 __le16 sta_id;
2514 __le16 tx_to_peer_last_seq;
2515} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2516
2517/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002518 * struct iwl_tdls_config_res - TDLS config information from FW
Arik Nemtsov307e4722014-09-15 18:48:59 +03002519 *
2520 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2521 * @sta_info: per-station TDLS config information
2522 */
2523struct iwl_tdls_config_res {
2524 __le32 tx_to_ap_last_seq;
2525 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2526} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2527
Sara Sharondb06f042016-07-05 17:37:58 +03002528#define TX_FIFO_MAX_NUM_9000 8
2529#define TX_FIFO_MAX_NUM 15
2530#define RX_FIFO_MAX_NUM 2
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002531#define TX_FIFO_INTERNAL_MAX_NUM 6
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002532
2533/**
Johannes Bergb4f48982017-06-01 09:06:11 +02002534 * struct iwl_shared_mem_cfg_v2 - Shared memory configuration information
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002535 *
2536 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2537 * accessible)
2538 * @shared_mem_size: shared memory size
2539 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2540 * 0x0 as accessible only via DBGM RDAT)
2541 * @sample_buff_size: internal sample buff size
2542 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2543 * 8000 HW set to 0x0 as not accessible)
2544 * @txfifo_size: size of TXF0 ... TXF7
2545 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2546 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2547 * when paging is not supported this should be 0
2548 * @page_buff_size: size of %page_buff_addr
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002549 * @rxfifo_addr: Start address of rxFifo
2550 * @internal_txfifo_addr: start address of internalFifo
2551 * @internal_txfifo_size: internal fifos' size
2552 *
2553 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2554 * set, the last 3 members don't exist.
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002555 */
Johannes Bergb4f48982017-06-01 09:06:11 +02002556struct iwl_shared_mem_cfg_v2 {
Sara Sharondb06f042016-07-05 17:37:58 +03002557 __le32 shared_mem_addr;
2558 __le32 shared_mem_size;
2559 __le32 sample_buff_addr;
2560 __le32 sample_buff_size;
2561 __le32 txfifo_addr;
2562 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2563 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2564 __le32 page_buff_addr;
2565 __le32 page_buff_size;
2566 __le32 rxfifo_addr;
2567 __le32 internal_txfifo_addr;
2568 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2569} __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2570
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002571/**
2572 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2573 *
2574 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2575 * @txfifo_size: size of TX FIFOs
2576 * @rxfifo1_addr: RXF1 addr
2577 * @rxfifo1_size: RXF1 size
2578 */
2579struct iwl_shared_mem_lmac_cfg {
2580 __le32 txfifo_addr;
2581 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2582 __le32 rxfifo1_addr;
2583 __le32 rxfifo1_size;
2584
2585} __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2586
2587/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002588 * struct iwl_shared_mem_cfg - Shared memory configuration information
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002589 *
2590 * @shared_mem_addr: shared memory address
2591 * @shared_mem_size: shared memory size
2592 * @sample_buff_addr: internal sample (mon/adc) buff addr
2593 * @sample_buff_size: internal sample buff size
2594 * @rxfifo2_addr: start addr of RXF2
2595 * @rxfifo2_size: size of RXF2
2596 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2597 * when paging is not supported this should be 0
2598 * @page_buff_size: size of %page_buff_addr
2599 * @lmac_num: number of LMACs (1 or 2)
2600 * @lmac_smem: per - LMAC smem data
2601 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002602struct iwl_shared_mem_cfg {
2603 __le32 shared_mem_addr;
2604 __le32 shared_mem_size;
2605 __le32 sample_buff_addr;
2606 __le32 sample_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002607 __le32 rxfifo2_addr;
2608 __le32 rxfifo2_size;
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002609 __le32 page_buff_addr;
2610 __le32 page_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002611 __le32 lmac_num;
2612 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
Sara Sharondb06f042016-07-05 17:37:58 +03002613} __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002614
Sara Sharona07a8f32015-11-15 11:11:59 +02002615/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002616 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
Sara Sharona07a8f32015-11-15 11:11:59 +02002617 *
Johannes Bergacf91dd2017-05-16 16:15:42 +02002618 * @reserved: reserved
Sara Sharona07a8f32015-11-15 11:11:59 +02002619 * @membership_status: a bitmap of MU groups
2620 * @user_position:the position of station in a group. If the station is in the
2621 * group then bits (group * 2) is the position -1
2622 */
2623struct iwl_mu_group_mgmt_cmd {
2624 __le32 reserved;
2625 __le32 membership_status[2];
2626 __le32 user_position[4];
2627} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2628
Sara Sharonf92659a2016-02-03 15:04:49 +02002629/**
2630 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2631 *
2632 * @membership_status: a bitmap of MU groups
2633 * @user_position: the position of station in a group. If the station is in the
2634 * group then bits (group * 2) is the position -1
2635 */
2636struct iwl_mu_group_mgmt_notif {
2637 __le32 membership_status[2];
2638 __le32 user_position[4];
2639} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2640
Sara Sharon0db056d2015-12-29 11:07:15 +02002641#define MAX_STORED_BEACON_SIZE 600
2642
2643/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002644 * struct iwl_stored_beacon_notif - Stored beacon notification
Sara Sharon0db056d2015-12-29 11:07:15 +02002645 *
2646 * @system_time: system time on air rise
2647 * @tsf: TSF on air rise
2648 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002649 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002650 * @channel: channel this beacon was received on
2651 * @rates: rate in ucode internal format
2652 * @byte_count: frame's byte count
Johannes Bergacf91dd2017-05-16 16:15:42 +02002653 * @data: beacon data, length in @byte_count
Sara Sharon0db056d2015-12-29 11:07:15 +02002654 */
2655struct iwl_stored_beacon_notif {
2656 __le32 system_time;
2657 __le64 tsf;
2658 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002659 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002660 __le16 channel;
2661 __le32 rates;
2662 __le32 byte_count;
2663 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002664} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002665
Aviya Erenfeld03098262016-02-18 14:09:33 +02002666#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2667
2668enum iwl_lqm_cmd_operatrions {
2669 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2670 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2671};
2672
2673enum iwl_lqm_status {
2674 LQM_STATUS_SUCCESS = 0,
2675 LQM_STATUS_TIMEOUT = 1,
2676 LQM_STATUS_ABORT = 2,
2677};
2678
2679/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002680 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
Johannes Berg83b03192017-05-16 13:28:53 +02002681 * @cmd_operation: command operation to be performed (start or stop)
Aviya Erenfeld03098262016-02-18 14:09:33 +02002682 * as defined above.
2683 * @mac_id: MAC ID the measurement applies to.
2684 * @measurement_time: time of the total measurement to be performed, in uSec.
2685 * @timeout: maximum time allowed until a response is sent, in uSec.
2686 */
2687struct iwl_link_qual_msrmnt_cmd {
2688 __le32 cmd_operation;
2689 __le32 mac_id;
2690 __le32 measurement_time;
2691 __le32 timeout;
2692} __packed /* LQM_CMD_API_S_VER_1 */;
2693
2694/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002695 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
Aviya Erenfeld03098262016-02-18 14:09:33 +02002696 *
2697 * @frequent_stations_air_time: an array containing the total air time
2698 * (in uSec) used by the most frequently transmitting stations.
2699 * @number_of_stations: the number of uniqe stations included in the array
2700 * (a number between 0 to 16)
2701 * @total_air_time_other_stations: the total air time (uSec) used by all the
2702 * stations which are not included in the above report.
2703 * @time_in_measurement_window: the total time in uSec in which a measurement
2704 * took place.
2705 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2706 * measurement
2707 * @mac_id: MAC ID the measurement applies to.
2708 * @status: return status. may be one of the LQM_STATUS_* defined above.
2709 * @reserved: reserved.
2710 */
2711struct iwl_link_qual_msrmnt_notif {
2712 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2713 __le32 number_of_stations;
2714 __le32 total_air_time_other_stations;
2715 __le32 time_in_measurement_window;
2716 __le32 tx_frame_dropped;
2717 __le32 mac_id;
2718 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002719 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002720} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2721
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002722/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002723 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002724 *
2725 * @id_and_color: ID and color of the MAC
2726 */
2727struct iwl_channel_switch_noa_notif {
2728 __le32 id_and_color;
2729} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2730
Ido Yariv2b55f432016-08-23 14:44:59 -04002731/* Operation types for the debug mem access */
2732enum {
2733 DEBUG_MEM_OP_READ = 0,
2734 DEBUG_MEM_OP_WRITE = 1,
2735 DEBUG_MEM_OP_WRITE_BYTES = 2,
2736};
2737
2738#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2739
2740/**
2741 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2742 * @op: DEBUG_MEM_OP_*
2743 * @addr: address to read/write from/to
2744 * @len: in dwords, to read/write
2745 * @data: for write opeations, contains the source buffer
2746 */
2747struct iwl_dbg_mem_access_cmd {
2748 __le32 op;
2749 __le32 addr;
2750 __le32 len;
2751 __le32 data[];
2752} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2753
2754/* Status responses for the debug mem access */
2755enum {
2756 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2757 DEBUG_MEM_STATUS_FAILED = 0x1,
2758 DEBUG_MEM_STATUS_LOCKED = 0x2,
2759 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2760 DEBUG_MEM_STATUS_LENGTH = 0x4,
2761};
2762
2763/**
2764 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2765 * @status: DEBUG_MEM_STATUS_*
2766 * @len: read dwords (0 for write operations)
2767 * @data: contains the read DWs
2768 */
2769struct iwl_dbg_mem_access_rsp {
2770 __le32 status;
2771 __le32 len;
2772 __le32 data[];
2773} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2774
Sara Sharon1f370652016-08-31 18:13:57 +03002775/**
2776 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
Johannes Bergacf91dd2017-05-16 16:15:42 +02002777 * @reserved: reserved
Sara Sharon1f370652016-08-31 18:13:57 +03002778 */
2779struct iwl_nvm_access_complete_cmd {
2780 __le32 reserved;
2781} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2782
Sara Sharon4399caa2016-12-11 10:32:42 +02002783/**
2784 * enum iwl_extended_cfg_flag - commands driver may send before
2785 * finishing init flow
2786 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2787 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2788 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2789 */
2790enum iwl_extended_cfg_flags {
2791 IWL_INIT_DEBUG_CFG,
2792 IWL_INIT_NVM,
2793 IWL_INIT_PHY,
2794};
2795
2796/**
2797 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2798 * before finishing init flows
2799 * @init_flags: values from iwl_extended_cfg_flags
2800 */
2801struct iwl_init_extended_cfg_cmd {
2802 __le32 init_flags;
2803} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2804
Sara Sharone9e1ba32017-01-08 16:46:14 +02002805/*
2806 * struct iwl_nvm_get_info - request to get NVM data
2807 */
2808struct iwl_nvm_get_info {
2809 __le32 reserved;
2810} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2811
2812/**
2813 * struct iwl_nvm_get_info_general - general NVM data
2814 * @flags: 1 - empty, 0 - valid
2815 * @nvm_version: nvm version
2816 * @board_type: board type
Johannes Bergacf91dd2017-05-16 16:15:42 +02002817 * @reserved: reserved
Sara Sharone9e1ba32017-01-08 16:46:14 +02002818 */
2819struct iwl_nvm_get_info_general {
2820 __le32 flags;
2821 __le16 nvm_version;
2822 u8 board_type;
2823 u8 reserved;
2824} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2825
2826/**
2827 * struct iwl_nvm_get_info_sku - mac information
2828 * @enable_24g: band 2.4G enabled
2829 * @enable_5g: band 5G enabled
2830 * @enable_11n: 11n enabled
2831 * @enable_11ac: 11ac enabled
2832 * @mimo_disable: MIMO enabled
2833 * @ext_crypto: Extended crypto enabled
2834 */
2835struct iwl_nvm_get_info_sku {
2836 __le32 enable_24g;
2837 __le32 enable_5g;
2838 __le32 enable_11n;
2839 __le32 enable_11ac;
2840 __le32 mimo_disable;
2841 __le32 ext_crypto;
2842} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2843
2844/**
2845 * struct iwl_nvm_get_info_phy - phy information
2846 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2847 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2848 */
2849struct iwl_nvm_get_info_phy {
2850 __le32 tx_chains;
2851 __le32 rx_chains;
2852} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2853
2854#define IWL_NUM_CHANNELS (51)
2855
2856/**
2857 * struct iwl_nvm_get_info_regulatory - regulatory information
2858 * @lar_enabled: is LAR enabled
2859 * @channel_profile: regulatory data of this channel
Johannes Berg358631b2017-05-16 15:14:19 +02002860 * @reserved: reserved
Sara Sharone9e1ba32017-01-08 16:46:14 +02002861 */
2862struct iwl_nvm_get_info_regulatory {
2863 __le32 lar_enabled;
2864 __le16 channel_profile[IWL_NUM_CHANNELS];
2865 __le16 reserved;
2866} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2867
2868/**
2869 * struct iwl_nvm_get_info_rsp - response to get NVM data
2870 * @general: general NVM data
2871 * @mac_sku: data relating to MAC sku
2872 * @phy_sku: data relating to PHY sku
2873 * @regulatory: regulatory data
2874 */
2875struct iwl_nvm_get_info_rsp {
2876 struct iwl_nvm_get_info_general general;
2877 struct iwl_nvm_get_info_sku mac_sku;
2878 struct iwl_nvm_get_info_phy phy_sku;
2879 struct iwl_nvm_get_info_regulatory regulatory;
2880} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2881
Johannes Berg15fc1962017-03-10 14:01:42 +01002882/**
2883 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2884 * @isolation: antenna isolation value
2885 */
2886struct iwl_mvm_antenna_coupling_notif {
2887 __le32 isolation;
2888} __packed;
2889
Johannes Berg8ca151b2013-01-24 14:25:36 +01002890#endif /* __fw_api_h__ */