blob: bfc865ad89049fc708a6727b858a3b20c303e02a [file] [log] [blame]
Johannes Berg8ca151b2013-01-24 14:25:36 +01001/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +02008 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Avraham Sternee9219b2015-03-23 15:09:27 +02009 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
Golan Ben-Amibdccdb82016-11-15 14:45:29 +020010 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010011 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * USA
25 *
26 * The full GNU General Public License is included in this distribution
Emmanuel Grumbach410dc5a2013-02-18 09:22:28 +020027 * in the file called COPYING.
Johannes Berg8ca151b2013-01-24 14:25:36 +010028 *
29 * Contact Information:
Emmanuel Grumbachcb2f8272015-11-17 15:39:56 +020030 * Intel Linux Wireless <linuxwifi@intel.com>
Johannes Berg8ca151b2013-01-24 14:25:36 +010031 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 *
33 * BSD LICENSE
34 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +020035 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Avraham Sternee9219b2015-03-23 15:09:27 +020036 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
Golan Ben-Amibdccdb82016-11-15 14:45:29 +020037 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010038 * All rights reserved.
39 *
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
42 * are met:
43 *
44 * * Redistributions of source code must retain the above copyright
45 * notice, this list of conditions and the following disclaimer.
46 * * Redistributions in binary form must reproduce the above copyright
47 * notice, this list of conditions and the following disclaimer in
48 * the documentation and/or other materials provided with the
49 * distribution.
50 * * Neither the name Intel Corporation nor the names of its
51 * contributors may be used to endorse or promote products derived
52 * from this software without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
56 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
64 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 *
66 *****************************************************************************/
67
68#ifndef __fw_api_h__
69#define __fw_api_h__
70
71#include "fw-api-rs.h"
Johannes Bergee6dbb22015-09-02 14:53:39 +020072#include "fw-api-rx.h"
Johannes Berg8ca151b2013-01-24 14:25:36 +010073#include "fw-api-tx.h"
74#include "fw-api-sta.h"
75#include "fw-api-mac.h"
76#include "fw-api-power.h"
77#include "fw-api-d3.h"
Emmanuel Grumbach5b7ff612014-03-11 19:27:45 +020078#include "fw-api-coex.h"
Haim Dreyfusse820c2d2014-04-06 11:19:09 +030079#include "fw-api-scan.h"
Johannes Bergd19ac582015-01-14 15:54:18 +010080#include "fw-api-stats.h"
Gregory Greenmance792912015-06-02 18:06:16 +030081#include "fw-api-tof.h"
Johannes Berg8ca151b2013-01-24 14:25:36 +010082
Liad Kaufman24afba72015-07-28 18:56:08 +030083/* Tx queue numbers for non-DQA mode */
Johannes Berg8ca151b2013-01-24 14:25:36 +010084enum {
85 IWL_MVM_OFFCHANNEL_QUEUE = 8,
86 IWL_MVM_CMD_QUEUE = 9,
Johannes Berg8ca151b2013-01-24 14:25:36 +010087};
88
Liad Kaufman24afba72015-07-28 18:56:08 +030089/*
90 * DQA queue numbers
91 *
Liad Kaufman097129c2015-08-09 18:28:43 +030092 * @IWL_MVM_DQA_CMD_QUEUE: a queue reserved for sending HCMDs to the FW
Liad Kaufman28d07932015-09-01 16:36:25 +030093 * @IWL_MVM_DQA_AUX_QUEUE: a queue reserved for aux frames
Liad Kaufman4c965132015-08-09 19:26:56 +030094 * @IWL_MVM_DQA_P2P_DEVICE_QUEUE: a queue reserved for P2P device frames
Liad Kaufman0e0e4422015-08-04 15:13:38 +030095 * @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames
Liad Kaufmand5216a22015-08-09 15:50:51 +030096 * @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure
97 * that we are never left without the possibility to connect to an AP.
Liad Kaufman24afba72015-07-28 18:56:08 +030098 * @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames.
99 * Each MGMT queue is mapped to a single STA
100 * MGMT frames are frames that return true on ieee80211_is_mgmt()
101 * @IWL_MVM_DQA_MAX_MGMT_QUEUE: last TXQ in pool for MGMT frames
Liad Kaufmande24f632015-08-04 15:19:18 +0300102 * @IWL_MVM_DQA_AP_PROBE_RESP_QUEUE: a queue reserved for P2P GO/SoftAP probe
103 * responses
Liad Kaufman24afba72015-07-28 18:56:08 +0300104 * @IWL_MVM_DQA_MIN_DATA_QUEUE: first TXQ in pool for DATA frames.
105 * DATA frames are intended for !ieee80211_is_mgmt() frames, but if
106 * the MGMT TXQ pool is exhausted, mgmt frames can be sent on DATA queues
107 * as well
108 * @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames
109 */
110enum iwl_mvm_dqa_txq {
Liad Kaufman097129c2015-08-09 18:28:43 +0300111 IWL_MVM_DQA_CMD_QUEUE = 0,
Liad Kaufman28d07932015-09-01 16:36:25 +0300112 IWL_MVM_DQA_AUX_QUEUE = 1,
Liad Kaufman4c965132015-08-09 19:26:56 +0300113 IWL_MVM_DQA_P2P_DEVICE_QUEUE = 2,
Liad Kaufman0e0e4422015-08-04 15:13:38 +0300114 IWL_MVM_DQA_GCAST_QUEUE = 3,
Liad Kaufmand5216a22015-08-09 15:50:51 +0300115 IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4,
Liad Kaufman24afba72015-07-28 18:56:08 +0300116 IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
117 IWL_MVM_DQA_MAX_MGMT_QUEUE = 8,
Liad Kaufmande24f632015-08-04 15:19:18 +0300118 IWL_MVM_DQA_AP_PROBE_RESP_QUEUE = 9,
Liad Kaufman24afba72015-07-28 18:56:08 +0300119 IWL_MVM_DQA_MIN_DATA_QUEUE = 10,
120 IWL_MVM_DQA_MAX_DATA_QUEUE = 31,
121};
122
Johannes Bergb2d81db2014-08-01 20:48:25 +0200123enum iwl_mvm_tx_fifo {
124 IWL_MVM_TX_FIFO_BK = 0,
125 IWL_MVM_TX_FIFO_BE,
126 IWL_MVM_TX_FIFO_VI,
127 IWL_MVM_TX_FIFO_VO,
128 IWL_MVM_TX_FIFO_MCAST = 5,
129 IWL_MVM_TX_FIFO_CMD = 7,
130};
Eytan Lifshitz19e737c2013-09-09 13:30:15 +0200131
Arik Nemtsovcf7b4912014-05-15 11:44:40 +0300132
Johannes Berg15fc1962017-03-10 14:01:42 +0100133/**
134 * enum iwl_legacy_cmds - legacy group command IDs
135 */
Johannes Berg72361c32017-03-09 17:06:45 +0100136enum iwl_legacy_cmds {
Johannes Berg15fc1962017-03-10 14:01:42 +0100137 /**
138 * @MVM_ALIVE:
139 * Alive data from the firmware, as described in
140 * &struct mvm_alive_resp_v3 or &struct mvm_alive_resp.
141 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100142 MVM_ALIVE = 0x1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100143
144 /**
145 * @REPLY_ERROR: Cause an error in the firmware, for testing purposes.
146 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100147 REPLY_ERROR = 0x2,
Johannes Berg15fc1962017-03-10 14:01:42 +0100148
149 /**
150 * @ECHO_CMD: Send data to the device to have it returned immediately.
151 */
Emmanuel Grumbache5046012015-08-17 10:45:50 +0300152 ECHO_CMD = 0x3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100153
Johannes Berg15fc1962017-03-10 14:01:42 +0100154 /**
155 * @INIT_COMPLETE_NOTIF: Notification that initialization is complete.
156 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100157 INIT_COMPLETE_NOTIF = 0x4,
158
Johannes Berg15fc1962017-03-10 14:01:42 +0100159 /**
160 * @PHY_CONTEXT_CMD:
161 * Add/modify/remove a PHY context, using &struct iwl_phy_context_cmd.
162 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100163 PHY_CONTEXT_CMD = 0x8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100164
165 /**
166 * @DBG_CFG: Debug configuration command.
167 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100168 DBG_CFG = 0x9,
Johannes Berg15fc1962017-03-10 14:01:42 +0100169
170 /**
171 * @ANTENNA_COUPLING_NOTIFICATION:
172 * Antenna coupling data, &struct iwl_mvm_antenna_coupling_notif
173 */
Emmanuel Grumbachb9fae2d2014-02-17 11:24:10 +0200174 ANTENNA_COUPLING_NOTIFICATION = 0xa,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100175
Johannes Berg15fc1962017-03-10 14:01:42 +0100176 /**
177 * @SCAN_ITERATION_COMPLETE_UMAC:
178 * Firmware indicates a scan iteration completed, using
179 * &struct iwl_umac_scan_iter_complete_notif.
180 */
Avraham Sternee9219b2015-03-23 15:09:27 +0200181 SCAN_ITERATION_COMPLETE_UMAC = 0xb5,
Johannes Berg15fc1962017-03-10 14:01:42 +0100182
183 /**
184 * @SCAN_CFG_CMD:
185 * uses &struct iwl_scan_config_v1 or &struct iwl_scan_config
186 */
David Spinadeld2496222014-05-20 12:46:37 +0300187 SCAN_CFG_CMD = 0xc,
Johannes Berg358631b2017-05-16 15:14:19 +0200188
189 /**
190 * @SCAN_REQ_UMAC: uses &struct iwl_scan_req_umac
191 */
David Spinadeld2496222014-05-20 12:46:37 +0300192 SCAN_REQ_UMAC = 0xd,
Johannes Berg358631b2017-05-16 15:14:19 +0200193
194 /**
195 * @SCAN_ABORT_UMAC: uses &struct iwl_umac_scan_abort
196 */
David Spinadeld2496222014-05-20 12:46:37 +0300197 SCAN_ABORT_UMAC = 0xe,
Johannes Berg15fc1962017-03-10 14:01:42 +0100198
199 /**
200 * @SCAN_COMPLETE_UMAC: uses &struct iwl_umac_scan_complete
201 */
David Spinadeld2496222014-05-20 12:46:37 +0300202 SCAN_COMPLETE_UMAC = 0xf,
203
Johannes Berg358631b2017-05-16 15:14:19 +0200204 /**
205 * @BA_WINDOW_STATUS_NOTIFICATION_ID:
206 * uses &struct iwl_ba_window_status_notif
207 */
Sara Sharon3af512d62015-07-22 11:38:40 +0300208 BA_WINDOW_STATUS_NOTIFICATION_ID = 0x13,
209
Johannes Berg15fc1962017-03-10 14:01:42 +0100210 /**
211 * @ADD_STA_KEY:
212 * &struct iwl_mvm_add_sta_key_cmd_v1 or
213 * &struct iwl_mvm_add_sta_key_cmd.
214 */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300215 ADD_STA_KEY = 0x17,
Johannes Berg15fc1962017-03-10 14:01:42 +0100216
217 /**
218 * @ADD_STA:
219 * &struct iwl_mvm_add_sta_cmd or &struct iwl_mvm_add_sta_cmd_v7.
220 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100221 ADD_STA = 0x18,
Johannes Berg358631b2017-05-16 15:14:19 +0200222
Johannes Berg15fc1962017-03-10 14:01:42 +0100223 /**
224 * @REMOVE_STA: &struct iwl_mvm_rm_sta_cmd
225 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100226 REMOVE_STA = 0x19,
227
Johannes Berg358631b2017-05-16 15:14:19 +0200228 /**
229 * @FW_GET_ITEM_CMD: uses &struct iwl_fw_get_item_cmd
230 */
Matti Gottliebe1120182015-07-19 11:15:07 +0300231 FW_GET_ITEM_CMD = 0x1a,
232
Johannes Berge8226a52017-03-31 11:25:52 +0200233 /**
Johannes Berg7b7cab72017-05-02 13:01:49 +0200234 * @TX_CMD: uses &struct iwl_tx_cmd or &struct iwl_tx_cmd_gen2,
Johannes Berga6a62192017-05-03 21:56:04 +0200235 * response in &struct iwl_mvm_tx_resp or
236 * &struct iwl_mvm_tx_resp_v3
Johannes Berge8226a52017-03-31 11:25:52 +0200237 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100238 TX_CMD = 0x1c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100239
240 /**
241 * @TXPATH_FLUSH: &struct iwl_tx_path_flush_cmd
242 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100243 TXPATH_FLUSH = 0x1e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100244
245 /**
246 * @MGMT_MCAST_KEY:
247 * &struct iwl_mvm_mgmt_mcast_key_cmd or
248 * &struct iwl_mvm_mgmt_mcast_key_cmd_v1
249 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100250 MGMT_MCAST_KEY = 0x1f,
251
Avri Altman3edf8ff2014-07-30 11:41:01 +0300252 /* scheduler config */
Johannes Berg15fc1962017-03-10 14:01:42 +0100253 /**
Johannes Berge153c1e2017-03-30 14:23:21 +0200254 * @SCD_QUEUE_CFG: &struct iwl_scd_txq_cfg_cmd for older hardware,
255 * &struct iwl_tx_queue_cfg_cmd with &struct iwl_tx_queue_cfg_rsp
256 * for newer (A000) hardware.
Johannes Berg15fc1962017-03-10 14:01:42 +0100257 */
Avri Altman3edf8ff2014-07-30 11:41:01 +0300258 SCD_QUEUE_CFG = 0x1d,
259
Johannes Berg358631b2017-05-16 15:14:19 +0200260 /**
261 * @WEP_KEY: uses &struct iwl_mvm_wep_key_cmd
262 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100263 WEP_KEY = 0x20,
264
Johannes Berg358631b2017-05-16 15:14:19 +0200265 /**
266 * @SHARED_MEM_CFG:
267 * retrieve shared memory configuration - response in
268 * &struct iwl_shared_mem_cfg
269 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +0200270 SHARED_MEM_CFG = 0x25,
271
Johannes Berg358631b2017-05-16 15:14:19 +0200272 /**
273 * @TDLS_CHANNEL_SWITCH_CMD: uses &struct iwl_tdls_channel_switch_cmd
274 */
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300275 TDLS_CHANNEL_SWITCH_CMD = 0x27,
Johannes Berg358631b2017-05-16 15:14:19 +0200276
277 /**
278 * @TDLS_CHANNEL_SWITCH_NOTIFICATION:
279 * uses &struct iwl_tdls_channel_switch_notif
280 */
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300281 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
Johannes Berg358631b2017-05-16 15:14:19 +0200282
283 /**
284 * @TDLS_CONFIG_CMD:
285 * &struct iwl_tdls_config_cmd, response in &struct iwl_tdls_config_res
286 */
Arik Nemtsov307e4722014-09-15 18:48:59 +0300287 TDLS_CONFIG_CMD = 0xa7,
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300288
Johannes Berg15fc1962017-03-10 14:01:42 +0100289 /**
290 * @MAC_CONTEXT_CMD: &struct iwl_mac_ctx_cmd
291 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100292 MAC_CONTEXT_CMD = 0x28,
Johannes Berg15fc1962017-03-10 14:01:42 +0100293
294 /**
295 * @TIME_EVENT_CMD:
296 * &struct iwl_time_event_cmd, response in &struct iwl_time_event_resp
297 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100298 TIME_EVENT_CMD = 0x29, /* both CMD and response */
Johannes Berg358631b2017-05-16 15:14:19 +0200299
Johannes Berg15fc1962017-03-10 14:01:42 +0100300 /**
301 * @TIME_EVENT_NOTIFICATION: &struct iwl_time_event_notif
302 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100303 TIME_EVENT_NOTIFICATION = 0x2a,
Johannes Berg358631b2017-05-16 15:14:19 +0200304
Johannes Berg15fc1962017-03-10 14:01:42 +0100305 /**
306 * @BINDING_CONTEXT_CMD:
307 * &struct iwl_binding_cmd or &struct iwl_binding_cmd_v1
308 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100309 BINDING_CONTEXT_CMD = 0x2b,
Johannes Berg358631b2017-05-16 15:14:19 +0200310
Johannes Berg15fc1962017-03-10 14:01:42 +0100311 /**
312 * @TIME_QUOTA_CMD: &struct iwl_time_quota_cmd
313 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100314 TIME_QUOTA_CMD = 0x2c,
Johannes Berg358631b2017-05-16 15:14:19 +0200315
316 /**
317 * @NON_QOS_TX_COUNTER_CMD:
318 * command is &struct iwl_nonqos_seq_query_cmd
319 */
Johannes Berg4ac6cb52013-08-08 09:30:13 +0200320 NON_QOS_TX_COUNTER_CMD = 0x2d,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100321
Johannes Berg15fc1962017-03-10 14:01:42 +0100322 /**
323 * @LQ_CMD: using &struct iwl_lq_cmd
324 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100325 LQ_CMD = 0x4e,
326
Johannes Berg15fc1962017-03-10 14:01:42 +0100327 /**
328 * @FW_PAGING_BLOCK_CMD:
Johannes Berg4f2210e2017-06-01 11:37:25 +0200329 * &struct iwl_fw_paging_cmd
Johannes Berg15fc1962017-03-10 14:01:42 +0100330 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300331 FW_PAGING_BLOCK_CMD = 0x4f,
332
Johannes Berg358631b2017-05-16 15:14:19 +0200333 /**
334 * @SCAN_OFFLOAD_REQUEST_CMD: uses &struct iwl_scan_req_lmac
335 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100336 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
Johannes Berg358631b2017-05-16 15:14:19 +0200337
338 /**
339 * @SCAN_OFFLOAD_ABORT_CMD: abort the scan - no further contents
340 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100341 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Johannes Berg358631b2017-05-16 15:14:19 +0200342
343 /**
344 * @HOT_SPOT_CMD: uses &struct iwl_hs20_roc_req
345 */
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300346 HOT_SPOT_CMD = 0x53,
Johannes Berg358631b2017-05-16 15:14:19 +0200347
348 /**
349 * @SCAN_OFFLOAD_COMPLETE:
350 * notification, &struct iwl_periodic_scan_complete
351 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100352 SCAN_OFFLOAD_COMPLETE = 0x6D,
Johannes Berg358631b2017-05-16 15:14:19 +0200353
354 /**
355 * @SCAN_OFFLOAD_UPDATE_PROFILES_CMD:
356 * update scan offload (scheduled scan) profiles/blacklist/etc.
357 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100358 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
Johannes Berg358631b2017-05-16 15:14:19 +0200359
360 /**
361 * @MATCH_FOUND_NOTIFICATION: scan match found
362 */
David Spinadel35a000b2013-08-28 09:29:43 +0300363 MATCH_FOUND_NOTIFICATION = 0xd9,
Johannes Berg358631b2017-05-16 15:14:19 +0200364
365 /**
366 * @SCAN_ITERATION_COMPLETE:
367 * uses &struct iwl_lmac_scan_complete_notif
368 */
David Spinadelfb98be52014-05-04 12:51:10 +0300369 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100370
371 /* Phy */
Johannes Berg15fc1962017-03-10 14:01:42 +0100372 /**
373 * @PHY_CONFIGURATION_CMD: &struct iwl_phy_cfg_cmd
374 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100375 PHY_CONFIGURATION_CMD = 0x6a,
Johannes Berg358631b2017-05-16 15:14:19 +0200376
377 /**
378 * @CALIB_RES_NOTIF_PHY_DB: &struct iwl_calib_res_notif_phy_db
379 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100380 CALIB_RES_NOTIF_PHY_DB = 0x6b,
Johannes Berg358631b2017-05-16 15:14:19 +0200381
382 /**
383 * @PHY_DB_CMD: &struct iwl_phy_db_cmd
384 */
Sara Sharon176aa602016-08-31 19:03:01 +0300385 PHY_DB_CMD = 0x6c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100386
Johannes Berg358631b2017-05-16 15:14:19 +0200387 /**
388 * @TOF_CMD: &struct iwl_tof_config_cmd
389 */
Gregory Greenmance792912015-06-02 18:06:16 +0300390 TOF_CMD = 0x10,
Johannes Berg358631b2017-05-16 15:14:19 +0200391
392 /**
393 * @TOF_NOTIFICATION: &struct iwl_tof_gen_resp_cmd
394 */
Gregory Greenmance792912015-06-02 18:06:16 +0300395 TOF_NOTIFICATION = 0x11,
396
Johannes Berg15fc1962017-03-10 14:01:42 +0100397 /**
398 * @POWER_TABLE_CMD: &struct iwl_device_power_cmd
399 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100400 POWER_TABLE_CMD = 0x77,
Johannes Berg358631b2017-05-16 15:14:19 +0200401
402 /**
403 * @PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION:
404 * &struct iwl_uapsd_misbehaving_ap_notif
405 */
Alexander Bondar175a70b2013-04-14 20:59:37 +0300406 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Johannes Berg358631b2017-05-16 15:14:19 +0200407
408 /**
409 * @LTR_CONFIG: &struct iwl_ltr_config_cmd
410 */
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300411 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100412
Johannes Berg358631b2017-05-16 15:14:19 +0200413 /**
414 * @REPLY_THERMAL_MNG_BACKOFF:
415 * Thermal throttling command
416 */
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300417 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
418
Johannes Berg358631b2017-05-16 15:14:19 +0200419 /**
420 * @DC2DC_CONFIG_CMD:
421 * Set/Get DC2DC frequency tune
422 * Command is &struct iwl_dc2dc_config_cmd,
423 * response is &struct iwl_dc2dc_config_resp
424 */
Matti Gottlieb0becb372015-05-31 09:18:30 +0300425 DC2DC_CONFIG_CMD = 0x83,
426
Johannes Berg15fc1962017-03-10 14:01:42 +0100427 /**
428 * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd
429 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100430 NVM_ACCESS_CMD = 0x88,
431
Johannes Berg358631b2017-05-16 15:14:19 +0200432 /**
433 * @BEACON_NOTIFICATION: &struct iwl_extended_beacon_notif
434 */
Ilan Peer571765c2013-03-05 15:26:03 +0200435 BEACON_NOTIFICATION = 0x90,
Johannes Berg358631b2017-05-16 15:14:19 +0200436
Johannes Bergb7bea642017-03-31 10:48:17 +0200437 /**
438 * @BEACON_TEMPLATE_CMD:
439 * Uses one of &struct iwl_mac_beacon_cmd_v6,
440 * &struct iwl_mac_beacon_cmd_v7 or &struct iwl_mac_beacon_cmd
441 * depending on the device version.
442 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100443 BEACON_TEMPLATE_CMD = 0x91,
Johannes Berg15fc1962017-03-10 14:01:42 +0100444 /**
445 * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
446 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100447 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg15fc1962017-03-10 14:01:42 +0100448
449 /**
Liad Kaufman678d9b62017-05-18 18:00:49 +0300450 * @STATISTICS_CMD:
451 * one of &struct iwl_statistics_cmd,
452 * &struct iwl_notif_statistics_v11,
453 * &struct iwl_notif_statistics_v10,
454 * &struct iwl_notif_statistics_cdb
Johannes Berg15fc1962017-03-10 14:01:42 +0100455 */
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100456 STATISTICS_CMD = 0x9c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100457
458 /**
459 * @STATISTICS_NOTIFICATION:
460 * one of &struct iwl_notif_statistics_v10,
461 * &struct iwl_notif_statistics_v11,
462 * &struct iwl_notif_statistics_cdb
463 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100464 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg358631b2017-05-16 15:14:19 +0200465
466 /**
467 * @EOSP_NOTIFICATION:
468 * Notify that a service period ended,
469 * &struct iwl_mvm_eosp_notification
470 */
Johannes Berg3e56ead2013-02-15 22:23:18 +0100471 EOSP_NOTIFICATION = 0x9e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100472
473 /**
474 * @REDUCE_TX_POWER_CMD:
475 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
476 */
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300477 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100478
Johannes Berg358631b2017-05-16 15:14:19 +0200479 /**
480 * @CARD_STATE_NOTIFICATION:
481 * Card state (RF/CT kill) notification,
482 * uses &struct iwl_card_state_notif
483 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100484 CARD_STATE_NOTIFICATION = 0xa1,
485
Johannes Berg358631b2017-05-16 15:14:19 +0200486 /**
487 * @MISSED_BEACONS_NOTIFICATION: &struct iwl_missed_beacons_notif
488 */
Hila Gonend64048e2013-03-13 18:00:03 +0200489 MISSED_BEACONS_NOTIFICATION = 0xa2,
490
Johannes Berg15fc1962017-03-10 14:01:42 +0100491 /**
492 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
493 */
Alexander Bondare811ada2013-03-10 15:29:44 +0200494 MAC_PM_POWER_TABLE = 0xa9,
495
Johannes Berg15fc1962017-03-10 14:01:42 +0100496 /**
497 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
498 */
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200499 MFUART_LOAD_NOTIFICATION = 0xb1,
500
Johannes Berg15fc1962017-03-10 14:01:42 +0100501 /**
502 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
503 */
Sara Sharon43413a92015-12-31 11:49:18 +0200504 RSS_CONFIG_CMD = 0xb3,
505
Johannes Berg6857df82017-03-15 14:06:53 +0100506 /**
507 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
508 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100509 REPLY_RX_PHY_CMD = 0xc0,
Johannes Berg6857df82017-03-15 14:06:53 +0100510
511 /**
512 * @REPLY_RX_MPDU_CMD:
513 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
514 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100515 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg358631b2017-05-16 15:14:19 +0200516
517 /**
518 * @FRAME_RELEASE:
519 * Frame release (reorder helper) notification, uses
520 * &struct iwl_frame_release
521 */
Johannes Berg13555e82015-09-02 16:16:49 +0200522 FRAME_RELEASE = 0xc3,
Johannes Berg358631b2017-05-16 15:14:19 +0200523
524 /**
525 * @BA_NOTIF:
526 * BlockAck notification, uses &struct iwl_mvm_compressed_ba_notif
527 * or &struct iwl_mvm_ba_notif depending on the HW
528 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100529 BA_NOTIF = 0xc5,
530
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200531 /* Location Aware Regulatory */
Johannes Berg15fc1962017-03-10 14:01:42 +0100532 /**
533 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
534 */
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200535 MCC_UPDATE_CMD = 0xc8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100536
537 /**
538 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
539 */
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200540 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200541
Johannes Berg358631b2017-05-16 15:14:19 +0200542 /**
543 * @MARKER_CMD: trace marker command, uses &struct iwl_mvm_marker
544 */
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300545 MARKER_CMD = 0xcb,
546
Johannes Berg15fc1962017-03-10 14:01:42 +0100547 /**
548 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
549 */
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200550 BT_PROFILE_NOTIFICATION = 0xce,
Johannes Berg358631b2017-05-16 15:14:19 +0200551
Johannes Berg15fc1962017-03-10 14:01:42 +0100552 /**
553 * @BT_CONFIG: &struct iwl_bt_coex_cmd
554 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300555 BT_CONFIG = 0x9b,
Johannes Berg358631b2017-05-16 15:14:19 +0200556
557 /**
558 * @BT_COEX_UPDATE_CORUN_LUT:
559 * &struct iwl_bt_coex_corun_lut_update_cmd
560 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300561 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
Johannes Berg358631b2017-05-16 15:14:19 +0200562
563 /**
564 * @BT_COEX_UPDATE_REDUCED_TXP:
565 * &struct iwl_bt_coex_reduced_txp_update_cmd
566 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300567 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Johannes Berg358631b2017-05-16 15:14:19 +0200568
Johannes Berg15fc1962017-03-10 14:01:42 +0100569 /**
570 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
571 */
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300572 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200573
Johannes Berg15fc1962017-03-10 14:01:42 +0100574 /**
575 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
576 */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200577 REPLY_SF_CFG_CMD = 0xd1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100578 /**
579 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
580 */
Hila Gonen7df15b12012-12-12 11:16:19 +0200581 REPLY_BEACON_FILTERING_CMD = 0xd2,
582
Johannes Berg358631b2017-05-16 15:14:19 +0200583 /**
584 * @DTS_MEASUREMENT_NOTIFICATION:
585 * &struct iwl_dts_measurement_notif_v1 or
586 * &struct iwl_dts_measurement_notif_v2
587 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300588 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
589
Johannes Berg358631b2017-05-16 15:14:19 +0200590 /**
591 * @LDBG_CONFIG_CMD: configure continuous trace recording
592 */
Golan Ben Ami321c2102015-07-27 17:02:35 +0300593 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg358631b2017-05-16 15:14:19 +0200594
595 /**
596 * @DEBUG_LOG_MSG: Debugging log data from firmware
597 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100598 DEBUG_LOG_MSG = 0xf7,
599
Johannes Berg358631b2017-05-16 15:14:19 +0200600 /**
601 * @BCAST_FILTER_CMD: &struct iwl_bcast_filter_cmd
602 */
Eliad Pellerc87163b2014-01-08 10:11:11 +0200603 BCAST_FILTER_CMD = 0xcf,
Johannes Berg358631b2017-05-16 15:14:19 +0200604
605 /**
606 * @MCAST_FILTER_CMD: &struct iwl_mcast_filter_cmd
607 */
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300608 MCAST_FILTER_CMD = 0xd0,
609
Johannes Berg15fc1962017-03-10 14:01:42 +0100610 /**
611 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
612 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100613 D3_CONFIG_CMD = 0xd3,
Johannes Berg358631b2017-05-16 15:14:19 +0200614
615 /**
616 * @PROT_OFFLOAD_CONFIG_CMD: Depending on firmware, uses one of
617 * &struct iwl_proto_offload_cmd_v1, &struct iwl_proto_offload_cmd_v2,
618 * &struct iwl_proto_offload_cmd_v3_small,
619 * &struct iwl_proto_offload_cmd_v3_large
620 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100621 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
Johannes Berg358631b2017-05-16 15:14:19 +0200622
623 /**
624 * @OFFLOADS_QUERY_CMD:
625 * No data in command, response in &struct iwl_wowlan_status
626 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100627 OFFLOADS_QUERY_CMD = 0xd5,
Johannes Berg358631b2017-05-16 15:14:19 +0200628
629 /**
630 * @REMOTE_WAKE_CONFIG_CMD: &struct iwl_wowlan_remote_wake_config
631 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100632 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Johannes Berg358631b2017-05-16 15:14:19 +0200633
634 /**
635 * @D0I3_END_CMD: End D0i3/D3 state, no command data
636 */
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300637 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100638
Johannes Berg15fc1962017-03-10 14:01:42 +0100639 /**
640 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
641 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100642 WOWLAN_PATTERNS = 0xe0,
Johannes Berg15fc1962017-03-10 14:01:42 +0100643
644 /**
645 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
646 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100647 WOWLAN_CONFIGURATION = 0xe1,
Johannes Berg358631b2017-05-16 15:14:19 +0200648
Johannes Berg15fc1962017-03-10 14:01:42 +0100649 /**
650 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
651 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100652 WOWLAN_TSC_RSC_PARAM = 0xe2,
Johannes Berg358631b2017-05-16 15:14:19 +0200653
Johannes Berg15fc1962017-03-10 14:01:42 +0100654 /**
655 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
656 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100657 WOWLAN_TKIP_PARAM = 0xe3,
Johannes Berg358631b2017-05-16 15:14:19 +0200658
Johannes Berg15fc1962017-03-10 14:01:42 +0100659 /**
660 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
661 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100662 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
Johannes Berg358631b2017-05-16 15:14:19 +0200663
Johannes Berg15fc1962017-03-10 14:01:42 +0100664 /**
665 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
666 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100667 WOWLAN_GET_STATUSES = 0xe5,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100668
Johannes Berg358631b2017-05-16 15:14:19 +0200669 /**
670 * @SCAN_OFFLOAD_PROFILES_QUERY_CMD:
671 * No command data, response is &struct iwl_scan_offload_profiles_query
672 */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200673 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100674};
675
Sharon Dvir39bdb172015-10-15 18:18:09 +0300676/* Please keep this enum *SORTED* by hex value.
677 * Needed for binary search, otherwise a warning will be triggered.
678 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200679enum iwl_mac_conf_subcmd_ids {
680 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
681 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200682 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200683};
684
Johannes Berg15fc1962017-03-10 14:01:42 +0100685/**
686 * enum iwl_phy_ops_subcmd_ids - PHY group commands
687 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300688enum iwl_phy_ops_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200689 /**
690 * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
691 * Uses either &struct iwl_dts_measurement_cmd or
692 * &struct iwl_ext_dts_measurement_cmd
693 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300694 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200695
696 /**
697 * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
698 */
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200699 CTDP_CONFIG_CMD = 0x03,
Johannes Berg15fc1962017-03-10 14:01:42 +0100700
701 /**
702 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
703 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200704 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Johannes Berg358631b2017-05-16 15:14:19 +0200705
706 /**
707 * @GEO_TX_POWER_LIMIT: &struct iwl_geo_tx_power_profiles_cmd
708 */
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200709 GEO_TX_POWER_LIMIT = 0x05,
Johannes Berg358631b2017-05-16 15:14:19 +0200710
711 /**
712 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
713 */
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200714 CT_KILL_NOTIFICATION = 0xFE,
Johannes Berg358631b2017-05-16 15:14:19 +0200715
716 /**
717 * @DTS_MEASUREMENT_NOTIF_WIDE:
718 * &struct iwl_dts_measurement_notif_v1 or
719 * &struct iwl_dts_measurement_notif_v2
720 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300721 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
722};
723
Johannes Berg15fc1962017-03-10 14:01:42 +0100724/**
725 * enum iwl_system_subcmd_ids - system group command IDs
726 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200727enum iwl_system_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100728 /**
729 * @SHARED_MEM_CFG_CMD:
730 * response in &struct iwl_shared_mem_cfg or
Johannes Bergb4f48982017-06-01 09:06:11 +0200731 * &struct iwl_shared_mem_cfg_v2
Johannes Berg15fc1962017-03-10 14:01:42 +0100732 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200733 SHARED_MEM_CFG_CMD = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200734
735 /**
736 * @INIT_EXTENDED_CFG_CMD: &struct iwl_init_extended_cfg_cmd
737 */
Sara Sharon4399caa2016-12-11 10:32:42 +0200738 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200739};
740
Johannes Berg15fc1962017-03-10 14:01:42 +0100741/**
742 * enum iwl_data_path_subcmd_ids - data path group commands
743 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200744enum iwl_data_path_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100745 /**
746 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
747 */
Liad Kaufman97d5be72015-08-31 14:33:23 +0300748 DQA_ENABLE_CMD = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200749
750 /**
751 * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd
752 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200753 UPDATE_MU_GROUPS_CMD = 0x1,
Johannes Berg358631b2017-05-16 15:14:19 +0200754
755 /**
756 * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd
757 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200758 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg358631b2017-05-16 15:14:19 +0200759
760 /**
761 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
762 */
Johannes Berg65e25482016-04-13 14:24:22 +0200763 STA_PM_NOTIF = 0xFD,
Johannes Berg358631b2017-05-16 15:14:19 +0200764
765 /**
766 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
767 */
Sara Sharonf92659a2016-02-03 15:04:49 +0200768 MU_GROUP_MGMT_NOTIF = 0xFE,
Johannes Berg358631b2017-05-16 15:14:19 +0200769
770 /**
771 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
772 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200773 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200774};
775
Johannes Berg358631b2017-05-16 15:14:19 +0200776/**
777 * enum iwl_prot_offload_subcmd_ids - protocol offload commands
778 */
Sara Sharon0db056d2015-12-29 11:07:15 +0200779enum iwl_prot_offload_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200780 /**
781 * @STORED_BEACON_NTF: &struct iwl_stored_beacon_notif
782 */
Sara Sharon0db056d2015-12-29 11:07:15 +0200783 STORED_BEACON_NTF = 0xFF,
784};
785
Johannes Berg358631b2017-05-16 15:14:19 +0200786/**
787 * enum iwl_regulatory_and_nvm_subcmd_ids - regulatory/NVM commands
788 */
Sara Sharon1f370652016-08-31 18:13:57 +0300789enum iwl_regulatory_and_nvm_subcmd_ids {
Johannes Berg358631b2017-05-16 15:14:19 +0200790 /**
791 * @NVM_ACCESS_COMPLETE: &struct iwl_nvm_access_complete_cmd
792 */
Sara Sharon1f370652016-08-31 18:13:57 +0300793 NVM_ACCESS_COMPLETE = 0x0,
Johannes Berg358631b2017-05-16 15:14:19 +0200794
795 /**
796 * @NVM_GET_INFO:
797 * Command is &struct iwl_nvm_get_info,
798 * response is &struct iwl_nvm_get_info_rsp
799 */
Sara Sharone9e1ba32017-01-08 16:46:14 +0200800 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300801};
802
Johannes Berge6138c92017-05-04 10:00:03 +0200803/**
804 * enum iwl_debug_cmds - debug commands
805 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200806enum iwl_debug_cmds {
Johannes Berge6138c92017-05-04 10:00:03 +0200807 /**
808 * @LMAC_RD_WR:
809 * LMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
810 * &struct iwl_dbg_mem_access_rsp
811 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400812 LMAC_RD_WR = 0x0,
Johannes Berge6138c92017-05-04 10:00:03 +0200813 /**
814 * @UMAC_RD_WR:
815 * UMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
816 * &struct iwl_dbg_mem_access_rsp
817 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400818 UMAC_RD_WR = 0x1,
Johannes Berge6138c92017-05-04 10:00:03 +0200819 /**
820 * @MFU_ASSERT_DUMP_NTF:
821 * &struct iwl_mfu_assert_dump_notif
822 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200823 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400824};
825
Johannes Berg72361c32017-03-09 17:06:45 +0100826/**
827 * enum iwl_mvm_command_groups - command groups for the firmware
828 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
829 * @LONG_GROUP: legacy group with long header, also uses command IDs
830 * from &enum iwl_legacy_cmds
831 * @SYSTEM_GROUP: system group, uses command IDs from
832 * &enum iwl_system_subcmd_ids
833 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
834 * &enum iwl_mac_conf_subcmd_ids
835 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
836 * &enum iwl_phy_ops_subcmd_ids
837 * @DATA_PATH_GROUP: data path group, uses command IDs from
838 * &enum iwl_data_path_subcmd_ids
Johannes Berg72361c32017-03-09 17:06:45 +0100839 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
840 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
841 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
842 * &enum iwl_prot_offload_subcmd_ids
843 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
844 * &enum iwl_regulatory_and_nvm_subcmd_ids
845 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
846 */
847enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300848 LEGACY_GROUP = 0x0,
849 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200850 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200851 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300852 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200853 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200854 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300855 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400856 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300857};
858
Johannes Berg8ca151b2013-01-24 14:25:36 +0100859/**
860 * struct iwl_cmd_response - generic response struct for most commands
861 * @status: status of the command asked, changes for each one
862 */
863struct iwl_cmd_response {
864 __le32 status;
865};
866
867/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300868 * struct iwl_dqa_enable_cmd
869 * @cmd_queue: the TXQ number of the command queue
870 */
871struct iwl_dqa_enable_cmd {
872 __le32 cmd_queue;
873} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
874
875/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100876 * struct iwl_tx_ant_cfg_cmd
877 * @valid: valid antenna configuration
878 */
879struct iwl_tx_ant_cfg_cmd {
880 __le32 valid;
881} __packed;
882
Johannes Berg31a658b2017-03-09 15:56:57 +0100883/**
884 * struct iwl_calib_ctrl - Calibration control struct.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100885 * Sent as part of the phy configuration command.
886 * @flow_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100887 * flow triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100888 * @event_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100889 * event triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100890 */
891struct iwl_calib_ctrl {
892 __le32 flow_trigger;
893 __le32 event_trigger;
894} __packed;
895
896/* This enum defines the bitmap of various calibrations to enable in both
897 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
898 */
899enum iwl_calib_cfg {
900 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
901 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
902 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
903 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
904 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
905 IWL_CALIB_CFG_DC_IDX = BIT(5),
906 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
907 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
908 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
909 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
910 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
911 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
912 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
913 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
914 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
915 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
916 IWL_CALIB_CFG_DAC_IDX = BIT(16),
917 IWL_CALIB_CFG_ABS_IDX = BIT(17),
918 IWL_CALIB_CFG_AGC_IDX = BIT(18),
919};
920
Johannes Berg31a658b2017-03-09 15:56:57 +0100921/**
922 * struct iwl_phy_cfg_cmd - Phy configuration command
923 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
924 * @calib_control: calibration control data
Johannes Berg8ca151b2013-01-24 14:25:36 +0100925 */
926struct iwl_phy_cfg_cmd {
927 __le32 phy_cfg;
928 struct iwl_calib_ctrl calib_control;
929} __packed;
930
931#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
932#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
933#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
934#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
935#define PHY_CFG_TX_CHAIN_A BIT(8)
936#define PHY_CFG_TX_CHAIN_B BIT(9)
937#define PHY_CFG_TX_CHAIN_C BIT(10)
938#define PHY_CFG_RX_CHAIN_A BIT(12)
939#define PHY_CFG_RX_CHAIN_B BIT(13)
940#define PHY_CFG_RX_CHAIN_C BIT(14)
941
942
Johannes Bergd69f0a22017-03-14 10:58:16 +0100943/**
944 * enum iwl_nvm_access_op - NVM access opcode
945 * @IWL_NVM_READ: read NVM
946 * @IWL_NVM_WRITE: write NVM
947 */
948enum iwl_nvm_access_op {
949 IWL_NVM_READ = 0,
950 IWL_NVM_WRITE = 1,
951};
952
953/**
954 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
955 * @NVM_ACCESS_TARGET_CACHE: access the cache
956 * @NVM_ACCESS_TARGET_OTP: access the OTP
957 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
958 */
959enum iwl_nvm_access_target {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100960 NVM_ACCESS_TARGET_CACHE = 0,
961 NVM_ACCESS_TARGET_OTP = 1,
962 NVM_ACCESS_TARGET_EEPROM = 2,
963};
964
Johannes Bergd69f0a22017-03-14 10:58:16 +0100965/**
966 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
967 * @NVM_SECTION_TYPE_SW: software section
968 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
969 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
970 * @NVM_SECTION_TYPE_PRODUCTION: production section
971 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
972 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
973 * @NVM_MAX_NUM_SECTIONS: number of sections
974 */
975enum iwl_nvm_section_type {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200976 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200977 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200978 NVM_SECTION_TYPE_CALIBRATION = 4,
979 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200980 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200981 NVM_SECTION_TYPE_PHY_SKU = 12,
982 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100983};
984
985/**
Johannes Berg67625862017-03-14 11:01:27 +0100986 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
987 * @op_code: &enum iwl_nvm_access_op
988 * @target: &enum iwl_nvm_access_target
989 * @type: &enum iwl_nvm_section_type
Johannes Berg8ca151b2013-01-24 14:25:36 +0100990 * @offset: offset in bytes into the section
991 * @length: in bytes, to read/write
992 * @data: if write operation, the data to write. On read its empty
993 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200994struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100995 u8 op_code;
996 u8 target;
997 __le16 type;
998 __le16 offset;
999 __le16 length;
1000 u8 data[];
1001} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
1002
Golan Ben Ami321c2102015-07-27 17:02:35 +03001003#define CONT_REC_COMMAND_SIZE 80
1004#define ENABLE_CONT_RECORDING 0x15
1005#define DISABLE_CONT_RECORDING 0x16
1006
1007/*
1008 * struct iwl_continuous_record_mode - recording mode
1009 */
1010struct iwl_continuous_record_mode {
1011 __le16 enable_recording;
1012} __packed;
1013
1014/*
1015 * struct iwl_continuous_record_cmd - enable/disable continuous recording
1016 */
1017struct iwl_continuous_record_cmd {
1018 struct iwl_continuous_record_mode record_mode;
1019 u8 pad[CONT_REC_COMMAND_SIZE -
1020 sizeof(struct iwl_continuous_record_mode)];
1021} __packed;
1022
Johannes Berg8ca151b2013-01-24 14:25:36 +01001023/**
1024 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
1025 * @offset: offset in bytes into the section
1026 * @length: in bytes, either how much was written or read
1027 * @type: NVM_SECTION_TYPE_*
1028 * @status: 0 for success, fail otherwise
1029 * @data: if read operation, the data returned. Empty on write.
1030 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +02001031struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +01001032 __le16 offset;
1033 __le16 length;
1034 __le16 type;
1035 __le16 status;
1036 u8 data[];
1037} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
1038
1039/* MVM_ALIVE 0x1 */
1040
1041/* alive response is_valid values */
1042#define ALIVE_RESP_UCODE_OK BIT(0)
1043#define ALIVE_RESP_RFKILL BIT(1)
1044
1045/* alive response ver_type values */
1046enum {
1047 FW_TYPE_HW = 0,
1048 FW_TYPE_PROT = 1,
1049 FW_TYPE_AP = 2,
1050 FW_TYPE_WOWLAN = 3,
1051 FW_TYPE_TIMING = 4,
1052 FW_TYPE_WIPAN = 5
1053};
1054
1055/* alive response ver_subtype values */
1056enum {
1057 FW_SUBTYPE_FULL_FEATURE = 0,
1058 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
1059 FW_SUBTYPE_REDUCED = 2,
1060 FW_SUBTYPE_ALIVE_ONLY = 3,
1061 FW_SUBTYPE_WOWLAN = 4,
1062 FW_SUBTYPE_AP_SUBTYPE = 5,
1063 FW_SUBTYPE_WIPAN = 6,
1064 FW_SUBTYPE_INITIALIZE = 9
1065};
1066
1067#define IWL_ALIVE_STATUS_ERR 0xDEAD
1068#define IWL_ALIVE_STATUS_OK 0xCAFE
1069
1070#define IWL_ALIVE_FLG_RFKILL BIT(0)
1071
Sara Sharon5c228d62016-11-24 13:48:27 +02001072struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001073 __le32 ucode_minor;
1074 __le32 ucode_major;
1075 u8 ver_subtype;
1076 u8 ver_type;
1077 u8 mac;
1078 u8 opt;
1079 __le32 timestamp;
1080 __le32 error_event_table_ptr; /* SRAM address for error log */
1081 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
1082 __le32 cpu_register_ptr;
1083 __le32 dbgm_config_ptr;
1084 __le32 alive_counter_ptr;
1085 __le32 scd_base_ptr; /* SRAM address for SCD */
1086 __le32 st_fwrd_addr; /* pointer to Store and forward */
1087 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +02001088} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
1089
1090struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001091 __le32 umac_minor; /* UMAC version: minor */
1092 __le32 umac_major; /* UMAC version: major */
1093 __le32 error_info_addr; /* SRAM address for UMAC error log */
1094 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +02001095} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
1096
1097struct mvm_alive_resp_v3 {
1098 __le16 status;
1099 __le16 flags;
1100 struct iwl_lmac_alive lmac_data;
1101 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +02001102} __packed; /* ALIVE_RES_API_S_VER_3 */
1103
Sara Sharon5c228d62016-11-24 13:48:27 +02001104struct mvm_alive_resp {
1105 __le16 status;
1106 __le16 flags;
1107 struct iwl_lmac_alive lmac_data[2];
1108 struct iwl_umac_alive umac_data;
1109} __packed; /* ALIVE_RES_API_S_VER_4 */
1110
Johannes Berg8ca151b2013-01-24 14:25:36 +01001111/* Error response/notification */
1112enum {
1113 FW_ERR_UNKNOWN_CMD = 0x0,
1114 FW_ERR_INVALID_CMD_PARAM = 0x1,
1115 FW_ERR_SERVICE = 0x2,
1116 FW_ERR_ARC_MEMORY = 0x3,
1117 FW_ERR_ARC_CODE = 0x4,
1118 FW_ERR_WATCH_DOG = 0x5,
1119 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
1120 FW_ERR_WEP_KEY_SIZE = 0x11,
1121 FW_ERR_OBSOLETE_FUNC = 0x12,
1122 FW_ERR_UNEXPECTED = 0xFE,
1123 FW_ERR_FATAL = 0xFF
1124};
1125
1126/**
1127 * struct iwl_error_resp - FW error indication
1128 * ( REPLY_ERROR = 0x2 )
1129 * @error_type: one of FW_ERR_*
1130 * @cmd_id: the command ID for which the error occured
Johannes Bergacf91dd2017-05-16 16:15:42 +02001131 * @reserved1: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +01001132 * @bad_cmd_seq_num: sequence number of the erroneous command
1133 * @error_service: which service created the error, applicable only if
1134 * error_type = 2, otherwise 0
1135 * @timestamp: TSF in usecs.
1136 */
1137struct iwl_error_resp {
1138 __le32 error_type;
1139 u8 cmd_id;
1140 u8 reserved1;
1141 __le16 bad_cmd_seq_num;
1142 __le32 error_service;
1143 __le64 timestamp;
1144} __packed;
1145
1146
1147/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001148#define MAX_MACS_IN_BINDING (3)
1149#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +01001150
Johannes Bergd69f0a22017-03-14 10:58:16 +01001151/**
1152 * enum iwl_mvm_id_and_color - ID and color fields in context dword
1153 * @FW_CTXT_ID_POS: position of the ID
1154 * @FW_CTXT_ID_MSK: mask of the ID
1155 * @FW_CTXT_COLOR_POS: position of the color
1156 * @FW_CTXT_COLOR_MSK: mask of the color
1157 * @FW_CTXT_INVALID: value used to indicate unused/invalid
1158 */
1159enum iwl_mvm_id_and_color {
1160 FW_CTXT_ID_POS = 0,
1161 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
1162 FW_CTXT_COLOR_POS = 8,
1163 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
1164 FW_CTXT_INVALID = 0xffffffff,
1165};
Johannes Berg8ca151b2013-01-24 14:25:36 +01001166
1167#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
1168 (_color << FW_CTXT_COLOR_POS))
1169
1170/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +02001171enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +01001172 FW_CTXT_ACTION_STUB = 0,
1173 FW_CTXT_ACTION_ADD,
1174 FW_CTXT_ACTION_MODIFY,
1175 FW_CTXT_ACTION_REMOVE,
1176 FW_CTXT_ACTION_NUM
1177}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
1178
1179/* Time Events */
1180
1181/* Time Event types, according to MAC type */
1182enum iwl_time_event_type {
1183 /* BSS Station Events */
1184 TE_BSS_STA_AGGRESSIVE_ASSOC,
1185 TE_BSS_STA_ASSOC,
1186 TE_BSS_EAP_DHCP_PROT,
1187 TE_BSS_QUIET_PERIOD,
1188
1189 /* P2P Device Events */
1190 TE_P2P_DEVICE_DISCOVERABLE,
1191 TE_P2P_DEVICE_LISTEN,
1192 TE_P2P_DEVICE_ACTION_SCAN,
1193 TE_P2P_DEVICE_FULL_SCAN,
1194
1195 /* P2P Client Events */
1196 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
1197 TE_P2P_CLIENT_ASSOC,
1198 TE_P2P_CLIENT_QUIET_PERIOD,
1199
1200 /* P2P GO Events */
1201 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02001202 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +01001203 TE_P2P_GO_CT_WINDOW,
1204
1205 /* WiDi Sync Events */
1206 TE_WIDI_TX_SYNC,
1207
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001208 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +03001209 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001210
Johannes Berg8ca151b2013-01-24 14:25:36 +01001211 TE_MAX
1212}; /* MAC_EVENT_TYPE_API_E_VER_1 */
1213
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001214
1215
1216/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001217
1218/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001219 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1220 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1221 * the first fragment is scheduled.
1222 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1223 * the first 2 fragments are scheduled.
1224 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1225 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001226 *
1227 * Other than the constant defined above, specifying a fragmentation value 'x'
1228 * means that the event can be fragmented but only the first 'x' will be
1229 * scheduled.
1230 */
1231enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001232 TE_V1_FRAG_NONE = 0,
1233 TE_V1_FRAG_SINGLE = 1,
1234 TE_V1_FRAG_DUAL = 2,
1235 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +01001236};
1237
Johannes Berg8ca151b2013-01-24 14:25:36 +01001238/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001239#define TE_V1_FRAG_MAX_MSK 0x0fffffff
1240/* Repeat the time event endlessly (until removed) */
1241#define TE_V1_REPEAT_ENDLESS 0xffffffff
1242/* If a Time Event has bounded repetitions, this is the maximal value */
1243#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1244
1245/* Time Event dependencies: none, on another TE, or in a specific time */
1246enum {
1247 TE_V1_INDEPENDENT = 0,
1248 TE_V1_DEP_OTHER = BIT(0),
1249 TE_V1_DEP_TSF = BIT(1),
1250 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1251}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1252
1253/*
1254 * @TE_V1_NOTIF_NONE: no notifications
1255 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1256 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1257 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1258 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1259 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1260 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1261 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1262 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1263 *
1264 * Supported Time event notifications configuration.
1265 * A notification (both event and fragment) includes a status indicating weather
1266 * the FW was able to schedule the event or not. For fragment start/end
1267 * notification the status is always success. There is no start/end fragment
1268 * notification for monolithic events.
1269 */
1270enum {
1271 TE_V1_NOTIF_NONE = 0,
1272 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1273 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1274 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1275 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1276 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1277 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1278 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1279 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1280}; /* MAC_EVENT_ACTION_API_E_VER_2 */
1281
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001282/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001283
1284/*
1285 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1286 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1287 * the first fragment is scheduled.
1288 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1289 * the first 2 fragments are scheduled.
1290 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1291 * number of fragments are valid.
1292 *
1293 * Other than the constant defined above, specifying a fragmentation value 'x'
1294 * means that the event can be fragmented but only the first 'x' will be
1295 * scheduled.
1296 */
1297enum {
1298 TE_V2_FRAG_NONE = 0,
1299 TE_V2_FRAG_SINGLE = 1,
1300 TE_V2_FRAG_DUAL = 2,
1301 TE_V2_FRAG_MAX = 0xfe,
1302 TE_V2_FRAG_ENDLESS = 0xff
1303};
1304
1305/* Repeat the time event endlessly (until removed) */
1306#define TE_V2_REPEAT_ENDLESS 0xff
1307/* If a Time Event has bounded repetitions, this is the maximal value */
1308#define TE_V2_REPEAT_MAX 0xfe
1309
1310#define TE_V2_PLACEMENT_POS 12
1311#define TE_V2_ABSENCE_POS 15
1312
Johannes Bergd69f0a22017-03-14 10:58:16 +01001313/**
1314 * enum iwl_time_event_policy - Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001315 * A notification (both event and fragment) includes a status indicating weather
1316 * the FW was able to schedule the event or not. For fragment start/end
1317 * notification the status is always success. There is no start/end fragment
1318 * notification for monolithic events.
1319 *
1320 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1321 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1322 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1323 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1324 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1325 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1326 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1327 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1328 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
Johannes Bergd69f0a22017-03-14 10:58:16 +01001329 * @T2_V2_START_IMMEDIATELY: start time event immediately
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001330 * @TE_V2_DEP_OTHER: depends on another time event
1331 * @TE_V2_DEP_TSF: depends on a specific time
1332 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1333 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1334 */
Johannes Bergd69f0a22017-03-14 10:58:16 +01001335enum iwl_time_event_policy {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001336 TE_V2_DEFAULT_POLICY = 0x0,
1337
1338 /* notifications (event start/stop, fragment start/stop) */
1339 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1340 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1341 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1342 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1343
1344 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1345 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1346 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1347 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +02001348 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001349
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001350 /* placement characteristics */
1351 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1352 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1353 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1354
1355 /* are we present or absent during the Time Event. */
1356 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1357};
1358
1359/**
Johannes Berg67625862017-03-14 11:01:27 +01001360 * struct iwl_time_event_cmd - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001361 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1362 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1363 * ( TIME_EVENT_CMD = 0x29 )
Johannes Berg67625862017-03-14 11:01:27 +01001364 * @id_and_color: ID and color of the relevant MAC,
1365 * &enum iwl_mvm_id_and_color
1366 * @action: action to perform, one of &enum iwl_phy_ctxt_action
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001367 * @id: this field has two meanings, depending on the action:
1368 * If the action is ADD, then it means the type of event to add.
1369 * For all other actions it is the unique event ID assigned when the
1370 * event was added by the FW.
1371 * @apply_time: When to start the Time Event (in GP2)
1372 * @max_delay: maximum delay to event's start (apply time), in TU
1373 * @depends_on: the unique ID of the event we depend on (if any)
1374 * @interval: interval between repetitions, in TU
1375 * @duration: duration of event in TU
1376 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1377 * @max_frags: maximal number of fragments the Time Event can be divided to
1378 * @policy: defines whether uCode shall notify the host or other uCode modules
1379 * on event and/or fragment start and/or end
1380 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1381 * TE_EVENT_SOCIOPATHIC
Johannes Berg67625862017-03-14 11:01:27 +01001382 * using TE_ABSENCE and using TE_NOTIF_*,
1383 * &enum iwl_time_event_policy
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001384 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001385struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001386 /* COMMON_INDEX_HDR_API_S_VER_1 */
1387 __le32 id_and_color;
1388 __le32 action;
1389 __le32 id;
1390 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1391 __le32 apply_time;
1392 __le32 max_delay;
1393 __le32 depends_on;
1394 __le32 interval;
1395 __le32 duration;
1396 u8 repeat;
1397 u8 max_frags;
1398 __le16 policy;
1399} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1400
Johannes Berg8ca151b2013-01-24 14:25:36 +01001401/**
1402 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1403 * @status: bit 0 indicates success, all others specify errors
1404 * @id: the Time Event type
1405 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
Johannes Berg67625862017-03-14 11:01:27 +01001406 * @id_and_color: ID and color of the relevant MAC,
1407 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001408 */
1409struct iwl_time_event_resp {
1410 __le32 status;
1411 __le32 id;
1412 __le32 unique_id;
1413 __le32 id_and_color;
1414} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1415
1416/**
1417 * struct iwl_time_event_notif - notifications of time event start/stop
1418 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1419 * @timestamp: action timestamp in GP2
1420 * @session_id: session's unique id
1421 * @unique_id: unique id of the Time Event itself
1422 * @id_and_color: ID and color of the relevant MAC
Johannes Berg67625862017-03-14 11:01:27 +01001423 * @action: &enum iwl_time_event_policy
Johannes Berg8ca151b2013-01-24 14:25:36 +01001424 * @status: true if scheduled, false otherwise (not executed)
1425 */
1426struct iwl_time_event_notif {
1427 __le32 timestamp;
1428 __le32 session_id;
1429 __le32 unique_id;
1430 __le32 id_and_color;
1431 __le32 action;
1432 __le32 status;
1433} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1434
1435
1436/* Bindings and Time Quota */
1437
1438/**
Johannes Berg4d151c22017-03-14 11:04:06 +01001439 * struct iwl_binding_cmd_v1 - configuring bindings
1440 * ( BINDING_CONTEXT_CMD = 0x2b )
1441 * @id_and_color: ID and color of the relevant Binding,
1442 * &enum iwl_mvm_id_and_color
1443 * @action: action to perform, one of FW_CTXT_ACTION_*
1444 * @macs: array of MAC id and colors which belong to the binding,
1445 * &enum iwl_mvm_id_and_color
1446 * @phy: PHY id and color which belongs to the binding,
1447 * &enum iwl_mvm_id_and_color
1448 */
1449struct iwl_binding_cmd_v1 {
1450 /* COMMON_INDEX_HDR_API_S_VER_1 */
1451 __le32 id_and_color;
1452 __le32 action;
1453 /* BINDING_DATA_API_S_VER_1 */
1454 __le32 macs[MAX_MACS_IN_BINDING];
1455 __le32 phy;
1456} __packed; /* BINDING_CMD_API_S_VER_1 */
1457
1458/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001459 * struct iwl_binding_cmd - configuring bindings
1460 * ( BINDING_CONTEXT_CMD = 0x2b )
Johannes Berg67625862017-03-14 11:01:27 +01001461 * @id_and_color: ID and color of the relevant Binding,
1462 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001463 * @action: action to perform, one of FW_CTXT_ACTION_*
1464 * @macs: array of MAC id and colors which belong to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001465 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001466 * @phy: PHY id and color which belongs to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001467 * &enum iwl_mvm_id_and_color
Sara Sharon9415af72016-11-17 13:57:32 +02001468 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001469 */
1470struct iwl_binding_cmd {
1471 /* COMMON_INDEX_HDR_API_S_VER_1 */
1472 __le32 id_and_color;
1473 __le32 action;
1474 /* BINDING_DATA_API_S_VER_1 */
1475 __le32 macs[MAX_MACS_IN_BINDING];
1476 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001477 __le32 lmac_id;
1478} __packed; /* BINDING_CMD_API_S_VER_2 */
1479
Johannes Berg4d151c22017-03-14 11:04:06 +01001480#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
Sara Sharon9415af72016-11-17 13:57:32 +02001481#define IWL_LMAC_24G_INDEX 0
1482#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001483
Ilan Peer35adfd62013-02-04 13:16:24 +02001484/* The maximal number of fragments in the FW's schedule session */
1485#define IWL_MVM_MAX_QUOTA 128
1486
Johannes Berg8ca151b2013-01-24 14:25:36 +01001487/**
1488 * struct iwl_time_quota_data - configuration of time quota per binding
Johannes Berg67625862017-03-14 11:01:27 +01001489 * @id_and_color: ID and color of the relevant Binding,
1490 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001491 * @quota: absolute time quota in TU. The scheduler will try to divide the
1492 * remainig quota (after Time Events) according to this quota.
1493 * @max_duration: max uninterrupted context duration in TU
1494 */
1495struct iwl_time_quota_data {
1496 __le32 id_and_color;
1497 __le32 quota;
1498 __le32 max_duration;
1499} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1500
1501/**
1502 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1503 * ( TIME_QUOTA_CMD = 0x2c )
1504 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001505 * Note: on non-CDB the fourth one is the auxilary mac and is
1506 * essentially zero.
1507 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001508 */
1509struct iwl_time_quota_cmd {
1510 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1511} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1512
1513
1514/* PHY context */
1515
1516/* Supported bands */
1517#define PHY_BAND_5 (0)
1518#define PHY_BAND_24 (1)
1519
1520/* Supported channel width, vary if there is VHT support */
1521#define PHY_VHT_CHANNEL_MODE20 (0x0)
1522#define PHY_VHT_CHANNEL_MODE40 (0x1)
1523#define PHY_VHT_CHANNEL_MODE80 (0x2)
1524#define PHY_VHT_CHANNEL_MODE160 (0x3)
1525
1526/*
1527 * Control channel position:
1528 * For legacy set bit means upper channel, otherwise lower.
1529 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1530 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1531 * center_freq
1532 * |
1533 * 40Mhz |_______|_______|
1534 * 80Mhz |_______|_______|_______|_______|
1535 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1536 * code 011 010 001 000 | 100 101 110 111
1537 */
1538#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1539#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1540#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1541#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1542#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1543#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1544#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1545#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1546
1547/*
1548 * @band: PHY_BAND_*
1549 * @channel: channel number
1550 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1551 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1552 */
1553struct iwl_fw_channel_info {
1554 u8 band;
1555 u8 channel;
1556 u8 width;
1557 u8 ctrl_pos;
1558} __packed;
1559
1560#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1561#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1562 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1563#define PHY_RX_CHAIN_VALID_POS (1)
1564#define PHY_RX_CHAIN_VALID_MSK \
1565 (0x7 << PHY_RX_CHAIN_VALID_POS)
1566#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1567#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1568 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1569#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1570#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1571 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1572#define PHY_RX_CHAIN_CNT_POS (10)
1573#define PHY_RX_CHAIN_CNT_MSK \
1574 (0x3 << PHY_RX_CHAIN_CNT_POS)
1575#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1576#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1577 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1578#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1579#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1580 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1581
1582/* TODO: fix the value, make it depend on firmware at runtime? */
1583#define NUM_PHY_CTX 3
1584
1585/* TODO: complete missing documentation */
1586/**
1587 * struct iwl_phy_context_cmd - config of the PHY context
1588 * ( PHY_CONTEXT_CMD = 0x8 )
1589 * @id_and_color: ID and color of the relevant Binding
1590 * @action: action to perform, one of FW_CTXT_ACTION_*
1591 * @apply_time: 0 means immediate apply and context switch.
1592 * other value means apply new params after X usecs
1593 * @tx_param_color: ???
Johannes Bergacf91dd2017-05-16 16:15:42 +02001594 * @ci: channel info
Johannes Berg8ca151b2013-01-24 14:25:36 +01001595 * @txchain_info: ???
1596 * @rxchain_info: ???
1597 * @acquisition_data: ???
1598 * @dsp_cfg_flags: set to 0
1599 */
1600struct iwl_phy_context_cmd {
1601 /* COMMON_INDEX_HDR_API_S_VER_1 */
1602 __le32 id_and_color;
1603 __le32 action;
1604 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1605 __le32 apply_time;
1606 __le32 tx_param_color;
1607 struct iwl_fw_channel_info ci;
1608 __le32 txchain_info;
1609 __le32 rxchain_info;
1610 __le32 acquisition_data;
1611 __le32 dsp_cfg_flags;
1612} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1613
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001614/*
1615 * Aux ROC command
1616 *
1617 * Command requests the firmware to create a time event for a certain duration
1618 * and remain on the given channel. This is done by using the Aux framework in
1619 * the FW.
1620 * The command was first used for Hot Spot issues - but can be used regardless
1621 * to Hot Spot.
1622 *
1623 * ( HOT_SPOT_CMD 0x53 )
1624 *
1625 * @id_and_color: ID and color of the MAC
1626 * @action: action to perform, one of FW_CTXT_ACTION_*
1627 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1628 * event_unique_id should be the id of the time event assigned by ucode.
1629 * Otherwise ignore the event_unique_id.
1630 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1631 * activity.
1632 * @channel_info: channel info
1633 * @node_addr: Our MAC Address
1634 * @reserved: reserved for alignment
1635 * @apply_time: GP2 value to start (should always be the current GP2 value)
1636 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1637 * time by which start of the event is allowed to be postponed.
1638 * @duration: event duration in TU To calculate event duration:
1639 * timeEventDuration = min(duration, remainingQuota)
1640 */
1641struct iwl_hs20_roc_req {
1642 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1643 __le32 id_and_color;
1644 __le32 action;
1645 __le32 event_unique_id;
1646 __le32 sta_id_and_color;
1647 struct iwl_fw_channel_info channel_info;
1648 u8 node_addr[ETH_ALEN];
1649 __le16 reserved;
1650 __le32 apply_time;
1651 __le32 apply_time_max_delay;
1652 __le32 duration;
1653} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1654
1655/*
1656 * values for AUX ROC result values
1657 */
1658enum iwl_mvm_hot_spot {
1659 HOT_SPOT_RSP_STATUS_OK,
1660 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1661 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1662};
1663
1664/*
1665 * Aux ROC command response
1666 *
1667 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1668 * driver the uid of the timevent.
1669 *
1670 * ( HOT_SPOT_CMD 0x53 )
1671 *
1672 * @event_unique_id: Unique ID of time event assigned by ucode
1673 * @status: Return status 0 is success, all the rest used for specific errors
1674 */
1675struct iwl_hs20_roc_res {
1676 __le32 event_unique_id;
1677 __le32 status;
1678} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1679
Johannes Berg8ca151b2013-01-24 14:25:36 +01001680/**
1681 * struct iwl_radio_version_notif - information on the radio version
1682 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
Johannes Bergacf91dd2017-05-16 16:15:42 +02001683 * @radio_flavor: radio flavor
1684 * @radio_step: radio version step
1685 * @radio_dash: radio version dash
Johannes Berg8ca151b2013-01-24 14:25:36 +01001686 */
1687struct iwl_radio_version_notif {
1688 __le32 radio_flavor;
1689 __le32 radio_step;
1690 __le32 radio_dash;
1691} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1692
1693enum iwl_card_state_flags {
1694 CARD_ENABLED = 0x00,
1695 HW_CARD_DISABLED = 0x01,
1696 SW_CARD_DISABLED = 0x02,
1697 CT_KILL_CARD_DISABLED = 0x04,
1698 HALT_CARD_DISABLED = 0x08,
1699 CARD_DISABLED_MSK = 0x0f,
1700 CARD_IS_RX_ON = 0x10,
1701};
1702
1703/**
1704 * struct iwl_radio_version_notif - information on the radio version
1705 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1706 * @flags: %iwl_card_state_flags
1707 */
1708struct iwl_card_state_notif {
1709 __le32 flags;
1710} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1711
1712/**
Hila Gonend64048e2013-03-13 18:00:03 +02001713 * struct iwl_missed_beacons_notif - information on missed beacons
1714 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1715 * @mac_id: interface ID
1716 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1717 * beacons since last RX.
1718 * @consec_missed_beacons: number of consecutive missed beacons
Johannes Bergacf91dd2017-05-16 16:15:42 +02001719 * @num_expected_beacons: number of expected beacons
1720 * @num_recvd_beacons: number of received beacons
Hila Gonend64048e2013-03-13 18:00:03 +02001721 */
1722struct iwl_missed_beacons_notif {
1723 __le32 mac_id;
1724 __le32 consec_missed_beacons_since_last_rx;
1725 __le32 consec_missed_beacons;
1726 __le32 num_expected_beacons;
1727 __le32 num_recvd_beacons;
1728} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1729
1730/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001731 * struct iwl_mfuart_load_notif - mfuart image version & status
1732 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1733 * @installed_ver: installed image version
1734 * @external_ver: external image version
1735 * @status: MFUART loading status
1736 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001737 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001738*/
1739struct iwl_mfuart_load_notif {
1740 __le32 installed_ver;
1741 __le32 external_ver;
1742 __le32 status;
1743 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001744 /* image size valid only in v2 of the command */
1745 __le32 image_size;
1746} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001747
1748/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001749 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1750 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1751 * @assert_id: mfuart assert id that cause the notif
1752 * @curr_reset_num: number of asserts since uptime
1753 * @index_num: current chunk id
1754 * @parts_num: total number of chunks
1755 * @data_size: number of data bytes sent
1756 * @data: data buffer
1757 */
1758struct iwl_mfu_assert_dump_notif {
1759 __le32 assert_id;
1760 __le32 curr_reset_num;
1761 __le16 index_num;
1762 __le16 parts_num;
1763 __le32 data_size;
1764 __le32 data[0];
1765} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1766
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001767#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001768#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001769
1770/**
1771 * struct iwl_mcast_filter_cmd - configure multicast filter.
1772 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1773 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1774 * to identify network interface adopted in host-device IF.
1775 * It is used by FW as index in array of addresses. This array has
1776 * MAX_PORT_ID_NUM members.
1777 * @count: Number of MAC addresses in the array
1778 * @pass_all: Set 1 to pass all multicast packets.
1779 * @bssid: current association BSSID.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001780 * @reserved: reserved
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001781 * @addr_list: Place holder for array of MAC addresses.
1782 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1783 */
1784struct iwl_mcast_filter_cmd {
1785 u8 filter_own;
1786 u8 port_id;
1787 u8 count;
1788 u8 pass_all;
1789 u8 bssid[6];
1790 u8 reserved[2];
1791 u8 addr_list[0];
1792} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1793
Eliad Pellerc87163b2014-01-08 10:11:11 +02001794#define MAX_BCAST_FILTERS 8
1795#define MAX_BCAST_FILTER_ATTRS 2
1796
1797/**
1798 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1799 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1800 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1801 * start of ip payload).
1802 */
1803enum iwl_mvm_bcast_filter_attr_offset {
1804 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1805 BCAST_FILTER_OFFSET_IP_END = 1,
1806};
1807
1808/**
1809 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1810 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1811 * @offset: starting offset of this pattern.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001812 * @reserved1: reserved
1813 * @val: value to match - big endian (MSB is the first
Eliad Pellerc87163b2014-01-08 10:11:11 +02001814 * byte to match from offset pos).
1815 * @mask: mask to match (big endian).
1816 */
1817struct iwl_fw_bcast_filter_attr {
1818 u8 offset_type;
1819 u8 offset;
1820 __le16 reserved1;
1821 __be32 val;
1822 __be32 mask;
1823} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1824
1825/**
1826 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1827 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1828 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1829 */
1830enum iwl_mvm_bcast_filter_frame_type {
1831 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1832 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1833};
1834
1835/**
1836 * struct iwl_fw_bcast_filter - broadcast filter
1837 * @discard: discard frame (1) or let it pass (0).
1838 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
Johannes Bergacf91dd2017-05-16 16:15:42 +02001839 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001840 * @num_attrs: number of valid attributes in this filter.
1841 * @attrs: attributes of this filter. a filter is considered matched
1842 * only when all its attributes are matched (i.e. AND relationship)
1843 */
1844struct iwl_fw_bcast_filter {
1845 u8 discard;
1846 u8 frame_type;
1847 u8 num_attrs;
1848 u8 reserved1;
1849 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1850} __packed; /* BCAST_FILTER_S_VER_1 */
1851
Sara Sharon3af512d62015-07-22 11:38:40 +03001852#define BA_WINDOW_STREAMS_MAX 16
1853#define BA_WINDOW_STATUS_TID_MSK 0x000F
1854#define BA_WINDOW_STATUS_STA_ID_POS 4
1855#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1856#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1857
1858/**
1859 * struct iwl_ba_window_status_notif - reordering window's status notification
1860 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1861 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1862 * @start_seq_num: the start sequence number of the bitmap
1863 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1864 */
1865struct iwl_ba_window_status_notif {
1866 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1867 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1868 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1869 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1870} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1871
Eliad Pellerc87163b2014-01-08 10:11:11 +02001872/**
1873 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1874 * @default_discard: default action for this mac (discard (1) / pass (0)).
Johannes Bergacf91dd2017-05-16 16:15:42 +02001875 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001876 * @attached_filters: bitmap of relevant filters for this mac.
1877 */
1878struct iwl_fw_bcast_mac {
1879 u8 default_discard;
1880 u8 reserved1;
1881 __le16 attached_filters;
1882} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1883
1884/**
1885 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1886 * @disable: enable (0) / disable (1)
1887 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1888 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
Johannes Bergacf91dd2017-05-16 16:15:42 +02001889 * @reserved1: reserved
Eliad Pellerc87163b2014-01-08 10:11:11 +02001890 * @filters: broadcast filters
1891 * @macs: broadcast filtering configuration per-mac
1892 */
1893struct iwl_bcast_filter_cmd {
1894 u8 disable;
1895 u8 max_bcast_filters;
1896 u8 max_macs;
1897 u8 reserved1;
1898 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1899 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1900} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1901
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001902/*
1903 * enum iwl_mvm_marker_id - maker ids
1904 *
1905 * The ids for different type of markers to insert into the usniffer logs
1906 */
1907enum iwl_mvm_marker_id {
1908 MARKER_ID_TX_FRAME_LATENCY = 1,
1909}; /* MARKER_ID_API_E_VER_1 */
1910
1911/**
1912 * struct iwl_mvm_marker - mark info into the usniffer logs
1913 *
1914 * (MARKER_CMD = 0xcb)
1915 *
1916 * Mark the UTC time stamp into the usniffer logs together with additional
1917 * metadata, so the usniffer output can be parsed.
1918 * In the command response the ucode will return the GP2 time.
1919 *
1920 * @dw_len: The amount of dwords following this byte including this byte.
1921 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1922 * @reserved: reserved.
1923 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1924 * @metadata: additional meta data that will be written to the unsiffer log
1925 */
1926struct iwl_mvm_marker {
Johannes Berg1644be92017-05-16 13:21:52 +02001927 u8 dw_len;
1928 u8 marker_id;
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001929 __le16 reserved;
1930 __le64 timestamp;
1931 __le32 metadata[0];
1932} __packed; /* MARKER_API_S_VER_1 */
1933
Matti Gottlieb0becb372015-05-31 09:18:30 +03001934/*
1935 * enum iwl_dc2dc_config_id - flag ids
1936 *
1937 * Ids of dc2dc configuration flags
1938 */
1939enum iwl_dc2dc_config_id {
1940 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1941 DCDC_FREQ_TUNE_SET = 0x2,
1942}; /* MARKER_ID_API_E_VER_1 */
1943
1944/**
1945 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1946 *
1947 * (DC2DC_CONFIG_CMD = 0x83)
1948 *
1949 * Set/Get & configure dc2dc values.
1950 * The command always returns the current dc2dc values.
1951 *
1952 * @flags: set/get dc2dc
1953 * @enable_low_power_mode: not used.
1954 * @dc2dc_freq_tune0: frequency divider - digital domain
1955 * @dc2dc_freq_tune1: frequency divider - analog domain
1956 */
1957struct iwl_dc2dc_config_cmd {
1958 __le32 flags;
1959 __le32 enable_low_power_mode; /* not used */
1960 __le32 dc2dc_freq_tune0;
1961 __le32 dc2dc_freq_tune1;
1962} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1963
1964/**
1965 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1966 *
1967 * Current dc2dc values returned by the FW.
1968 *
1969 * @dc2dc_freq_tune0: frequency divider - digital domain
1970 * @dc2dc_freq_tune1: frequency divider - analog domain
1971 */
1972struct iwl_dc2dc_config_resp {
1973 __le32 dc2dc_freq_tune0;
1974 __le32 dc2dc_freq_tune1;
1975} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1976
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001977/***********************************
1978 * Smart Fifo API
1979 ***********************************/
1980/* Smart Fifo state */
1981enum iwl_sf_state {
1982 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1983 SF_FULL_ON,
1984 SF_UNINIT,
1985 SF_INIT_OFF,
1986 SF_HW_NUM_STATES
1987};
1988
1989/* Smart Fifo possible scenario */
1990enum iwl_sf_scenario {
1991 SF_SCENARIO_SINGLE_UNICAST,
1992 SF_SCENARIO_AGG_UNICAST,
1993 SF_SCENARIO_MULTICAST,
1994 SF_SCENARIO_BA_RESP,
1995 SF_SCENARIO_TX_RESP,
1996 SF_NUM_SCENARIO
1997};
1998
1999#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
2000#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
2001
2002/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02002003#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002004#define SF_W_MARK_MIMO2 8192
2005#define SF_W_MARK_MIMO3 6144
2006#define SF_W_MARK_LEGACY 4096
2007#define SF_W_MARK_SCAN 4096
2008
Eran Hararyf4a3ee42015-02-08 13:58:50 +02002009/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
2010#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
2011#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2012#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
2013#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2014#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
2015#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
2016#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
2017#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
2018#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
2019#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
2020
2021/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002022#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
2023#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
2024#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
2025#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
2026#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
2027#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
2028#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
2029#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
2030#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
2031#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
2032
2033#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
2034
Eran Harary161bdb72014-07-27 08:03:06 +03002035#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
2036
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002037/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002038 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
2039 * @state: smart fifo state, types listed in &enum iwl_sf_state.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002040 * @watermark: Minimum allowed availabe free space in RXF for transient state.
2041 * @long_delay_timeouts: aging and idle timer values for each scenario
2042 * in long delay state.
2043 * @full_on_timeouts: timer values for each scenario in full on state.
2044 */
2045struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03002046 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02002047 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
2048 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
2049 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
2050} __packed; /* SF_CFG_API_S_VER_2 */
2051
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002052/***********************************
2053 * Location Aware Regulatory (LAR) API - MCC updates
2054 ***********************************/
2055
2056/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002057 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002058 * regulatory profile according to the given MCC (Mobile Country Code).
2059 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2060 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2061 * MCC in the cmd response will be the relevant MCC in the NVM.
2062 * @mcc: given mobile country code
2063 * @source_id: the source from where we got the MCC, see iwl_mcc_source
2064 * @reserved: reserved for alignment
2065 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002066struct iwl_mcc_update_cmd_v1 {
2067 __le16 mcc;
2068 u8 source_id;
2069 u8 reserved;
2070} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
2071
2072/**
2073 * struct iwl_mcc_update_cmd - Request the device to update geographic
2074 * regulatory profile according to the given MCC (Mobile Country Code).
2075 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2076 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2077 * MCC in the cmd response will be the relevant MCC in the NVM.
2078 * @mcc: given mobile country code
2079 * @source_id: the source from where we got the MCC, see iwl_mcc_source
2080 * @reserved: reserved for alignment
2081 * @key: integrity key for MCC API OEM testing
2082 * @reserved2: reserved
2083 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002084struct iwl_mcc_update_cmd {
2085 __le16 mcc;
2086 u8 source_id;
2087 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002088 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01002089 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002090} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002091
2092/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002093 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002094 * Contains the new channel control profile map, if changed, and the new MCC
2095 * (mobile country code).
2096 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02002097 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002098 * @mcc: the new applied MCC
2099 * @cap: capabilities for all channels which matches the MCC
2100 * @source_id: the MCC source, see iwl_mcc_source
2101 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
2102 * channels, depending on platform)
2103 * @channels: channel control data map, DWORD for each channel. Only the first
2104 * 16bits are used.
2105 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002106struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002107 __le32 status;
2108 __le16 mcc;
2109 u8 cap;
2110 u8 source_id;
2111 __le32 n_channels;
2112 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002113} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
2114
2115/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002116 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002117 * Contains the new channel control profile map, if changed, and the new MCC
2118 * (mobile country code).
2119 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
2120 * @status: see &enum iwl_mcc_update_status
2121 * @mcc: the new applied MCC
2122 * @cap: capabilities for all channels which matches the MCC
2123 * @source_id: the MCC source, see iwl_mcc_source
2124 * @time: time elapsed from the MCC test start (in 30 seconds TU)
2125 * @reserved: reserved.
2126 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
2127 * channels, depending on platform)
2128 * @channels: channel control data map, DWORD for each channel. Only the first
2129 * 16bits are used.
2130 */
2131struct iwl_mcc_update_resp {
2132 __le32 status;
2133 __le16 mcc;
2134 u8 cap;
2135 u8 source_id;
2136 __le16 time;
2137 __le16 reserved;
2138 __le32 n_channels;
2139 __le32 channels[0];
2140} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002141
2142/**
2143 * struct iwl_mcc_chub_notif - chub notifies of mcc change
2144 * (MCC_CHUB_UPDATE_CMD = 0xc9)
2145 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
2146 * the cellular and connectivity cores that gets updates of the mcc, and
2147 * notifies the ucode directly of any mcc change.
2148 * The ucode requests the driver to request the device to update geographic
2149 * regulatory profile according to the given MCC (Mobile Country Code).
2150 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
2151 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
2152 * MCC in the cmd response will be the relevant MCC in the NVM.
2153 * @mcc: given mobile country code
2154 * @source_id: identity of the change originator, see iwl_mcc_source
2155 * @reserved1: reserved for alignment
2156 */
2157struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01002158 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002159 u8 source_id;
2160 u8 reserved1;
2161} __packed; /* LAR_MCC_NOTIFY_S */
2162
2163enum iwl_mcc_update_status {
2164 MCC_RESP_NEW_CHAN_PROFILE,
2165 MCC_RESP_SAME_CHAN_PROFILE,
2166 MCC_RESP_INVALID,
2167 MCC_RESP_NVM_DISABLED,
2168 MCC_RESP_ILLEGAL,
2169 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002170 MCC_RESP_TEST_MODE_ACTIVE,
2171 MCC_RESP_TEST_MODE_NOT_ACTIVE,
2172 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002173};
2174
2175enum iwl_mcc_source {
2176 MCC_SOURCE_OLD_FW = 0,
2177 MCC_SOURCE_ME = 1,
2178 MCC_SOURCE_BIOS = 2,
2179 MCC_SOURCE_3G_LTE_HOST = 3,
2180 MCC_SOURCE_3G_LTE_DEVICE = 4,
2181 MCC_SOURCE_WIFI = 5,
2182 MCC_SOURCE_RESERVED = 6,
2183 MCC_SOURCE_DEFAULT = 7,
2184 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002185 MCC_SOURCE_MCC_API = 9,
2186 MCC_SOURCE_GET_CURRENT = 0x10,
2187 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002188};
2189
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002190/* DTS measurements */
2191
2192enum iwl_dts_measurement_flags {
2193 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
2194 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
2195};
2196
2197/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002198 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002199 *
Johannes Berg31a658b2017-03-09 15:56:57 +01002200 * @flags: indicates which measurements we want as specified in
2201 * &enum iwl_dts_measurement_flags
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002202 */
2203struct iwl_dts_measurement_cmd {
2204 __le32 flags;
2205} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2206
2207/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03002208* enum iwl_dts_control_measurement_mode - DTS measurement type
2209* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2210* back (latest value. Not waiting for new value). Use automatic
2211* SW DTS configuration.
2212* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2213* trigger DTS reading and provide read back temperature read
2214* when available.
2215* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2216* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2217* without measurement trigger.
2218*/
2219enum iwl_dts_control_measurement_mode {
2220 DTS_AUTOMATIC = 0,
2221 DTS_REQUEST_READ = 1,
2222 DTS_OVER_WRITE = 2,
2223 DTS_DIRECT_WITHOUT_MEASURE = 3,
2224};
2225
2226/**
2227* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2228* @DTS_USE_TOP: Top
2229* @DTS_USE_CHAIN_A: chain A
2230* @DTS_USE_CHAIN_B: chain B
2231* @DTS_USE_CHAIN_C: chain C
Johannes Bergacf91dd2017-05-16 16:15:42 +02002232* @XTAL_TEMPERATURE: read temperature from xtal
Arik Nemtsov78efc702015-10-06 12:22:47 +03002233*/
2234enum iwl_dts_used {
2235 DTS_USE_TOP = 0,
2236 DTS_USE_CHAIN_A = 1,
2237 DTS_USE_CHAIN_B = 2,
2238 DTS_USE_CHAIN_C = 3,
2239 XTAL_TEMPERATURE = 4,
2240};
2241
2242/**
2243* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2244* @DTS_BIT6_MODE: bit 6 mode
2245* @DTS_BIT8_MODE: bit 8 mode
2246*/
2247enum iwl_dts_bit_mode {
2248 DTS_BIT6_MODE = 0,
2249 DTS_BIT8_MODE = 1,
2250};
2251
2252/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002253 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
Arik Nemtsov78efc702015-10-06 12:22:47 +03002254 * @control_mode: see &enum iwl_dts_control_measurement_mode
2255 * @temperature: used when over write DTS mode is selected
2256 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2257 * @avg_factor: average factor to DTS in request DTS read mode
2258 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2259 * @step_duration: step duration for the DTS
2260 */
2261struct iwl_ext_dts_measurement_cmd {
2262 __le32 control_mode;
2263 __le32 temperature;
2264 __le32 sensor;
2265 __le32 avg_factor;
2266 __le32 bit_mode;
2267 __le32 step_duration;
2268} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2269
2270/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002271 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002272 *
2273 * @temp: the measured temperature
2274 * @voltage: the measured voltage
2275 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002276struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002277 __le32 temp;
2278 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002279} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2280
2281/**
2282 * struct iwl_dts_measurement_notif_v2 - measurements notification
2283 *
2284 * @temp: the measured temperature
2285 * @voltage: the measured voltage
2286 * @threshold_idx: the trip index that was crossed
2287 */
2288struct iwl_dts_measurement_notif_v2 {
2289 __le32 temp;
2290 __le32 voltage;
2291 __le32 threshold_idx;
2292} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002293
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02002294/**
2295 * struct ct_kill_notif - CT-kill entry notification
2296 *
2297 * @temperature: the current temperature in celsius
2298 * @reserved: reserved
2299 */
2300struct ct_kill_notif {
2301 __le16 temperature;
2302 __le16 reserved;
2303} __packed; /* GRP_PHY_CT_KILL_NTF */
2304
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002305/**
2306* enum ctdp_cmd_operation - CTDP command operations
2307* @CTDP_CMD_OPERATION_START: update the current budget
2308* @CTDP_CMD_OPERATION_STOP: stop ctdp
Chaya Rachel Ivgi3b9449b2017-05-08 15:14:01 +03002309* @CTDP_CMD_OPERATION_REPORT: get the average budget
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002310*/
2311enum iwl_mvm_ctdp_cmd_operation {
2312 CTDP_CMD_OPERATION_START = 0x1,
2313 CTDP_CMD_OPERATION_STOP = 0x2,
2314 CTDP_CMD_OPERATION_REPORT = 0x4,
2315};/* CTDP_CMD_OPERATION_TYPE_E */
2316
2317/**
2318 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2319 *
2320 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2321 * @budget: the budget in milliwatt
2322 * @window_size: defined in API but not used
2323 */
2324struct iwl_mvm_ctdp_cmd {
2325 __le32 operation;
2326 __le32 budget;
2327 __le32 window_size;
2328} __packed;
2329
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002330#define IWL_MAX_DTS_TRIPS 8
2331
2332/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002333 * struct temp_report_ths_cmd - set temperature thresholds
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002334 *
2335 * @num_temps: number of temperature thresholds passed
2336 * @thresholds: array with the thresholds to be configured
2337 */
2338struct temp_report_ths_cmd {
2339 __le32 num_temps;
2340 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2341} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2342
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002343/***********************************
2344 * TDLS API
2345 ***********************************/
2346
2347/* Type of TDLS request */
2348enum iwl_tdls_channel_switch_type {
2349 TDLS_SEND_CHAN_SW_REQ = 0,
2350 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2351 TDLS_MOVE_CH,
2352}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2353
2354/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002355 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002356 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2357 * received from peer
2358 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2359 * to the TDLS off-channel communication. For instance if the DTIM is
2360 * 200TU and the TDLS peer is to be given 25% of the time, the value
2361 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2362 * @switch_time: switch time the peer sent in its channel switch timing IE
Johannes Berg83b03192017-05-16 13:28:53 +02002363 * @switch_timeout: switch timeout the peer sent in its channel switch timing IE
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002364 */
2365struct iwl_tdls_channel_switch_timing {
2366 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2367 __le32 max_offchan_duration; /* given in micro-seconds */
2368 __le32 switch_time; /* given in micro-seconds */
2369 __le32 switch_timeout; /* given in micro-seconds */
2370} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2371
2372#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2373
2374/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002375 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002376 *
2377 * A template representing a TDLS channel-switch request or response frame
2378 *
2379 * @switch_time_offset: offset to the channel switch timing IE in the template
2380 * @tx_cmd: Tx parameters for the frame
2381 * @data: frame data
2382 */
2383struct iwl_tdls_channel_switch_frame {
2384 __le32 switch_time_offset;
2385 struct iwl_tx_cmd tx_cmd;
2386 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2387} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2388
2389/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002390 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002391 *
2392 * The command is sent to initiate a channel switch and also in response to
2393 * incoming TDLS channel-switch request/response packets from remote peers.
2394 *
2395 * @switch_type: see &enum iwl_tdls_channel_switch_type
2396 * @peer_sta_id: station id of TDLS peer
2397 * @ci: channel we switch to
2398 * @timing: timing related data for command
2399 * @frame: channel-switch request/response template, depending to switch_type
2400 */
2401struct iwl_tdls_channel_switch_cmd {
2402 u8 switch_type;
2403 __le32 peer_sta_id;
2404 struct iwl_fw_channel_info ci;
2405 struct iwl_tdls_channel_switch_timing timing;
2406 struct iwl_tdls_channel_switch_frame frame;
2407} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2408
2409/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002410 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002411 *
2412 * @status: non-zero on success
2413 * @offchannel_duration: duration given in microseconds
2414 * @sta_id: peer currently performing the channel-switch with
2415 */
2416struct iwl_tdls_channel_switch_notif {
2417 __le32 status;
2418 __le32 offchannel_duration;
2419 __le32 sta_id;
2420} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2421
Arik Nemtsov307e4722014-09-15 18:48:59 +03002422/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002423 * struct iwl_tdls_sta_info - TDLS station info
Arik Nemtsov307e4722014-09-15 18:48:59 +03002424 *
2425 * @sta_id: station id of the TDLS peer
2426 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2427 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2428 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2429 */
2430struct iwl_tdls_sta_info {
2431 u8 sta_id;
2432 u8 tx_to_peer_tid;
2433 __le16 tx_to_peer_ssn;
2434 __le32 is_initiator;
2435} __packed; /* TDLS_STA_INFO_VER_1 */
2436
2437/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002438 * struct iwl_tdls_config_cmd - TDLS basic config command
Arik Nemtsov307e4722014-09-15 18:48:59 +03002439 *
2440 * @id_and_color: MAC id and color being configured
2441 * @tdls_peer_count: amount of currently connected TDLS peers
2442 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2443 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2444 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2445 * @pti_req_data_offset: offset of network-level data for the PTI template
2446 * @pti_req_tx_cmd: Tx parameters for PTI request template
2447 * @pti_req_template: PTI request template data
2448 */
2449struct iwl_tdls_config_cmd {
2450 __le32 id_and_color; /* mac id and color */
2451 u8 tdls_peer_count;
2452 u8 tx_to_ap_tid;
2453 __le16 tx_to_ap_ssn;
2454 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2455
2456 __le32 pti_req_data_offset;
2457 struct iwl_tx_cmd pti_req_tx_cmd;
2458 u8 pti_req_template[0];
2459} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2460
2461/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002462 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
Arik Nemtsov307e4722014-09-15 18:48:59 +03002463 *
2464 * @sta_id: station id of the TDLS peer
2465 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2466 * the peer
2467 */
2468struct iwl_tdls_config_sta_info_res {
2469 __le16 sta_id;
2470 __le16 tx_to_peer_last_seq;
2471} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2472
2473/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002474 * struct iwl_tdls_config_res - TDLS config information from FW
Arik Nemtsov307e4722014-09-15 18:48:59 +03002475 *
2476 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2477 * @sta_info: per-station TDLS config information
2478 */
2479struct iwl_tdls_config_res {
2480 __le32 tx_to_ap_last_seq;
2481 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2482} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2483
Sara Sharona07a8f32015-11-15 11:11:59 +02002484/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002485 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
Sara Sharona07a8f32015-11-15 11:11:59 +02002486 *
Johannes Bergacf91dd2017-05-16 16:15:42 +02002487 * @reserved: reserved
Sara Sharona07a8f32015-11-15 11:11:59 +02002488 * @membership_status: a bitmap of MU groups
2489 * @user_position:the position of station in a group. If the station is in the
2490 * group then bits (group * 2) is the position -1
2491 */
2492struct iwl_mu_group_mgmt_cmd {
2493 __le32 reserved;
2494 __le32 membership_status[2];
2495 __le32 user_position[4];
2496} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2497
Sara Sharonf92659a2016-02-03 15:04:49 +02002498/**
2499 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2500 *
2501 * @membership_status: a bitmap of MU groups
2502 * @user_position: the position of station in a group. If the station is in the
2503 * group then bits (group * 2) is the position -1
2504 */
2505struct iwl_mu_group_mgmt_notif {
2506 __le32 membership_status[2];
2507 __le32 user_position[4];
2508} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2509
Sara Sharon0db056d2015-12-29 11:07:15 +02002510#define MAX_STORED_BEACON_SIZE 600
2511
2512/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002513 * struct iwl_stored_beacon_notif - Stored beacon notification
Sara Sharon0db056d2015-12-29 11:07:15 +02002514 *
2515 * @system_time: system time on air rise
2516 * @tsf: TSF on air rise
2517 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002518 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002519 * @channel: channel this beacon was received on
2520 * @rates: rate in ucode internal format
2521 * @byte_count: frame's byte count
Johannes Bergacf91dd2017-05-16 16:15:42 +02002522 * @data: beacon data, length in @byte_count
Sara Sharon0db056d2015-12-29 11:07:15 +02002523 */
2524struct iwl_stored_beacon_notif {
2525 __le32 system_time;
2526 __le64 tsf;
2527 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002528 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002529 __le16 channel;
2530 __le32 rates;
2531 __le32 byte_count;
2532 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002533} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002534
Aviya Erenfeld03098262016-02-18 14:09:33 +02002535#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2536
2537enum iwl_lqm_cmd_operatrions {
2538 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2539 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2540};
2541
2542enum iwl_lqm_status {
2543 LQM_STATUS_SUCCESS = 0,
2544 LQM_STATUS_TIMEOUT = 1,
2545 LQM_STATUS_ABORT = 2,
2546};
2547
2548/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002549 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
Johannes Berg83b03192017-05-16 13:28:53 +02002550 * @cmd_operation: command operation to be performed (start or stop)
Aviya Erenfeld03098262016-02-18 14:09:33 +02002551 * as defined above.
2552 * @mac_id: MAC ID the measurement applies to.
2553 * @measurement_time: time of the total measurement to be performed, in uSec.
2554 * @timeout: maximum time allowed until a response is sent, in uSec.
2555 */
2556struct iwl_link_qual_msrmnt_cmd {
2557 __le32 cmd_operation;
2558 __le32 mac_id;
2559 __le32 measurement_time;
2560 __le32 timeout;
2561} __packed /* LQM_CMD_API_S_VER_1 */;
2562
2563/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002564 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
Aviya Erenfeld03098262016-02-18 14:09:33 +02002565 *
2566 * @frequent_stations_air_time: an array containing the total air time
2567 * (in uSec) used by the most frequently transmitting stations.
2568 * @number_of_stations: the number of uniqe stations included in the array
2569 * (a number between 0 to 16)
2570 * @total_air_time_other_stations: the total air time (uSec) used by all the
2571 * stations which are not included in the above report.
2572 * @time_in_measurement_window: the total time in uSec in which a measurement
2573 * took place.
2574 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2575 * measurement
2576 * @mac_id: MAC ID the measurement applies to.
2577 * @status: return status. may be one of the LQM_STATUS_* defined above.
2578 * @reserved: reserved.
2579 */
2580struct iwl_link_qual_msrmnt_notif {
2581 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2582 __le32 number_of_stations;
2583 __le32 total_air_time_other_stations;
2584 __le32 time_in_measurement_window;
2585 __le32 tx_frame_dropped;
2586 __le32 mac_id;
2587 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002588 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002589} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2590
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002591/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002592 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002593 *
2594 * @id_and_color: ID and color of the MAC
2595 */
2596struct iwl_channel_switch_noa_notif {
2597 __le32 id_and_color;
2598} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2599
Ido Yariv2b55f432016-08-23 14:44:59 -04002600/* Operation types for the debug mem access */
2601enum {
2602 DEBUG_MEM_OP_READ = 0,
2603 DEBUG_MEM_OP_WRITE = 1,
2604 DEBUG_MEM_OP_WRITE_BYTES = 2,
2605};
2606
2607#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2608
2609/**
2610 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2611 * @op: DEBUG_MEM_OP_*
2612 * @addr: address to read/write from/to
2613 * @len: in dwords, to read/write
2614 * @data: for write opeations, contains the source buffer
2615 */
2616struct iwl_dbg_mem_access_cmd {
2617 __le32 op;
2618 __le32 addr;
2619 __le32 len;
2620 __le32 data[];
2621} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2622
2623/* Status responses for the debug mem access */
2624enum {
2625 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2626 DEBUG_MEM_STATUS_FAILED = 0x1,
2627 DEBUG_MEM_STATUS_LOCKED = 0x2,
2628 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2629 DEBUG_MEM_STATUS_LENGTH = 0x4,
2630};
2631
2632/**
2633 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2634 * @status: DEBUG_MEM_STATUS_*
2635 * @len: read dwords (0 for write operations)
2636 * @data: contains the read DWs
2637 */
2638struct iwl_dbg_mem_access_rsp {
2639 __le32 status;
2640 __le32 len;
2641 __le32 data[];
2642} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2643
Sara Sharon1f370652016-08-31 18:13:57 +03002644/**
2645 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
Johannes Bergacf91dd2017-05-16 16:15:42 +02002646 * @reserved: reserved
Sara Sharon1f370652016-08-31 18:13:57 +03002647 */
2648struct iwl_nvm_access_complete_cmd {
2649 __le32 reserved;
2650} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2651
Sara Sharon4399caa2016-12-11 10:32:42 +02002652/**
2653 * enum iwl_extended_cfg_flag - commands driver may send before
2654 * finishing init flow
2655 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2656 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2657 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2658 */
2659enum iwl_extended_cfg_flags {
2660 IWL_INIT_DEBUG_CFG,
2661 IWL_INIT_NVM,
2662 IWL_INIT_PHY,
2663};
2664
2665/**
2666 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2667 * before finishing init flows
2668 * @init_flags: values from iwl_extended_cfg_flags
2669 */
2670struct iwl_init_extended_cfg_cmd {
2671 __le32 init_flags;
2672} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2673
Sara Sharone9e1ba32017-01-08 16:46:14 +02002674/*
2675 * struct iwl_nvm_get_info - request to get NVM data
2676 */
2677struct iwl_nvm_get_info {
2678 __le32 reserved;
2679} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2680
2681/**
2682 * struct iwl_nvm_get_info_general - general NVM data
2683 * @flags: 1 - empty, 0 - valid
2684 * @nvm_version: nvm version
2685 * @board_type: board type
Johannes Bergacf91dd2017-05-16 16:15:42 +02002686 * @reserved: reserved
Sara Sharone9e1ba32017-01-08 16:46:14 +02002687 */
2688struct iwl_nvm_get_info_general {
2689 __le32 flags;
2690 __le16 nvm_version;
2691 u8 board_type;
2692 u8 reserved;
2693} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2694
2695/**
2696 * struct iwl_nvm_get_info_sku - mac information
2697 * @enable_24g: band 2.4G enabled
2698 * @enable_5g: band 5G enabled
2699 * @enable_11n: 11n enabled
2700 * @enable_11ac: 11ac enabled
2701 * @mimo_disable: MIMO enabled
2702 * @ext_crypto: Extended crypto enabled
2703 */
2704struct iwl_nvm_get_info_sku {
2705 __le32 enable_24g;
2706 __le32 enable_5g;
2707 __le32 enable_11n;
2708 __le32 enable_11ac;
2709 __le32 mimo_disable;
2710 __le32 ext_crypto;
2711} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2712
2713/**
2714 * struct iwl_nvm_get_info_phy - phy information
2715 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2716 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2717 */
2718struct iwl_nvm_get_info_phy {
2719 __le32 tx_chains;
2720 __le32 rx_chains;
2721} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2722
2723#define IWL_NUM_CHANNELS (51)
2724
2725/**
2726 * struct iwl_nvm_get_info_regulatory - regulatory information
2727 * @lar_enabled: is LAR enabled
2728 * @channel_profile: regulatory data of this channel
Johannes Berg358631b2017-05-16 15:14:19 +02002729 * @reserved: reserved
Sara Sharone9e1ba32017-01-08 16:46:14 +02002730 */
2731struct iwl_nvm_get_info_regulatory {
2732 __le32 lar_enabled;
2733 __le16 channel_profile[IWL_NUM_CHANNELS];
2734 __le16 reserved;
2735} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2736
2737/**
2738 * struct iwl_nvm_get_info_rsp - response to get NVM data
2739 * @general: general NVM data
2740 * @mac_sku: data relating to MAC sku
2741 * @phy_sku: data relating to PHY sku
2742 * @regulatory: regulatory data
2743 */
2744struct iwl_nvm_get_info_rsp {
2745 struct iwl_nvm_get_info_general general;
2746 struct iwl_nvm_get_info_sku mac_sku;
2747 struct iwl_nvm_get_info_phy phy_sku;
2748 struct iwl_nvm_get_info_regulatory regulatory;
2749} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2750
Johannes Berg15fc1962017-03-10 14:01:42 +01002751/**
2752 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2753 * @isolation: antenna isolation value
2754 */
2755struct iwl_mvm_antenna_coupling_notif {
2756 __le32 isolation;
2757} __packed;
2758
Johannes Berg8ca151b2013-01-24 14:25:36 +01002759#endif /* __fw_api_h__ */