blob: 17475e269ef58aa0b3624bcce62eab4e9d061544 [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:
329 * &struct iwl_fw_paging_cmd or &struct iwl_fw_paging_cmd_v1
330 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300331 FW_PAGING_BLOCK_CMD = 0x4f,
332
Johannes Berg358631b2017-05-16 15:14:19 +0200333 /**
334 * @SCAN_OFFLOAD_REQUEST_CMD: uses &struct iwl_scan_req_lmac
335 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100336 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
Johannes Berg358631b2017-05-16 15:14:19 +0200337
338 /**
339 * @SCAN_OFFLOAD_ABORT_CMD: abort the scan - no further contents
340 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100341 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Johannes Berg358631b2017-05-16 15:14:19 +0200342
343 /**
344 * @HOT_SPOT_CMD: uses &struct iwl_hs20_roc_req
345 */
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300346 HOT_SPOT_CMD = 0x53,
Johannes Berg358631b2017-05-16 15:14:19 +0200347
348 /**
349 * @SCAN_OFFLOAD_COMPLETE:
350 * notification, &struct iwl_periodic_scan_complete
351 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100352 SCAN_OFFLOAD_COMPLETE = 0x6D,
Johannes Berg358631b2017-05-16 15:14:19 +0200353
354 /**
355 * @SCAN_OFFLOAD_UPDATE_PROFILES_CMD:
356 * update scan offload (scheduled scan) profiles/blacklist/etc.
357 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100358 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
Johannes Berg358631b2017-05-16 15:14:19 +0200359
360 /**
361 * @MATCH_FOUND_NOTIFICATION: scan match found
362 */
David Spinadel35a000b2013-08-28 09:29:43 +0300363 MATCH_FOUND_NOTIFICATION = 0xd9,
Johannes Berg358631b2017-05-16 15:14:19 +0200364
365 /**
366 * @SCAN_ITERATION_COMPLETE:
367 * uses &struct iwl_lmac_scan_complete_notif
368 */
David Spinadelfb98be52014-05-04 12:51:10 +0300369 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100370
371 /* Phy */
Johannes Berg15fc1962017-03-10 14:01:42 +0100372 /**
373 * @PHY_CONFIGURATION_CMD: &struct iwl_phy_cfg_cmd
374 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100375 PHY_CONFIGURATION_CMD = 0x6a,
Johannes Berg358631b2017-05-16 15:14:19 +0200376
377 /**
378 * @CALIB_RES_NOTIF_PHY_DB: &struct iwl_calib_res_notif_phy_db
379 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100380 CALIB_RES_NOTIF_PHY_DB = 0x6b,
Johannes Berg358631b2017-05-16 15:14:19 +0200381
382 /**
383 * @PHY_DB_CMD: &struct iwl_phy_db_cmd
384 */
Sara Sharon176aa602016-08-31 19:03:01 +0300385 PHY_DB_CMD = 0x6c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100386
Johannes Berg358631b2017-05-16 15:14:19 +0200387 /**
388 * @TOF_CMD: &struct iwl_tof_config_cmd
389 */
Gregory Greenmance792912015-06-02 18:06:16 +0300390 TOF_CMD = 0x10,
Johannes Berg358631b2017-05-16 15:14:19 +0200391
392 /**
393 * @TOF_NOTIFICATION: &struct iwl_tof_gen_resp_cmd
394 */
Gregory Greenmance792912015-06-02 18:06:16 +0300395 TOF_NOTIFICATION = 0x11,
396
Johannes Berg15fc1962017-03-10 14:01:42 +0100397 /**
398 * @POWER_TABLE_CMD: &struct iwl_device_power_cmd
399 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100400 POWER_TABLE_CMD = 0x77,
Johannes Berg358631b2017-05-16 15:14:19 +0200401
402 /**
403 * @PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION:
404 * &struct iwl_uapsd_misbehaving_ap_notif
405 */
Alexander Bondar175a70b2013-04-14 20:59:37 +0300406 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Johannes Berg358631b2017-05-16 15:14:19 +0200407
408 /**
409 * @LTR_CONFIG: &struct iwl_ltr_config_cmd
410 */
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300411 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100412
Johannes Berg358631b2017-05-16 15:14:19 +0200413 /**
414 * @REPLY_THERMAL_MNG_BACKOFF:
415 * Thermal throttling command
416 */
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300417 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
418
Johannes Berg358631b2017-05-16 15:14:19 +0200419 /**
420 * @DC2DC_CONFIG_CMD:
421 * Set/Get DC2DC frequency tune
422 * Command is &struct iwl_dc2dc_config_cmd,
423 * response is &struct iwl_dc2dc_config_resp
424 */
Matti Gottlieb0becb372015-05-31 09:18:30 +0300425 DC2DC_CONFIG_CMD = 0x83,
426
Johannes Berg15fc1962017-03-10 14:01:42 +0100427 /**
428 * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd
429 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100430 NVM_ACCESS_CMD = 0x88,
431
Johannes Berg358631b2017-05-16 15:14:19 +0200432 /**
433 * @BEACON_NOTIFICATION: &struct iwl_extended_beacon_notif
434 */
Ilan Peer571765c2013-03-05 15:26:03 +0200435 BEACON_NOTIFICATION = 0x90,
Johannes Berg358631b2017-05-16 15:14:19 +0200436
Johannes Bergb7bea642017-03-31 10:48:17 +0200437 /**
438 * @BEACON_TEMPLATE_CMD:
439 * Uses one of &struct iwl_mac_beacon_cmd_v6,
440 * &struct iwl_mac_beacon_cmd_v7 or &struct iwl_mac_beacon_cmd
441 * depending on the device version.
442 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100443 BEACON_TEMPLATE_CMD = 0x91,
Johannes Berg15fc1962017-03-10 14:01:42 +0100444 /**
445 * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
446 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100447 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg15fc1962017-03-10 14:01:42 +0100448
449 /**
450 * @STATISTICS_CMD: &struct iwl_statistics_cmd
451 */
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100452 STATISTICS_CMD = 0x9c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100453
454 /**
455 * @STATISTICS_NOTIFICATION:
456 * one of &struct iwl_notif_statistics_v10,
457 * &struct iwl_notif_statistics_v11,
458 * &struct iwl_notif_statistics_cdb
459 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100460 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg358631b2017-05-16 15:14:19 +0200461
462 /**
463 * @EOSP_NOTIFICATION:
464 * Notify that a service period ended,
465 * &struct iwl_mvm_eosp_notification
466 */
Johannes Berg3e56ead2013-02-15 22:23:18 +0100467 EOSP_NOTIFICATION = 0x9e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100468
469 /**
470 * @REDUCE_TX_POWER_CMD:
471 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
472 */
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300473 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100474
Johannes Berg358631b2017-05-16 15:14:19 +0200475 /**
476 * @CARD_STATE_NOTIFICATION:
477 * Card state (RF/CT kill) notification,
478 * uses &struct iwl_card_state_notif
479 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100480 CARD_STATE_NOTIFICATION = 0xa1,
481
Johannes Berg358631b2017-05-16 15:14:19 +0200482 /**
483 * @MISSED_BEACONS_NOTIFICATION: &struct iwl_missed_beacons_notif
484 */
Hila Gonend64048e2013-03-13 18:00:03 +0200485 MISSED_BEACONS_NOTIFICATION = 0xa2,
486
Johannes Berg15fc1962017-03-10 14:01:42 +0100487 /**
488 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
489 */
Alexander Bondare811ada2013-03-10 15:29:44 +0200490 MAC_PM_POWER_TABLE = 0xa9,
491
Johannes Berg15fc1962017-03-10 14:01:42 +0100492 /**
493 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
494 */
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200495 MFUART_LOAD_NOTIFICATION = 0xb1,
496
Johannes Berg15fc1962017-03-10 14:01:42 +0100497 /**
498 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
499 */
Sara Sharon43413a92015-12-31 11:49:18 +0200500 RSS_CONFIG_CMD = 0xb3,
501
Johannes Berg6857df82017-03-15 14:06:53 +0100502 /**
503 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
504 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100505 REPLY_RX_PHY_CMD = 0xc0,
Johannes Berg6857df82017-03-15 14:06:53 +0100506
507 /**
508 * @REPLY_RX_MPDU_CMD:
509 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
510 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100511 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg358631b2017-05-16 15:14:19 +0200512
513 /**
514 * @FRAME_RELEASE:
515 * Frame release (reorder helper) notification, uses
516 * &struct iwl_frame_release
517 */
Johannes Berg13555e82015-09-02 16:16:49 +0200518 FRAME_RELEASE = 0xc3,
Johannes Berg358631b2017-05-16 15:14:19 +0200519
520 /**
521 * @BA_NOTIF:
522 * BlockAck notification, uses &struct iwl_mvm_compressed_ba_notif
523 * or &struct iwl_mvm_ba_notif depending on the HW
524 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100525 BA_NOTIF = 0xc5,
526
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200527 /* Location Aware Regulatory */
Johannes Berg15fc1962017-03-10 14:01:42 +0100528 /**
529 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
530 */
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200531 MCC_UPDATE_CMD = 0xc8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100532
533 /**
534 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
535 */
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200536 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200537
Johannes Berg358631b2017-05-16 15:14:19 +0200538 /**
539 * @MARKER_CMD: trace marker command, uses &struct iwl_mvm_marker
540 */
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300541 MARKER_CMD = 0xcb,
542
Johannes Berg15fc1962017-03-10 14:01:42 +0100543 /**
544 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
545 */
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200546 BT_PROFILE_NOTIFICATION = 0xce,
Johannes Berg358631b2017-05-16 15:14:19 +0200547
Johannes Berg15fc1962017-03-10 14:01:42 +0100548 /**
549 * @BT_CONFIG: &struct iwl_bt_coex_cmd
550 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300551 BT_CONFIG = 0x9b,
Johannes Berg358631b2017-05-16 15:14:19 +0200552
553 /**
554 * @BT_COEX_UPDATE_CORUN_LUT:
555 * &struct iwl_bt_coex_corun_lut_update_cmd
556 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300557 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
Johannes Berg358631b2017-05-16 15:14:19 +0200558
559 /**
560 * @BT_COEX_UPDATE_REDUCED_TXP:
561 * &struct iwl_bt_coex_reduced_txp_update_cmd
562 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300563 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Johannes Berg358631b2017-05-16 15:14:19 +0200564
Johannes Berg15fc1962017-03-10 14:01:42 +0100565 /**
566 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
567 */
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300568 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200569
Johannes Berg15fc1962017-03-10 14:01:42 +0100570 /**
571 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
572 */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200573 REPLY_SF_CFG_CMD = 0xd1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100574 /**
575 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
576 */
Hila Gonen7df15b12012-12-12 11:16:19 +0200577 REPLY_BEACON_FILTERING_CMD = 0xd2,
578
Johannes Berg358631b2017-05-16 15:14:19 +0200579 /**
580 * @DTS_MEASUREMENT_NOTIFICATION:
581 * &struct iwl_dts_measurement_notif_v1 or
582 * &struct iwl_dts_measurement_notif_v2
583 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300584 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
585
Johannes Berg358631b2017-05-16 15:14:19 +0200586 /**
587 * @LDBG_CONFIG_CMD: configure continuous trace recording
588 */
Golan Ben Ami321c2102015-07-27 17:02:35 +0300589 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg358631b2017-05-16 15:14:19 +0200590
591 /**
592 * @DEBUG_LOG_MSG: Debugging log data from firmware
593 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100594 DEBUG_LOG_MSG = 0xf7,
595
Johannes Berg358631b2017-05-16 15:14:19 +0200596 /**
597 * @BCAST_FILTER_CMD: &struct iwl_bcast_filter_cmd
598 */
Eliad Pellerc87163b2014-01-08 10:11:11 +0200599 BCAST_FILTER_CMD = 0xcf,
Johannes Berg358631b2017-05-16 15:14:19 +0200600
601 /**
602 * @MCAST_FILTER_CMD: &struct iwl_mcast_filter_cmd
603 */
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300604 MCAST_FILTER_CMD = 0xd0,
605
Johannes Berg15fc1962017-03-10 14:01:42 +0100606 /**
607 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
608 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100609 D3_CONFIG_CMD = 0xd3,
Johannes Berg358631b2017-05-16 15:14:19 +0200610
611 /**
612 * @PROT_OFFLOAD_CONFIG_CMD: Depending on firmware, uses one of
613 * &struct iwl_proto_offload_cmd_v1, &struct iwl_proto_offload_cmd_v2,
614 * &struct iwl_proto_offload_cmd_v3_small,
615 * &struct iwl_proto_offload_cmd_v3_large
616 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100617 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
Johannes Berg358631b2017-05-16 15:14:19 +0200618
619 /**
620 * @OFFLOADS_QUERY_CMD:
621 * No data in command, response in &struct iwl_wowlan_status
622 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100623 OFFLOADS_QUERY_CMD = 0xd5,
Johannes Berg358631b2017-05-16 15:14:19 +0200624
625 /**
626 * @REMOTE_WAKE_CONFIG_CMD: &struct iwl_wowlan_remote_wake_config
627 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100628 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Johannes Berg358631b2017-05-16 15:14:19 +0200629
630 /**
631 * @D0I3_END_CMD: End D0i3/D3 state, no command data
632 */
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300633 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100634
Johannes Berg15fc1962017-03-10 14:01:42 +0100635 /**
636 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
637 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100638 WOWLAN_PATTERNS = 0xe0,
Johannes Berg15fc1962017-03-10 14:01:42 +0100639
640 /**
641 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
642 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100643 WOWLAN_CONFIGURATION = 0xe1,
Johannes Berg358631b2017-05-16 15:14:19 +0200644
Johannes Berg15fc1962017-03-10 14:01:42 +0100645 /**
646 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
647 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100648 WOWLAN_TSC_RSC_PARAM = 0xe2,
Johannes Berg358631b2017-05-16 15:14:19 +0200649
Johannes Berg15fc1962017-03-10 14:01:42 +0100650 /**
651 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
652 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100653 WOWLAN_TKIP_PARAM = 0xe3,
Johannes Berg358631b2017-05-16 15:14:19 +0200654
Johannes Berg15fc1962017-03-10 14:01:42 +0100655 /**
656 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
657 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100658 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
Johannes Berg358631b2017-05-16 15:14:19 +0200659
Johannes Berg15fc1962017-03-10 14:01:42 +0100660 /**
661 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
662 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100663 WOWLAN_GET_STATUSES = 0xe5,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100664
Johannes Berg358631b2017-05-16 15:14:19 +0200665 /**
666 * @SCAN_OFFLOAD_PROFILES_QUERY_CMD:
667 * No command data, response is &struct iwl_scan_offload_profiles_query
668 */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200669 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100670};
671
Sharon Dvir39bdb172015-10-15 18:18:09 +0300672/* Please keep this enum *SORTED* by hex value.
673 * Needed for binary search, otherwise a warning will be triggered.
674 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200675enum iwl_mac_conf_subcmd_ids {
676 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
677 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200678 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200679};
680
Johannes Berg15fc1962017-03-10 14:01:42 +0100681/**
682 * enum iwl_phy_ops_subcmd_ids - PHY group commands
683 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300684enum iwl_phy_ops_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200685 /**
686 * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
687 * Uses either &struct iwl_dts_measurement_cmd or
688 * &struct iwl_ext_dts_measurement_cmd
689 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300690 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200691
692 /**
693 * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
694 */
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200695 CTDP_CONFIG_CMD = 0x03,
Johannes Berg15fc1962017-03-10 14:01:42 +0100696
697 /**
698 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
699 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200700 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Johannes Berg358631b2017-05-16 15:14:19 +0200701
702 /**
703 * @GEO_TX_POWER_LIMIT: &struct iwl_geo_tx_power_profiles_cmd
704 */
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200705 GEO_TX_POWER_LIMIT = 0x05,
Johannes Berg358631b2017-05-16 15:14:19 +0200706
707 /**
708 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
709 */
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200710 CT_KILL_NOTIFICATION = 0xFE,
Johannes Berg358631b2017-05-16 15:14:19 +0200711
712 /**
713 * @DTS_MEASUREMENT_NOTIF_WIDE:
714 * &struct iwl_dts_measurement_notif_v1 or
715 * &struct iwl_dts_measurement_notif_v2
716 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300717 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
718};
719
Johannes Berg15fc1962017-03-10 14:01:42 +0100720/**
721 * enum iwl_system_subcmd_ids - system group command IDs
722 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200723enum iwl_system_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100724 /**
725 * @SHARED_MEM_CFG_CMD:
726 * response in &struct iwl_shared_mem_cfg or
727 * &struct iwl_shared_mem_cfg_v1
728 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200729 SHARED_MEM_CFG_CMD = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200730
731 /**
732 * @INIT_EXTENDED_CFG_CMD: &struct iwl_init_extended_cfg_cmd
733 */
Sara Sharon4399caa2016-12-11 10:32:42 +0200734 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200735};
736
Johannes Berg15fc1962017-03-10 14:01:42 +0100737/**
738 * enum iwl_data_path_subcmd_ids - data path group commands
739 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200740enum iwl_data_path_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100741 /**
742 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
743 */
Liad Kaufman97d5be72015-08-31 14:33:23 +0300744 DQA_ENABLE_CMD = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200745
746 /**
747 * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd
748 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200749 UPDATE_MU_GROUPS_CMD = 0x1,
Johannes Berg358631b2017-05-16 15:14:19 +0200750
751 /**
752 * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd
753 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200754 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg358631b2017-05-16 15:14:19 +0200755
756 /**
757 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
758 */
Johannes Berg65e25482016-04-13 14:24:22 +0200759 STA_PM_NOTIF = 0xFD,
Johannes Berg358631b2017-05-16 15:14:19 +0200760
761 /**
762 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
763 */
Sara Sharonf92659a2016-02-03 15:04:49 +0200764 MU_GROUP_MGMT_NOTIF = 0xFE,
Johannes Berg358631b2017-05-16 15:14:19 +0200765
766 /**
767 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
768 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200769 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200770};
771
Johannes Berg358631b2017-05-16 15:14:19 +0200772/**
773 * enum iwl_prot_offload_subcmd_ids - protocol offload commands
774 */
Sara Sharon0db056d2015-12-29 11:07:15 +0200775enum iwl_prot_offload_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200776 /**
777 * @STORED_BEACON_NTF: &struct iwl_stored_beacon_notif
778 */
Sara Sharon0db056d2015-12-29 11:07:15 +0200779 STORED_BEACON_NTF = 0xFF,
780};
781
Johannes Berg358631b2017-05-16 15:14:19 +0200782/**
783 * enum iwl_regulatory_and_nvm_subcmd_ids - regulatory/NVM commands
784 */
Sara Sharon1f370652016-08-31 18:13:57 +0300785enum iwl_regulatory_and_nvm_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200786 /**
787 * @NVM_ACCESS_COMPLETE: &struct iwl_nvm_access_complete_cmd
788 */
Sara Sharon1f370652016-08-31 18:13:57 +0300789 NVM_ACCESS_COMPLETE = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200790
791 /**
792 * @NVM_GET_INFO:
793 * Command is &struct iwl_nvm_get_info,
794 * response is &struct iwl_nvm_get_info_rsp
795 */
Sara Sharone9e1ba32017-01-08 16:46:14 +0200796 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300797};
798
Johannes Berge6138c92017-05-04 10:00:03 +0200799/**
800 * enum iwl_debug_cmds - debug commands
801 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200802enum iwl_debug_cmds {
Johannes Berge6138c92017-05-04 10:00:03 +0200803 /**
804 * @LMAC_RD_WR:
805 * LMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
806 * &struct iwl_dbg_mem_access_rsp
807 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400808 LMAC_RD_WR = 0x0,
Johannes Berge6138c92017-05-04 10:00:03 +0200809 /**
810 * @UMAC_RD_WR:
811 * UMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
812 * &struct iwl_dbg_mem_access_rsp
813 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400814 UMAC_RD_WR = 0x1,
Johannes Berge6138c92017-05-04 10:00:03 +0200815 /**
816 * @MFU_ASSERT_DUMP_NTF:
817 * &struct iwl_mfu_assert_dump_notif
818 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200819 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400820};
821
Johannes Berg72361c32017-03-09 17:06:45 +0100822/**
823 * enum iwl_mvm_command_groups - command groups for the firmware
824 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
825 * @LONG_GROUP: legacy group with long header, also uses command IDs
826 * from &enum iwl_legacy_cmds
827 * @SYSTEM_GROUP: system group, uses command IDs from
828 * &enum iwl_system_subcmd_ids
829 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
830 * &enum iwl_mac_conf_subcmd_ids
831 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
832 * &enum iwl_phy_ops_subcmd_ids
833 * @DATA_PATH_GROUP: data path group, uses command IDs from
834 * &enum iwl_data_path_subcmd_ids
Johannes Berg72361c32017-03-09 17:06:45 +0100835 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
836 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
837 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
838 * &enum iwl_prot_offload_subcmd_ids
839 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
840 * &enum iwl_regulatory_and_nvm_subcmd_ids
841 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
842 */
843enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300844 LEGACY_GROUP = 0x0,
845 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200846 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200847 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300848 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200849 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200850 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300851 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400852 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300853};
854
Johannes Berg8ca151b2013-01-24 14:25:36 +0100855/**
856 * struct iwl_cmd_response - generic response struct for most commands
857 * @status: status of the command asked, changes for each one
858 */
859struct iwl_cmd_response {
860 __le32 status;
861};
862
863/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300864 * struct iwl_dqa_enable_cmd
865 * @cmd_queue: the TXQ number of the command queue
866 */
867struct iwl_dqa_enable_cmd {
868 __le32 cmd_queue;
869} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
870
871/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100872 * struct iwl_tx_ant_cfg_cmd
873 * @valid: valid antenna configuration
874 */
875struct iwl_tx_ant_cfg_cmd {
876 __le32 valid;
877} __packed;
878
Johannes Berg31a658b2017-03-09 15:56:57 +0100879/**
880 * struct iwl_calib_ctrl - Calibration control struct.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100881 * Sent as part of the phy configuration command.
882 * @flow_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100883 * flow triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100884 * @event_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100885 * event triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100886 */
887struct iwl_calib_ctrl {
888 __le32 flow_trigger;
889 __le32 event_trigger;
890} __packed;
891
892/* This enum defines the bitmap of various calibrations to enable in both
893 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
894 */
895enum iwl_calib_cfg {
896 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
897 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
898 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
899 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
900 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
901 IWL_CALIB_CFG_DC_IDX = BIT(5),
902 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
903 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
904 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
905 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
906 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
907 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
908 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
909 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
910 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
911 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
912 IWL_CALIB_CFG_DAC_IDX = BIT(16),
913 IWL_CALIB_CFG_ABS_IDX = BIT(17),
914 IWL_CALIB_CFG_AGC_IDX = BIT(18),
915};
916
Johannes Berg31a658b2017-03-09 15:56:57 +0100917/**
918 * struct iwl_phy_cfg_cmd - Phy configuration command
919 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
920 * @calib_control: calibration control data
Johannes Berg8ca151b2013-01-24 14:25:36 +0100921 */
922struct iwl_phy_cfg_cmd {
923 __le32 phy_cfg;
924 struct iwl_calib_ctrl calib_control;
925} __packed;
926
927#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
928#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
929#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
930#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
931#define PHY_CFG_TX_CHAIN_A BIT(8)
932#define PHY_CFG_TX_CHAIN_B BIT(9)
933#define PHY_CFG_TX_CHAIN_C BIT(10)
934#define PHY_CFG_RX_CHAIN_A BIT(12)
935#define PHY_CFG_RX_CHAIN_B BIT(13)
936#define PHY_CFG_RX_CHAIN_C BIT(14)
937
938
Johannes Bergd69f0a22017-03-14 10:58:16 +0100939/**
940 * enum iwl_nvm_access_op - NVM access opcode
941 * @IWL_NVM_READ: read NVM
942 * @IWL_NVM_WRITE: write NVM
943 */
944enum iwl_nvm_access_op {
945 IWL_NVM_READ = 0,
946 IWL_NVM_WRITE = 1,
947};
948
949/**
950 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
951 * @NVM_ACCESS_TARGET_CACHE: access the cache
952 * @NVM_ACCESS_TARGET_OTP: access the OTP
953 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
954 */
955enum iwl_nvm_access_target {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100956 NVM_ACCESS_TARGET_CACHE = 0,
957 NVM_ACCESS_TARGET_OTP = 1,
958 NVM_ACCESS_TARGET_EEPROM = 2,
959};
960
Johannes Bergd69f0a22017-03-14 10:58:16 +0100961/**
962 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
963 * @NVM_SECTION_TYPE_SW: software section
964 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
965 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
966 * @NVM_SECTION_TYPE_PRODUCTION: production section
967 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
968 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
969 * @NVM_MAX_NUM_SECTIONS: number of sections
970 */
971enum iwl_nvm_section_type {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200972 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200973 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200974 NVM_SECTION_TYPE_CALIBRATION = 4,
975 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200976 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200977 NVM_SECTION_TYPE_PHY_SKU = 12,
978 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100979};
980
981/**
Johannes Berg67625862017-03-14 11:01:27 +0100982 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
983 * @op_code: &enum iwl_nvm_access_op
984 * @target: &enum iwl_nvm_access_target
985 * @type: &enum iwl_nvm_section_type
Johannes Berg8ca151b2013-01-24 14:25:36 +0100986 * @offset: offset in bytes into the section
987 * @length: in bytes, to read/write
988 * @data: if write operation, the data to write. On read its empty
989 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200990struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100991 u8 op_code;
992 u8 target;
993 __le16 type;
994 __le16 offset;
995 __le16 length;
996 u8 data[];
997} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
998
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300999#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
1000
Johannes Berg3b43fbc2017-03-13 21:48:39 +01001001/**
1002 * struct iwl_fw_paging_cmd_v1 - paging layout
1003 *
1004 * (FW_PAGING_BLOCK_CMD = 0x4f)
1005 *
1006 * Send to FW the paging layout in the driver.
1007 *
1008 * @flags: various flags for the command
1009 * @block_size: the block size in powers of 2
1010 * @block_num: number of blocks specified in the command.
1011 * @device_phy_addr: virtual addresses from device side
1012 */
1013struct iwl_fw_paging_cmd_v1 {
1014 __le32 flags;
1015 __le32 block_size;
1016 __le32 block_num;
1017 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
1018} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
1019
1020/**
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001021 * struct iwl_fw_paging_cmd - paging layout
1022 *
1023 * (FW_PAGING_BLOCK_CMD = 0x4f)
1024 *
1025 * Send to FW the paging layout in the driver.
1026 *
1027 * @flags: various flags for the command
1028 * @block_size: the block size in powers of 2
1029 * @block_num: number of blocks specified in the command.
1030 * @device_phy_addr: virtual addresses from device side
Johannes Berg3b43fbc2017-03-13 21:48:39 +01001031 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001032struct iwl_fw_paging_cmd {
1033 __le32 flags;
1034 __le32 block_size;
1035 __le32 block_num;
Johannes Berg3b43fbc2017-03-13 21:48:39 +01001036 __le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
Sara Sharond975d722016-07-04 11:52:07 +03001037} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +03001038
Matti Gottliebe1120182015-07-19 11:15:07 +03001039/*
1040 * Fw items ID's
1041 *
1042 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
1043 * download
1044 */
1045enum iwl_fw_item_id {
1046 IWL_FW_ITEM_ID_PAGING = 3,
1047};
1048
1049/*
1050 * struct iwl_fw_get_item_cmd - get an item from the fw
1051 */
1052struct iwl_fw_get_item_cmd {
1053 __le32 item_id;
1054} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
1055
Golan Ben Ami321c2102015-07-27 17:02:35 +03001056#define CONT_REC_COMMAND_SIZE 80
1057#define ENABLE_CONT_RECORDING 0x15
1058#define DISABLE_CONT_RECORDING 0x16
1059
1060/*
1061 * struct iwl_continuous_record_mode - recording mode
1062 */
1063struct iwl_continuous_record_mode {
1064 __le16 enable_recording;
1065} __packed;
1066
1067/*
1068 * struct iwl_continuous_record_cmd - enable/disable continuous recording
1069 */
1070struct iwl_continuous_record_cmd {
1071 struct iwl_continuous_record_mode record_mode;
1072 u8 pad[CONT_REC_COMMAND_SIZE -
1073 sizeof(struct iwl_continuous_record_mode)];
1074} __packed;
1075
Matti Gottliebe1120182015-07-19 11:15:07 +03001076struct iwl_fw_get_item_resp {
1077 __le32 item_id;
1078 __le32 item_byte_cnt;
1079 __le32 item_val;
1080} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
1081
Johannes Berg8ca151b2013-01-24 14:25:36 +01001082/**
1083 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
1084 * @offset: offset in bytes into the section
1085 * @length: in bytes, either how much was written or read
1086 * @type: NVM_SECTION_TYPE_*
1087 * @status: 0 for success, fail otherwise
1088 * @data: if read operation, the data returned. Empty on write.
1089 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +02001090struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +01001091 __le16 offset;
1092 __le16 length;
1093 __le16 type;
1094 __le16 status;
1095 u8 data[];
1096} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
1097
1098/* MVM_ALIVE 0x1 */
1099
1100/* alive response is_valid values */
1101#define ALIVE_RESP_UCODE_OK BIT(0)
1102#define ALIVE_RESP_RFKILL BIT(1)
1103
1104/* alive response ver_type values */
1105enum {
1106 FW_TYPE_HW = 0,
1107 FW_TYPE_PROT = 1,
1108 FW_TYPE_AP = 2,
1109 FW_TYPE_WOWLAN = 3,
1110 FW_TYPE_TIMING = 4,
1111 FW_TYPE_WIPAN = 5
1112};
1113
1114/* alive response ver_subtype values */
1115enum {
1116 FW_SUBTYPE_FULL_FEATURE = 0,
1117 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
1118 FW_SUBTYPE_REDUCED = 2,
1119 FW_SUBTYPE_ALIVE_ONLY = 3,
1120 FW_SUBTYPE_WOWLAN = 4,
1121 FW_SUBTYPE_AP_SUBTYPE = 5,
1122 FW_SUBTYPE_WIPAN = 6,
1123 FW_SUBTYPE_INITIALIZE = 9
1124};
1125
1126#define IWL_ALIVE_STATUS_ERR 0xDEAD
1127#define IWL_ALIVE_STATUS_OK 0xCAFE
1128
1129#define IWL_ALIVE_FLG_RFKILL BIT(0)
1130
Sara Sharon5c228d62016-11-24 13:48:27 +02001131struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001132 __le32 ucode_minor;
1133 __le32 ucode_major;
1134 u8 ver_subtype;
1135 u8 ver_type;
1136 u8 mac;
1137 u8 opt;
1138 __le32 timestamp;
1139 __le32 error_event_table_ptr; /* SRAM address for error log */
1140 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
1141 __le32 cpu_register_ptr;
1142 __le32 dbgm_config_ptr;
1143 __le32 alive_counter_ptr;
1144 __le32 scd_base_ptr; /* SRAM address for SCD */
1145 __le32 st_fwrd_addr; /* pointer to Store and forward */
1146 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +02001147} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
1148
1149struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001150 __le32 umac_minor; /* UMAC version: minor */
1151 __le32 umac_major; /* UMAC version: major */
1152 __le32 error_info_addr; /* SRAM address for UMAC error log */
1153 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +02001154} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
1155
1156struct mvm_alive_resp_v3 {
1157 __le16 status;
1158 __le16 flags;
1159 struct iwl_lmac_alive lmac_data;
1160 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001161} __packed; /* ALIVE_RES_API_S_VER_3 */
1162
Sara Sharon5c228d62016-11-24 13:48:27 +02001163struct mvm_alive_resp {
1164 __le16 status;
1165 __le16 flags;
1166 struct iwl_lmac_alive lmac_data[2];
1167 struct iwl_umac_alive umac_data;
1168} __packed; /* ALIVE_RES_API_S_VER_4 */
1169
Johannes Berg8ca151b2013-01-24 14:25:36 +01001170/* Error response/notification */
1171enum {
1172 FW_ERR_UNKNOWN_CMD = 0x0,
1173 FW_ERR_INVALID_CMD_PARAM = 0x1,
1174 FW_ERR_SERVICE = 0x2,
1175 FW_ERR_ARC_MEMORY = 0x3,
1176 FW_ERR_ARC_CODE = 0x4,
1177 FW_ERR_WATCH_DOG = 0x5,
1178 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
1179 FW_ERR_WEP_KEY_SIZE = 0x11,
1180 FW_ERR_OBSOLETE_FUNC = 0x12,
1181 FW_ERR_UNEXPECTED = 0xFE,
1182 FW_ERR_FATAL = 0xFF
1183};
1184
1185/**
1186 * struct iwl_error_resp - FW error indication
1187 * ( REPLY_ERROR = 0x2 )
1188 * @error_type: one of FW_ERR_*
1189 * @cmd_id: the command ID for which the error occured
Johannes Bergacf91dd2017-05-16 16:15:42 +02001190 * @reserved1: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +01001191 * @bad_cmd_seq_num: sequence number of the erroneous command
1192 * @error_service: which service created the error, applicable only if
1193 * error_type = 2, otherwise 0
1194 * @timestamp: TSF in usecs.
1195 */
1196struct iwl_error_resp {
1197 __le32 error_type;
1198 u8 cmd_id;
1199 u8 reserved1;
1200 __le16 bad_cmd_seq_num;
1201 __le32 error_service;
1202 __le64 timestamp;
1203} __packed;
1204
1205
1206/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001207#define MAX_MACS_IN_BINDING (3)
1208#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +01001209
Johannes Bergd69f0a22017-03-14 10:58:16 +01001210/**
1211 * enum iwl_mvm_id_and_color - ID and color fields in context dword
1212 * @FW_CTXT_ID_POS: position of the ID
1213 * @FW_CTXT_ID_MSK: mask of the ID
1214 * @FW_CTXT_COLOR_POS: position of the color
1215 * @FW_CTXT_COLOR_MSK: mask of the color
1216 * @FW_CTXT_INVALID: value used to indicate unused/invalid
1217 */
1218enum iwl_mvm_id_and_color {
1219 FW_CTXT_ID_POS = 0,
1220 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
1221 FW_CTXT_COLOR_POS = 8,
1222 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
1223 FW_CTXT_INVALID = 0xffffffff,
1224};
Johannes Berg8ca151b2013-01-24 14:25:36 +01001225
1226#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
1227 (_color << FW_CTXT_COLOR_POS))
1228
1229/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +02001230enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +01001231 FW_CTXT_ACTION_STUB = 0,
1232 FW_CTXT_ACTION_ADD,
1233 FW_CTXT_ACTION_MODIFY,
1234 FW_CTXT_ACTION_REMOVE,
1235 FW_CTXT_ACTION_NUM
1236}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
1237
1238/* Time Events */
1239
1240/* Time Event types, according to MAC type */
1241enum iwl_time_event_type {
1242 /* BSS Station Events */
1243 TE_BSS_STA_AGGRESSIVE_ASSOC,
1244 TE_BSS_STA_ASSOC,
1245 TE_BSS_EAP_DHCP_PROT,
1246 TE_BSS_QUIET_PERIOD,
1247
1248 /* P2P Device Events */
1249 TE_P2P_DEVICE_DISCOVERABLE,
1250 TE_P2P_DEVICE_LISTEN,
1251 TE_P2P_DEVICE_ACTION_SCAN,
1252 TE_P2P_DEVICE_FULL_SCAN,
1253
1254 /* P2P Client Events */
1255 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
1256 TE_P2P_CLIENT_ASSOC,
1257 TE_P2P_CLIENT_QUIET_PERIOD,
1258
1259 /* P2P GO Events */
1260 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02001261 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +01001262 TE_P2P_GO_CT_WINDOW,
1263
1264 /* WiDi Sync Events */
1265 TE_WIDI_TX_SYNC,
1266
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001267 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +03001268 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001269
Johannes Berg8ca151b2013-01-24 14:25:36 +01001270 TE_MAX
1271}; /* MAC_EVENT_TYPE_API_E_VER_1 */
1272
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001273
1274
1275/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001276
1277/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001278 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1279 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1280 * the first fragment is scheduled.
1281 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1282 * the first 2 fragments are scheduled.
1283 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1284 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001285 *
1286 * Other than the constant defined above, specifying a fragmentation value 'x'
1287 * means that the event can be fragmented but only the first 'x' will be
1288 * scheduled.
1289 */
1290enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001291 TE_V1_FRAG_NONE = 0,
1292 TE_V1_FRAG_SINGLE = 1,
1293 TE_V1_FRAG_DUAL = 2,
1294 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +01001295};
1296
Johannes Berg8ca151b2013-01-24 14:25:36 +01001297/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001298#define TE_V1_FRAG_MAX_MSK 0x0fffffff
1299/* Repeat the time event endlessly (until removed) */
1300#define TE_V1_REPEAT_ENDLESS 0xffffffff
1301/* If a Time Event has bounded repetitions, this is the maximal value */
1302#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1303
1304/* Time Event dependencies: none, on another TE, or in a specific time */
1305enum {
1306 TE_V1_INDEPENDENT = 0,
1307 TE_V1_DEP_OTHER = BIT(0),
1308 TE_V1_DEP_TSF = BIT(1),
1309 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1310}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1311
1312/*
1313 * @TE_V1_NOTIF_NONE: no notifications
1314 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1315 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1316 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1317 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1318 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1319 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1320 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1321 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1322 *
1323 * Supported Time event notifications configuration.
1324 * A notification (both event and fragment) includes a status indicating weather
1325 * the FW was able to schedule the event or not. For fragment start/end
1326 * notification the status is always success. There is no start/end fragment
1327 * notification for monolithic events.
1328 */
1329enum {
1330 TE_V1_NOTIF_NONE = 0,
1331 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1332 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1333 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1334 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1335 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1336 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1337 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1338 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1339}; /* MAC_EVENT_ACTION_API_E_VER_2 */
1340
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001341/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001342
1343/*
1344 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1345 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1346 * the first fragment is scheduled.
1347 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1348 * the first 2 fragments are scheduled.
1349 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1350 * number of fragments are valid.
1351 *
1352 * Other than the constant defined above, specifying a fragmentation value 'x'
1353 * means that the event can be fragmented but only the first 'x' will be
1354 * scheduled.
1355 */
1356enum {
1357 TE_V2_FRAG_NONE = 0,
1358 TE_V2_FRAG_SINGLE = 1,
1359 TE_V2_FRAG_DUAL = 2,
1360 TE_V2_FRAG_MAX = 0xfe,
1361 TE_V2_FRAG_ENDLESS = 0xff
1362};
1363
1364/* Repeat the time event endlessly (until removed) */
1365#define TE_V2_REPEAT_ENDLESS 0xff
1366/* If a Time Event has bounded repetitions, this is the maximal value */
1367#define TE_V2_REPEAT_MAX 0xfe
1368
1369#define TE_V2_PLACEMENT_POS 12
1370#define TE_V2_ABSENCE_POS 15
1371
Johannes Bergd69f0a22017-03-14 10:58:16 +01001372/**
1373 * enum iwl_time_event_policy - Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001374 * A notification (both event and fragment) includes a status indicating weather
1375 * the FW was able to schedule the event or not. For fragment start/end
1376 * notification the status is always success. There is no start/end fragment
1377 * notification for monolithic events.
1378 *
1379 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1380 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1381 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1382 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1383 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1384 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1385 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1386 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1387 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
Johannes Bergd69f0a22017-03-14 10:58:16 +01001388 * @T2_V2_START_IMMEDIATELY: start time event immediately
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001389 * @TE_V2_DEP_OTHER: depends on another time event
1390 * @TE_V2_DEP_TSF: depends on a specific time
1391 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1392 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1393 */
Johannes Bergd69f0a22017-03-14 10:58:16 +01001394enum iwl_time_event_policy {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001395 TE_V2_DEFAULT_POLICY = 0x0,
1396
1397 /* notifications (event start/stop, fragment start/stop) */
1398 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1399 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1400 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1401 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1402
1403 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1404 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1405 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1406 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +02001407 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001408
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001409 /* placement characteristics */
1410 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1411 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1412 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1413
1414 /* are we present or absent during the Time Event. */
1415 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1416};
1417
1418/**
Johannes Berg67625862017-03-14 11:01:27 +01001419 * struct iwl_time_event_cmd - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001420 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1421 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1422 * ( TIME_EVENT_CMD = 0x29 )
Johannes Berg67625862017-03-14 11:01:27 +01001423 * @id_and_color: ID and color of the relevant MAC,
1424 * &enum iwl_mvm_id_and_color
1425 * @action: action to perform, one of &enum iwl_phy_ctxt_action
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001426 * @id: this field has two meanings, depending on the action:
1427 * If the action is ADD, then it means the type of event to add.
1428 * For all other actions it is the unique event ID assigned when the
1429 * event was added by the FW.
1430 * @apply_time: When to start the Time Event (in GP2)
1431 * @max_delay: maximum delay to event's start (apply time), in TU
1432 * @depends_on: the unique ID of the event we depend on (if any)
1433 * @interval: interval between repetitions, in TU
1434 * @duration: duration of event in TU
1435 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1436 * @max_frags: maximal number of fragments the Time Event can be divided to
1437 * @policy: defines whether uCode shall notify the host or other uCode modules
1438 * on event and/or fragment start and/or end
1439 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1440 * TE_EVENT_SOCIOPATHIC
Johannes Berg67625862017-03-14 11:01:27 +01001441 * using TE_ABSENCE and using TE_NOTIF_*,
1442 * &enum iwl_time_event_policy
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001443 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001444struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001445 /* COMMON_INDEX_HDR_API_S_VER_1 */
1446 __le32 id_and_color;
1447 __le32 action;
1448 __le32 id;
1449 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1450 __le32 apply_time;
1451 __le32 max_delay;
1452 __le32 depends_on;
1453 __le32 interval;
1454 __le32 duration;
1455 u8 repeat;
1456 u8 max_frags;
1457 __le16 policy;
1458} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1459
Johannes Berg8ca151b2013-01-24 14:25:36 +01001460/**
1461 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1462 * @status: bit 0 indicates success, all others specify errors
1463 * @id: the Time Event type
1464 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
Johannes Berg67625862017-03-14 11:01:27 +01001465 * @id_and_color: ID and color of the relevant MAC,
1466 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001467 */
1468struct iwl_time_event_resp {
1469 __le32 status;
1470 __le32 id;
1471 __le32 unique_id;
1472 __le32 id_and_color;
1473} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1474
1475/**
1476 * struct iwl_time_event_notif - notifications of time event start/stop
1477 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1478 * @timestamp: action timestamp in GP2
1479 * @session_id: session's unique id
1480 * @unique_id: unique id of the Time Event itself
1481 * @id_and_color: ID and color of the relevant MAC
Johannes Berg67625862017-03-14 11:01:27 +01001482 * @action: &enum iwl_time_event_policy
Johannes Berg8ca151b2013-01-24 14:25:36 +01001483 * @status: true if scheduled, false otherwise (not executed)
1484 */
1485struct iwl_time_event_notif {
1486 __le32 timestamp;
1487 __le32 session_id;
1488 __le32 unique_id;
1489 __le32 id_and_color;
1490 __le32 action;
1491 __le32 status;
1492} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1493
1494
1495/* Bindings and Time Quota */
1496
1497/**
Johannes Berg4d151c22017-03-14 11:04:06 +01001498 * struct iwl_binding_cmd_v1 - configuring bindings
1499 * ( BINDING_CONTEXT_CMD = 0x2b )
1500 * @id_and_color: ID and color of the relevant Binding,
1501 * &enum iwl_mvm_id_and_color
1502 * @action: action to perform, one of FW_CTXT_ACTION_*
1503 * @macs: array of MAC id and colors which belong to the binding,
1504 * &enum iwl_mvm_id_and_color
1505 * @phy: PHY id and color which belongs to the binding,
1506 * &enum iwl_mvm_id_and_color
1507 */
1508struct iwl_binding_cmd_v1 {
1509 /* COMMON_INDEX_HDR_API_S_VER_1 */
1510 __le32 id_and_color;
1511 __le32 action;
1512 /* BINDING_DATA_API_S_VER_1 */
1513 __le32 macs[MAX_MACS_IN_BINDING];
1514 __le32 phy;
1515} __packed; /* BINDING_CMD_API_S_VER_1 */
1516
1517/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001518 * struct iwl_binding_cmd - configuring bindings
1519 * ( BINDING_CONTEXT_CMD = 0x2b )
Johannes Berg67625862017-03-14 11:01:27 +01001520 * @id_and_color: ID and color of the relevant Binding,
1521 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001522 * @action: action to perform, one of FW_CTXT_ACTION_*
1523 * @macs: array of MAC id and colors which belong to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001524 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001525 * @phy: PHY id and color which belongs to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001526 * &enum iwl_mvm_id_and_color
Sara Sharon9415af72016-11-17 13:57:32 +02001527 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001528 */
1529struct iwl_binding_cmd {
1530 /* COMMON_INDEX_HDR_API_S_VER_1 */
1531 __le32 id_and_color;
1532 __le32 action;
1533 /* BINDING_DATA_API_S_VER_1 */
1534 __le32 macs[MAX_MACS_IN_BINDING];
1535 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001536 __le32 lmac_id;
1537} __packed; /* BINDING_CMD_API_S_VER_2 */
1538
Johannes Berg4d151c22017-03-14 11:04:06 +01001539#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
Sara Sharon9415af72016-11-17 13:57:32 +02001540#define IWL_LMAC_24G_INDEX 0
1541#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001542
Ilan Peer35adfd62013-02-04 13:16:24 +02001543/* The maximal number of fragments in the FW's schedule session */
1544#define IWL_MVM_MAX_QUOTA 128
1545
Johannes Berg8ca151b2013-01-24 14:25:36 +01001546/**
1547 * struct iwl_time_quota_data - configuration of time quota per binding
Johannes Berg67625862017-03-14 11:01:27 +01001548 * @id_and_color: ID and color of the relevant Binding,
1549 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001550 * @quota: absolute time quota in TU. The scheduler will try to divide the
1551 * remainig quota (after Time Events) according to this quota.
1552 * @max_duration: max uninterrupted context duration in TU
1553 */
1554struct iwl_time_quota_data {
1555 __le32 id_and_color;
1556 __le32 quota;
1557 __le32 max_duration;
1558} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1559
1560/**
1561 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1562 * ( TIME_QUOTA_CMD = 0x2c )
1563 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001564 * Note: on non-CDB the fourth one is the auxilary mac and is
1565 * essentially zero.
1566 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001567 */
1568struct iwl_time_quota_cmd {
1569 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1570} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1571
1572
1573/* PHY context */
1574
1575/* Supported bands */
1576#define PHY_BAND_5 (0)
1577#define PHY_BAND_24 (1)
1578
1579/* Supported channel width, vary if there is VHT support */
1580#define PHY_VHT_CHANNEL_MODE20 (0x0)
1581#define PHY_VHT_CHANNEL_MODE40 (0x1)
1582#define PHY_VHT_CHANNEL_MODE80 (0x2)
1583#define PHY_VHT_CHANNEL_MODE160 (0x3)
1584
1585/*
1586 * Control channel position:
1587 * For legacy set bit means upper channel, otherwise lower.
1588 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1589 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1590 * center_freq
1591 * |
1592 * 40Mhz |_______|_______|
1593 * 80Mhz |_______|_______|_______|_______|
1594 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1595 * code 011 010 001 000 | 100 101 110 111
1596 */
1597#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1598#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1599#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1600#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1601#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1602#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1603#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1604#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1605
1606/*
1607 * @band: PHY_BAND_*
1608 * @channel: channel number
1609 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1610 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1611 */
1612struct iwl_fw_channel_info {
1613 u8 band;
1614 u8 channel;
1615 u8 width;
1616 u8 ctrl_pos;
1617} __packed;
1618
1619#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1620#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1621 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1622#define PHY_RX_CHAIN_VALID_POS (1)
1623#define PHY_RX_CHAIN_VALID_MSK \
1624 (0x7 << PHY_RX_CHAIN_VALID_POS)
1625#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1626#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1627 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1628#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1629#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1630 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1631#define PHY_RX_CHAIN_CNT_POS (10)
1632#define PHY_RX_CHAIN_CNT_MSK \
1633 (0x3 << PHY_RX_CHAIN_CNT_POS)
1634#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1635#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1636 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1637#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1638#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1639 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1640
1641/* TODO: fix the value, make it depend on firmware at runtime? */
1642#define NUM_PHY_CTX 3
1643
1644/* TODO: complete missing documentation */
1645/**
1646 * struct iwl_phy_context_cmd - config of the PHY context
1647 * ( PHY_CONTEXT_CMD = 0x8 )
1648 * @id_and_color: ID and color of the relevant Binding
1649 * @action: action to perform, one of FW_CTXT_ACTION_*
1650 * @apply_time: 0 means immediate apply and context switch.
1651 * other value means apply new params after X usecs
1652 * @tx_param_color: ???
Johannes Bergacf91dd2017-05-16 16:15:42 +02001653 * @ci: channel info
Johannes Berg8ca151b2013-01-24 14:25:36 +01001654 * @txchain_info: ???
1655 * @rxchain_info: ???
1656 * @acquisition_data: ???
1657 * @dsp_cfg_flags: set to 0
1658 */
1659struct iwl_phy_context_cmd {
1660 /* COMMON_INDEX_HDR_API_S_VER_1 */
1661 __le32 id_and_color;
1662 __le32 action;
1663 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1664 __le32 apply_time;
1665 __le32 tx_param_color;
1666 struct iwl_fw_channel_info ci;
1667 __le32 txchain_info;
1668 __le32 rxchain_info;
1669 __le32 acquisition_data;
1670 __le32 dsp_cfg_flags;
1671} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1672
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001673/*
1674 * Aux ROC command
1675 *
1676 * Command requests the firmware to create a time event for a certain duration
1677 * and remain on the given channel. This is done by using the Aux framework in
1678 * the FW.
1679 * The command was first used for Hot Spot issues - but can be used regardless
1680 * to Hot Spot.
1681 *
1682 * ( HOT_SPOT_CMD 0x53 )
1683 *
1684 * @id_and_color: ID and color of the MAC
1685 * @action: action to perform, one of FW_CTXT_ACTION_*
1686 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1687 * event_unique_id should be the id of the time event assigned by ucode.
1688 * Otherwise ignore the event_unique_id.
1689 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1690 * activity.
1691 * @channel_info: channel info
1692 * @node_addr: Our MAC Address
1693 * @reserved: reserved for alignment
1694 * @apply_time: GP2 value to start (should always be the current GP2 value)
1695 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1696 * time by which start of the event is allowed to be postponed.
1697 * @duration: event duration in TU To calculate event duration:
1698 * timeEventDuration = min(duration, remainingQuota)
1699 */
1700struct iwl_hs20_roc_req {
1701 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1702 __le32 id_and_color;
1703 __le32 action;
1704 __le32 event_unique_id;
1705 __le32 sta_id_and_color;
1706 struct iwl_fw_channel_info channel_info;
1707 u8 node_addr[ETH_ALEN];
1708 __le16 reserved;
1709 __le32 apply_time;
1710 __le32 apply_time_max_delay;
1711 __le32 duration;
1712} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1713
1714/*
1715 * values for AUX ROC result values
1716 */
1717enum iwl_mvm_hot_spot {
1718 HOT_SPOT_RSP_STATUS_OK,
1719 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1720 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1721};
1722
1723/*
1724 * Aux ROC command response
1725 *
1726 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1727 * driver the uid of the timevent.
1728 *
1729 * ( HOT_SPOT_CMD 0x53 )
1730 *
1731 * @event_unique_id: Unique ID of time event assigned by ucode
1732 * @status: Return status 0 is success, all the rest used for specific errors
1733 */
1734struct iwl_hs20_roc_res {
1735 __le32 event_unique_id;
1736 __le32 status;
1737} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1738
Johannes Berg8ca151b2013-01-24 14:25:36 +01001739/**
1740 * struct iwl_radio_version_notif - information on the radio version
1741 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
Johannes Bergacf91dd2017-05-16 16:15:42 +02001742 * @radio_flavor: radio flavor
1743 * @radio_step: radio version step
1744 * @radio_dash: radio version dash
Johannes Berg8ca151b2013-01-24 14:25:36 +01001745 */
1746struct iwl_radio_version_notif {
1747 __le32 radio_flavor;
1748 __le32 radio_step;
1749 __le32 radio_dash;
1750} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1751
1752enum iwl_card_state_flags {
1753 CARD_ENABLED = 0x00,
1754 HW_CARD_DISABLED = 0x01,
1755 SW_CARD_DISABLED = 0x02,
1756 CT_KILL_CARD_DISABLED = 0x04,
1757 HALT_CARD_DISABLED = 0x08,
1758 CARD_DISABLED_MSK = 0x0f,
1759 CARD_IS_RX_ON = 0x10,
1760};
1761
1762/**
1763 * struct iwl_radio_version_notif - information on the radio version
1764 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1765 * @flags: %iwl_card_state_flags
1766 */
1767struct iwl_card_state_notif {
1768 __le32 flags;
1769} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1770
1771/**
Hila Gonend64048e2013-03-13 18:00:03 +02001772 * struct iwl_missed_beacons_notif - information on missed beacons
1773 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1774 * @mac_id: interface ID
1775 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1776 * beacons since last RX.
1777 * @consec_missed_beacons: number of consecutive missed beacons
Johannes Bergacf91dd2017-05-16 16:15:42 +02001778 * @num_expected_beacons: number of expected beacons
1779 * @num_recvd_beacons: number of received beacons
Hila Gonend64048e2013-03-13 18:00:03 +02001780 */
1781struct iwl_missed_beacons_notif {
1782 __le32 mac_id;
1783 __le32 consec_missed_beacons_since_last_rx;
1784 __le32 consec_missed_beacons;
1785 __le32 num_expected_beacons;
1786 __le32 num_recvd_beacons;
1787} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1788
1789/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001790 * struct iwl_mfuart_load_notif - mfuart image version & status
1791 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1792 * @installed_ver: installed image version
1793 * @external_ver: external image version
1794 * @status: MFUART loading status
1795 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001796 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001797*/
1798struct iwl_mfuart_load_notif {
1799 __le32 installed_ver;
1800 __le32 external_ver;
1801 __le32 status;
1802 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001803 /* image size valid only in v2 of the command */
1804 __le32 image_size;
1805} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001806
1807/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001808 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1809 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1810 * @assert_id: mfuart assert id that cause the notif
1811 * @curr_reset_num: number of asserts since uptime
1812 * @index_num: current chunk id
1813 * @parts_num: total number of chunks
1814 * @data_size: number of data bytes sent
1815 * @data: data buffer
1816 */
1817struct iwl_mfu_assert_dump_notif {
1818 __le32 assert_id;
1819 __le32 curr_reset_num;
1820 __le16 index_num;
1821 __le16 parts_num;
1822 __le32 data_size;
1823 __le32 data[0];
1824} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1825
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001826#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001827#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001828
1829/**
1830 * struct iwl_mcast_filter_cmd - configure multicast filter.
1831 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1832 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1833 * to identify network interface adopted in host-device IF.
1834 * It is used by FW as index in array of addresses. This array has
1835 * MAX_PORT_ID_NUM members.
1836 * @count: Number of MAC addresses in the array
1837 * @pass_all: Set 1 to pass all multicast packets.
1838 * @bssid: current association BSSID.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001839 * @reserved: reserved
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001840 * @addr_list: Place holder for array of MAC addresses.
1841 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1842 */
1843struct iwl_mcast_filter_cmd {
1844 u8 filter_own;
1845 u8 port_id;
1846 u8 count;
1847 u8 pass_all;
1848 u8 bssid[6];
1849 u8 reserved[2];
1850 u8 addr_list[0];
1851} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1852
Eliad Pellerc87163b2014-01-08 10:11:11 +02001853#define MAX_BCAST_FILTERS 8
1854#define MAX_BCAST_FILTER_ATTRS 2
1855
1856/**
1857 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1858 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1859 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1860 * start of ip payload).
1861 */
1862enum iwl_mvm_bcast_filter_attr_offset {
1863 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1864 BCAST_FILTER_OFFSET_IP_END = 1,
1865};
1866
1867/**
1868 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1869 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1870 * @offset: starting offset of this pattern.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001871 * @reserved1: reserved
1872 * @val: value to match - big endian (MSB is the first
Eliad Pellerc87163b2014-01-08 10:11:11 +02001873 * byte to match from offset pos).
1874 * @mask: mask to match (big endian).
1875 */
1876struct iwl_fw_bcast_filter_attr {
1877 u8 offset_type;
1878 u8 offset;
1879 __le16 reserved1;
1880 __be32 val;
1881 __be32 mask;
1882} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1883
1884/**
1885 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1886 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1887 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1888 */
1889enum iwl_mvm_bcast_filter_frame_type {
1890 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1891 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1892};
1893
1894/**
1895 * struct iwl_fw_bcast_filter - broadcast filter
1896 * @discard: discard frame (1) or let it pass (0).
1897 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001898 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001899 * @num_attrs: number of valid attributes in this filter.
1900 * @attrs: attributes of this filter. a filter is considered matched
1901 * only when all its attributes are matched (i.e. AND relationship)
1902 */
1903struct iwl_fw_bcast_filter {
1904 u8 discard;
1905 u8 frame_type;
1906 u8 num_attrs;
1907 u8 reserved1;
1908 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1909} __packed; /* BCAST_FILTER_S_VER_1 */
1910
Sara Sharon3af512d62015-07-22 11:38:40 +03001911#define BA_WINDOW_STREAMS_MAX 16
1912#define BA_WINDOW_STATUS_TID_MSK 0x000F
1913#define BA_WINDOW_STATUS_STA_ID_POS 4
1914#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1915#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1916
1917/**
1918 * struct iwl_ba_window_status_notif - reordering window's status notification
1919 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1920 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1921 * @start_seq_num: the start sequence number of the bitmap
1922 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1923 */
1924struct iwl_ba_window_status_notif {
1925 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1926 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1927 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1928 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1929} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1930
Eliad Pellerc87163b2014-01-08 10:11:11 +02001931/**
1932 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1933 * @default_discard: default action for this mac (discard (1) / pass (0)).
Johannes Bergacf91dd2017-05-16 16:15:42 +02001934 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001935 * @attached_filters: bitmap of relevant filters for this mac.
1936 */
1937struct iwl_fw_bcast_mac {
1938 u8 default_discard;
1939 u8 reserved1;
1940 __le16 attached_filters;
1941} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1942
1943/**
1944 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1945 * @disable: enable (0) / disable (1)
1946 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1947 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
Johannes Bergacf91dd2017-05-16 16:15:42 +02001948 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001949 * @filters: broadcast filters
1950 * @macs: broadcast filtering configuration per-mac
1951 */
1952struct iwl_bcast_filter_cmd {
1953 u8 disable;
1954 u8 max_bcast_filters;
1955 u8 max_macs;
1956 u8 reserved1;
1957 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1958 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1959} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1960
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001961/*
1962 * enum iwl_mvm_marker_id - maker ids
1963 *
1964 * The ids for different type of markers to insert into the usniffer logs
1965 */
1966enum iwl_mvm_marker_id {
1967 MARKER_ID_TX_FRAME_LATENCY = 1,
1968}; /* MARKER_ID_API_E_VER_1 */
1969
1970/**
1971 * struct iwl_mvm_marker - mark info into the usniffer logs
1972 *
1973 * (MARKER_CMD = 0xcb)
1974 *
1975 * Mark the UTC time stamp into the usniffer logs together with additional
1976 * metadata, so the usniffer output can be parsed.
1977 * In the command response the ucode will return the GP2 time.
1978 *
1979 * @dw_len: The amount of dwords following this byte including this byte.
1980 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1981 * @reserved: reserved.
1982 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1983 * @metadata: additional meta data that will be written to the unsiffer log
1984 */
1985struct iwl_mvm_marker {
Johannes Berg1644be92017-05-16 13:21:52 +02001986 u8 dw_len;
1987 u8 marker_id;
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001988 __le16 reserved;
1989 __le64 timestamp;
1990 __le32 metadata[0];
1991} __packed; /* MARKER_API_S_VER_1 */
1992
Matti Gottlieb0becb372015-05-31 09:18:30 +03001993/*
1994 * enum iwl_dc2dc_config_id - flag ids
1995 *
1996 * Ids of dc2dc configuration flags
1997 */
1998enum iwl_dc2dc_config_id {
1999 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
2000 DCDC_FREQ_TUNE_SET = 0x2,
2001}; /* MARKER_ID_API_E_VER_1 */
2002
2003/**
2004 * struct iwl_dc2dc_config_cmd - configure dc2dc values
2005 *
2006 * (DC2DC_CONFIG_CMD = 0x83)
2007 *
2008 * Set/Get & configure dc2dc values.
2009 * The command always returns the current dc2dc values.
2010 *
2011 * @flags: set/get dc2dc
2012 * @enable_low_power_mode: not used.
2013 * @dc2dc_freq_tune0: frequency divider - digital domain
2014 * @dc2dc_freq_tune1: frequency divider - analog domain
2015 */
2016struct iwl_dc2dc_config_cmd {
2017 __le32 flags;
2018 __le32 enable_low_power_mode; /* not used */
2019 __le32 dc2dc_freq_tune0;
2020 __le32 dc2dc_freq_tune1;
2021} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
2022
2023/**
2024 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
2025 *
2026 * Current dc2dc values returned by the FW.
2027 *
2028 * @dc2dc_freq_tune0: frequency divider - digital domain
2029 * @dc2dc_freq_tune1: frequency divider - analog domain
2030 */
2031struct iwl_dc2dc_config_resp {
2032 __le32 dc2dc_freq_tune0;
2033 __le32 dc2dc_freq_tune1;
2034} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
2035
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002036/***********************************
2037 * Smart Fifo API
2038 ***********************************/
2039/* Smart Fifo state */
2040enum iwl_sf_state {
2041 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
2042 SF_FULL_ON,
2043 SF_UNINIT,
2044 SF_INIT_OFF,
2045 SF_HW_NUM_STATES
2046};
2047
2048/* Smart Fifo possible scenario */
2049enum iwl_sf_scenario {
2050 SF_SCENARIO_SINGLE_UNICAST,
2051 SF_SCENARIO_AGG_UNICAST,
2052 SF_SCENARIO_MULTICAST,
2053 SF_SCENARIO_BA_RESP,
2054 SF_SCENARIO_TX_RESP,
2055 SF_NUM_SCENARIO
2056};
2057
2058#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
2059#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
2060
2061/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02002062#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002063#define SF_W_MARK_MIMO2 8192
2064#define SF_W_MARK_MIMO3 6144
2065#define SF_W_MARK_LEGACY 4096
2066#define SF_W_MARK_SCAN 4096
2067
Eran Hararyf4a3ee42015-02-08 13:58:50 +02002068/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
2069#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
2070#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2071#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
2072#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2073#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
2074#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2075#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
2076#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
2077#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
2078#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
2079
2080/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002081#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
2082#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
2083#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
2084#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
2085#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
2086#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
2087#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
2088#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
2089#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
2090#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
2091
2092#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
2093
Eran Harary161bdb72014-07-27 08:03:06 +03002094#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
2095
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002096/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002097 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
2098 * @state: smart fifo state, types listed in &enum iwl_sf_state.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002099 * @watermark: Minimum allowed availabe free space in RXF for transient state.
2100 * @long_delay_timeouts: aging and idle timer values for each scenario
2101 * in long delay state.
2102 * @full_on_timeouts: timer values for each scenario in full on state.
2103 */
2104struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03002105 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002106 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
2107 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
2108 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
2109} __packed; /* SF_CFG_API_S_VER_2 */
2110
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002111/***********************************
2112 * Location Aware Regulatory (LAR) API - MCC updates
2113 ***********************************/
2114
2115/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002116 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002117 * regulatory profile according to the given MCC (Mobile Country Code).
2118 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2119 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2120 * MCC in the cmd response will be the relevant MCC in the NVM.
2121 * @mcc: given mobile country code
2122 * @source_id: the source from where we got the MCC, see iwl_mcc_source
2123 * @reserved: reserved for alignment
2124 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002125struct iwl_mcc_update_cmd_v1 {
2126 __le16 mcc;
2127 u8 source_id;
2128 u8 reserved;
2129} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
2130
2131/**
2132 * struct iwl_mcc_update_cmd - Request the device to update geographic
2133 * regulatory profile according to the given MCC (Mobile Country Code).
2134 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2135 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2136 * MCC in the cmd response will be the relevant MCC in the NVM.
2137 * @mcc: given mobile country code
2138 * @source_id: the source from where we got the MCC, see iwl_mcc_source
2139 * @reserved: reserved for alignment
2140 * @key: integrity key for MCC API OEM testing
2141 * @reserved2: reserved
2142 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002143struct iwl_mcc_update_cmd {
2144 __le16 mcc;
2145 u8 source_id;
2146 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002147 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01002148 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002149} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002150
2151/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002152 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002153 * Contains the new channel control profile map, if changed, and the new MCC
2154 * (mobile country code).
2155 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02002156 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002157 * @mcc: the new applied MCC
2158 * @cap: capabilities for all channels which matches the MCC
2159 * @source_id: the MCC source, see iwl_mcc_source
2160 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
2161 * channels, depending on platform)
2162 * @channels: channel control data map, DWORD for each channel. Only the first
2163 * 16bits are used.
2164 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002165struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002166 __le32 status;
2167 __le16 mcc;
2168 u8 cap;
2169 u8 source_id;
2170 __le32 n_channels;
2171 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002172} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
2173
2174/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002175 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002176 * Contains the new channel control profile map, if changed, and the new MCC
2177 * (mobile country code).
2178 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
2179 * @status: see &enum iwl_mcc_update_status
2180 * @mcc: the new applied MCC
2181 * @cap: capabilities for all channels which matches the MCC
2182 * @source_id: the MCC source, see iwl_mcc_source
2183 * @time: time elapsed from the MCC test start (in 30 seconds TU)
2184 * @reserved: reserved.
2185 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
2186 * channels, depending on platform)
2187 * @channels: channel control data map, DWORD for each channel. Only the first
2188 * 16bits are used.
2189 */
2190struct iwl_mcc_update_resp {
2191 __le32 status;
2192 __le16 mcc;
2193 u8 cap;
2194 u8 source_id;
2195 __le16 time;
2196 __le16 reserved;
2197 __le32 n_channels;
2198 __le32 channels[0];
2199} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002200
2201/**
2202 * struct iwl_mcc_chub_notif - chub notifies of mcc change
2203 * (MCC_CHUB_UPDATE_CMD = 0xc9)
2204 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
2205 * the cellular and connectivity cores that gets updates of the mcc, and
2206 * notifies the ucode directly of any mcc change.
2207 * The ucode requests the driver to request the device to update geographic
2208 * regulatory profile according to the given MCC (Mobile Country Code).
2209 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2210 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2211 * MCC in the cmd response will be the relevant MCC in the NVM.
2212 * @mcc: given mobile country code
2213 * @source_id: identity of the change originator, see iwl_mcc_source
2214 * @reserved1: reserved for alignment
2215 */
2216struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01002217 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002218 u8 source_id;
2219 u8 reserved1;
2220} __packed; /* LAR_MCC_NOTIFY_S */
2221
2222enum iwl_mcc_update_status {
2223 MCC_RESP_NEW_CHAN_PROFILE,
2224 MCC_RESP_SAME_CHAN_PROFILE,
2225 MCC_RESP_INVALID,
2226 MCC_RESP_NVM_DISABLED,
2227 MCC_RESP_ILLEGAL,
2228 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002229 MCC_RESP_TEST_MODE_ACTIVE,
2230 MCC_RESP_TEST_MODE_NOT_ACTIVE,
2231 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002232};
2233
2234enum iwl_mcc_source {
2235 MCC_SOURCE_OLD_FW = 0,
2236 MCC_SOURCE_ME = 1,
2237 MCC_SOURCE_BIOS = 2,
2238 MCC_SOURCE_3G_LTE_HOST = 3,
2239 MCC_SOURCE_3G_LTE_DEVICE = 4,
2240 MCC_SOURCE_WIFI = 5,
2241 MCC_SOURCE_RESERVED = 6,
2242 MCC_SOURCE_DEFAULT = 7,
2243 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002244 MCC_SOURCE_MCC_API = 9,
2245 MCC_SOURCE_GET_CURRENT = 0x10,
2246 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002247};
2248
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002249/* DTS measurements */
2250
2251enum iwl_dts_measurement_flags {
2252 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
2253 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
2254};
2255
2256/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002257 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002258 *
Johannes Berg31a658b2017-03-09 15:56:57 +01002259 * @flags: indicates which measurements we want as specified in
2260 * &enum iwl_dts_measurement_flags
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002261 */
2262struct iwl_dts_measurement_cmd {
2263 __le32 flags;
2264} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2265
2266/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03002267* enum iwl_dts_control_measurement_mode - DTS measurement type
2268* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2269* back (latest value. Not waiting for new value). Use automatic
2270* SW DTS configuration.
2271* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2272* trigger DTS reading and provide read back temperature read
2273* when available.
2274* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2275* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2276* without measurement trigger.
2277*/
2278enum iwl_dts_control_measurement_mode {
2279 DTS_AUTOMATIC = 0,
2280 DTS_REQUEST_READ = 1,
2281 DTS_OVER_WRITE = 2,
2282 DTS_DIRECT_WITHOUT_MEASURE = 3,
2283};
2284
2285/**
2286* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2287* @DTS_USE_TOP: Top
2288* @DTS_USE_CHAIN_A: chain A
2289* @DTS_USE_CHAIN_B: chain B
2290* @DTS_USE_CHAIN_C: chain C
Johannes Bergacf91dd2017-05-16 16:15:42 +02002291* @XTAL_TEMPERATURE: read temperature from xtal
Arik Nemtsov78efc702015-10-06 12:22:47 +03002292*/
2293enum iwl_dts_used {
2294 DTS_USE_TOP = 0,
2295 DTS_USE_CHAIN_A = 1,
2296 DTS_USE_CHAIN_B = 2,
2297 DTS_USE_CHAIN_C = 3,
2298 XTAL_TEMPERATURE = 4,
2299};
2300
2301/**
2302* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2303* @DTS_BIT6_MODE: bit 6 mode
2304* @DTS_BIT8_MODE: bit 8 mode
2305*/
2306enum iwl_dts_bit_mode {
2307 DTS_BIT6_MODE = 0,
2308 DTS_BIT8_MODE = 1,
2309};
2310
2311/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002312 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
Arik Nemtsov78efc702015-10-06 12:22:47 +03002313 * @control_mode: see &enum iwl_dts_control_measurement_mode
2314 * @temperature: used when over write DTS mode is selected
2315 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2316 * @avg_factor: average factor to DTS in request DTS read mode
2317 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2318 * @step_duration: step duration for the DTS
2319 */
2320struct iwl_ext_dts_measurement_cmd {
2321 __le32 control_mode;
2322 __le32 temperature;
2323 __le32 sensor;
2324 __le32 avg_factor;
2325 __le32 bit_mode;
2326 __le32 step_duration;
2327} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2328
2329/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002330 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002331 *
2332 * @temp: the measured temperature
2333 * @voltage: the measured voltage
2334 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002335struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002336 __le32 temp;
2337 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002338} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2339
2340/**
2341 * struct iwl_dts_measurement_notif_v2 - measurements notification
2342 *
2343 * @temp: the measured temperature
2344 * @voltage: the measured voltage
2345 * @threshold_idx: the trip index that was crossed
2346 */
2347struct iwl_dts_measurement_notif_v2 {
2348 __le32 temp;
2349 __le32 voltage;
2350 __le32 threshold_idx;
2351} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002352
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02002353/**
2354 * struct ct_kill_notif - CT-kill entry notification
2355 *
2356 * @temperature: the current temperature in celsius
2357 * @reserved: reserved
2358 */
2359struct ct_kill_notif {
2360 __le16 temperature;
2361 __le16 reserved;
2362} __packed; /* GRP_PHY_CT_KILL_NTF */
2363
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002364/**
2365* enum ctdp_cmd_operation - CTDP command operations
2366* @CTDP_CMD_OPERATION_START: update the current budget
2367* @CTDP_CMD_OPERATION_STOP: stop ctdp
Chaya Rachel Ivgi3b9449b2017-05-08 15:14:01 +03002368* @CTDP_CMD_OPERATION_REPORT: get the average budget
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002369*/
2370enum iwl_mvm_ctdp_cmd_operation {
2371 CTDP_CMD_OPERATION_START = 0x1,
2372 CTDP_CMD_OPERATION_STOP = 0x2,
2373 CTDP_CMD_OPERATION_REPORT = 0x4,
2374};/* CTDP_CMD_OPERATION_TYPE_E */
2375
2376/**
2377 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2378 *
2379 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2380 * @budget: the budget in milliwatt
2381 * @window_size: defined in API but not used
2382 */
2383struct iwl_mvm_ctdp_cmd {
2384 __le32 operation;
2385 __le32 budget;
2386 __le32 window_size;
2387} __packed;
2388
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002389#define IWL_MAX_DTS_TRIPS 8
2390
2391/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002392 * struct temp_report_ths_cmd - set temperature thresholds
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002393 *
2394 * @num_temps: number of temperature thresholds passed
2395 * @thresholds: array with the thresholds to be configured
2396 */
2397struct temp_report_ths_cmd {
2398 __le32 num_temps;
2399 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2400} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2401
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002402/***********************************
2403 * TDLS API
2404 ***********************************/
2405
2406/* Type of TDLS request */
2407enum iwl_tdls_channel_switch_type {
2408 TDLS_SEND_CHAN_SW_REQ = 0,
2409 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2410 TDLS_MOVE_CH,
2411}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2412
2413/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002414 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002415 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2416 * received from peer
2417 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2418 * to the TDLS off-channel communication. For instance if the DTIM is
2419 * 200TU and the TDLS peer is to be given 25% of the time, the value
2420 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2421 * @switch_time: switch time the peer sent in its channel switch timing IE
Johannes Berg83b03192017-05-16 13:28:53 +02002422 * @switch_timeout: switch timeout the peer sent in its channel switch timing IE
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002423 */
2424struct iwl_tdls_channel_switch_timing {
2425 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2426 __le32 max_offchan_duration; /* given in micro-seconds */
2427 __le32 switch_time; /* given in micro-seconds */
2428 __le32 switch_timeout; /* given in micro-seconds */
2429} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2430
2431#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2432
2433/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002434 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002435 *
2436 * A template representing a TDLS channel-switch request or response frame
2437 *
2438 * @switch_time_offset: offset to the channel switch timing IE in the template
2439 * @tx_cmd: Tx parameters for the frame
2440 * @data: frame data
2441 */
2442struct iwl_tdls_channel_switch_frame {
2443 __le32 switch_time_offset;
2444 struct iwl_tx_cmd tx_cmd;
2445 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2446} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2447
2448/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002449 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002450 *
2451 * The command is sent to initiate a channel switch and also in response to
2452 * incoming TDLS channel-switch request/response packets from remote peers.
2453 *
2454 * @switch_type: see &enum iwl_tdls_channel_switch_type
2455 * @peer_sta_id: station id of TDLS peer
2456 * @ci: channel we switch to
2457 * @timing: timing related data for command
2458 * @frame: channel-switch request/response template, depending to switch_type
2459 */
2460struct iwl_tdls_channel_switch_cmd {
2461 u8 switch_type;
2462 __le32 peer_sta_id;
2463 struct iwl_fw_channel_info ci;
2464 struct iwl_tdls_channel_switch_timing timing;
2465 struct iwl_tdls_channel_switch_frame frame;
2466} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2467
2468/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002469 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002470 *
2471 * @status: non-zero on success
2472 * @offchannel_duration: duration given in microseconds
2473 * @sta_id: peer currently performing the channel-switch with
2474 */
2475struct iwl_tdls_channel_switch_notif {
2476 __le32 status;
2477 __le32 offchannel_duration;
2478 __le32 sta_id;
2479} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2480
Arik Nemtsov307e4722014-09-15 18:48:59 +03002481/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002482 * struct iwl_tdls_sta_info - TDLS station info
Arik Nemtsov307e4722014-09-15 18:48:59 +03002483 *
2484 * @sta_id: station id of the TDLS peer
2485 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2486 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2487 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2488 */
2489struct iwl_tdls_sta_info {
2490 u8 sta_id;
2491 u8 tx_to_peer_tid;
2492 __le16 tx_to_peer_ssn;
2493 __le32 is_initiator;
2494} __packed; /* TDLS_STA_INFO_VER_1 */
2495
2496/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002497 * struct iwl_tdls_config_cmd - TDLS basic config command
Arik Nemtsov307e4722014-09-15 18:48:59 +03002498 *
2499 * @id_and_color: MAC id and color being configured
2500 * @tdls_peer_count: amount of currently connected TDLS peers
2501 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2502 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2503 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2504 * @pti_req_data_offset: offset of network-level data for the PTI template
2505 * @pti_req_tx_cmd: Tx parameters for PTI request template
2506 * @pti_req_template: PTI request template data
2507 */
2508struct iwl_tdls_config_cmd {
2509 __le32 id_and_color; /* mac id and color */
2510 u8 tdls_peer_count;
2511 u8 tx_to_ap_tid;
2512 __le16 tx_to_ap_ssn;
2513 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2514
2515 __le32 pti_req_data_offset;
2516 struct iwl_tx_cmd pti_req_tx_cmd;
2517 u8 pti_req_template[0];
2518} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2519
2520/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002521 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
Arik Nemtsov307e4722014-09-15 18:48:59 +03002522 *
2523 * @sta_id: station id of the TDLS peer
2524 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2525 * the peer
2526 */
2527struct iwl_tdls_config_sta_info_res {
2528 __le16 sta_id;
2529 __le16 tx_to_peer_last_seq;
2530} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2531
2532/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002533 * struct iwl_tdls_config_res - TDLS config information from FW
Arik Nemtsov307e4722014-09-15 18:48:59 +03002534 *
2535 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2536 * @sta_info: per-station TDLS config information
2537 */
2538struct iwl_tdls_config_res {
2539 __le32 tx_to_ap_last_seq;
2540 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2541} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2542
Sara Sharondb06f042016-07-05 17:37:58 +03002543#define TX_FIFO_MAX_NUM_9000 8
2544#define TX_FIFO_MAX_NUM 15
2545#define RX_FIFO_MAX_NUM 2
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002546#define TX_FIFO_INTERNAL_MAX_NUM 6
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002547
2548/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002549 * struct iwl_shared_mem_cfg_v1 - Shared memory configuration information
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002550 *
2551 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2552 * accessible)
2553 * @shared_mem_size: shared memory size
2554 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2555 * 0x0 as accessible only via DBGM RDAT)
2556 * @sample_buff_size: internal sample buff size
2557 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2558 * 8000 HW set to 0x0 as not accessible)
2559 * @txfifo_size: size of TXF0 ... TXF7
2560 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2561 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2562 * when paging is not supported this should be 0
2563 * @page_buff_size: size of %page_buff_addr
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002564 * @rxfifo_addr: Start address of rxFifo
2565 * @internal_txfifo_addr: start address of internalFifo
2566 * @internal_txfifo_size: internal fifos' size
2567 *
2568 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2569 * set, the last 3 members don't exist.
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002570 */
Sara Sharondb06f042016-07-05 17:37:58 +03002571struct iwl_shared_mem_cfg_v1 {
2572 __le32 shared_mem_addr;
2573 __le32 shared_mem_size;
2574 __le32 sample_buff_addr;
2575 __le32 sample_buff_size;
2576 __le32 txfifo_addr;
2577 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2578 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2579 __le32 page_buff_addr;
2580 __le32 page_buff_size;
2581 __le32 rxfifo_addr;
2582 __le32 internal_txfifo_addr;
2583 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2584} __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2585
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002586/**
2587 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2588 *
2589 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2590 * @txfifo_size: size of TX FIFOs
2591 * @rxfifo1_addr: RXF1 addr
2592 * @rxfifo1_size: RXF1 size
2593 */
2594struct iwl_shared_mem_lmac_cfg {
2595 __le32 txfifo_addr;
2596 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2597 __le32 rxfifo1_addr;
2598 __le32 rxfifo1_size;
2599
2600} __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2601
2602/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002603 * struct iwl_shared_mem_cfg - Shared memory configuration information
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002604 *
2605 * @shared_mem_addr: shared memory address
2606 * @shared_mem_size: shared memory size
2607 * @sample_buff_addr: internal sample (mon/adc) buff addr
2608 * @sample_buff_size: internal sample buff size
2609 * @rxfifo2_addr: start addr of RXF2
2610 * @rxfifo2_size: size of RXF2
2611 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2612 * when paging is not supported this should be 0
2613 * @page_buff_size: size of %page_buff_addr
2614 * @lmac_num: number of LMACs (1 or 2)
2615 * @lmac_smem: per - LMAC smem data
2616 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002617struct iwl_shared_mem_cfg {
2618 __le32 shared_mem_addr;
2619 __le32 shared_mem_size;
2620 __le32 sample_buff_addr;
2621 __le32 sample_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002622 __le32 rxfifo2_addr;
2623 __le32 rxfifo2_size;
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002624 __le32 page_buff_addr;
2625 __le32 page_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002626 __le32 lmac_num;
2627 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
Sara Sharondb06f042016-07-05 17:37:58 +03002628} __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002629
Sara Sharona07a8f32015-11-15 11:11:59 +02002630/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002631 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
Sara Sharona07a8f32015-11-15 11:11:59 +02002632 *
Johannes Bergacf91dd2017-05-16 16:15:42 +02002633 * @reserved: reserved
Sara Sharona07a8f32015-11-15 11:11:59 +02002634 * @membership_status: a bitmap of MU groups
2635 * @user_position:the position of station in a group. If the station is in the
2636 * group then bits (group * 2) is the position -1
2637 */
2638struct iwl_mu_group_mgmt_cmd {
2639 __le32 reserved;
2640 __le32 membership_status[2];
2641 __le32 user_position[4];
2642} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2643
Sara Sharonf92659a2016-02-03 15:04:49 +02002644/**
2645 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2646 *
2647 * @membership_status: a bitmap of MU groups
2648 * @user_position: the position of station in a group. If the station is in the
2649 * group then bits (group * 2) is the position -1
2650 */
2651struct iwl_mu_group_mgmt_notif {
2652 __le32 membership_status[2];
2653 __le32 user_position[4];
2654} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2655
Sara Sharon0db056d2015-12-29 11:07:15 +02002656#define MAX_STORED_BEACON_SIZE 600
2657
2658/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002659 * struct iwl_stored_beacon_notif - Stored beacon notification
Sara Sharon0db056d2015-12-29 11:07:15 +02002660 *
2661 * @system_time: system time on air rise
2662 * @tsf: TSF on air rise
2663 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002664 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002665 * @channel: channel this beacon was received on
2666 * @rates: rate in ucode internal format
2667 * @byte_count: frame's byte count
Johannes Bergacf91dd2017-05-16 16:15:42 +02002668 * @data: beacon data, length in @byte_count
Sara Sharon0db056d2015-12-29 11:07:15 +02002669 */
2670struct iwl_stored_beacon_notif {
2671 __le32 system_time;
2672 __le64 tsf;
2673 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002674 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002675 __le16 channel;
2676 __le32 rates;
2677 __le32 byte_count;
2678 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002679} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002680
Aviya Erenfeld03098262016-02-18 14:09:33 +02002681#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2682
2683enum iwl_lqm_cmd_operatrions {
2684 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2685 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2686};
2687
2688enum iwl_lqm_status {
2689 LQM_STATUS_SUCCESS = 0,
2690 LQM_STATUS_TIMEOUT = 1,
2691 LQM_STATUS_ABORT = 2,
2692};
2693
2694/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002695 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
Johannes Berg83b03192017-05-16 13:28:53 +02002696 * @cmd_operation: command operation to be performed (start or stop)
Aviya Erenfeld03098262016-02-18 14:09:33 +02002697 * as defined above.
2698 * @mac_id: MAC ID the measurement applies to.
2699 * @measurement_time: time of the total measurement to be performed, in uSec.
2700 * @timeout: maximum time allowed until a response is sent, in uSec.
2701 */
2702struct iwl_link_qual_msrmnt_cmd {
2703 __le32 cmd_operation;
2704 __le32 mac_id;
2705 __le32 measurement_time;
2706 __le32 timeout;
2707} __packed /* LQM_CMD_API_S_VER_1 */;
2708
2709/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002710 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
Aviya Erenfeld03098262016-02-18 14:09:33 +02002711 *
2712 * @frequent_stations_air_time: an array containing the total air time
2713 * (in uSec) used by the most frequently transmitting stations.
2714 * @number_of_stations: the number of uniqe stations included in the array
2715 * (a number between 0 to 16)
2716 * @total_air_time_other_stations: the total air time (uSec) used by all the
2717 * stations which are not included in the above report.
2718 * @time_in_measurement_window: the total time in uSec in which a measurement
2719 * took place.
2720 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2721 * measurement
2722 * @mac_id: MAC ID the measurement applies to.
2723 * @status: return status. may be one of the LQM_STATUS_* defined above.
2724 * @reserved: reserved.
2725 */
2726struct iwl_link_qual_msrmnt_notif {
2727 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2728 __le32 number_of_stations;
2729 __le32 total_air_time_other_stations;
2730 __le32 time_in_measurement_window;
2731 __le32 tx_frame_dropped;
2732 __le32 mac_id;
2733 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002734 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002735} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2736
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002737/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002738 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002739 *
2740 * @id_and_color: ID and color of the MAC
2741 */
2742struct iwl_channel_switch_noa_notif {
2743 __le32 id_and_color;
2744} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2745
Ido Yariv2b55f432016-08-23 14:44:59 -04002746/* Operation types for the debug mem access */
2747enum {
2748 DEBUG_MEM_OP_READ = 0,
2749 DEBUG_MEM_OP_WRITE = 1,
2750 DEBUG_MEM_OP_WRITE_BYTES = 2,
2751};
2752
2753#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2754
2755/**
2756 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2757 * @op: DEBUG_MEM_OP_*
2758 * @addr: address to read/write from/to
2759 * @len: in dwords, to read/write
2760 * @data: for write opeations, contains the source buffer
2761 */
2762struct iwl_dbg_mem_access_cmd {
2763 __le32 op;
2764 __le32 addr;
2765 __le32 len;
2766 __le32 data[];
2767} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2768
2769/* Status responses for the debug mem access */
2770enum {
2771 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2772 DEBUG_MEM_STATUS_FAILED = 0x1,
2773 DEBUG_MEM_STATUS_LOCKED = 0x2,
2774 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2775 DEBUG_MEM_STATUS_LENGTH = 0x4,
2776};
2777
2778/**
2779 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2780 * @status: DEBUG_MEM_STATUS_*
2781 * @len: read dwords (0 for write operations)
2782 * @data: contains the read DWs
2783 */
2784struct iwl_dbg_mem_access_rsp {
2785 __le32 status;
2786 __le32 len;
2787 __le32 data[];
2788} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2789
Sara Sharon1f370652016-08-31 18:13:57 +03002790/**
2791 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
Johannes Bergacf91dd2017-05-16 16:15:42 +02002792 * @reserved: reserved
Sara Sharon1f370652016-08-31 18:13:57 +03002793 */
2794struct iwl_nvm_access_complete_cmd {
2795 __le32 reserved;
2796} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2797
Sara Sharon4399caa2016-12-11 10:32:42 +02002798/**
2799 * enum iwl_extended_cfg_flag - commands driver may send before
2800 * finishing init flow
2801 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2802 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2803 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2804 */
2805enum iwl_extended_cfg_flags {
2806 IWL_INIT_DEBUG_CFG,
2807 IWL_INIT_NVM,
2808 IWL_INIT_PHY,
2809};
2810
2811/**
2812 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2813 * before finishing init flows
2814 * @init_flags: values from iwl_extended_cfg_flags
2815 */
2816struct iwl_init_extended_cfg_cmd {
2817 __le32 init_flags;
2818} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2819
Sara Sharone9e1ba32017-01-08 16:46:14 +02002820/*
2821 * struct iwl_nvm_get_info - request to get NVM data
2822 */
2823struct iwl_nvm_get_info {
2824 __le32 reserved;
2825} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2826
2827/**
2828 * struct iwl_nvm_get_info_general - general NVM data
2829 * @flags: 1 - empty, 0 - valid
2830 * @nvm_version: nvm version
2831 * @board_type: board type
Johannes Bergacf91dd2017-05-16 16:15:42 +02002832 * @reserved: reserved
Sara Sharone9e1ba32017-01-08 16:46:14 +02002833 */
2834struct iwl_nvm_get_info_general {
2835 __le32 flags;
2836 __le16 nvm_version;
2837 u8 board_type;
2838 u8 reserved;
2839} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2840
2841/**
2842 * struct iwl_nvm_get_info_sku - mac information
2843 * @enable_24g: band 2.4G enabled
2844 * @enable_5g: band 5G enabled
2845 * @enable_11n: 11n enabled
2846 * @enable_11ac: 11ac enabled
2847 * @mimo_disable: MIMO enabled
2848 * @ext_crypto: Extended crypto enabled
2849 */
2850struct iwl_nvm_get_info_sku {
2851 __le32 enable_24g;
2852 __le32 enable_5g;
2853 __le32 enable_11n;
2854 __le32 enable_11ac;
2855 __le32 mimo_disable;
2856 __le32 ext_crypto;
2857} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2858
2859/**
2860 * struct iwl_nvm_get_info_phy - phy information
2861 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2862 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2863 */
2864struct iwl_nvm_get_info_phy {
2865 __le32 tx_chains;
2866 __le32 rx_chains;
2867} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2868
2869#define IWL_NUM_CHANNELS (51)
2870
2871/**
2872 * struct iwl_nvm_get_info_regulatory - regulatory information
2873 * @lar_enabled: is LAR enabled
2874 * @channel_profile: regulatory data of this channel
Johannes Berg358631b2017-05-16 15:14:19 +02002875 * @reserved: reserved
Sara Sharone9e1ba32017-01-08 16:46:14 +02002876 */
2877struct iwl_nvm_get_info_regulatory {
2878 __le32 lar_enabled;
2879 __le16 channel_profile[IWL_NUM_CHANNELS];
2880 __le16 reserved;
2881} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2882
2883/**
2884 * struct iwl_nvm_get_info_rsp - response to get NVM data
2885 * @general: general NVM data
2886 * @mac_sku: data relating to MAC sku
2887 * @phy_sku: data relating to PHY sku
2888 * @regulatory: regulatory data
2889 */
2890struct iwl_nvm_get_info_rsp {
2891 struct iwl_nvm_get_info_general general;
2892 struct iwl_nvm_get_info_sku mac_sku;
2893 struct iwl_nvm_get_info_phy phy_sku;
2894 struct iwl_nvm_get_info_regulatory regulatory;
2895} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2896
Johannes Berg15fc1962017-03-10 14:01:42 +01002897/**
2898 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2899 * @isolation: antenna isolation value
2900 */
2901struct iwl_mvm_antenna_coupling_notif {
2902 __le32 isolation;
2903} __packed;
2904
Johannes Berg8ca151b2013-01-24 14:25:36 +01002905#endif /* __fw_api_h__ */