blob: 7a52fb6b4924067e477ce2affc16bd94a405a27c [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,
188 SCAN_REQ_UMAC = 0xd,
189 SCAN_ABORT_UMAC = 0xe,
Johannes Berg15fc1962017-03-10 14:01:42 +0100190
191 /**
192 * @SCAN_COMPLETE_UMAC: uses &struct iwl_umac_scan_complete
193 */
David Spinadeld2496222014-05-20 12:46:37 +0300194 SCAN_COMPLETE_UMAC = 0xf,
195
Sara Sharon3af512d62015-07-22 11:38:40 +0300196 BA_WINDOW_STATUS_NOTIFICATION_ID = 0x13,
197
Johannes Berg15fc1962017-03-10 14:01:42 +0100198 /**
199 * @ADD_STA_KEY:
200 * &struct iwl_mvm_add_sta_key_cmd_v1 or
201 * &struct iwl_mvm_add_sta_key_cmd.
202 */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300203 ADD_STA_KEY = 0x17,
Johannes Berg15fc1962017-03-10 14:01:42 +0100204
205 /**
206 * @ADD_STA:
207 * &struct iwl_mvm_add_sta_cmd or &struct iwl_mvm_add_sta_cmd_v7.
208 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100209 ADD_STA = 0x18,
Johannes Berg15fc1962017-03-10 14:01:42 +0100210 /**
211 * @REMOVE_STA: &struct iwl_mvm_rm_sta_cmd
212 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100213 REMOVE_STA = 0x19,
214
Matti Gottliebe1120182015-07-19 11:15:07 +0300215 /* paging get item */
216 FW_GET_ITEM_CMD = 0x1a,
217
Johannes Berge8226a52017-03-31 11:25:52 +0200218 /**
Johannes Berg7b7cab72017-05-02 13:01:49 +0200219 * @TX_CMD: uses &struct iwl_tx_cmd or &struct iwl_tx_cmd_gen2,
220 * response in &struct iwl_mvm_tx_resp
Johannes Berge8226a52017-03-31 11:25:52 +0200221 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100222 TX_CMD = 0x1c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100223
224 /**
225 * @TXPATH_FLUSH: &struct iwl_tx_path_flush_cmd
226 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100227 TXPATH_FLUSH = 0x1e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100228
229 /**
230 * @MGMT_MCAST_KEY:
231 * &struct iwl_mvm_mgmt_mcast_key_cmd or
232 * &struct iwl_mvm_mgmt_mcast_key_cmd_v1
233 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100234 MGMT_MCAST_KEY = 0x1f,
235
Avri Altman3edf8ff2014-07-30 11:41:01 +0300236 /* scheduler config */
Johannes Berg15fc1962017-03-10 14:01:42 +0100237 /**
Johannes Berge153c1e2017-03-30 14:23:21 +0200238 * @SCD_QUEUE_CFG: &struct iwl_scd_txq_cfg_cmd for older hardware,
239 * &struct iwl_tx_queue_cfg_cmd with &struct iwl_tx_queue_cfg_rsp
240 * for newer (A000) hardware.
Johannes Berg15fc1962017-03-10 14:01:42 +0100241 */
Avri Altman3edf8ff2014-07-30 11:41:01 +0300242 SCD_QUEUE_CFG = 0x1d,
243
Johannes Berg8ca151b2013-01-24 14:25:36 +0100244 /* global key */
245 WEP_KEY = 0x20,
246
Liad Kaufman04fd2c22014-12-15 17:54:16 +0200247 /* Memory */
248 SHARED_MEM_CFG = 0x25,
249
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300250 /* TDLS */
251 TDLS_CHANNEL_SWITCH_CMD = 0x27,
252 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
Arik Nemtsov307e4722014-09-15 18:48:59 +0300253 TDLS_CONFIG_CMD = 0xa7,
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300254
Johannes Berg15fc1962017-03-10 14:01:42 +0100255 /**
256 * @MAC_CONTEXT_CMD: &struct iwl_mac_ctx_cmd
257 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100258 MAC_CONTEXT_CMD = 0x28,
Johannes Berg15fc1962017-03-10 14:01:42 +0100259
260 /**
261 * @TIME_EVENT_CMD:
262 * &struct iwl_time_event_cmd, response in &struct iwl_time_event_resp
263 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100264 TIME_EVENT_CMD = 0x29, /* both CMD and response */
Johannes Berg15fc1962017-03-10 14:01:42 +0100265 /**
266 * @TIME_EVENT_NOTIFICATION: &struct iwl_time_event_notif
267 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100268 TIME_EVENT_NOTIFICATION = 0x2a,
Johannes Berg15fc1962017-03-10 14:01:42 +0100269 /**
270 * @BINDING_CONTEXT_CMD:
271 * &struct iwl_binding_cmd or &struct iwl_binding_cmd_v1
272 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100273 BINDING_CONTEXT_CMD = 0x2b,
Johannes Berg15fc1962017-03-10 14:01:42 +0100274 /**
275 * @TIME_QUOTA_CMD: &struct iwl_time_quota_cmd
276 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100277 TIME_QUOTA_CMD = 0x2c,
Johannes Berg4ac6cb52013-08-08 09:30:13 +0200278 NON_QOS_TX_COUNTER_CMD = 0x2d,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100279
Johannes Berg15fc1962017-03-10 14:01:42 +0100280 /**
281 * @LQ_CMD: using &struct iwl_lq_cmd
282 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100283 LQ_CMD = 0x4e,
284
Johannes Berg15fc1962017-03-10 14:01:42 +0100285 /**
286 * @FW_PAGING_BLOCK_CMD:
287 * &struct iwl_fw_paging_cmd or &struct iwl_fw_paging_cmd_v1
288 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300289 FW_PAGING_BLOCK_CMD = 0x4f,
290
Johannes Berg8ca151b2013-01-24 14:25:36 +0100291 /* Scan offload */
292 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
293 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300294 HOT_SPOT_CMD = 0x53,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100295 SCAN_OFFLOAD_COMPLETE = 0x6D,
296 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
297 SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
David Spinadel35a000b2013-08-28 09:29:43 +0300298 MATCH_FOUND_NOTIFICATION = 0xd9,
David Spinadelfb98be52014-05-04 12:51:10 +0300299 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100300
301 /* Phy */
Johannes Berg15fc1962017-03-10 14:01:42 +0100302 /**
303 * @PHY_CONFIGURATION_CMD: &struct iwl_phy_cfg_cmd
304 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100305 PHY_CONFIGURATION_CMD = 0x6a,
306 CALIB_RES_NOTIF_PHY_DB = 0x6b,
Sara Sharon176aa602016-08-31 19:03:01 +0300307 PHY_DB_CMD = 0x6c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100308
Gregory Greenmance792912015-06-02 18:06:16 +0300309 /* ToF - 802.11mc FTM */
310 TOF_CMD = 0x10,
311 TOF_NOTIFICATION = 0x11,
312
Johannes Berg15fc1962017-03-10 14:01:42 +0100313 /**
314 * @POWER_TABLE_CMD: &struct iwl_device_power_cmd
315 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100316 POWER_TABLE_CMD = 0x77,
Alexander Bondar175a70b2013-04-14 20:59:37 +0300317 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300318 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100319
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300320 /* Thermal Throttling*/
321 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
322
Matti Gottlieb0becb372015-05-31 09:18:30 +0300323 /* Set/Get DC2DC frequency tune */
324 DC2DC_CONFIG_CMD = 0x83,
325
Johannes Berg15fc1962017-03-10 14:01:42 +0100326 /**
327 * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd
328 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100329 NVM_ACCESS_CMD = 0x88,
330
331 SET_CALIB_DEFAULT_CMD = 0x8e,
332
Ilan Peer571765c2013-03-05 15:26:03 +0200333 BEACON_NOTIFICATION = 0x90,
Johannes Bergb7bea642017-03-31 10:48:17 +0200334 /**
335 * @BEACON_TEMPLATE_CMD:
336 * Uses one of &struct iwl_mac_beacon_cmd_v6,
337 * &struct iwl_mac_beacon_cmd_v7 or &struct iwl_mac_beacon_cmd
338 * depending on the device version.
339 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100340 BEACON_TEMPLATE_CMD = 0x91,
Johannes Berg15fc1962017-03-10 14:01:42 +0100341 /**
342 * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
343 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100344 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg15fc1962017-03-10 14:01:42 +0100345
346 /**
347 * @STATISTICS_CMD: &struct iwl_statistics_cmd
348 */
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100349 STATISTICS_CMD = 0x9c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100350
351 /**
352 * @STATISTICS_NOTIFICATION:
353 * one of &struct iwl_notif_statistics_v10,
354 * &struct iwl_notif_statistics_v11,
355 * &struct iwl_notif_statistics_cdb
356 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100357 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg3e56ead2013-02-15 22:23:18 +0100358 EOSP_NOTIFICATION = 0x9e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100359
360 /**
361 * @REDUCE_TX_POWER_CMD:
362 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
363 */
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300364 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100365
366 /* RF-KILL commands and notifications */
367 CARD_STATE_CMD = 0xa0,
368 CARD_STATE_NOTIFICATION = 0xa1,
369
Hila Gonend64048e2013-03-13 18:00:03 +0200370 MISSED_BEACONS_NOTIFICATION = 0xa2,
371
Johannes Berg15fc1962017-03-10 14:01:42 +0100372 /**
373 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
374 */
Alexander Bondare811ada2013-03-10 15:29:44 +0200375 MAC_PM_POWER_TABLE = 0xa9,
376
Johannes Berg15fc1962017-03-10 14:01:42 +0100377 /**
378 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
379 */
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200380 MFUART_LOAD_NOTIFICATION = 0xb1,
381
Johannes Berg15fc1962017-03-10 14:01:42 +0100382 /**
383 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
384 */
Sara Sharon43413a92015-12-31 11:49:18 +0200385 RSS_CONFIG_CMD = 0xb3,
386
Johannes Berg6857df82017-03-15 14:06:53 +0100387 /**
388 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
389 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100390 REPLY_RX_PHY_CMD = 0xc0,
Johannes Berg6857df82017-03-15 14:06:53 +0100391
392 /**
393 * @REPLY_RX_MPDU_CMD:
394 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
395 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100396 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg13555e82015-09-02 16:16:49 +0200397 FRAME_RELEASE = 0xc3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100398 BA_NOTIF = 0xc5,
399
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200400 /* Location Aware Regulatory */
Johannes Berg15fc1962017-03-10 14:01:42 +0100401 /**
402 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
403 */
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200404 MCC_UPDATE_CMD = 0xc8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100405
406 /**
407 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
408 */
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200409 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200410
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300411 MARKER_CMD = 0xcb,
412
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200413 /* BT Coex */
414 BT_COEX_PRIO_TABLE = 0xcc,
415 BT_COEX_PROT_ENV = 0xcd,
Johannes Berg15fc1962017-03-10 14:01:42 +0100416 /**
417 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
418 */
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200419 BT_PROFILE_NOTIFICATION = 0xce,
Johannes Berg15fc1962017-03-10 14:01:42 +0100420 /**
421 * @BT_CONFIG: &struct iwl_bt_coex_cmd
422 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300423 BT_CONFIG = 0x9b,
424 BT_COEX_UPDATE_SW_BOOST = 0x5a,
425 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
426 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100427 /**
428 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
429 */
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300430 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200431
Johannes Berg15fc1962017-03-10 14:01:42 +0100432 /**
433 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
434 */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200435 REPLY_SF_CFG_CMD = 0xd1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100436 /**
437 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
438 */
Hila Gonen7df15b12012-12-12 11:16:19 +0200439 REPLY_BEACON_FILTERING_CMD = 0xd2,
440
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300441 /* DTS measurements */
442 CMD_DTS_MEASUREMENT_TRIGGER = 0xdc,
443 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
444
Johannes Berg8ca151b2013-01-24 14:25:36 +0100445 REPLY_DEBUG_CMD = 0xf0,
Golan Ben Ami321c2102015-07-27 17:02:35 +0300446 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100447 DEBUG_LOG_MSG = 0xf7,
448
Eliad Pellerc87163b2014-01-08 10:11:11 +0200449 BCAST_FILTER_CMD = 0xcf,
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300450 MCAST_FILTER_CMD = 0xd0,
451
Johannes Berg15fc1962017-03-10 14:01:42 +0100452 /**
453 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
454 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100455 D3_CONFIG_CMD = 0xd3,
456 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
457 OFFLOADS_QUERY_CMD = 0xd5,
458 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300459 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100460
Johannes Berg15fc1962017-03-10 14:01:42 +0100461 /**
462 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
463 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100464 WOWLAN_PATTERNS = 0xe0,
Johannes Berg15fc1962017-03-10 14:01:42 +0100465
466 /**
467 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
468 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100469 WOWLAN_CONFIGURATION = 0xe1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100470 /**
471 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
472 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100473 WOWLAN_TSC_RSC_PARAM = 0xe2,
Johannes Berg15fc1962017-03-10 14:01:42 +0100474 /**
475 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
476 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100477 WOWLAN_TKIP_PARAM = 0xe3,
Johannes Berg15fc1962017-03-10 14:01:42 +0100478 /**
479 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
480 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100481 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
Johannes Berg15fc1962017-03-10 14:01:42 +0100482 /**
483 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
484 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100485 WOWLAN_GET_STATUSES = 0xe5,
486 WOWLAN_TX_POWER_PER_DB = 0xe6,
487
488 /* and for NetDetect */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200489 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
490 SCAN_OFFLOAD_HOTSPOTS_CONFIG_CMD = 0x58,
491 SCAN_OFFLOAD_HOTSPOTS_QUERY_CMD = 0x59,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100492};
493
Sharon Dvir39bdb172015-10-15 18:18:09 +0300494/* Please keep this enum *SORTED* by hex value.
495 * Needed for binary search, otherwise a warning will be triggered.
496 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200497enum iwl_mac_conf_subcmd_ids {
498 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
499 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200500 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200501};
502
Johannes Berg15fc1962017-03-10 14:01:42 +0100503/**
504 * enum iwl_phy_ops_subcmd_ids - PHY group commands
505 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300506enum iwl_phy_ops_subcmd_ids {
507 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200508 CTDP_CONFIG_CMD = 0x03,
Johannes Berg15fc1962017-03-10 14:01:42 +0100509
510 /**
511 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
512 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200513 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200514 GEO_TX_POWER_LIMIT = 0x05,
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200515 CT_KILL_NOTIFICATION = 0xFE,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300516 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
517};
518
Johannes Berg15fc1962017-03-10 14:01:42 +0100519/**
520 * enum iwl_system_subcmd_ids - system group command IDs
521 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200522enum iwl_system_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100523 /**
524 * @SHARED_MEM_CFG_CMD:
525 * response in &struct iwl_shared_mem_cfg or
526 * &struct iwl_shared_mem_cfg_v1
527 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200528 SHARED_MEM_CFG_CMD = 0x0,
Sara Sharon4399caa2016-12-11 10:32:42 +0200529 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200530};
531
Johannes Berg15fc1962017-03-10 14:01:42 +0100532/**
533 * enum iwl_data_path_subcmd_ids - data path group commands
534 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200535enum iwl_data_path_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100536 /**
537 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
538 */
Liad Kaufman97d5be72015-08-31 14:33:23 +0300539 DQA_ENABLE_CMD = 0x0,
Sara Sharona07a8f32015-11-15 11:11:59 +0200540 UPDATE_MU_GROUPS_CMD = 0x1,
Sara Sharon94bb4482015-12-16 18:48:28 +0200541 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg65e25482016-04-13 14:24:22 +0200542 STA_PM_NOTIF = 0xFD,
Sara Sharonf92659a2016-02-03 15:04:49 +0200543 MU_GROUP_MGMT_NOTIF = 0xFE,
Sara Sharon94bb4482015-12-16 18:48:28 +0200544 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200545};
546
Sara Sharon0db056d2015-12-29 11:07:15 +0200547enum iwl_prot_offload_subcmd_ids {
548 STORED_BEACON_NTF = 0xFF,
549};
550
Sara Sharon1f370652016-08-31 18:13:57 +0300551enum iwl_regulatory_and_nvm_subcmd_ids {
552 NVM_ACCESS_COMPLETE = 0x0,
Sara Sharone9e1ba32017-01-08 16:46:14 +0200553 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300554};
555
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200556enum iwl_debug_cmds {
Ido Yariv2b55f432016-08-23 14:44:59 -0400557 LMAC_RD_WR = 0x0,
558 UMAC_RD_WR = 0x1,
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200559 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400560};
561
Johannes Berg72361c32017-03-09 17:06:45 +0100562/**
563 * enum iwl_mvm_command_groups - command groups for the firmware
564 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
565 * @LONG_GROUP: legacy group with long header, also uses command IDs
566 * from &enum iwl_legacy_cmds
567 * @SYSTEM_GROUP: system group, uses command IDs from
568 * &enum iwl_system_subcmd_ids
569 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
570 * &enum iwl_mac_conf_subcmd_ids
571 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
572 * &enum iwl_phy_ops_subcmd_ids
573 * @DATA_PATH_GROUP: data path group, uses command IDs from
574 * &enum iwl_data_path_subcmd_ids
Johannes Berg72361c32017-03-09 17:06:45 +0100575 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
576 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
577 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
578 * &enum iwl_prot_offload_subcmd_ids
579 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
580 * &enum iwl_regulatory_and_nvm_subcmd_ids
581 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
582 */
583enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300584 LEGACY_GROUP = 0x0,
585 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200586 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200587 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300588 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200589 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200590 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300591 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400592 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300593};
594
Johannes Berg8ca151b2013-01-24 14:25:36 +0100595/**
596 * struct iwl_cmd_response - generic response struct for most commands
597 * @status: status of the command asked, changes for each one
598 */
599struct iwl_cmd_response {
600 __le32 status;
601};
602
603/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300604 * struct iwl_dqa_enable_cmd
605 * @cmd_queue: the TXQ number of the command queue
606 */
607struct iwl_dqa_enable_cmd {
608 __le32 cmd_queue;
609} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
610
611/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100612 * struct iwl_tx_ant_cfg_cmd
613 * @valid: valid antenna configuration
614 */
615struct iwl_tx_ant_cfg_cmd {
616 __le32 valid;
617} __packed;
618
Johannes Berg31a658b2017-03-09 15:56:57 +0100619/**
620 * struct iwl_calib_ctrl - Calibration control struct.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100621 * Sent as part of the phy configuration command.
622 * @flow_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100623 * flow triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100624 * @event_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100625 * event triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100626 */
627struct iwl_calib_ctrl {
628 __le32 flow_trigger;
629 __le32 event_trigger;
630} __packed;
631
632/* This enum defines the bitmap of various calibrations to enable in both
633 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
634 */
635enum iwl_calib_cfg {
636 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
637 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
638 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
639 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
640 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
641 IWL_CALIB_CFG_DC_IDX = BIT(5),
642 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
643 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
644 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
645 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
646 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
647 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
648 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
649 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
650 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
651 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
652 IWL_CALIB_CFG_DAC_IDX = BIT(16),
653 IWL_CALIB_CFG_ABS_IDX = BIT(17),
654 IWL_CALIB_CFG_AGC_IDX = BIT(18),
655};
656
Johannes Berg31a658b2017-03-09 15:56:57 +0100657/**
658 * struct iwl_phy_cfg_cmd - Phy configuration command
659 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
660 * @calib_control: calibration control data
Johannes Berg8ca151b2013-01-24 14:25:36 +0100661 */
662struct iwl_phy_cfg_cmd {
663 __le32 phy_cfg;
664 struct iwl_calib_ctrl calib_control;
665} __packed;
666
667#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
668#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
669#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
670#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
671#define PHY_CFG_TX_CHAIN_A BIT(8)
672#define PHY_CFG_TX_CHAIN_B BIT(9)
673#define PHY_CFG_TX_CHAIN_C BIT(10)
674#define PHY_CFG_RX_CHAIN_A BIT(12)
675#define PHY_CFG_RX_CHAIN_B BIT(13)
676#define PHY_CFG_RX_CHAIN_C BIT(14)
677
678
Johannes Bergd69f0a22017-03-14 10:58:16 +0100679/**
680 * enum iwl_nvm_access_op - NVM access opcode
681 * @IWL_NVM_READ: read NVM
682 * @IWL_NVM_WRITE: write NVM
683 */
684enum iwl_nvm_access_op {
685 IWL_NVM_READ = 0,
686 IWL_NVM_WRITE = 1,
687};
688
689/**
690 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
691 * @NVM_ACCESS_TARGET_CACHE: access the cache
692 * @NVM_ACCESS_TARGET_OTP: access the OTP
693 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
694 */
695enum iwl_nvm_access_target {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100696 NVM_ACCESS_TARGET_CACHE = 0,
697 NVM_ACCESS_TARGET_OTP = 1,
698 NVM_ACCESS_TARGET_EEPROM = 2,
699};
700
Johannes Bergd69f0a22017-03-14 10:58:16 +0100701/**
702 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
703 * @NVM_SECTION_TYPE_SW: software section
704 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
705 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
706 * @NVM_SECTION_TYPE_PRODUCTION: production section
707 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
708 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
709 * @NVM_MAX_NUM_SECTIONS: number of sections
710 */
711enum iwl_nvm_section_type {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200712 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200713 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200714 NVM_SECTION_TYPE_CALIBRATION = 4,
715 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200716 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200717 NVM_SECTION_TYPE_PHY_SKU = 12,
718 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100719};
720
721/**
Johannes Berg67625862017-03-14 11:01:27 +0100722 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
723 * @op_code: &enum iwl_nvm_access_op
724 * @target: &enum iwl_nvm_access_target
725 * @type: &enum iwl_nvm_section_type
Johannes Berg8ca151b2013-01-24 14:25:36 +0100726 * @offset: offset in bytes into the section
727 * @length: in bytes, to read/write
728 * @data: if write operation, the data to write. On read its empty
729 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200730struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100731 u8 op_code;
732 u8 target;
733 __le16 type;
734 __le16 offset;
735 __le16 length;
736 u8 data[];
737} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
738
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300739#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
740
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100741/**
742 * struct iwl_fw_paging_cmd_v1 - paging layout
743 *
744 * (FW_PAGING_BLOCK_CMD = 0x4f)
745 *
746 * Send to FW the paging layout in the driver.
747 *
748 * @flags: various flags for the command
749 * @block_size: the block size in powers of 2
750 * @block_num: number of blocks specified in the command.
751 * @device_phy_addr: virtual addresses from device side
752 */
753struct iwl_fw_paging_cmd_v1 {
754 __le32 flags;
755 __le32 block_size;
756 __le32 block_num;
757 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
758} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
759
760/**
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300761 * struct iwl_fw_paging_cmd - paging layout
762 *
763 * (FW_PAGING_BLOCK_CMD = 0x4f)
764 *
765 * Send to FW the paging layout in the driver.
766 *
767 * @flags: various flags for the command
768 * @block_size: the block size in powers of 2
769 * @block_num: number of blocks specified in the command.
770 * @device_phy_addr: virtual addresses from device side
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100771 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300772struct iwl_fw_paging_cmd {
773 __le32 flags;
774 __le32 block_size;
775 __le32 block_num;
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100776 __le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
Sara Sharond975d722016-07-04 11:52:07 +0300777} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300778
Matti Gottliebe1120182015-07-19 11:15:07 +0300779/*
780 * Fw items ID's
781 *
782 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
783 * download
784 */
785enum iwl_fw_item_id {
786 IWL_FW_ITEM_ID_PAGING = 3,
787};
788
789/*
790 * struct iwl_fw_get_item_cmd - get an item from the fw
791 */
792struct iwl_fw_get_item_cmd {
793 __le32 item_id;
794} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
795
Golan Ben Ami321c2102015-07-27 17:02:35 +0300796#define CONT_REC_COMMAND_SIZE 80
797#define ENABLE_CONT_RECORDING 0x15
798#define DISABLE_CONT_RECORDING 0x16
799
800/*
801 * struct iwl_continuous_record_mode - recording mode
802 */
803struct iwl_continuous_record_mode {
804 __le16 enable_recording;
805} __packed;
806
807/*
808 * struct iwl_continuous_record_cmd - enable/disable continuous recording
809 */
810struct iwl_continuous_record_cmd {
811 struct iwl_continuous_record_mode record_mode;
812 u8 pad[CONT_REC_COMMAND_SIZE -
813 sizeof(struct iwl_continuous_record_mode)];
814} __packed;
815
Matti Gottliebe1120182015-07-19 11:15:07 +0300816struct iwl_fw_get_item_resp {
817 __le32 item_id;
818 __le32 item_byte_cnt;
819 __le32 item_val;
820} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
821
Johannes Berg8ca151b2013-01-24 14:25:36 +0100822/**
823 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
824 * @offset: offset in bytes into the section
825 * @length: in bytes, either how much was written or read
826 * @type: NVM_SECTION_TYPE_*
827 * @status: 0 for success, fail otherwise
828 * @data: if read operation, the data returned. Empty on write.
829 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200830struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100831 __le16 offset;
832 __le16 length;
833 __le16 type;
834 __le16 status;
835 u8 data[];
836} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
837
838/* MVM_ALIVE 0x1 */
839
840/* alive response is_valid values */
841#define ALIVE_RESP_UCODE_OK BIT(0)
842#define ALIVE_RESP_RFKILL BIT(1)
843
844/* alive response ver_type values */
845enum {
846 FW_TYPE_HW = 0,
847 FW_TYPE_PROT = 1,
848 FW_TYPE_AP = 2,
849 FW_TYPE_WOWLAN = 3,
850 FW_TYPE_TIMING = 4,
851 FW_TYPE_WIPAN = 5
852};
853
854/* alive response ver_subtype values */
855enum {
856 FW_SUBTYPE_FULL_FEATURE = 0,
857 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
858 FW_SUBTYPE_REDUCED = 2,
859 FW_SUBTYPE_ALIVE_ONLY = 3,
860 FW_SUBTYPE_WOWLAN = 4,
861 FW_SUBTYPE_AP_SUBTYPE = 5,
862 FW_SUBTYPE_WIPAN = 6,
863 FW_SUBTYPE_INITIALIZE = 9
864};
865
866#define IWL_ALIVE_STATUS_ERR 0xDEAD
867#define IWL_ALIVE_STATUS_OK 0xCAFE
868
869#define IWL_ALIVE_FLG_RFKILL BIT(0)
870
Sara Sharon5c228d62016-11-24 13:48:27 +0200871struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200872 __le32 ucode_minor;
873 __le32 ucode_major;
874 u8 ver_subtype;
875 u8 ver_type;
876 u8 mac;
877 u8 opt;
878 __le32 timestamp;
879 __le32 error_event_table_ptr; /* SRAM address for error log */
880 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
881 __le32 cpu_register_ptr;
882 __le32 dbgm_config_ptr;
883 __le32 alive_counter_ptr;
884 __le32 scd_base_ptr; /* SRAM address for SCD */
885 __le32 st_fwrd_addr; /* pointer to Store and forward */
886 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +0200887} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
888
889struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200890 __le32 umac_minor; /* UMAC version: minor */
891 __le32 umac_major; /* UMAC version: major */
892 __le32 error_info_addr; /* SRAM address for UMAC error log */
893 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +0200894} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
895
896struct mvm_alive_resp_v3 {
897 __le16 status;
898 __le16 flags;
899 struct iwl_lmac_alive lmac_data;
900 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200901} __packed; /* ALIVE_RES_API_S_VER_3 */
902
Sara Sharon5c228d62016-11-24 13:48:27 +0200903struct mvm_alive_resp {
904 __le16 status;
905 __le16 flags;
906 struct iwl_lmac_alive lmac_data[2];
907 struct iwl_umac_alive umac_data;
908} __packed; /* ALIVE_RES_API_S_VER_4 */
909
Johannes Berg8ca151b2013-01-24 14:25:36 +0100910/* Error response/notification */
911enum {
912 FW_ERR_UNKNOWN_CMD = 0x0,
913 FW_ERR_INVALID_CMD_PARAM = 0x1,
914 FW_ERR_SERVICE = 0x2,
915 FW_ERR_ARC_MEMORY = 0x3,
916 FW_ERR_ARC_CODE = 0x4,
917 FW_ERR_WATCH_DOG = 0x5,
918 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
919 FW_ERR_WEP_KEY_SIZE = 0x11,
920 FW_ERR_OBSOLETE_FUNC = 0x12,
921 FW_ERR_UNEXPECTED = 0xFE,
922 FW_ERR_FATAL = 0xFF
923};
924
925/**
926 * struct iwl_error_resp - FW error indication
927 * ( REPLY_ERROR = 0x2 )
928 * @error_type: one of FW_ERR_*
929 * @cmd_id: the command ID for which the error occured
930 * @bad_cmd_seq_num: sequence number of the erroneous command
931 * @error_service: which service created the error, applicable only if
932 * error_type = 2, otherwise 0
933 * @timestamp: TSF in usecs.
934 */
935struct iwl_error_resp {
936 __le32 error_type;
937 u8 cmd_id;
938 u8 reserved1;
939 __le16 bad_cmd_seq_num;
940 __le32 error_service;
941 __le64 timestamp;
942} __packed;
943
944
945/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100946#define MAX_MACS_IN_BINDING (3)
947#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +0100948
Johannes Bergd69f0a22017-03-14 10:58:16 +0100949/**
950 * enum iwl_mvm_id_and_color - ID and color fields in context dword
951 * @FW_CTXT_ID_POS: position of the ID
952 * @FW_CTXT_ID_MSK: mask of the ID
953 * @FW_CTXT_COLOR_POS: position of the color
954 * @FW_CTXT_COLOR_MSK: mask of the color
955 * @FW_CTXT_INVALID: value used to indicate unused/invalid
956 */
957enum iwl_mvm_id_and_color {
958 FW_CTXT_ID_POS = 0,
959 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
960 FW_CTXT_COLOR_POS = 8,
961 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
962 FW_CTXT_INVALID = 0xffffffff,
963};
Johannes Berg8ca151b2013-01-24 14:25:36 +0100964
965#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
966 (_color << FW_CTXT_COLOR_POS))
967
968/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +0200969enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100970 FW_CTXT_ACTION_STUB = 0,
971 FW_CTXT_ACTION_ADD,
972 FW_CTXT_ACTION_MODIFY,
973 FW_CTXT_ACTION_REMOVE,
974 FW_CTXT_ACTION_NUM
975}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
976
977/* Time Events */
978
979/* Time Event types, according to MAC type */
980enum iwl_time_event_type {
981 /* BSS Station Events */
982 TE_BSS_STA_AGGRESSIVE_ASSOC,
983 TE_BSS_STA_ASSOC,
984 TE_BSS_EAP_DHCP_PROT,
985 TE_BSS_QUIET_PERIOD,
986
987 /* P2P Device Events */
988 TE_P2P_DEVICE_DISCOVERABLE,
989 TE_P2P_DEVICE_LISTEN,
990 TE_P2P_DEVICE_ACTION_SCAN,
991 TE_P2P_DEVICE_FULL_SCAN,
992
993 /* P2P Client Events */
994 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
995 TE_P2P_CLIENT_ASSOC,
996 TE_P2P_CLIENT_QUIET_PERIOD,
997
998 /* P2P GO Events */
999 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02001000 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +01001001 TE_P2P_GO_CT_WINDOW,
1002
1003 /* WiDi Sync Events */
1004 TE_WIDI_TX_SYNC,
1005
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001006 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +03001007 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001008
Johannes Berg8ca151b2013-01-24 14:25:36 +01001009 TE_MAX
1010}; /* MAC_EVENT_TYPE_API_E_VER_1 */
1011
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001012
1013
1014/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001015
1016/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001017 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1018 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1019 * the first fragment is scheduled.
1020 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1021 * the first 2 fragments are scheduled.
1022 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1023 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001024 *
1025 * Other than the constant defined above, specifying a fragmentation value 'x'
1026 * means that the event can be fragmented but only the first 'x' will be
1027 * scheduled.
1028 */
1029enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001030 TE_V1_FRAG_NONE = 0,
1031 TE_V1_FRAG_SINGLE = 1,
1032 TE_V1_FRAG_DUAL = 2,
1033 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +01001034};
1035
Johannes Berg8ca151b2013-01-24 14:25:36 +01001036/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001037#define TE_V1_FRAG_MAX_MSK 0x0fffffff
1038/* Repeat the time event endlessly (until removed) */
1039#define TE_V1_REPEAT_ENDLESS 0xffffffff
1040/* If a Time Event has bounded repetitions, this is the maximal value */
1041#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1042
1043/* Time Event dependencies: none, on another TE, or in a specific time */
1044enum {
1045 TE_V1_INDEPENDENT = 0,
1046 TE_V1_DEP_OTHER = BIT(0),
1047 TE_V1_DEP_TSF = BIT(1),
1048 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1049}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1050
1051/*
1052 * @TE_V1_NOTIF_NONE: no notifications
1053 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1054 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1055 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1056 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1057 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1058 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1059 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1060 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1061 *
1062 * Supported Time event notifications configuration.
1063 * A notification (both event and fragment) includes a status indicating weather
1064 * the FW was able to schedule the event or not. For fragment start/end
1065 * notification the status is always success. There is no start/end fragment
1066 * notification for monolithic events.
1067 */
1068enum {
1069 TE_V1_NOTIF_NONE = 0,
1070 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1071 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1072 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1073 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1074 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1075 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1076 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1077 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1078}; /* MAC_EVENT_ACTION_API_E_VER_2 */
1079
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001080/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001081
1082/*
1083 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1084 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1085 * the first fragment is scheduled.
1086 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1087 * the first 2 fragments are scheduled.
1088 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1089 * number of fragments are valid.
1090 *
1091 * Other than the constant defined above, specifying a fragmentation value 'x'
1092 * means that the event can be fragmented but only the first 'x' will be
1093 * scheduled.
1094 */
1095enum {
1096 TE_V2_FRAG_NONE = 0,
1097 TE_V2_FRAG_SINGLE = 1,
1098 TE_V2_FRAG_DUAL = 2,
1099 TE_V2_FRAG_MAX = 0xfe,
1100 TE_V2_FRAG_ENDLESS = 0xff
1101};
1102
1103/* Repeat the time event endlessly (until removed) */
1104#define TE_V2_REPEAT_ENDLESS 0xff
1105/* If a Time Event has bounded repetitions, this is the maximal value */
1106#define TE_V2_REPEAT_MAX 0xfe
1107
1108#define TE_V2_PLACEMENT_POS 12
1109#define TE_V2_ABSENCE_POS 15
1110
Johannes Bergd69f0a22017-03-14 10:58:16 +01001111/**
1112 * enum iwl_time_event_policy - Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001113 * A notification (both event and fragment) includes a status indicating weather
1114 * the FW was able to schedule the event or not. For fragment start/end
1115 * notification the status is always success. There is no start/end fragment
1116 * notification for monolithic events.
1117 *
1118 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1119 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1120 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1121 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1122 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1123 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1124 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1125 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1126 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
Johannes Bergd69f0a22017-03-14 10:58:16 +01001127 * @T2_V2_START_IMMEDIATELY: start time event immediately
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001128 * @TE_V2_DEP_OTHER: depends on another time event
1129 * @TE_V2_DEP_TSF: depends on a specific time
1130 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1131 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1132 */
Johannes Bergd69f0a22017-03-14 10:58:16 +01001133enum iwl_time_event_policy {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001134 TE_V2_DEFAULT_POLICY = 0x0,
1135
1136 /* notifications (event start/stop, fragment start/stop) */
1137 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1138 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1139 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1140 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1141
1142 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1143 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1144 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1145 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +02001146 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001147
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001148 /* placement characteristics */
1149 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1150 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1151 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1152
1153 /* are we present or absent during the Time Event. */
1154 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1155};
1156
1157/**
Johannes Berg67625862017-03-14 11:01:27 +01001158 * struct iwl_time_event_cmd - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001159 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1160 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1161 * ( TIME_EVENT_CMD = 0x29 )
Johannes Berg67625862017-03-14 11:01:27 +01001162 * @id_and_color: ID and color of the relevant MAC,
1163 * &enum iwl_mvm_id_and_color
1164 * @action: action to perform, one of &enum iwl_phy_ctxt_action
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001165 * @id: this field has two meanings, depending on the action:
1166 * If the action is ADD, then it means the type of event to add.
1167 * For all other actions it is the unique event ID assigned when the
1168 * event was added by the FW.
1169 * @apply_time: When to start the Time Event (in GP2)
1170 * @max_delay: maximum delay to event's start (apply time), in TU
1171 * @depends_on: the unique ID of the event we depend on (if any)
1172 * @interval: interval between repetitions, in TU
1173 * @duration: duration of event in TU
1174 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1175 * @max_frags: maximal number of fragments the Time Event can be divided to
1176 * @policy: defines whether uCode shall notify the host or other uCode modules
1177 * on event and/or fragment start and/or end
1178 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1179 * TE_EVENT_SOCIOPATHIC
Johannes Berg67625862017-03-14 11:01:27 +01001180 * using TE_ABSENCE and using TE_NOTIF_*,
1181 * &enum iwl_time_event_policy
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001182 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001183struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001184 /* COMMON_INDEX_HDR_API_S_VER_1 */
1185 __le32 id_and_color;
1186 __le32 action;
1187 __le32 id;
1188 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1189 __le32 apply_time;
1190 __le32 max_delay;
1191 __le32 depends_on;
1192 __le32 interval;
1193 __le32 duration;
1194 u8 repeat;
1195 u8 max_frags;
1196 __le16 policy;
1197} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1198
Johannes Berg8ca151b2013-01-24 14:25:36 +01001199/**
1200 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1201 * @status: bit 0 indicates success, all others specify errors
1202 * @id: the Time Event type
1203 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
Johannes Berg67625862017-03-14 11:01:27 +01001204 * @id_and_color: ID and color of the relevant MAC,
1205 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001206 */
1207struct iwl_time_event_resp {
1208 __le32 status;
1209 __le32 id;
1210 __le32 unique_id;
1211 __le32 id_and_color;
1212} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1213
1214/**
1215 * struct iwl_time_event_notif - notifications of time event start/stop
1216 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1217 * @timestamp: action timestamp in GP2
1218 * @session_id: session's unique id
1219 * @unique_id: unique id of the Time Event itself
1220 * @id_and_color: ID and color of the relevant MAC
Johannes Berg67625862017-03-14 11:01:27 +01001221 * @action: &enum iwl_time_event_policy
Johannes Berg8ca151b2013-01-24 14:25:36 +01001222 * @status: true if scheduled, false otherwise (not executed)
1223 */
1224struct iwl_time_event_notif {
1225 __le32 timestamp;
1226 __le32 session_id;
1227 __le32 unique_id;
1228 __le32 id_and_color;
1229 __le32 action;
1230 __le32 status;
1231} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1232
1233
1234/* Bindings and Time Quota */
1235
1236/**
Johannes Berg4d151c22017-03-14 11:04:06 +01001237 * struct iwl_binding_cmd_v1 - configuring bindings
1238 * ( BINDING_CONTEXT_CMD = 0x2b )
1239 * @id_and_color: ID and color of the relevant Binding,
1240 * &enum iwl_mvm_id_and_color
1241 * @action: action to perform, one of FW_CTXT_ACTION_*
1242 * @macs: array of MAC id and colors which belong to the binding,
1243 * &enum iwl_mvm_id_and_color
1244 * @phy: PHY id and color which belongs to the binding,
1245 * &enum iwl_mvm_id_and_color
1246 */
1247struct iwl_binding_cmd_v1 {
1248 /* COMMON_INDEX_HDR_API_S_VER_1 */
1249 __le32 id_and_color;
1250 __le32 action;
1251 /* BINDING_DATA_API_S_VER_1 */
1252 __le32 macs[MAX_MACS_IN_BINDING];
1253 __le32 phy;
1254} __packed; /* BINDING_CMD_API_S_VER_1 */
1255
1256/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001257 * struct iwl_binding_cmd - configuring bindings
1258 * ( BINDING_CONTEXT_CMD = 0x2b )
Johannes Berg67625862017-03-14 11:01:27 +01001259 * @id_and_color: ID and color of the relevant Binding,
1260 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001261 * @action: action to perform, one of FW_CTXT_ACTION_*
1262 * @macs: array of MAC id and colors which belong to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001263 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001264 * @phy: PHY id and color which belongs to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001265 * &enum iwl_mvm_id_and_color
Sara Sharon9415af72016-11-17 13:57:32 +02001266 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001267 */
1268struct iwl_binding_cmd {
1269 /* COMMON_INDEX_HDR_API_S_VER_1 */
1270 __le32 id_and_color;
1271 __le32 action;
1272 /* BINDING_DATA_API_S_VER_1 */
1273 __le32 macs[MAX_MACS_IN_BINDING];
1274 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001275 __le32 lmac_id;
1276} __packed; /* BINDING_CMD_API_S_VER_2 */
1277
Johannes Berg4d151c22017-03-14 11:04:06 +01001278#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
Sara Sharon9415af72016-11-17 13:57:32 +02001279#define IWL_LMAC_24G_INDEX 0
1280#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001281
Ilan Peer35adfd62013-02-04 13:16:24 +02001282/* The maximal number of fragments in the FW's schedule session */
1283#define IWL_MVM_MAX_QUOTA 128
1284
Johannes Berg8ca151b2013-01-24 14:25:36 +01001285/**
1286 * struct iwl_time_quota_data - configuration of time quota per binding
Johannes Berg67625862017-03-14 11:01:27 +01001287 * @id_and_color: ID and color of the relevant Binding,
1288 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001289 * @quota: absolute time quota in TU. The scheduler will try to divide the
1290 * remainig quota (after Time Events) according to this quota.
1291 * @max_duration: max uninterrupted context duration in TU
1292 */
1293struct iwl_time_quota_data {
1294 __le32 id_and_color;
1295 __le32 quota;
1296 __le32 max_duration;
1297} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1298
1299/**
1300 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1301 * ( TIME_QUOTA_CMD = 0x2c )
1302 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001303 * Note: on non-CDB the fourth one is the auxilary mac and is
1304 * essentially zero.
1305 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001306 */
1307struct iwl_time_quota_cmd {
1308 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1309} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1310
1311
1312/* PHY context */
1313
1314/* Supported bands */
1315#define PHY_BAND_5 (0)
1316#define PHY_BAND_24 (1)
1317
1318/* Supported channel width, vary if there is VHT support */
1319#define PHY_VHT_CHANNEL_MODE20 (0x0)
1320#define PHY_VHT_CHANNEL_MODE40 (0x1)
1321#define PHY_VHT_CHANNEL_MODE80 (0x2)
1322#define PHY_VHT_CHANNEL_MODE160 (0x3)
1323
1324/*
1325 * Control channel position:
1326 * For legacy set bit means upper channel, otherwise lower.
1327 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1328 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1329 * center_freq
1330 * |
1331 * 40Mhz |_______|_______|
1332 * 80Mhz |_______|_______|_______|_______|
1333 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1334 * code 011 010 001 000 | 100 101 110 111
1335 */
1336#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1337#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1338#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1339#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1340#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1341#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1342#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1343#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1344
1345/*
1346 * @band: PHY_BAND_*
1347 * @channel: channel number
1348 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1349 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1350 */
1351struct iwl_fw_channel_info {
1352 u8 band;
1353 u8 channel;
1354 u8 width;
1355 u8 ctrl_pos;
1356} __packed;
1357
1358#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1359#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1360 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1361#define PHY_RX_CHAIN_VALID_POS (1)
1362#define PHY_RX_CHAIN_VALID_MSK \
1363 (0x7 << PHY_RX_CHAIN_VALID_POS)
1364#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1365#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1366 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1367#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1368#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1369 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1370#define PHY_RX_CHAIN_CNT_POS (10)
1371#define PHY_RX_CHAIN_CNT_MSK \
1372 (0x3 << PHY_RX_CHAIN_CNT_POS)
1373#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1374#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1375 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1376#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1377#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1378 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1379
1380/* TODO: fix the value, make it depend on firmware at runtime? */
1381#define NUM_PHY_CTX 3
1382
1383/* TODO: complete missing documentation */
1384/**
1385 * struct iwl_phy_context_cmd - config of the PHY context
1386 * ( PHY_CONTEXT_CMD = 0x8 )
1387 * @id_and_color: ID and color of the relevant Binding
1388 * @action: action to perform, one of FW_CTXT_ACTION_*
1389 * @apply_time: 0 means immediate apply and context switch.
1390 * other value means apply new params after X usecs
1391 * @tx_param_color: ???
1392 * @channel_info:
1393 * @txchain_info: ???
1394 * @rxchain_info: ???
1395 * @acquisition_data: ???
1396 * @dsp_cfg_flags: set to 0
1397 */
1398struct iwl_phy_context_cmd {
1399 /* COMMON_INDEX_HDR_API_S_VER_1 */
1400 __le32 id_and_color;
1401 __le32 action;
1402 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1403 __le32 apply_time;
1404 __le32 tx_param_color;
1405 struct iwl_fw_channel_info ci;
1406 __le32 txchain_info;
1407 __le32 rxchain_info;
1408 __le32 acquisition_data;
1409 __le32 dsp_cfg_flags;
1410} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1411
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001412/*
1413 * Aux ROC command
1414 *
1415 * Command requests the firmware to create a time event for a certain duration
1416 * and remain on the given channel. This is done by using the Aux framework in
1417 * the FW.
1418 * The command was first used for Hot Spot issues - but can be used regardless
1419 * to Hot Spot.
1420 *
1421 * ( HOT_SPOT_CMD 0x53 )
1422 *
1423 * @id_and_color: ID and color of the MAC
1424 * @action: action to perform, one of FW_CTXT_ACTION_*
1425 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1426 * event_unique_id should be the id of the time event assigned by ucode.
1427 * Otherwise ignore the event_unique_id.
1428 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1429 * activity.
1430 * @channel_info: channel info
1431 * @node_addr: Our MAC Address
1432 * @reserved: reserved for alignment
1433 * @apply_time: GP2 value to start (should always be the current GP2 value)
1434 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1435 * time by which start of the event is allowed to be postponed.
1436 * @duration: event duration in TU To calculate event duration:
1437 * timeEventDuration = min(duration, remainingQuota)
1438 */
1439struct iwl_hs20_roc_req {
1440 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1441 __le32 id_and_color;
1442 __le32 action;
1443 __le32 event_unique_id;
1444 __le32 sta_id_and_color;
1445 struct iwl_fw_channel_info channel_info;
1446 u8 node_addr[ETH_ALEN];
1447 __le16 reserved;
1448 __le32 apply_time;
1449 __le32 apply_time_max_delay;
1450 __le32 duration;
1451} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1452
1453/*
1454 * values for AUX ROC result values
1455 */
1456enum iwl_mvm_hot_spot {
1457 HOT_SPOT_RSP_STATUS_OK,
1458 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1459 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1460};
1461
1462/*
1463 * Aux ROC command response
1464 *
1465 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1466 * driver the uid of the timevent.
1467 *
1468 * ( HOT_SPOT_CMD 0x53 )
1469 *
1470 * @event_unique_id: Unique ID of time event assigned by ucode
1471 * @status: Return status 0 is success, all the rest used for specific errors
1472 */
1473struct iwl_hs20_roc_res {
1474 __le32 event_unique_id;
1475 __le32 status;
1476} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1477
Johannes Berg8ca151b2013-01-24 14:25:36 +01001478/**
1479 * struct iwl_radio_version_notif - information on the radio version
1480 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
1481 * @radio_flavor:
1482 * @radio_step:
1483 * @radio_dash:
1484 */
1485struct iwl_radio_version_notif {
1486 __le32 radio_flavor;
1487 __le32 radio_step;
1488 __le32 radio_dash;
1489} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1490
1491enum iwl_card_state_flags {
1492 CARD_ENABLED = 0x00,
1493 HW_CARD_DISABLED = 0x01,
1494 SW_CARD_DISABLED = 0x02,
1495 CT_KILL_CARD_DISABLED = 0x04,
1496 HALT_CARD_DISABLED = 0x08,
1497 CARD_DISABLED_MSK = 0x0f,
1498 CARD_IS_RX_ON = 0x10,
1499};
1500
1501/**
1502 * struct iwl_radio_version_notif - information on the radio version
1503 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1504 * @flags: %iwl_card_state_flags
1505 */
1506struct iwl_card_state_notif {
1507 __le32 flags;
1508} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1509
1510/**
Hila Gonend64048e2013-03-13 18:00:03 +02001511 * struct iwl_missed_beacons_notif - information on missed beacons
1512 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1513 * @mac_id: interface ID
1514 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1515 * beacons since last RX.
1516 * @consec_missed_beacons: number of consecutive missed beacons
1517 * @num_expected_beacons:
1518 * @num_recvd_beacons:
1519 */
1520struct iwl_missed_beacons_notif {
1521 __le32 mac_id;
1522 __le32 consec_missed_beacons_since_last_rx;
1523 __le32 consec_missed_beacons;
1524 __le32 num_expected_beacons;
1525 __le32 num_recvd_beacons;
1526} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1527
1528/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001529 * struct iwl_mfuart_load_notif - mfuart image version & status
1530 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1531 * @installed_ver: installed image version
1532 * @external_ver: external image version
1533 * @status: MFUART loading status
1534 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001535 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001536*/
1537struct iwl_mfuart_load_notif {
1538 __le32 installed_ver;
1539 __le32 external_ver;
1540 __le32 status;
1541 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001542 /* image size valid only in v2 of the command */
1543 __le32 image_size;
1544} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001545
1546/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001547 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1548 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1549 * @assert_id: mfuart assert id that cause the notif
1550 * @curr_reset_num: number of asserts since uptime
1551 * @index_num: current chunk id
1552 * @parts_num: total number of chunks
1553 * @data_size: number of data bytes sent
1554 * @data: data buffer
1555 */
1556struct iwl_mfu_assert_dump_notif {
1557 __le32 assert_id;
1558 __le32 curr_reset_num;
1559 __le16 index_num;
1560 __le16 parts_num;
1561 __le32 data_size;
1562 __le32 data[0];
1563} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1564
1565/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001566 * struct iwl_set_calib_default_cmd - set default value for calibration.
1567 * ( SET_CALIB_DEFAULT_CMD = 0x8e )
1568 * @calib_index: the calibration to set value for
1569 * @length: of data
1570 * @data: the value to set for the calibration result
1571 */
1572struct iwl_set_calib_default_cmd {
1573 __le16 calib_index;
1574 __le16 length;
1575 u8 data[0];
1576} __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
1577
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001578#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001579#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001580
1581/**
1582 * struct iwl_mcast_filter_cmd - configure multicast filter.
1583 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1584 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1585 * to identify network interface adopted in host-device IF.
1586 * It is used by FW as index in array of addresses. This array has
1587 * MAX_PORT_ID_NUM members.
1588 * @count: Number of MAC addresses in the array
1589 * @pass_all: Set 1 to pass all multicast packets.
1590 * @bssid: current association BSSID.
1591 * @addr_list: Place holder for array of MAC addresses.
1592 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1593 */
1594struct iwl_mcast_filter_cmd {
1595 u8 filter_own;
1596 u8 port_id;
1597 u8 count;
1598 u8 pass_all;
1599 u8 bssid[6];
1600 u8 reserved[2];
1601 u8 addr_list[0];
1602} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1603
Eliad Pellerc87163b2014-01-08 10:11:11 +02001604#define MAX_BCAST_FILTERS 8
1605#define MAX_BCAST_FILTER_ATTRS 2
1606
1607/**
1608 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1609 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1610 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1611 * start of ip payload).
1612 */
1613enum iwl_mvm_bcast_filter_attr_offset {
1614 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1615 BCAST_FILTER_OFFSET_IP_END = 1,
1616};
1617
1618/**
1619 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1620 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1621 * @offset: starting offset of this pattern.
1622 * @val: value to match - big endian (MSB is the first
1623 * byte to match from offset pos).
1624 * @mask: mask to match (big endian).
1625 */
1626struct iwl_fw_bcast_filter_attr {
1627 u8 offset_type;
1628 u8 offset;
1629 __le16 reserved1;
1630 __be32 val;
1631 __be32 mask;
1632} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1633
1634/**
1635 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1636 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1637 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1638 */
1639enum iwl_mvm_bcast_filter_frame_type {
1640 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1641 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1642};
1643
1644/**
1645 * struct iwl_fw_bcast_filter - broadcast filter
1646 * @discard: discard frame (1) or let it pass (0).
1647 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
1648 * @num_attrs: number of valid attributes in this filter.
1649 * @attrs: attributes of this filter. a filter is considered matched
1650 * only when all its attributes are matched (i.e. AND relationship)
1651 */
1652struct iwl_fw_bcast_filter {
1653 u8 discard;
1654 u8 frame_type;
1655 u8 num_attrs;
1656 u8 reserved1;
1657 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1658} __packed; /* BCAST_FILTER_S_VER_1 */
1659
Sara Sharon3af512d62015-07-22 11:38:40 +03001660#define BA_WINDOW_STREAMS_MAX 16
1661#define BA_WINDOW_STATUS_TID_MSK 0x000F
1662#define BA_WINDOW_STATUS_STA_ID_POS 4
1663#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1664#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1665
1666/**
1667 * struct iwl_ba_window_status_notif - reordering window's status notification
1668 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1669 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1670 * @start_seq_num: the start sequence number of the bitmap
1671 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1672 */
1673struct iwl_ba_window_status_notif {
1674 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1675 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1676 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1677 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1678} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1679
Eliad Pellerc87163b2014-01-08 10:11:11 +02001680/**
1681 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1682 * @default_discard: default action for this mac (discard (1) / pass (0)).
1683 * @attached_filters: bitmap of relevant filters for this mac.
1684 */
1685struct iwl_fw_bcast_mac {
1686 u8 default_discard;
1687 u8 reserved1;
1688 __le16 attached_filters;
1689} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1690
1691/**
1692 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1693 * @disable: enable (0) / disable (1)
1694 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1695 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
1696 * @filters: broadcast filters
1697 * @macs: broadcast filtering configuration per-mac
1698 */
1699struct iwl_bcast_filter_cmd {
1700 u8 disable;
1701 u8 max_bcast_filters;
1702 u8 max_macs;
1703 u8 reserved1;
1704 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1705 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1706} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1707
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001708/*
1709 * enum iwl_mvm_marker_id - maker ids
1710 *
1711 * The ids for different type of markers to insert into the usniffer logs
1712 */
1713enum iwl_mvm_marker_id {
1714 MARKER_ID_TX_FRAME_LATENCY = 1,
1715}; /* MARKER_ID_API_E_VER_1 */
1716
1717/**
1718 * struct iwl_mvm_marker - mark info into the usniffer logs
1719 *
1720 * (MARKER_CMD = 0xcb)
1721 *
1722 * Mark the UTC time stamp into the usniffer logs together with additional
1723 * metadata, so the usniffer output can be parsed.
1724 * In the command response the ucode will return the GP2 time.
1725 *
1726 * @dw_len: The amount of dwords following this byte including this byte.
1727 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1728 * @reserved: reserved.
1729 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1730 * @metadata: additional meta data that will be written to the unsiffer log
1731 */
1732struct iwl_mvm_marker {
1733 u8 dwLen;
1734 u8 markerId;
1735 __le16 reserved;
1736 __le64 timestamp;
1737 __le32 metadata[0];
1738} __packed; /* MARKER_API_S_VER_1 */
1739
Matti Gottlieb0becb372015-05-31 09:18:30 +03001740/*
1741 * enum iwl_dc2dc_config_id - flag ids
1742 *
1743 * Ids of dc2dc configuration flags
1744 */
1745enum iwl_dc2dc_config_id {
1746 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1747 DCDC_FREQ_TUNE_SET = 0x2,
1748}; /* MARKER_ID_API_E_VER_1 */
1749
1750/**
1751 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1752 *
1753 * (DC2DC_CONFIG_CMD = 0x83)
1754 *
1755 * Set/Get & configure dc2dc values.
1756 * The command always returns the current dc2dc values.
1757 *
1758 * @flags: set/get dc2dc
1759 * @enable_low_power_mode: not used.
1760 * @dc2dc_freq_tune0: frequency divider - digital domain
1761 * @dc2dc_freq_tune1: frequency divider - analog domain
1762 */
1763struct iwl_dc2dc_config_cmd {
1764 __le32 flags;
1765 __le32 enable_low_power_mode; /* not used */
1766 __le32 dc2dc_freq_tune0;
1767 __le32 dc2dc_freq_tune1;
1768} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1769
1770/**
1771 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1772 *
1773 * Current dc2dc values returned by the FW.
1774 *
1775 * @dc2dc_freq_tune0: frequency divider - digital domain
1776 * @dc2dc_freq_tune1: frequency divider - analog domain
1777 */
1778struct iwl_dc2dc_config_resp {
1779 __le32 dc2dc_freq_tune0;
1780 __le32 dc2dc_freq_tune1;
1781} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1782
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001783/***********************************
1784 * Smart Fifo API
1785 ***********************************/
1786/* Smart Fifo state */
1787enum iwl_sf_state {
1788 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1789 SF_FULL_ON,
1790 SF_UNINIT,
1791 SF_INIT_OFF,
1792 SF_HW_NUM_STATES
1793};
1794
1795/* Smart Fifo possible scenario */
1796enum iwl_sf_scenario {
1797 SF_SCENARIO_SINGLE_UNICAST,
1798 SF_SCENARIO_AGG_UNICAST,
1799 SF_SCENARIO_MULTICAST,
1800 SF_SCENARIO_BA_RESP,
1801 SF_SCENARIO_TX_RESP,
1802 SF_NUM_SCENARIO
1803};
1804
1805#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
1806#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
1807
1808/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02001809#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001810#define SF_W_MARK_MIMO2 8192
1811#define SF_W_MARK_MIMO3 6144
1812#define SF_W_MARK_LEGACY 4096
1813#define SF_W_MARK_SCAN 4096
1814
Eran Hararyf4a3ee42015-02-08 13:58:50 +02001815/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
1816#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1817#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1818#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1819#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1820#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
1821#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1822#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
1823#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
1824#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
1825#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
1826
1827/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001828#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1829#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1830#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1831#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1832#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
1833#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
1834#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
1835#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
1836#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
1837#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
1838
1839#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
1840
Eran Harary161bdb72014-07-27 08:03:06 +03001841#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
1842
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001843/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001844 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
1845 * @state: smart fifo state, types listed in &enum iwl_sf_state.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001846 * @watermark: Minimum allowed availabe free space in RXF for transient state.
1847 * @long_delay_timeouts: aging and idle timer values for each scenario
1848 * in long delay state.
1849 * @full_on_timeouts: timer values for each scenario in full on state.
1850 */
1851struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001852 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001853 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
1854 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1855 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1856} __packed; /* SF_CFG_API_S_VER_2 */
1857
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001858/***********************************
1859 * Location Aware Regulatory (LAR) API - MCC updates
1860 ***********************************/
1861
1862/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001863 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001864 * regulatory profile according to the given MCC (Mobile Country Code).
1865 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1866 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1867 * MCC in the cmd response will be the relevant MCC in the NVM.
1868 * @mcc: given mobile country code
1869 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1870 * @reserved: reserved for alignment
1871 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001872struct iwl_mcc_update_cmd_v1 {
1873 __le16 mcc;
1874 u8 source_id;
1875 u8 reserved;
1876} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
1877
1878/**
1879 * struct iwl_mcc_update_cmd - Request the device to update geographic
1880 * regulatory profile according to the given MCC (Mobile Country Code).
1881 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1882 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1883 * MCC in the cmd response will be the relevant MCC in the NVM.
1884 * @mcc: given mobile country code
1885 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1886 * @reserved: reserved for alignment
1887 * @key: integrity key for MCC API OEM testing
1888 * @reserved2: reserved
1889 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001890struct iwl_mcc_update_cmd {
1891 __le16 mcc;
1892 u8 source_id;
1893 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001894 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01001895 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001896} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001897
1898/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001899 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001900 * Contains the new channel control profile map, if changed, and the new MCC
1901 * (mobile country code).
1902 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02001903 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001904 * @mcc: the new applied MCC
1905 * @cap: capabilities for all channels which matches the MCC
1906 * @source_id: the MCC source, see iwl_mcc_source
1907 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1908 * channels, depending on platform)
1909 * @channels: channel control data map, DWORD for each channel. Only the first
1910 * 16bits are used.
1911 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001912struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001913 __le32 status;
1914 __le16 mcc;
1915 u8 cap;
1916 u8 source_id;
1917 __le32 n_channels;
1918 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001919} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
1920
1921/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001922 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001923 * Contains the new channel control profile map, if changed, and the new MCC
1924 * (mobile country code).
1925 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
1926 * @status: see &enum iwl_mcc_update_status
1927 * @mcc: the new applied MCC
1928 * @cap: capabilities for all channels which matches the MCC
1929 * @source_id: the MCC source, see iwl_mcc_source
1930 * @time: time elapsed from the MCC test start (in 30 seconds TU)
1931 * @reserved: reserved.
1932 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1933 * channels, depending on platform)
1934 * @channels: channel control data map, DWORD for each channel. Only the first
1935 * 16bits are used.
1936 */
1937struct iwl_mcc_update_resp {
1938 __le32 status;
1939 __le16 mcc;
1940 u8 cap;
1941 u8 source_id;
1942 __le16 time;
1943 __le16 reserved;
1944 __le32 n_channels;
1945 __le32 channels[0];
1946} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001947
1948/**
1949 * struct iwl_mcc_chub_notif - chub notifies of mcc change
1950 * (MCC_CHUB_UPDATE_CMD = 0xc9)
1951 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
1952 * the cellular and connectivity cores that gets updates of the mcc, and
1953 * notifies the ucode directly of any mcc change.
1954 * The ucode requests the driver to request the device to update geographic
1955 * regulatory profile according to the given MCC (Mobile Country Code).
1956 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1957 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1958 * MCC in the cmd response will be the relevant MCC in the NVM.
1959 * @mcc: given mobile country code
1960 * @source_id: identity of the change originator, see iwl_mcc_source
1961 * @reserved1: reserved for alignment
1962 */
1963struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01001964 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001965 u8 source_id;
1966 u8 reserved1;
1967} __packed; /* LAR_MCC_NOTIFY_S */
1968
1969enum iwl_mcc_update_status {
1970 MCC_RESP_NEW_CHAN_PROFILE,
1971 MCC_RESP_SAME_CHAN_PROFILE,
1972 MCC_RESP_INVALID,
1973 MCC_RESP_NVM_DISABLED,
1974 MCC_RESP_ILLEGAL,
1975 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001976 MCC_RESP_TEST_MODE_ACTIVE,
1977 MCC_RESP_TEST_MODE_NOT_ACTIVE,
1978 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001979};
1980
1981enum iwl_mcc_source {
1982 MCC_SOURCE_OLD_FW = 0,
1983 MCC_SOURCE_ME = 1,
1984 MCC_SOURCE_BIOS = 2,
1985 MCC_SOURCE_3G_LTE_HOST = 3,
1986 MCC_SOURCE_3G_LTE_DEVICE = 4,
1987 MCC_SOURCE_WIFI = 5,
1988 MCC_SOURCE_RESERVED = 6,
1989 MCC_SOURCE_DEFAULT = 7,
1990 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001991 MCC_SOURCE_MCC_API = 9,
1992 MCC_SOURCE_GET_CURRENT = 0x10,
1993 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001994};
1995
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001996/* DTS measurements */
1997
1998enum iwl_dts_measurement_flags {
1999 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
2000 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
2001};
2002
2003/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002004 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002005 *
Johannes Berg31a658b2017-03-09 15:56:57 +01002006 * @flags: indicates which measurements we want as specified in
2007 * &enum iwl_dts_measurement_flags
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002008 */
2009struct iwl_dts_measurement_cmd {
2010 __le32 flags;
2011} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2012
2013/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03002014* enum iwl_dts_control_measurement_mode - DTS measurement type
2015* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2016* back (latest value. Not waiting for new value). Use automatic
2017* SW DTS configuration.
2018* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2019* trigger DTS reading and provide read back temperature read
2020* when available.
2021* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2022* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2023* without measurement trigger.
2024*/
2025enum iwl_dts_control_measurement_mode {
2026 DTS_AUTOMATIC = 0,
2027 DTS_REQUEST_READ = 1,
2028 DTS_OVER_WRITE = 2,
2029 DTS_DIRECT_WITHOUT_MEASURE = 3,
2030};
2031
2032/**
2033* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2034* @DTS_USE_TOP: Top
2035* @DTS_USE_CHAIN_A: chain A
2036* @DTS_USE_CHAIN_B: chain B
2037* @DTS_USE_CHAIN_C: chain C
2038* @XTAL_TEMPERATURE - read temperature from xtal
2039*/
2040enum iwl_dts_used {
2041 DTS_USE_TOP = 0,
2042 DTS_USE_CHAIN_A = 1,
2043 DTS_USE_CHAIN_B = 2,
2044 DTS_USE_CHAIN_C = 3,
2045 XTAL_TEMPERATURE = 4,
2046};
2047
2048/**
2049* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2050* @DTS_BIT6_MODE: bit 6 mode
2051* @DTS_BIT8_MODE: bit 8 mode
2052*/
2053enum iwl_dts_bit_mode {
2054 DTS_BIT6_MODE = 0,
2055 DTS_BIT8_MODE = 1,
2056};
2057
2058/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002059 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
Arik Nemtsov78efc702015-10-06 12:22:47 +03002060 * @control_mode: see &enum iwl_dts_control_measurement_mode
2061 * @temperature: used when over write DTS mode is selected
2062 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2063 * @avg_factor: average factor to DTS in request DTS read mode
2064 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2065 * @step_duration: step duration for the DTS
2066 */
2067struct iwl_ext_dts_measurement_cmd {
2068 __le32 control_mode;
2069 __le32 temperature;
2070 __le32 sensor;
2071 __le32 avg_factor;
2072 __le32 bit_mode;
2073 __le32 step_duration;
2074} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2075
2076/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002077 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002078 *
2079 * @temp: the measured temperature
2080 * @voltage: the measured voltage
2081 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002082struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002083 __le32 temp;
2084 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002085} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2086
2087/**
2088 * struct iwl_dts_measurement_notif_v2 - measurements notification
2089 *
2090 * @temp: the measured temperature
2091 * @voltage: the measured voltage
2092 * @threshold_idx: the trip index that was crossed
2093 */
2094struct iwl_dts_measurement_notif_v2 {
2095 __le32 temp;
2096 __le32 voltage;
2097 __le32 threshold_idx;
2098} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002099
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02002100/**
2101 * struct ct_kill_notif - CT-kill entry notification
2102 *
2103 * @temperature: the current temperature in celsius
2104 * @reserved: reserved
2105 */
2106struct ct_kill_notif {
2107 __le16 temperature;
2108 __le16 reserved;
2109} __packed; /* GRP_PHY_CT_KILL_NTF */
2110
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002111/**
2112* enum ctdp_cmd_operation - CTDP command operations
2113* @CTDP_CMD_OPERATION_START: update the current budget
2114* @CTDP_CMD_OPERATION_STOP: stop ctdp
2115* @CTDP_CMD_OPERATION_REPORT: get the avgerage budget
2116*/
2117enum iwl_mvm_ctdp_cmd_operation {
2118 CTDP_CMD_OPERATION_START = 0x1,
2119 CTDP_CMD_OPERATION_STOP = 0x2,
2120 CTDP_CMD_OPERATION_REPORT = 0x4,
2121};/* CTDP_CMD_OPERATION_TYPE_E */
2122
2123/**
2124 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2125 *
2126 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2127 * @budget: the budget in milliwatt
2128 * @window_size: defined in API but not used
2129 */
2130struct iwl_mvm_ctdp_cmd {
2131 __le32 operation;
2132 __le32 budget;
2133 __le32 window_size;
2134} __packed;
2135
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002136#define IWL_MAX_DTS_TRIPS 8
2137
2138/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002139 * struct temp_report_ths_cmd - set temperature thresholds
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002140 *
2141 * @num_temps: number of temperature thresholds passed
2142 * @thresholds: array with the thresholds to be configured
2143 */
2144struct temp_report_ths_cmd {
2145 __le32 num_temps;
2146 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2147} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2148
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002149/***********************************
2150 * TDLS API
2151 ***********************************/
2152
2153/* Type of TDLS request */
2154enum iwl_tdls_channel_switch_type {
2155 TDLS_SEND_CHAN_SW_REQ = 0,
2156 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2157 TDLS_MOVE_CH,
2158}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2159
2160/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002161 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002162 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2163 * received from peer
2164 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2165 * to the TDLS off-channel communication. For instance if the DTIM is
2166 * 200TU and the TDLS peer is to be given 25% of the time, the value
2167 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2168 * @switch_time: switch time the peer sent in its channel switch timing IE
2169 * @switch_timout: switch timeout the peer sent in its channel switch timing IE
2170 */
2171struct iwl_tdls_channel_switch_timing {
2172 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2173 __le32 max_offchan_duration; /* given in micro-seconds */
2174 __le32 switch_time; /* given in micro-seconds */
2175 __le32 switch_timeout; /* given in micro-seconds */
2176} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2177
2178#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2179
2180/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002181 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002182 *
2183 * A template representing a TDLS channel-switch request or response frame
2184 *
2185 * @switch_time_offset: offset to the channel switch timing IE in the template
2186 * @tx_cmd: Tx parameters for the frame
2187 * @data: frame data
2188 */
2189struct iwl_tdls_channel_switch_frame {
2190 __le32 switch_time_offset;
2191 struct iwl_tx_cmd tx_cmd;
2192 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2193} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2194
2195/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002196 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002197 *
2198 * The command is sent to initiate a channel switch and also in response to
2199 * incoming TDLS channel-switch request/response packets from remote peers.
2200 *
2201 * @switch_type: see &enum iwl_tdls_channel_switch_type
2202 * @peer_sta_id: station id of TDLS peer
2203 * @ci: channel we switch to
2204 * @timing: timing related data for command
2205 * @frame: channel-switch request/response template, depending to switch_type
2206 */
2207struct iwl_tdls_channel_switch_cmd {
2208 u8 switch_type;
2209 __le32 peer_sta_id;
2210 struct iwl_fw_channel_info ci;
2211 struct iwl_tdls_channel_switch_timing timing;
2212 struct iwl_tdls_channel_switch_frame frame;
2213} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2214
2215/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002216 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002217 *
2218 * @status: non-zero on success
2219 * @offchannel_duration: duration given in microseconds
2220 * @sta_id: peer currently performing the channel-switch with
2221 */
2222struct iwl_tdls_channel_switch_notif {
2223 __le32 status;
2224 __le32 offchannel_duration;
2225 __le32 sta_id;
2226} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2227
Arik Nemtsov307e4722014-09-15 18:48:59 +03002228/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002229 * struct iwl_tdls_sta_info - TDLS station info
Arik Nemtsov307e4722014-09-15 18:48:59 +03002230 *
2231 * @sta_id: station id of the TDLS peer
2232 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2233 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2234 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2235 */
2236struct iwl_tdls_sta_info {
2237 u8 sta_id;
2238 u8 tx_to_peer_tid;
2239 __le16 tx_to_peer_ssn;
2240 __le32 is_initiator;
2241} __packed; /* TDLS_STA_INFO_VER_1 */
2242
2243/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002244 * struct iwl_tdls_config_cmd - TDLS basic config command
Arik Nemtsov307e4722014-09-15 18:48:59 +03002245 *
2246 * @id_and_color: MAC id and color being configured
2247 * @tdls_peer_count: amount of currently connected TDLS peers
2248 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2249 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2250 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2251 * @pti_req_data_offset: offset of network-level data for the PTI template
2252 * @pti_req_tx_cmd: Tx parameters for PTI request template
2253 * @pti_req_template: PTI request template data
2254 */
2255struct iwl_tdls_config_cmd {
2256 __le32 id_and_color; /* mac id and color */
2257 u8 tdls_peer_count;
2258 u8 tx_to_ap_tid;
2259 __le16 tx_to_ap_ssn;
2260 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2261
2262 __le32 pti_req_data_offset;
2263 struct iwl_tx_cmd pti_req_tx_cmd;
2264 u8 pti_req_template[0];
2265} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2266
2267/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002268 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
Arik Nemtsov307e4722014-09-15 18:48:59 +03002269 *
2270 * @sta_id: station id of the TDLS peer
2271 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2272 * the peer
2273 */
2274struct iwl_tdls_config_sta_info_res {
2275 __le16 sta_id;
2276 __le16 tx_to_peer_last_seq;
2277} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2278
2279/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002280 * struct iwl_tdls_config_res - TDLS config information from FW
Arik Nemtsov307e4722014-09-15 18:48:59 +03002281 *
2282 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2283 * @sta_info: per-station TDLS config information
2284 */
2285struct iwl_tdls_config_res {
2286 __le32 tx_to_ap_last_seq;
2287 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2288} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2289
Sara Sharondb06f042016-07-05 17:37:58 +03002290#define TX_FIFO_MAX_NUM_9000 8
2291#define TX_FIFO_MAX_NUM 15
2292#define RX_FIFO_MAX_NUM 2
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002293#define TX_FIFO_INTERNAL_MAX_NUM 6
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002294
2295/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002296 * struct iwl_shared_mem_cfg_v1 - Shared memory configuration information
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002297 *
2298 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2299 * accessible)
2300 * @shared_mem_size: shared memory size
2301 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2302 * 0x0 as accessible only via DBGM RDAT)
2303 * @sample_buff_size: internal sample buff size
2304 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2305 * 8000 HW set to 0x0 as not accessible)
2306 * @txfifo_size: size of TXF0 ... TXF7
2307 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2308 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2309 * when paging is not supported this should be 0
2310 * @page_buff_size: size of %page_buff_addr
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002311 * @rxfifo_addr: Start address of rxFifo
2312 * @internal_txfifo_addr: start address of internalFifo
2313 * @internal_txfifo_size: internal fifos' size
2314 *
2315 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2316 * set, the last 3 members don't exist.
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002317 */
Sara Sharondb06f042016-07-05 17:37:58 +03002318struct iwl_shared_mem_cfg_v1 {
2319 __le32 shared_mem_addr;
2320 __le32 shared_mem_size;
2321 __le32 sample_buff_addr;
2322 __le32 sample_buff_size;
2323 __le32 txfifo_addr;
2324 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2325 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2326 __le32 page_buff_addr;
2327 __le32 page_buff_size;
2328 __le32 rxfifo_addr;
2329 __le32 internal_txfifo_addr;
2330 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2331} __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2332
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002333/**
2334 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2335 *
2336 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2337 * @txfifo_size: size of TX FIFOs
2338 * @rxfifo1_addr: RXF1 addr
2339 * @rxfifo1_size: RXF1 size
2340 */
2341struct iwl_shared_mem_lmac_cfg {
2342 __le32 txfifo_addr;
2343 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2344 __le32 rxfifo1_addr;
2345 __le32 rxfifo1_size;
2346
2347} __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2348
2349/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002350 * struct iwl_shared_mem_cfg - Shared memory configuration information
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002351 *
2352 * @shared_mem_addr: shared memory address
2353 * @shared_mem_size: shared memory size
2354 * @sample_buff_addr: internal sample (mon/adc) buff addr
2355 * @sample_buff_size: internal sample buff size
2356 * @rxfifo2_addr: start addr of RXF2
2357 * @rxfifo2_size: size of RXF2
2358 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2359 * when paging is not supported this should be 0
2360 * @page_buff_size: size of %page_buff_addr
2361 * @lmac_num: number of LMACs (1 or 2)
2362 * @lmac_smem: per - LMAC smem data
2363 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002364struct iwl_shared_mem_cfg {
2365 __le32 shared_mem_addr;
2366 __le32 shared_mem_size;
2367 __le32 sample_buff_addr;
2368 __le32 sample_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002369 __le32 rxfifo2_addr;
2370 __le32 rxfifo2_size;
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002371 __le32 page_buff_addr;
2372 __le32 page_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002373 __le32 lmac_num;
2374 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
Sara Sharondb06f042016-07-05 17:37:58 +03002375} __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002376
Sara Sharona07a8f32015-11-15 11:11:59 +02002377/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002378 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
Sara Sharona07a8f32015-11-15 11:11:59 +02002379 *
2380 * @membership_status: a bitmap of MU groups
2381 * @user_position:the position of station in a group. If the station is in the
2382 * group then bits (group * 2) is the position -1
2383 */
2384struct iwl_mu_group_mgmt_cmd {
2385 __le32 reserved;
2386 __le32 membership_status[2];
2387 __le32 user_position[4];
2388} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2389
Sara Sharonf92659a2016-02-03 15:04:49 +02002390/**
2391 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2392 *
2393 * @membership_status: a bitmap of MU groups
2394 * @user_position: the position of station in a group. If the station is in the
2395 * group then bits (group * 2) is the position -1
2396 */
2397struct iwl_mu_group_mgmt_notif {
2398 __le32 membership_status[2];
2399 __le32 user_position[4];
2400} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2401
Sara Sharon0db056d2015-12-29 11:07:15 +02002402#define MAX_STORED_BEACON_SIZE 600
2403
2404/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002405 * struct iwl_stored_beacon_notif - Stored beacon notification
Sara Sharon0db056d2015-12-29 11:07:15 +02002406 *
2407 * @system_time: system time on air rise
2408 * @tsf: TSF on air rise
2409 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002410 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002411 * @channel: channel this beacon was received on
2412 * @rates: rate in ucode internal format
2413 * @byte_count: frame's byte count
2414 */
2415struct iwl_stored_beacon_notif {
2416 __le32 system_time;
2417 __le64 tsf;
2418 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002419 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002420 __le16 channel;
2421 __le32 rates;
2422 __le32 byte_count;
2423 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002424} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002425
Aviya Erenfeld03098262016-02-18 14:09:33 +02002426#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2427
2428enum iwl_lqm_cmd_operatrions {
2429 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2430 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2431};
2432
2433enum iwl_lqm_status {
2434 LQM_STATUS_SUCCESS = 0,
2435 LQM_STATUS_TIMEOUT = 1,
2436 LQM_STATUS_ABORT = 2,
2437};
2438
2439/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002440 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
Aviya Erenfeld03098262016-02-18 14:09:33 +02002441 * @cmd_operatrion: command operation to be performed (start or stop)
2442 * as defined above.
2443 * @mac_id: MAC ID the measurement applies to.
2444 * @measurement_time: time of the total measurement to be performed, in uSec.
2445 * @timeout: maximum time allowed until a response is sent, in uSec.
2446 */
2447struct iwl_link_qual_msrmnt_cmd {
2448 __le32 cmd_operation;
2449 __le32 mac_id;
2450 __le32 measurement_time;
2451 __le32 timeout;
2452} __packed /* LQM_CMD_API_S_VER_1 */;
2453
2454/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002455 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
Aviya Erenfeld03098262016-02-18 14:09:33 +02002456 *
2457 * @frequent_stations_air_time: an array containing the total air time
2458 * (in uSec) used by the most frequently transmitting stations.
2459 * @number_of_stations: the number of uniqe stations included in the array
2460 * (a number between 0 to 16)
2461 * @total_air_time_other_stations: the total air time (uSec) used by all the
2462 * stations which are not included in the above report.
2463 * @time_in_measurement_window: the total time in uSec in which a measurement
2464 * took place.
2465 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2466 * measurement
2467 * @mac_id: MAC ID the measurement applies to.
2468 * @status: return status. may be one of the LQM_STATUS_* defined above.
2469 * @reserved: reserved.
2470 */
2471struct iwl_link_qual_msrmnt_notif {
2472 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2473 __le32 number_of_stations;
2474 __le32 total_air_time_other_stations;
2475 __le32 time_in_measurement_window;
2476 __le32 tx_frame_dropped;
2477 __le32 mac_id;
2478 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002479 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002480} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2481
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002482/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002483 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002484 *
2485 * @id_and_color: ID and color of the MAC
2486 */
2487struct iwl_channel_switch_noa_notif {
2488 __le32 id_and_color;
2489} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2490
Ido Yariv2b55f432016-08-23 14:44:59 -04002491/* Operation types for the debug mem access */
2492enum {
2493 DEBUG_MEM_OP_READ = 0,
2494 DEBUG_MEM_OP_WRITE = 1,
2495 DEBUG_MEM_OP_WRITE_BYTES = 2,
2496};
2497
2498#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2499
2500/**
2501 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2502 * @op: DEBUG_MEM_OP_*
2503 * @addr: address to read/write from/to
2504 * @len: in dwords, to read/write
2505 * @data: for write opeations, contains the source buffer
2506 */
2507struct iwl_dbg_mem_access_cmd {
2508 __le32 op;
2509 __le32 addr;
2510 __le32 len;
2511 __le32 data[];
2512} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2513
2514/* Status responses for the debug mem access */
2515enum {
2516 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2517 DEBUG_MEM_STATUS_FAILED = 0x1,
2518 DEBUG_MEM_STATUS_LOCKED = 0x2,
2519 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2520 DEBUG_MEM_STATUS_LENGTH = 0x4,
2521};
2522
2523/**
2524 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2525 * @status: DEBUG_MEM_STATUS_*
2526 * @len: read dwords (0 for write operations)
2527 * @data: contains the read DWs
2528 */
2529struct iwl_dbg_mem_access_rsp {
2530 __le32 status;
2531 __le32 len;
2532 __le32 data[];
2533} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2534
Sara Sharon1f370652016-08-31 18:13:57 +03002535/**
2536 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
2537 */
2538struct iwl_nvm_access_complete_cmd {
2539 __le32 reserved;
2540} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2541
Sara Sharon4399caa2016-12-11 10:32:42 +02002542/**
2543 * enum iwl_extended_cfg_flag - commands driver may send before
2544 * finishing init flow
2545 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2546 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2547 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2548 */
2549enum iwl_extended_cfg_flags {
2550 IWL_INIT_DEBUG_CFG,
2551 IWL_INIT_NVM,
2552 IWL_INIT_PHY,
2553};
2554
2555/**
2556 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2557 * before finishing init flows
2558 * @init_flags: values from iwl_extended_cfg_flags
2559 */
2560struct iwl_init_extended_cfg_cmd {
2561 __le32 init_flags;
2562} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2563
Sara Sharone9e1ba32017-01-08 16:46:14 +02002564/*
2565 * struct iwl_nvm_get_info - request to get NVM data
2566 */
2567struct iwl_nvm_get_info {
2568 __le32 reserved;
2569} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2570
2571/**
2572 * struct iwl_nvm_get_info_general - general NVM data
2573 * @flags: 1 - empty, 0 - valid
2574 * @nvm_version: nvm version
2575 * @board_type: board type
2576 */
2577struct iwl_nvm_get_info_general {
2578 __le32 flags;
2579 __le16 nvm_version;
2580 u8 board_type;
2581 u8 reserved;
2582} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2583
2584/**
2585 * struct iwl_nvm_get_info_sku - mac information
2586 * @enable_24g: band 2.4G enabled
2587 * @enable_5g: band 5G enabled
2588 * @enable_11n: 11n enabled
2589 * @enable_11ac: 11ac enabled
2590 * @mimo_disable: MIMO enabled
2591 * @ext_crypto: Extended crypto enabled
2592 */
2593struct iwl_nvm_get_info_sku {
2594 __le32 enable_24g;
2595 __le32 enable_5g;
2596 __le32 enable_11n;
2597 __le32 enable_11ac;
2598 __le32 mimo_disable;
2599 __le32 ext_crypto;
2600} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2601
2602/**
2603 * struct iwl_nvm_get_info_phy - phy information
2604 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2605 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2606 */
2607struct iwl_nvm_get_info_phy {
2608 __le32 tx_chains;
2609 __le32 rx_chains;
2610} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2611
2612#define IWL_NUM_CHANNELS (51)
2613
2614/**
2615 * struct iwl_nvm_get_info_regulatory - regulatory information
2616 * @lar_enabled: is LAR enabled
2617 * @channel_profile: regulatory data of this channel
2618 * @regulatory: regulatory data, see &enum iwl_nvm_channel_flags for data
2619 */
2620struct iwl_nvm_get_info_regulatory {
2621 __le32 lar_enabled;
2622 __le16 channel_profile[IWL_NUM_CHANNELS];
2623 __le16 reserved;
2624} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2625
2626/**
2627 * struct iwl_nvm_get_info_rsp - response to get NVM data
2628 * @general: general NVM data
2629 * @mac_sku: data relating to MAC sku
2630 * @phy_sku: data relating to PHY sku
2631 * @regulatory: regulatory data
2632 */
2633struct iwl_nvm_get_info_rsp {
2634 struct iwl_nvm_get_info_general general;
2635 struct iwl_nvm_get_info_sku mac_sku;
2636 struct iwl_nvm_get_info_phy phy_sku;
2637 struct iwl_nvm_get_info_regulatory regulatory;
2638} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2639
Johannes Berg15fc1962017-03-10 14:01:42 +01002640/**
2641 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2642 * @isolation: antenna isolation value
2643 */
2644struct iwl_mvm_antenna_coupling_notif {
2645 __le32 isolation;
2646} __packed;
2647
Johannes Berg8ca151b2013-01-24 14:25:36 +01002648#endif /* __fw_api_h__ */