blob: 60f86997f8cf40db5b803336bb2a6ebc332c966a [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,
Johannes Berga6a62192017-05-03 21:56:04 +0200220 * response in &struct iwl_mvm_tx_resp or
221 * &struct iwl_mvm_tx_resp_v3
Johannes Berge8226a52017-03-31 11:25:52 +0200222 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100223 TX_CMD = 0x1c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100224
225 /**
226 * @TXPATH_FLUSH: &struct iwl_tx_path_flush_cmd
227 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100228 TXPATH_FLUSH = 0x1e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100229
230 /**
231 * @MGMT_MCAST_KEY:
232 * &struct iwl_mvm_mgmt_mcast_key_cmd or
233 * &struct iwl_mvm_mgmt_mcast_key_cmd_v1
234 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100235 MGMT_MCAST_KEY = 0x1f,
236
Avri Altman3edf8ff2014-07-30 11:41:01 +0300237 /* scheduler config */
Johannes Berg15fc1962017-03-10 14:01:42 +0100238 /**
Johannes Berge153c1e2017-03-30 14:23:21 +0200239 * @SCD_QUEUE_CFG: &struct iwl_scd_txq_cfg_cmd for older hardware,
240 * &struct iwl_tx_queue_cfg_cmd with &struct iwl_tx_queue_cfg_rsp
241 * for newer (A000) hardware.
Johannes Berg15fc1962017-03-10 14:01:42 +0100242 */
Avri Altman3edf8ff2014-07-30 11:41:01 +0300243 SCD_QUEUE_CFG = 0x1d,
244
Johannes Berg8ca151b2013-01-24 14:25:36 +0100245 /* global key */
246 WEP_KEY = 0x20,
247
Liad Kaufman04fd2c22014-12-15 17:54:16 +0200248 /* Memory */
249 SHARED_MEM_CFG = 0x25,
250
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300251 /* TDLS */
252 TDLS_CHANNEL_SWITCH_CMD = 0x27,
253 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
Arik Nemtsov307e4722014-09-15 18:48:59 +0300254 TDLS_CONFIG_CMD = 0xa7,
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300255
Johannes Berg15fc1962017-03-10 14:01:42 +0100256 /**
257 * @MAC_CONTEXT_CMD: &struct iwl_mac_ctx_cmd
258 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100259 MAC_CONTEXT_CMD = 0x28,
Johannes Berg15fc1962017-03-10 14:01:42 +0100260
261 /**
262 * @TIME_EVENT_CMD:
263 * &struct iwl_time_event_cmd, response in &struct iwl_time_event_resp
264 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100265 TIME_EVENT_CMD = 0x29, /* both CMD and response */
Johannes Berg15fc1962017-03-10 14:01:42 +0100266 /**
267 * @TIME_EVENT_NOTIFICATION: &struct iwl_time_event_notif
268 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100269 TIME_EVENT_NOTIFICATION = 0x2a,
Johannes Berg15fc1962017-03-10 14:01:42 +0100270 /**
271 * @BINDING_CONTEXT_CMD:
272 * &struct iwl_binding_cmd or &struct iwl_binding_cmd_v1
273 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100274 BINDING_CONTEXT_CMD = 0x2b,
Johannes Berg15fc1962017-03-10 14:01:42 +0100275 /**
276 * @TIME_QUOTA_CMD: &struct iwl_time_quota_cmd
277 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100278 TIME_QUOTA_CMD = 0x2c,
Johannes Berg4ac6cb52013-08-08 09:30:13 +0200279 NON_QOS_TX_COUNTER_CMD = 0x2d,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100280
Johannes Berg15fc1962017-03-10 14:01:42 +0100281 /**
282 * @LQ_CMD: using &struct iwl_lq_cmd
283 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100284 LQ_CMD = 0x4e,
285
Johannes Berg15fc1962017-03-10 14:01:42 +0100286 /**
287 * @FW_PAGING_BLOCK_CMD:
288 * &struct iwl_fw_paging_cmd or &struct iwl_fw_paging_cmd_v1
289 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300290 FW_PAGING_BLOCK_CMD = 0x4f,
291
Johannes Berg8ca151b2013-01-24 14:25:36 +0100292 /* Scan offload */
293 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
294 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300295 HOT_SPOT_CMD = 0x53,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100296 SCAN_OFFLOAD_COMPLETE = 0x6D,
297 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
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
Ilan Peer571765c2013-03-05 15:26:03 +0200331 BEACON_NOTIFICATION = 0x90,
Johannes Bergb7bea642017-03-31 10:48:17 +0200332 /**
333 * @BEACON_TEMPLATE_CMD:
334 * Uses one of &struct iwl_mac_beacon_cmd_v6,
335 * &struct iwl_mac_beacon_cmd_v7 or &struct iwl_mac_beacon_cmd
336 * depending on the device version.
337 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100338 BEACON_TEMPLATE_CMD = 0x91,
Johannes Berg15fc1962017-03-10 14:01:42 +0100339 /**
340 * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
341 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100342 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg15fc1962017-03-10 14:01:42 +0100343
344 /**
345 * @STATISTICS_CMD: &struct iwl_statistics_cmd
346 */
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100347 STATISTICS_CMD = 0x9c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100348
349 /**
350 * @STATISTICS_NOTIFICATION:
351 * one of &struct iwl_notif_statistics_v10,
352 * &struct iwl_notif_statistics_v11,
353 * &struct iwl_notif_statistics_cdb
354 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100355 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg3e56ead2013-02-15 22:23:18 +0100356 EOSP_NOTIFICATION = 0x9e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100357
358 /**
359 * @REDUCE_TX_POWER_CMD:
360 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
361 */
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300362 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100363
Johannes Berg8ca151b2013-01-24 14:25:36 +0100364 CARD_STATE_NOTIFICATION = 0xa1,
365
Hila Gonend64048e2013-03-13 18:00:03 +0200366 MISSED_BEACONS_NOTIFICATION = 0xa2,
367
Johannes Berg15fc1962017-03-10 14:01:42 +0100368 /**
369 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
370 */
Alexander Bondare811ada2013-03-10 15:29:44 +0200371 MAC_PM_POWER_TABLE = 0xa9,
372
Johannes Berg15fc1962017-03-10 14:01:42 +0100373 /**
374 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
375 */
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200376 MFUART_LOAD_NOTIFICATION = 0xb1,
377
Johannes Berg15fc1962017-03-10 14:01:42 +0100378 /**
379 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
380 */
Sara Sharon43413a92015-12-31 11:49:18 +0200381 RSS_CONFIG_CMD = 0xb3,
382
Johannes Berg6857df82017-03-15 14:06:53 +0100383 /**
384 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
385 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100386 REPLY_RX_PHY_CMD = 0xc0,
Johannes Berg6857df82017-03-15 14:06:53 +0100387
388 /**
389 * @REPLY_RX_MPDU_CMD:
390 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
391 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100392 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg13555e82015-09-02 16:16:49 +0200393 FRAME_RELEASE = 0xc3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100394 BA_NOTIF = 0xc5,
395
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200396 /* Location Aware Regulatory */
Johannes Berg15fc1962017-03-10 14:01:42 +0100397 /**
398 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
399 */
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200400 MCC_UPDATE_CMD = 0xc8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100401
402 /**
403 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
404 */
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200405 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200406
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300407 MARKER_CMD = 0xcb,
408
Johannes Berg15fc1962017-03-10 14:01:42 +0100409 /**
410 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
411 */
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200412 BT_PROFILE_NOTIFICATION = 0xce,
Johannes Berg15fc1962017-03-10 14:01:42 +0100413 /**
414 * @BT_CONFIG: &struct iwl_bt_coex_cmd
415 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300416 BT_CONFIG = 0x9b,
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300417 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
418 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100419 /**
420 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
421 */
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300422 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200423
Johannes Berg15fc1962017-03-10 14:01:42 +0100424 /**
425 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
426 */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200427 REPLY_SF_CFG_CMD = 0xd1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100428 /**
429 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
430 */
Hila Gonen7df15b12012-12-12 11:16:19 +0200431 REPLY_BEACON_FILTERING_CMD = 0xd2,
432
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300433 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
434
Golan Ben Ami321c2102015-07-27 17:02:35 +0300435 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100436 DEBUG_LOG_MSG = 0xf7,
437
Eliad Pellerc87163b2014-01-08 10:11:11 +0200438 BCAST_FILTER_CMD = 0xcf,
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300439 MCAST_FILTER_CMD = 0xd0,
440
Johannes Berg15fc1962017-03-10 14:01:42 +0100441 /**
442 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
443 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100444 D3_CONFIG_CMD = 0xd3,
445 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
446 OFFLOADS_QUERY_CMD = 0xd5,
447 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300448 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100449
Johannes Berg15fc1962017-03-10 14:01:42 +0100450 /**
451 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
452 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100453 WOWLAN_PATTERNS = 0xe0,
Johannes Berg15fc1962017-03-10 14:01:42 +0100454
455 /**
456 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
457 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100458 WOWLAN_CONFIGURATION = 0xe1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100459 /**
460 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
461 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100462 WOWLAN_TSC_RSC_PARAM = 0xe2,
Johannes Berg15fc1962017-03-10 14:01:42 +0100463 /**
464 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
465 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100466 WOWLAN_TKIP_PARAM = 0xe3,
Johannes Berg15fc1962017-03-10 14:01:42 +0100467 /**
468 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
469 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100470 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
Johannes Berg15fc1962017-03-10 14:01:42 +0100471 /**
472 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
473 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100474 WOWLAN_GET_STATUSES = 0xe5,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100475
476 /* and for NetDetect */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200477 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100478};
479
Sharon Dvir39bdb172015-10-15 18:18:09 +0300480/* Please keep this enum *SORTED* by hex value.
481 * Needed for binary search, otherwise a warning will be triggered.
482 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200483enum iwl_mac_conf_subcmd_ids {
484 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
485 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200486 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200487};
488
Johannes Berg15fc1962017-03-10 14:01:42 +0100489/**
490 * enum iwl_phy_ops_subcmd_ids - PHY group commands
491 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300492enum iwl_phy_ops_subcmd_ids {
493 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200494 CTDP_CONFIG_CMD = 0x03,
Johannes Berg15fc1962017-03-10 14:01:42 +0100495
496 /**
497 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
498 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200499 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200500 GEO_TX_POWER_LIMIT = 0x05,
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200501 CT_KILL_NOTIFICATION = 0xFE,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300502 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
503};
504
Johannes Berg15fc1962017-03-10 14:01:42 +0100505/**
506 * enum iwl_system_subcmd_ids - system group command IDs
507 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200508enum iwl_system_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100509 /**
510 * @SHARED_MEM_CFG_CMD:
511 * response in &struct iwl_shared_mem_cfg or
512 * &struct iwl_shared_mem_cfg_v1
513 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200514 SHARED_MEM_CFG_CMD = 0x0,
Sara Sharon4399caa2016-12-11 10:32:42 +0200515 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200516};
517
Johannes Berg15fc1962017-03-10 14:01:42 +0100518/**
519 * enum iwl_data_path_subcmd_ids - data path group commands
520 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200521enum iwl_data_path_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100522 /**
523 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
524 */
Liad Kaufman97d5be72015-08-31 14:33:23 +0300525 DQA_ENABLE_CMD = 0x0,
Sara Sharona07a8f32015-11-15 11:11:59 +0200526 UPDATE_MU_GROUPS_CMD = 0x1,
Sara Sharon94bb4482015-12-16 18:48:28 +0200527 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg65e25482016-04-13 14:24:22 +0200528 STA_PM_NOTIF = 0xFD,
Sara Sharonf92659a2016-02-03 15:04:49 +0200529 MU_GROUP_MGMT_NOTIF = 0xFE,
Sara Sharon94bb4482015-12-16 18:48:28 +0200530 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200531};
532
Sara Sharon0db056d2015-12-29 11:07:15 +0200533enum iwl_prot_offload_subcmd_ids {
534 STORED_BEACON_NTF = 0xFF,
535};
536
Sara Sharon1f370652016-08-31 18:13:57 +0300537enum iwl_regulatory_and_nvm_subcmd_ids {
538 NVM_ACCESS_COMPLETE = 0x0,
Sara Sharone9e1ba32017-01-08 16:46:14 +0200539 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300540};
541
Johannes Berge6138c92017-05-04 10:00:03 +0200542/**
543 * enum iwl_debug_cmds - debug commands
544 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200545enum iwl_debug_cmds {
Johannes Berge6138c92017-05-04 10:00:03 +0200546 /**
547 * @LMAC_RD_WR:
548 * LMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
549 * &struct iwl_dbg_mem_access_rsp
550 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400551 LMAC_RD_WR = 0x0,
Johannes Berge6138c92017-05-04 10:00:03 +0200552 /**
553 * @UMAC_RD_WR:
554 * UMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
555 * &struct iwl_dbg_mem_access_rsp
556 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400557 UMAC_RD_WR = 0x1,
Johannes Berge6138c92017-05-04 10:00:03 +0200558 /**
559 * @MFU_ASSERT_DUMP_NTF:
560 * &struct iwl_mfu_assert_dump_notif
561 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200562 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400563};
564
Johannes Berg72361c32017-03-09 17:06:45 +0100565/**
566 * enum iwl_mvm_command_groups - command groups for the firmware
567 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
568 * @LONG_GROUP: legacy group with long header, also uses command IDs
569 * from &enum iwl_legacy_cmds
570 * @SYSTEM_GROUP: system group, uses command IDs from
571 * &enum iwl_system_subcmd_ids
572 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
573 * &enum iwl_mac_conf_subcmd_ids
574 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
575 * &enum iwl_phy_ops_subcmd_ids
576 * @DATA_PATH_GROUP: data path group, uses command IDs from
577 * &enum iwl_data_path_subcmd_ids
Johannes Berg72361c32017-03-09 17:06:45 +0100578 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
579 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
580 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
581 * &enum iwl_prot_offload_subcmd_ids
582 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
583 * &enum iwl_regulatory_and_nvm_subcmd_ids
584 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
585 */
586enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300587 LEGACY_GROUP = 0x0,
588 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200589 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200590 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300591 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200592 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200593 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300594 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400595 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300596};
597
Johannes Berg8ca151b2013-01-24 14:25:36 +0100598/**
599 * struct iwl_cmd_response - generic response struct for most commands
600 * @status: status of the command asked, changes for each one
601 */
602struct iwl_cmd_response {
603 __le32 status;
604};
605
606/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300607 * struct iwl_dqa_enable_cmd
608 * @cmd_queue: the TXQ number of the command queue
609 */
610struct iwl_dqa_enable_cmd {
611 __le32 cmd_queue;
612} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
613
614/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100615 * struct iwl_tx_ant_cfg_cmd
616 * @valid: valid antenna configuration
617 */
618struct iwl_tx_ant_cfg_cmd {
619 __le32 valid;
620} __packed;
621
Johannes Berg31a658b2017-03-09 15:56:57 +0100622/**
623 * struct iwl_calib_ctrl - Calibration control struct.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100624 * Sent as part of the phy configuration command.
625 * @flow_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100626 * flow triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100627 * @event_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100628 * event triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100629 */
630struct iwl_calib_ctrl {
631 __le32 flow_trigger;
632 __le32 event_trigger;
633} __packed;
634
635/* This enum defines the bitmap of various calibrations to enable in both
636 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
637 */
638enum iwl_calib_cfg {
639 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
640 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
641 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
642 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
643 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
644 IWL_CALIB_CFG_DC_IDX = BIT(5),
645 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
646 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
647 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
648 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
649 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
650 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
651 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
652 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
653 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
654 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
655 IWL_CALIB_CFG_DAC_IDX = BIT(16),
656 IWL_CALIB_CFG_ABS_IDX = BIT(17),
657 IWL_CALIB_CFG_AGC_IDX = BIT(18),
658};
659
Johannes Berg31a658b2017-03-09 15:56:57 +0100660/**
661 * struct iwl_phy_cfg_cmd - Phy configuration command
662 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
663 * @calib_control: calibration control data
Johannes Berg8ca151b2013-01-24 14:25:36 +0100664 */
665struct iwl_phy_cfg_cmd {
666 __le32 phy_cfg;
667 struct iwl_calib_ctrl calib_control;
668} __packed;
669
670#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
671#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
672#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
673#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
674#define PHY_CFG_TX_CHAIN_A BIT(8)
675#define PHY_CFG_TX_CHAIN_B BIT(9)
676#define PHY_CFG_TX_CHAIN_C BIT(10)
677#define PHY_CFG_RX_CHAIN_A BIT(12)
678#define PHY_CFG_RX_CHAIN_B BIT(13)
679#define PHY_CFG_RX_CHAIN_C BIT(14)
680
681
Johannes Bergd69f0a22017-03-14 10:58:16 +0100682/**
683 * enum iwl_nvm_access_op - NVM access opcode
684 * @IWL_NVM_READ: read NVM
685 * @IWL_NVM_WRITE: write NVM
686 */
687enum iwl_nvm_access_op {
688 IWL_NVM_READ = 0,
689 IWL_NVM_WRITE = 1,
690};
691
692/**
693 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
694 * @NVM_ACCESS_TARGET_CACHE: access the cache
695 * @NVM_ACCESS_TARGET_OTP: access the OTP
696 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
697 */
698enum iwl_nvm_access_target {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100699 NVM_ACCESS_TARGET_CACHE = 0,
700 NVM_ACCESS_TARGET_OTP = 1,
701 NVM_ACCESS_TARGET_EEPROM = 2,
702};
703
Johannes Bergd69f0a22017-03-14 10:58:16 +0100704/**
705 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
706 * @NVM_SECTION_TYPE_SW: software section
707 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
708 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
709 * @NVM_SECTION_TYPE_PRODUCTION: production section
710 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
711 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
712 * @NVM_MAX_NUM_SECTIONS: number of sections
713 */
714enum iwl_nvm_section_type {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200715 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200716 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200717 NVM_SECTION_TYPE_CALIBRATION = 4,
718 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200719 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200720 NVM_SECTION_TYPE_PHY_SKU = 12,
721 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100722};
723
724/**
Johannes Berg67625862017-03-14 11:01:27 +0100725 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
726 * @op_code: &enum iwl_nvm_access_op
727 * @target: &enum iwl_nvm_access_target
728 * @type: &enum iwl_nvm_section_type
Johannes Berg8ca151b2013-01-24 14:25:36 +0100729 * @offset: offset in bytes into the section
730 * @length: in bytes, to read/write
731 * @data: if write operation, the data to write. On read its empty
732 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200733struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100734 u8 op_code;
735 u8 target;
736 __le16 type;
737 __le16 offset;
738 __le16 length;
739 u8 data[];
740} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
741
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300742#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
743
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100744/**
745 * struct iwl_fw_paging_cmd_v1 - paging layout
746 *
747 * (FW_PAGING_BLOCK_CMD = 0x4f)
748 *
749 * Send to FW the paging layout in the driver.
750 *
751 * @flags: various flags for the command
752 * @block_size: the block size in powers of 2
753 * @block_num: number of blocks specified in the command.
754 * @device_phy_addr: virtual addresses from device side
755 */
756struct iwl_fw_paging_cmd_v1 {
757 __le32 flags;
758 __le32 block_size;
759 __le32 block_num;
760 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
761} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
762
763/**
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300764 * struct iwl_fw_paging_cmd - paging layout
765 *
766 * (FW_PAGING_BLOCK_CMD = 0x4f)
767 *
768 * Send to FW the paging layout in the driver.
769 *
770 * @flags: various flags for the command
771 * @block_size: the block size in powers of 2
772 * @block_num: number of blocks specified in the command.
773 * @device_phy_addr: virtual addresses from device side
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100774 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300775struct iwl_fw_paging_cmd {
776 __le32 flags;
777 __le32 block_size;
778 __le32 block_num;
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100779 __le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
Sara Sharond975d722016-07-04 11:52:07 +0300780} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300781
Matti Gottliebe1120182015-07-19 11:15:07 +0300782/*
783 * Fw items ID's
784 *
785 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
786 * download
787 */
788enum iwl_fw_item_id {
789 IWL_FW_ITEM_ID_PAGING = 3,
790};
791
792/*
793 * struct iwl_fw_get_item_cmd - get an item from the fw
794 */
795struct iwl_fw_get_item_cmd {
796 __le32 item_id;
797} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
798
Golan Ben Ami321c2102015-07-27 17:02:35 +0300799#define CONT_REC_COMMAND_SIZE 80
800#define ENABLE_CONT_RECORDING 0x15
801#define DISABLE_CONT_RECORDING 0x16
802
803/*
804 * struct iwl_continuous_record_mode - recording mode
805 */
806struct iwl_continuous_record_mode {
807 __le16 enable_recording;
808} __packed;
809
810/*
811 * struct iwl_continuous_record_cmd - enable/disable continuous recording
812 */
813struct iwl_continuous_record_cmd {
814 struct iwl_continuous_record_mode record_mode;
815 u8 pad[CONT_REC_COMMAND_SIZE -
816 sizeof(struct iwl_continuous_record_mode)];
817} __packed;
818
Matti Gottliebe1120182015-07-19 11:15:07 +0300819struct iwl_fw_get_item_resp {
820 __le32 item_id;
821 __le32 item_byte_cnt;
822 __le32 item_val;
823} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
824
Johannes Berg8ca151b2013-01-24 14:25:36 +0100825/**
826 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
827 * @offset: offset in bytes into the section
828 * @length: in bytes, either how much was written or read
829 * @type: NVM_SECTION_TYPE_*
830 * @status: 0 for success, fail otherwise
831 * @data: if read operation, the data returned. Empty on write.
832 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200833struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100834 __le16 offset;
835 __le16 length;
836 __le16 type;
837 __le16 status;
838 u8 data[];
839} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
840
841/* MVM_ALIVE 0x1 */
842
843/* alive response is_valid values */
844#define ALIVE_RESP_UCODE_OK BIT(0)
845#define ALIVE_RESP_RFKILL BIT(1)
846
847/* alive response ver_type values */
848enum {
849 FW_TYPE_HW = 0,
850 FW_TYPE_PROT = 1,
851 FW_TYPE_AP = 2,
852 FW_TYPE_WOWLAN = 3,
853 FW_TYPE_TIMING = 4,
854 FW_TYPE_WIPAN = 5
855};
856
857/* alive response ver_subtype values */
858enum {
859 FW_SUBTYPE_FULL_FEATURE = 0,
860 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
861 FW_SUBTYPE_REDUCED = 2,
862 FW_SUBTYPE_ALIVE_ONLY = 3,
863 FW_SUBTYPE_WOWLAN = 4,
864 FW_SUBTYPE_AP_SUBTYPE = 5,
865 FW_SUBTYPE_WIPAN = 6,
866 FW_SUBTYPE_INITIALIZE = 9
867};
868
869#define IWL_ALIVE_STATUS_ERR 0xDEAD
870#define IWL_ALIVE_STATUS_OK 0xCAFE
871
872#define IWL_ALIVE_FLG_RFKILL BIT(0)
873
Sara Sharon5c228d62016-11-24 13:48:27 +0200874struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200875 __le32 ucode_minor;
876 __le32 ucode_major;
877 u8 ver_subtype;
878 u8 ver_type;
879 u8 mac;
880 u8 opt;
881 __le32 timestamp;
882 __le32 error_event_table_ptr; /* SRAM address for error log */
883 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
884 __le32 cpu_register_ptr;
885 __le32 dbgm_config_ptr;
886 __le32 alive_counter_ptr;
887 __le32 scd_base_ptr; /* SRAM address for SCD */
888 __le32 st_fwrd_addr; /* pointer to Store and forward */
889 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +0200890} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
891
892struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200893 __le32 umac_minor; /* UMAC version: minor */
894 __le32 umac_major; /* UMAC version: major */
895 __le32 error_info_addr; /* SRAM address for UMAC error log */
896 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +0200897} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
898
899struct mvm_alive_resp_v3 {
900 __le16 status;
901 __le16 flags;
902 struct iwl_lmac_alive lmac_data;
903 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200904} __packed; /* ALIVE_RES_API_S_VER_3 */
905
Sara Sharon5c228d62016-11-24 13:48:27 +0200906struct mvm_alive_resp {
907 __le16 status;
908 __le16 flags;
909 struct iwl_lmac_alive lmac_data[2];
910 struct iwl_umac_alive umac_data;
911} __packed; /* ALIVE_RES_API_S_VER_4 */
912
Johannes Berg8ca151b2013-01-24 14:25:36 +0100913/* Error response/notification */
914enum {
915 FW_ERR_UNKNOWN_CMD = 0x0,
916 FW_ERR_INVALID_CMD_PARAM = 0x1,
917 FW_ERR_SERVICE = 0x2,
918 FW_ERR_ARC_MEMORY = 0x3,
919 FW_ERR_ARC_CODE = 0x4,
920 FW_ERR_WATCH_DOG = 0x5,
921 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
922 FW_ERR_WEP_KEY_SIZE = 0x11,
923 FW_ERR_OBSOLETE_FUNC = 0x12,
924 FW_ERR_UNEXPECTED = 0xFE,
925 FW_ERR_FATAL = 0xFF
926};
927
928/**
929 * struct iwl_error_resp - FW error indication
930 * ( REPLY_ERROR = 0x2 )
931 * @error_type: one of FW_ERR_*
932 * @cmd_id: the command ID for which the error occured
933 * @bad_cmd_seq_num: sequence number of the erroneous command
934 * @error_service: which service created the error, applicable only if
935 * error_type = 2, otherwise 0
936 * @timestamp: TSF in usecs.
937 */
938struct iwl_error_resp {
939 __le32 error_type;
940 u8 cmd_id;
941 u8 reserved1;
942 __le16 bad_cmd_seq_num;
943 __le32 error_service;
944 __le64 timestamp;
945} __packed;
946
947
948/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100949#define MAX_MACS_IN_BINDING (3)
950#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +0100951
Johannes Bergd69f0a22017-03-14 10:58:16 +0100952/**
953 * enum iwl_mvm_id_and_color - ID and color fields in context dword
954 * @FW_CTXT_ID_POS: position of the ID
955 * @FW_CTXT_ID_MSK: mask of the ID
956 * @FW_CTXT_COLOR_POS: position of the color
957 * @FW_CTXT_COLOR_MSK: mask of the color
958 * @FW_CTXT_INVALID: value used to indicate unused/invalid
959 */
960enum iwl_mvm_id_and_color {
961 FW_CTXT_ID_POS = 0,
962 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
963 FW_CTXT_COLOR_POS = 8,
964 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
965 FW_CTXT_INVALID = 0xffffffff,
966};
Johannes Berg8ca151b2013-01-24 14:25:36 +0100967
968#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
969 (_color << FW_CTXT_COLOR_POS))
970
971/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +0200972enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100973 FW_CTXT_ACTION_STUB = 0,
974 FW_CTXT_ACTION_ADD,
975 FW_CTXT_ACTION_MODIFY,
976 FW_CTXT_ACTION_REMOVE,
977 FW_CTXT_ACTION_NUM
978}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
979
980/* Time Events */
981
982/* Time Event types, according to MAC type */
983enum iwl_time_event_type {
984 /* BSS Station Events */
985 TE_BSS_STA_AGGRESSIVE_ASSOC,
986 TE_BSS_STA_ASSOC,
987 TE_BSS_EAP_DHCP_PROT,
988 TE_BSS_QUIET_PERIOD,
989
990 /* P2P Device Events */
991 TE_P2P_DEVICE_DISCOVERABLE,
992 TE_P2P_DEVICE_LISTEN,
993 TE_P2P_DEVICE_ACTION_SCAN,
994 TE_P2P_DEVICE_FULL_SCAN,
995
996 /* P2P Client Events */
997 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
998 TE_P2P_CLIENT_ASSOC,
999 TE_P2P_CLIENT_QUIET_PERIOD,
1000
1001 /* P2P GO Events */
1002 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02001003 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +01001004 TE_P2P_GO_CT_WINDOW,
1005
1006 /* WiDi Sync Events */
1007 TE_WIDI_TX_SYNC,
1008
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001009 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +03001010 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001011
Johannes Berg8ca151b2013-01-24 14:25:36 +01001012 TE_MAX
1013}; /* MAC_EVENT_TYPE_API_E_VER_1 */
1014
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001015
1016
1017/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001018
1019/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001020 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1021 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1022 * the first fragment is scheduled.
1023 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1024 * the first 2 fragments are scheduled.
1025 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1026 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001027 *
1028 * Other than the constant defined above, specifying a fragmentation value 'x'
1029 * means that the event can be fragmented but only the first 'x' will be
1030 * scheduled.
1031 */
1032enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001033 TE_V1_FRAG_NONE = 0,
1034 TE_V1_FRAG_SINGLE = 1,
1035 TE_V1_FRAG_DUAL = 2,
1036 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +01001037};
1038
Johannes Berg8ca151b2013-01-24 14:25:36 +01001039/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001040#define TE_V1_FRAG_MAX_MSK 0x0fffffff
1041/* Repeat the time event endlessly (until removed) */
1042#define TE_V1_REPEAT_ENDLESS 0xffffffff
1043/* If a Time Event has bounded repetitions, this is the maximal value */
1044#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1045
1046/* Time Event dependencies: none, on another TE, or in a specific time */
1047enum {
1048 TE_V1_INDEPENDENT = 0,
1049 TE_V1_DEP_OTHER = BIT(0),
1050 TE_V1_DEP_TSF = BIT(1),
1051 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1052}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1053
1054/*
1055 * @TE_V1_NOTIF_NONE: no notifications
1056 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1057 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1058 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1059 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1060 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1061 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1062 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1063 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1064 *
1065 * Supported Time event notifications configuration.
1066 * A notification (both event and fragment) includes a status indicating weather
1067 * the FW was able to schedule the event or not. For fragment start/end
1068 * notification the status is always success. There is no start/end fragment
1069 * notification for monolithic events.
1070 */
1071enum {
1072 TE_V1_NOTIF_NONE = 0,
1073 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1074 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1075 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1076 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1077 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1078 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1079 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1080 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1081}; /* MAC_EVENT_ACTION_API_E_VER_2 */
1082
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001083/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001084
1085/*
1086 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1087 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1088 * the first fragment is scheduled.
1089 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1090 * the first 2 fragments are scheduled.
1091 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1092 * number of fragments are valid.
1093 *
1094 * Other than the constant defined above, specifying a fragmentation value 'x'
1095 * means that the event can be fragmented but only the first 'x' will be
1096 * scheduled.
1097 */
1098enum {
1099 TE_V2_FRAG_NONE = 0,
1100 TE_V2_FRAG_SINGLE = 1,
1101 TE_V2_FRAG_DUAL = 2,
1102 TE_V2_FRAG_MAX = 0xfe,
1103 TE_V2_FRAG_ENDLESS = 0xff
1104};
1105
1106/* Repeat the time event endlessly (until removed) */
1107#define TE_V2_REPEAT_ENDLESS 0xff
1108/* If a Time Event has bounded repetitions, this is the maximal value */
1109#define TE_V2_REPEAT_MAX 0xfe
1110
1111#define TE_V2_PLACEMENT_POS 12
1112#define TE_V2_ABSENCE_POS 15
1113
Johannes Bergd69f0a22017-03-14 10:58:16 +01001114/**
1115 * enum iwl_time_event_policy - Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001116 * A notification (both event and fragment) includes a status indicating weather
1117 * the FW was able to schedule the event or not. For fragment start/end
1118 * notification the status is always success. There is no start/end fragment
1119 * notification for monolithic events.
1120 *
1121 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1122 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1123 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1124 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1125 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1126 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1127 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1128 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1129 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
Johannes Bergd69f0a22017-03-14 10:58:16 +01001130 * @T2_V2_START_IMMEDIATELY: start time event immediately
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001131 * @TE_V2_DEP_OTHER: depends on another time event
1132 * @TE_V2_DEP_TSF: depends on a specific time
1133 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1134 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1135 */
Johannes Bergd69f0a22017-03-14 10:58:16 +01001136enum iwl_time_event_policy {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001137 TE_V2_DEFAULT_POLICY = 0x0,
1138
1139 /* notifications (event start/stop, fragment start/stop) */
1140 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1141 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1142 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1143 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1144
1145 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1146 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1147 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1148 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +02001149 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001150
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001151 /* placement characteristics */
1152 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1153 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1154 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1155
1156 /* are we present or absent during the Time Event. */
1157 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1158};
1159
1160/**
Johannes Berg67625862017-03-14 11:01:27 +01001161 * struct iwl_time_event_cmd - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001162 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1163 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1164 * ( TIME_EVENT_CMD = 0x29 )
Johannes Berg67625862017-03-14 11:01:27 +01001165 * @id_and_color: ID and color of the relevant MAC,
1166 * &enum iwl_mvm_id_and_color
1167 * @action: action to perform, one of &enum iwl_phy_ctxt_action
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001168 * @id: this field has two meanings, depending on the action:
1169 * If the action is ADD, then it means the type of event to add.
1170 * For all other actions it is the unique event ID assigned when the
1171 * event was added by the FW.
1172 * @apply_time: When to start the Time Event (in GP2)
1173 * @max_delay: maximum delay to event's start (apply time), in TU
1174 * @depends_on: the unique ID of the event we depend on (if any)
1175 * @interval: interval between repetitions, in TU
1176 * @duration: duration of event in TU
1177 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1178 * @max_frags: maximal number of fragments the Time Event can be divided to
1179 * @policy: defines whether uCode shall notify the host or other uCode modules
1180 * on event and/or fragment start and/or end
1181 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1182 * TE_EVENT_SOCIOPATHIC
Johannes Berg67625862017-03-14 11:01:27 +01001183 * using TE_ABSENCE and using TE_NOTIF_*,
1184 * &enum iwl_time_event_policy
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001185 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001186struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001187 /* COMMON_INDEX_HDR_API_S_VER_1 */
1188 __le32 id_and_color;
1189 __le32 action;
1190 __le32 id;
1191 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1192 __le32 apply_time;
1193 __le32 max_delay;
1194 __le32 depends_on;
1195 __le32 interval;
1196 __le32 duration;
1197 u8 repeat;
1198 u8 max_frags;
1199 __le16 policy;
1200} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1201
Johannes Berg8ca151b2013-01-24 14:25:36 +01001202/**
1203 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1204 * @status: bit 0 indicates success, all others specify errors
1205 * @id: the Time Event type
1206 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
Johannes Berg67625862017-03-14 11:01:27 +01001207 * @id_and_color: ID and color of the relevant MAC,
1208 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001209 */
1210struct iwl_time_event_resp {
1211 __le32 status;
1212 __le32 id;
1213 __le32 unique_id;
1214 __le32 id_and_color;
1215} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1216
1217/**
1218 * struct iwl_time_event_notif - notifications of time event start/stop
1219 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1220 * @timestamp: action timestamp in GP2
1221 * @session_id: session's unique id
1222 * @unique_id: unique id of the Time Event itself
1223 * @id_and_color: ID and color of the relevant MAC
Johannes Berg67625862017-03-14 11:01:27 +01001224 * @action: &enum iwl_time_event_policy
Johannes Berg8ca151b2013-01-24 14:25:36 +01001225 * @status: true if scheduled, false otherwise (not executed)
1226 */
1227struct iwl_time_event_notif {
1228 __le32 timestamp;
1229 __le32 session_id;
1230 __le32 unique_id;
1231 __le32 id_and_color;
1232 __le32 action;
1233 __le32 status;
1234} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1235
1236
1237/* Bindings and Time Quota */
1238
1239/**
Johannes Berg4d151c22017-03-14 11:04:06 +01001240 * struct iwl_binding_cmd_v1 - configuring bindings
1241 * ( BINDING_CONTEXT_CMD = 0x2b )
1242 * @id_and_color: ID and color of the relevant Binding,
1243 * &enum iwl_mvm_id_and_color
1244 * @action: action to perform, one of FW_CTXT_ACTION_*
1245 * @macs: array of MAC id and colors which belong to the binding,
1246 * &enum iwl_mvm_id_and_color
1247 * @phy: PHY id and color which belongs to the binding,
1248 * &enum iwl_mvm_id_and_color
1249 */
1250struct iwl_binding_cmd_v1 {
1251 /* COMMON_INDEX_HDR_API_S_VER_1 */
1252 __le32 id_and_color;
1253 __le32 action;
1254 /* BINDING_DATA_API_S_VER_1 */
1255 __le32 macs[MAX_MACS_IN_BINDING];
1256 __le32 phy;
1257} __packed; /* BINDING_CMD_API_S_VER_1 */
1258
1259/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001260 * struct iwl_binding_cmd - configuring bindings
1261 * ( BINDING_CONTEXT_CMD = 0x2b )
Johannes Berg67625862017-03-14 11:01:27 +01001262 * @id_and_color: ID and color of the relevant Binding,
1263 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001264 * @action: action to perform, one of FW_CTXT_ACTION_*
1265 * @macs: array of MAC id and colors which belong to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001266 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001267 * @phy: PHY id and color which belongs to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001268 * &enum iwl_mvm_id_and_color
Sara Sharon9415af72016-11-17 13:57:32 +02001269 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001270 */
1271struct iwl_binding_cmd {
1272 /* COMMON_INDEX_HDR_API_S_VER_1 */
1273 __le32 id_and_color;
1274 __le32 action;
1275 /* BINDING_DATA_API_S_VER_1 */
1276 __le32 macs[MAX_MACS_IN_BINDING];
1277 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001278 __le32 lmac_id;
1279} __packed; /* BINDING_CMD_API_S_VER_2 */
1280
Johannes Berg4d151c22017-03-14 11:04:06 +01001281#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
Sara Sharon9415af72016-11-17 13:57:32 +02001282#define IWL_LMAC_24G_INDEX 0
1283#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001284
Ilan Peer35adfd62013-02-04 13:16:24 +02001285/* The maximal number of fragments in the FW's schedule session */
1286#define IWL_MVM_MAX_QUOTA 128
1287
Johannes Berg8ca151b2013-01-24 14:25:36 +01001288/**
1289 * struct iwl_time_quota_data - configuration of time quota per binding
Johannes Berg67625862017-03-14 11:01:27 +01001290 * @id_and_color: ID and color of the relevant Binding,
1291 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001292 * @quota: absolute time quota in TU. The scheduler will try to divide the
1293 * remainig quota (after Time Events) according to this quota.
1294 * @max_duration: max uninterrupted context duration in TU
1295 */
1296struct iwl_time_quota_data {
1297 __le32 id_and_color;
1298 __le32 quota;
1299 __le32 max_duration;
1300} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1301
1302/**
1303 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1304 * ( TIME_QUOTA_CMD = 0x2c )
1305 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001306 * Note: on non-CDB the fourth one is the auxilary mac and is
1307 * essentially zero.
1308 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001309 */
1310struct iwl_time_quota_cmd {
1311 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1312} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1313
1314
1315/* PHY context */
1316
1317/* Supported bands */
1318#define PHY_BAND_5 (0)
1319#define PHY_BAND_24 (1)
1320
1321/* Supported channel width, vary if there is VHT support */
1322#define PHY_VHT_CHANNEL_MODE20 (0x0)
1323#define PHY_VHT_CHANNEL_MODE40 (0x1)
1324#define PHY_VHT_CHANNEL_MODE80 (0x2)
1325#define PHY_VHT_CHANNEL_MODE160 (0x3)
1326
1327/*
1328 * Control channel position:
1329 * For legacy set bit means upper channel, otherwise lower.
1330 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1331 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1332 * center_freq
1333 * |
1334 * 40Mhz |_______|_______|
1335 * 80Mhz |_______|_______|_______|_______|
1336 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1337 * code 011 010 001 000 | 100 101 110 111
1338 */
1339#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1340#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1341#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1342#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1343#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1344#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1345#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1346#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1347
1348/*
1349 * @band: PHY_BAND_*
1350 * @channel: channel number
1351 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1352 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1353 */
1354struct iwl_fw_channel_info {
1355 u8 band;
1356 u8 channel;
1357 u8 width;
1358 u8 ctrl_pos;
1359} __packed;
1360
1361#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1362#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1363 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1364#define PHY_RX_CHAIN_VALID_POS (1)
1365#define PHY_RX_CHAIN_VALID_MSK \
1366 (0x7 << PHY_RX_CHAIN_VALID_POS)
1367#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1368#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1369 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1370#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1371#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1372 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1373#define PHY_RX_CHAIN_CNT_POS (10)
1374#define PHY_RX_CHAIN_CNT_MSK \
1375 (0x3 << PHY_RX_CHAIN_CNT_POS)
1376#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1377#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1378 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1379#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1380#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1381 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1382
1383/* TODO: fix the value, make it depend on firmware at runtime? */
1384#define NUM_PHY_CTX 3
1385
1386/* TODO: complete missing documentation */
1387/**
1388 * struct iwl_phy_context_cmd - config of the PHY context
1389 * ( PHY_CONTEXT_CMD = 0x8 )
1390 * @id_and_color: ID and color of the relevant Binding
1391 * @action: action to perform, one of FW_CTXT_ACTION_*
1392 * @apply_time: 0 means immediate apply and context switch.
1393 * other value means apply new params after X usecs
1394 * @tx_param_color: ???
1395 * @channel_info:
1396 * @txchain_info: ???
1397 * @rxchain_info: ???
1398 * @acquisition_data: ???
1399 * @dsp_cfg_flags: set to 0
1400 */
1401struct iwl_phy_context_cmd {
1402 /* COMMON_INDEX_HDR_API_S_VER_1 */
1403 __le32 id_and_color;
1404 __le32 action;
1405 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1406 __le32 apply_time;
1407 __le32 tx_param_color;
1408 struct iwl_fw_channel_info ci;
1409 __le32 txchain_info;
1410 __le32 rxchain_info;
1411 __le32 acquisition_data;
1412 __le32 dsp_cfg_flags;
1413} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1414
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001415/*
1416 * Aux ROC command
1417 *
1418 * Command requests the firmware to create a time event for a certain duration
1419 * and remain on the given channel. This is done by using the Aux framework in
1420 * the FW.
1421 * The command was first used for Hot Spot issues - but can be used regardless
1422 * to Hot Spot.
1423 *
1424 * ( HOT_SPOT_CMD 0x53 )
1425 *
1426 * @id_and_color: ID and color of the MAC
1427 * @action: action to perform, one of FW_CTXT_ACTION_*
1428 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1429 * event_unique_id should be the id of the time event assigned by ucode.
1430 * Otherwise ignore the event_unique_id.
1431 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1432 * activity.
1433 * @channel_info: channel info
1434 * @node_addr: Our MAC Address
1435 * @reserved: reserved for alignment
1436 * @apply_time: GP2 value to start (should always be the current GP2 value)
1437 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1438 * time by which start of the event is allowed to be postponed.
1439 * @duration: event duration in TU To calculate event duration:
1440 * timeEventDuration = min(duration, remainingQuota)
1441 */
1442struct iwl_hs20_roc_req {
1443 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1444 __le32 id_and_color;
1445 __le32 action;
1446 __le32 event_unique_id;
1447 __le32 sta_id_and_color;
1448 struct iwl_fw_channel_info channel_info;
1449 u8 node_addr[ETH_ALEN];
1450 __le16 reserved;
1451 __le32 apply_time;
1452 __le32 apply_time_max_delay;
1453 __le32 duration;
1454} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1455
1456/*
1457 * values for AUX ROC result values
1458 */
1459enum iwl_mvm_hot_spot {
1460 HOT_SPOT_RSP_STATUS_OK,
1461 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1462 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1463};
1464
1465/*
1466 * Aux ROC command response
1467 *
1468 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1469 * driver the uid of the timevent.
1470 *
1471 * ( HOT_SPOT_CMD 0x53 )
1472 *
1473 * @event_unique_id: Unique ID of time event assigned by ucode
1474 * @status: Return status 0 is success, all the rest used for specific errors
1475 */
1476struct iwl_hs20_roc_res {
1477 __le32 event_unique_id;
1478 __le32 status;
1479} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1480
Johannes Berg8ca151b2013-01-24 14:25:36 +01001481/**
1482 * struct iwl_radio_version_notif - information on the radio version
1483 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
1484 * @radio_flavor:
1485 * @radio_step:
1486 * @radio_dash:
1487 */
1488struct iwl_radio_version_notif {
1489 __le32 radio_flavor;
1490 __le32 radio_step;
1491 __le32 radio_dash;
1492} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1493
1494enum iwl_card_state_flags {
1495 CARD_ENABLED = 0x00,
1496 HW_CARD_DISABLED = 0x01,
1497 SW_CARD_DISABLED = 0x02,
1498 CT_KILL_CARD_DISABLED = 0x04,
1499 HALT_CARD_DISABLED = 0x08,
1500 CARD_DISABLED_MSK = 0x0f,
1501 CARD_IS_RX_ON = 0x10,
1502};
1503
1504/**
1505 * struct iwl_radio_version_notif - information on the radio version
1506 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1507 * @flags: %iwl_card_state_flags
1508 */
1509struct iwl_card_state_notif {
1510 __le32 flags;
1511} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1512
1513/**
Hila Gonend64048e2013-03-13 18:00:03 +02001514 * struct iwl_missed_beacons_notif - information on missed beacons
1515 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1516 * @mac_id: interface ID
1517 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1518 * beacons since last RX.
1519 * @consec_missed_beacons: number of consecutive missed beacons
1520 * @num_expected_beacons:
1521 * @num_recvd_beacons:
1522 */
1523struct iwl_missed_beacons_notif {
1524 __le32 mac_id;
1525 __le32 consec_missed_beacons_since_last_rx;
1526 __le32 consec_missed_beacons;
1527 __le32 num_expected_beacons;
1528 __le32 num_recvd_beacons;
1529} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1530
1531/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001532 * struct iwl_mfuart_load_notif - mfuart image version & status
1533 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1534 * @installed_ver: installed image version
1535 * @external_ver: external image version
1536 * @status: MFUART loading status
1537 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001538 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001539*/
1540struct iwl_mfuart_load_notif {
1541 __le32 installed_ver;
1542 __le32 external_ver;
1543 __le32 status;
1544 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001545 /* image size valid only in v2 of the command */
1546 __le32 image_size;
1547} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001548
1549/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001550 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1551 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1552 * @assert_id: mfuart assert id that cause the notif
1553 * @curr_reset_num: number of asserts since uptime
1554 * @index_num: current chunk id
1555 * @parts_num: total number of chunks
1556 * @data_size: number of data bytes sent
1557 * @data: data buffer
1558 */
1559struct iwl_mfu_assert_dump_notif {
1560 __le32 assert_id;
1561 __le32 curr_reset_num;
1562 __le16 index_num;
1563 __le16 parts_num;
1564 __le32 data_size;
1565 __le32 data[0];
1566} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1567
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001568#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001569#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001570
1571/**
1572 * struct iwl_mcast_filter_cmd - configure multicast filter.
1573 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1574 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1575 * to identify network interface adopted in host-device IF.
1576 * It is used by FW as index in array of addresses. This array has
1577 * MAX_PORT_ID_NUM members.
1578 * @count: Number of MAC addresses in the array
1579 * @pass_all: Set 1 to pass all multicast packets.
1580 * @bssid: current association BSSID.
1581 * @addr_list: Place holder for array of MAC addresses.
1582 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1583 */
1584struct iwl_mcast_filter_cmd {
1585 u8 filter_own;
1586 u8 port_id;
1587 u8 count;
1588 u8 pass_all;
1589 u8 bssid[6];
1590 u8 reserved[2];
1591 u8 addr_list[0];
1592} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1593
Eliad Pellerc87163b2014-01-08 10:11:11 +02001594#define MAX_BCAST_FILTERS 8
1595#define MAX_BCAST_FILTER_ATTRS 2
1596
1597/**
1598 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1599 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1600 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1601 * start of ip payload).
1602 */
1603enum iwl_mvm_bcast_filter_attr_offset {
1604 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1605 BCAST_FILTER_OFFSET_IP_END = 1,
1606};
1607
1608/**
1609 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1610 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1611 * @offset: starting offset of this pattern.
1612 * @val: value to match - big endian (MSB is the first
1613 * byte to match from offset pos).
1614 * @mask: mask to match (big endian).
1615 */
1616struct iwl_fw_bcast_filter_attr {
1617 u8 offset_type;
1618 u8 offset;
1619 __le16 reserved1;
1620 __be32 val;
1621 __be32 mask;
1622} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1623
1624/**
1625 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1626 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1627 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1628 */
1629enum iwl_mvm_bcast_filter_frame_type {
1630 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1631 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1632};
1633
1634/**
1635 * struct iwl_fw_bcast_filter - broadcast filter
1636 * @discard: discard frame (1) or let it pass (0).
1637 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
1638 * @num_attrs: number of valid attributes in this filter.
1639 * @attrs: attributes of this filter. a filter is considered matched
1640 * only when all its attributes are matched (i.e. AND relationship)
1641 */
1642struct iwl_fw_bcast_filter {
1643 u8 discard;
1644 u8 frame_type;
1645 u8 num_attrs;
1646 u8 reserved1;
1647 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1648} __packed; /* BCAST_FILTER_S_VER_1 */
1649
Sara Sharon3af512d62015-07-22 11:38:40 +03001650#define BA_WINDOW_STREAMS_MAX 16
1651#define BA_WINDOW_STATUS_TID_MSK 0x000F
1652#define BA_WINDOW_STATUS_STA_ID_POS 4
1653#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1654#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1655
1656/**
1657 * struct iwl_ba_window_status_notif - reordering window's status notification
1658 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1659 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1660 * @start_seq_num: the start sequence number of the bitmap
1661 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1662 */
1663struct iwl_ba_window_status_notif {
1664 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1665 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1666 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1667 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1668} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1669
Eliad Pellerc87163b2014-01-08 10:11:11 +02001670/**
1671 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1672 * @default_discard: default action for this mac (discard (1) / pass (0)).
1673 * @attached_filters: bitmap of relevant filters for this mac.
1674 */
1675struct iwl_fw_bcast_mac {
1676 u8 default_discard;
1677 u8 reserved1;
1678 __le16 attached_filters;
1679} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1680
1681/**
1682 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1683 * @disable: enable (0) / disable (1)
1684 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1685 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
1686 * @filters: broadcast filters
1687 * @macs: broadcast filtering configuration per-mac
1688 */
1689struct iwl_bcast_filter_cmd {
1690 u8 disable;
1691 u8 max_bcast_filters;
1692 u8 max_macs;
1693 u8 reserved1;
1694 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1695 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1696} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1697
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001698/*
1699 * enum iwl_mvm_marker_id - maker ids
1700 *
1701 * The ids for different type of markers to insert into the usniffer logs
1702 */
1703enum iwl_mvm_marker_id {
1704 MARKER_ID_TX_FRAME_LATENCY = 1,
1705}; /* MARKER_ID_API_E_VER_1 */
1706
1707/**
1708 * struct iwl_mvm_marker - mark info into the usniffer logs
1709 *
1710 * (MARKER_CMD = 0xcb)
1711 *
1712 * Mark the UTC time stamp into the usniffer logs together with additional
1713 * metadata, so the usniffer output can be parsed.
1714 * In the command response the ucode will return the GP2 time.
1715 *
1716 * @dw_len: The amount of dwords following this byte including this byte.
1717 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1718 * @reserved: reserved.
1719 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1720 * @metadata: additional meta data that will be written to the unsiffer log
1721 */
1722struct iwl_mvm_marker {
Johannes Berg1644be92017-05-16 13:21:52 +02001723 u8 dw_len;
1724 u8 marker_id;
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001725 __le16 reserved;
1726 __le64 timestamp;
1727 __le32 metadata[0];
1728} __packed; /* MARKER_API_S_VER_1 */
1729
Matti Gottlieb0becb372015-05-31 09:18:30 +03001730/*
1731 * enum iwl_dc2dc_config_id - flag ids
1732 *
1733 * Ids of dc2dc configuration flags
1734 */
1735enum iwl_dc2dc_config_id {
1736 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1737 DCDC_FREQ_TUNE_SET = 0x2,
1738}; /* MARKER_ID_API_E_VER_1 */
1739
1740/**
1741 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1742 *
1743 * (DC2DC_CONFIG_CMD = 0x83)
1744 *
1745 * Set/Get & configure dc2dc values.
1746 * The command always returns the current dc2dc values.
1747 *
1748 * @flags: set/get dc2dc
1749 * @enable_low_power_mode: not used.
1750 * @dc2dc_freq_tune0: frequency divider - digital domain
1751 * @dc2dc_freq_tune1: frequency divider - analog domain
1752 */
1753struct iwl_dc2dc_config_cmd {
1754 __le32 flags;
1755 __le32 enable_low_power_mode; /* not used */
1756 __le32 dc2dc_freq_tune0;
1757 __le32 dc2dc_freq_tune1;
1758} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1759
1760/**
1761 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1762 *
1763 * Current dc2dc values returned by the FW.
1764 *
1765 * @dc2dc_freq_tune0: frequency divider - digital domain
1766 * @dc2dc_freq_tune1: frequency divider - analog domain
1767 */
1768struct iwl_dc2dc_config_resp {
1769 __le32 dc2dc_freq_tune0;
1770 __le32 dc2dc_freq_tune1;
1771} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1772
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001773/***********************************
1774 * Smart Fifo API
1775 ***********************************/
1776/* Smart Fifo state */
1777enum iwl_sf_state {
1778 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1779 SF_FULL_ON,
1780 SF_UNINIT,
1781 SF_INIT_OFF,
1782 SF_HW_NUM_STATES
1783};
1784
1785/* Smart Fifo possible scenario */
1786enum iwl_sf_scenario {
1787 SF_SCENARIO_SINGLE_UNICAST,
1788 SF_SCENARIO_AGG_UNICAST,
1789 SF_SCENARIO_MULTICAST,
1790 SF_SCENARIO_BA_RESP,
1791 SF_SCENARIO_TX_RESP,
1792 SF_NUM_SCENARIO
1793};
1794
1795#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
1796#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
1797
1798/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02001799#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001800#define SF_W_MARK_MIMO2 8192
1801#define SF_W_MARK_MIMO3 6144
1802#define SF_W_MARK_LEGACY 4096
1803#define SF_W_MARK_SCAN 4096
1804
Eran Hararyf4a3ee42015-02-08 13:58:50 +02001805/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
1806#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1807#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1808#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1809#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1810#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
1811#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1812#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
1813#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
1814#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
1815#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
1816
1817/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001818#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1819#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1820#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1821#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1822#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
1823#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
1824#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
1825#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
1826#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
1827#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
1828
1829#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
1830
Eran Harary161bdb72014-07-27 08:03:06 +03001831#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
1832
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001833/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001834 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
1835 * @state: smart fifo state, types listed in &enum iwl_sf_state.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001836 * @watermark: Minimum allowed availabe free space in RXF for transient state.
1837 * @long_delay_timeouts: aging and idle timer values for each scenario
1838 * in long delay state.
1839 * @full_on_timeouts: timer values for each scenario in full on state.
1840 */
1841struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001842 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001843 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
1844 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1845 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1846} __packed; /* SF_CFG_API_S_VER_2 */
1847
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001848/***********************************
1849 * Location Aware Regulatory (LAR) API - MCC updates
1850 ***********************************/
1851
1852/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001853 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001854 * regulatory profile according to the given MCC (Mobile Country Code).
1855 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1856 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1857 * MCC in the cmd response will be the relevant MCC in the NVM.
1858 * @mcc: given mobile country code
1859 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1860 * @reserved: reserved for alignment
1861 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001862struct iwl_mcc_update_cmd_v1 {
1863 __le16 mcc;
1864 u8 source_id;
1865 u8 reserved;
1866} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
1867
1868/**
1869 * struct iwl_mcc_update_cmd - Request the device to update geographic
1870 * regulatory profile according to the given MCC (Mobile Country Code).
1871 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1872 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1873 * MCC in the cmd response will be the relevant MCC in the NVM.
1874 * @mcc: given mobile country code
1875 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1876 * @reserved: reserved for alignment
1877 * @key: integrity key for MCC API OEM testing
1878 * @reserved2: reserved
1879 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001880struct iwl_mcc_update_cmd {
1881 __le16 mcc;
1882 u8 source_id;
1883 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001884 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01001885 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001886} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001887
1888/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001889 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001890 * Contains the new channel control profile map, if changed, and the new MCC
1891 * (mobile country code).
1892 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02001893 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001894 * @mcc: the new applied MCC
1895 * @cap: capabilities for all channels which matches the MCC
1896 * @source_id: the MCC source, see iwl_mcc_source
1897 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1898 * channels, depending on platform)
1899 * @channels: channel control data map, DWORD for each channel. Only the first
1900 * 16bits are used.
1901 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001902struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001903 __le32 status;
1904 __le16 mcc;
1905 u8 cap;
1906 u8 source_id;
1907 __le32 n_channels;
1908 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001909} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
1910
1911/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001912 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001913 * Contains the new channel control profile map, if changed, and the new MCC
1914 * (mobile country code).
1915 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
1916 * @status: see &enum iwl_mcc_update_status
1917 * @mcc: the new applied MCC
1918 * @cap: capabilities for all channels which matches the MCC
1919 * @source_id: the MCC source, see iwl_mcc_source
1920 * @time: time elapsed from the MCC test start (in 30 seconds TU)
1921 * @reserved: reserved.
1922 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1923 * channels, depending on platform)
1924 * @channels: channel control data map, DWORD for each channel. Only the first
1925 * 16bits are used.
1926 */
1927struct iwl_mcc_update_resp {
1928 __le32 status;
1929 __le16 mcc;
1930 u8 cap;
1931 u8 source_id;
1932 __le16 time;
1933 __le16 reserved;
1934 __le32 n_channels;
1935 __le32 channels[0];
1936} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001937
1938/**
1939 * struct iwl_mcc_chub_notif - chub notifies of mcc change
1940 * (MCC_CHUB_UPDATE_CMD = 0xc9)
1941 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
1942 * the cellular and connectivity cores that gets updates of the mcc, and
1943 * notifies the ucode directly of any mcc change.
1944 * The ucode requests the driver to request the device to update geographic
1945 * regulatory profile according to the given MCC (Mobile Country Code).
1946 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1947 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1948 * MCC in the cmd response will be the relevant MCC in the NVM.
1949 * @mcc: given mobile country code
1950 * @source_id: identity of the change originator, see iwl_mcc_source
1951 * @reserved1: reserved for alignment
1952 */
1953struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01001954 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001955 u8 source_id;
1956 u8 reserved1;
1957} __packed; /* LAR_MCC_NOTIFY_S */
1958
1959enum iwl_mcc_update_status {
1960 MCC_RESP_NEW_CHAN_PROFILE,
1961 MCC_RESP_SAME_CHAN_PROFILE,
1962 MCC_RESP_INVALID,
1963 MCC_RESP_NVM_DISABLED,
1964 MCC_RESP_ILLEGAL,
1965 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001966 MCC_RESP_TEST_MODE_ACTIVE,
1967 MCC_RESP_TEST_MODE_NOT_ACTIVE,
1968 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001969};
1970
1971enum iwl_mcc_source {
1972 MCC_SOURCE_OLD_FW = 0,
1973 MCC_SOURCE_ME = 1,
1974 MCC_SOURCE_BIOS = 2,
1975 MCC_SOURCE_3G_LTE_HOST = 3,
1976 MCC_SOURCE_3G_LTE_DEVICE = 4,
1977 MCC_SOURCE_WIFI = 5,
1978 MCC_SOURCE_RESERVED = 6,
1979 MCC_SOURCE_DEFAULT = 7,
1980 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001981 MCC_SOURCE_MCC_API = 9,
1982 MCC_SOURCE_GET_CURRENT = 0x10,
1983 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001984};
1985
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001986/* DTS measurements */
1987
1988enum iwl_dts_measurement_flags {
1989 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
1990 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
1991};
1992
1993/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001994 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001995 *
Johannes Berg31a658b2017-03-09 15:56:57 +01001996 * @flags: indicates which measurements we want as specified in
1997 * &enum iwl_dts_measurement_flags
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001998 */
1999struct iwl_dts_measurement_cmd {
2000 __le32 flags;
2001} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2002
2003/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03002004* enum iwl_dts_control_measurement_mode - DTS measurement type
2005* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2006* back (latest value. Not waiting for new value). Use automatic
2007* SW DTS configuration.
2008* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2009* trigger DTS reading and provide read back temperature read
2010* when available.
2011* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2012* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2013* without measurement trigger.
2014*/
2015enum iwl_dts_control_measurement_mode {
2016 DTS_AUTOMATIC = 0,
2017 DTS_REQUEST_READ = 1,
2018 DTS_OVER_WRITE = 2,
2019 DTS_DIRECT_WITHOUT_MEASURE = 3,
2020};
2021
2022/**
2023* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2024* @DTS_USE_TOP: Top
2025* @DTS_USE_CHAIN_A: chain A
2026* @DTS_USE_CHAIN_B: chain B
2027* @DTS_USE_CHAIN_C: chain C
2028* @XTAL_TEMPERATURE - read temperature from xtal
2029*/
2030enum iwl_dts_used {
2031 DTS_USE_TOP = 0,
2032 DTS_USE_CHAIN_A = 1,
2033 DTS_USE_CHAIN_B = 2,
2034 DTS_USE_CHAIN_C = 3,
2035 XTAL_TEMPERATURE = 4,
2036};
2037
2038/**
2039* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2040* @DTS_BIT6_MODE: bit 6 mode
2041* @DTS_BIT8_MODE: bit 8 mode
2042*/
2043enum iwl_dts_bit_mode {
2044 DTS_BIT6_MODE = 0,
2045 DTS_BIT8_MODE = 1,
2046};
2047
2048/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002049 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
Arik Nemtsov78efc702015-10-06 12:22:47 +03002050 * @control_mode: see &enum iwl_dts_control_measurement_mode
2051 * @temperature: used when over write DTS mode is selected
2052 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2053 * @avg_factor: average factor to DTS in request DTS read mode
2054 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2055 * @step_duration: step duration for the DTS
2056 */
2057struct iwl_ext_dts_measurement_cmd {
2058 __le32 control_mode;
2059 __le32 temperature;
2060 __le32 sensor;
2061 __le32 avg_factor;
2062 __le32 bit_mode;
2063 __le32 step_duration;
2064} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2065
2066/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002067 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002068 *
2069 * @temp: the measured temperature
2070 * @voltage: the measured voltage
2071 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002072struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002073 __le32 temp;
2074 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002075} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2076
2077/**
2078 * struct iwl_dts_measurement_notif_v2 - measurements notification
2079 *
2080 * @temp: the measured temperature
2081 * @voltage: the measured voltage
2082 * @threshold_idx: the trip index that was crossed
2083 */
2084struct iwl_dts_measurement_notif_v2 {
2085 __le32 temp;
2086 __le32 voltage;
2087 __le32 threshold_idx;
2088} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002089
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02002090/**
2091 * struct ct_kill_notif - CT-kill entry notification
2092 *
2093 * @temperature: the current temperature in celsius
2094 * @reserved: reserved
2095 */
2096struct ct_kill_notif {
2097 __le16 temperature;
2098 __le16 reserved;
2099} __packed; /* GRP_PHY_CT_KILL_NTF */
2100
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002101/**
2102* enum ctdp_cmd_operation - CTDP command operations
2103* @CTDP_CMD_OPERATION_START: update the current budget
2104* @CTDP_CMD_OPERATION_STOP: stop ctdp
Chaya Rachel Ivgi3b9449b2017-05-08 15:14:01 +03002105* @CTDP_CMD_OPERATION_REPORT: get the average budget
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002106*/
2107enum iwl_mvm_ctdp_cmd_operation {
2108 CTDP_CMD_OPERATION_START = 0x1,
2109 CTDP_CMD_OPERATION_STOP = 0x2,
2110 CTDP_CMD_OPERATION_REPORT = 0x4,
2111};/* CTDP_CMD_OPERATION_TYPE_E */
2112
2113/**
2114 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2115 *
2116 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2117 * @budget: the budget in milliwatt
2118 * @window_size: defined in API but not used
2119 */
2120struct iwl_mvm_ctdp_cmd {
2121 __le32 operation;
2122 __le32 budget;
2123 __le32 window_size;
2124} __packed;
2125
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002126#define IWL_MAX_DTS_TRIPS 8
2127
2128/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002129 * struct temp_report_ths_cmd - set temperature thresholds
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002130 *
2131 * @num_temps: number of temperature thresholds passed
2132 * @thresholds: array with the thresholds to be configured
2133 */
2134struct temp_report_ths_cmd {
2135 __le32 num_temps;
2136 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2137} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2138
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002139/***********************************
2140 * TDLS API
2141 ***********************************/
2142
2143/* Type of TDLS request */
2144enum iwl_tdls_channel_switch_type {
2145 TDLS_SEND_CHAN_SW_REQ = 0,
2146 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2147 TDLS_MOVE_CH,
2148}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2149
2150/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002151 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002152 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2153 * received from peer
2154 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2155 * to the TDLS off-channel communication. For instance if the DTIM is
2156 * 200TU and the TDLS peer is to be given 25% of the time, the value
2157 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2158 * @switch_time: switch time the peer sent in its channel switch timing IE
Johannes Berg83b03192017-05-16 13:28:53 +02002159 * @switch_timeout: switch timeout the peer sent in its channel switch timing IE
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002160 */
2161struct iwl_tdls_channel_switch_timing {
2162 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2163 __le32 max_offchan_duration; /* given in micro-seconds */
2164 __le32 switch_time; /* given in micro-seconds */
2165 __le32 switch_timeout; /* given in micro-seconds */
2166} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2167
2168#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2169
2170/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002171 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002172 *
2173 * A template representing a TDLS channel-switch request or response frame
2174 *
2175 * @switch_time_offset: offset to the channel switch timing IE in the template
2176 * @tx_cmd: Tx parameters for the frame
2177 * @data: frame data
2178 */
2179struct iwl_tdls_channel_switch_frame {
2180 __le32 switch_time_offset;
2181 struct iwl_tx_cmd tx_cmd;
2182 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2183} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2184
2185/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002186 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002187 *
2188 * The command is sent to initiate a channel switch and also in response to
2189 * incoming TDLS channel-switch request/response packets from remote peers.
2190 *
2191 * @switch_type: see &enum iwl_tdls_channel_switch_type
2192 * @peer_sta_id: station id of TDLS peer
2193 * @ci: channel we switch to
2194 * @timing: timing related data for command
2195 * @frame: channel-switch request/response template, depending to switch_type
2196 */
2197struct iwl_tdls_channel_switch_cmd {
2198 u8 switch_type;
2199 __le32 peer_sta_id;
2200 struct iwl_fw_channel_info ci;
2201 struct iwl_tdls_channel_switch_timing timing;
2202 struct iwl_tdls_channel_switch_frame frame;
2203} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2204
2205/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002206 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002207 *
2208 * @status: non-zero on success
2209 * @offchannel_duration: duration given in microseconds
2210 * @sta_id: peer currently performing the channel-switch with
2211 */
2212struct iwl_tdls_channel_switch_notif {
2213 __le32 status;
2214 __le32 offchannel_duration;
2215 __le32 sta_id;
2216} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2217
Arik Nemtsov307e4722014-09-15 18:48:59 +03002218/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002219 * struct iwl_tdls_sta_info - TDLS station info
Arik Nemtsov307e4722014-09-15 18:48:59 +03002220 *
2221 * @sta_id: station id of the TDLS peer
2222 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2223 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2224 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2225 */
2226struct iwl_tdls_sta_info {
2227 u8 sta_id;
2228 u8 tx_to_peer_tid;
2229 __le16 tx_to_peer_ssn;
2230 __le32 is_initiator;
2231} __packed; /* TDLS_STA_INFO_VER_1 */
2232
2233/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002234 * struct iwl_tdls_config_cmd - TDLS basic config command
Arik Nemtsov307e4722014-09-15 18:48:59 +03002235 *
2236 * @id_and_color: MAC id and color being configured
2237 * @tdls_peer_count: amount of currently connected TDLS peers
2238 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2239 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2240 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2241 * @pti_req_data_offset: offset of network-level data for the PTI template
2242 * @pti_req_tx_cmd: Tx parameters for PTI request template
2243 * @pti_req_template: PTI request template data
2244 */
2245struct iwl_tdls_config_cmd {
2246 __le32 id_and_color; /* mac id and color */
2247 u8 tdls_peer_count;
2248 u8 tx_to_ap_tid;
2249 __le16 tx_to_ap_ssn;
2250 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2251
2252 __le32 pti_req_data_offset;
2253 struct iwl_tx_cmd pti_req_tx_cmd;
2254 u8 pti_req_template[0];
2255} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2256
2257/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002258 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
Arik Nemtsov307e4722014-09-15 18:48:59 +03002259 *
2260 * @sta_id: station id of the TDLS peer
2261 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2262 * the peer
2263 */
2264struct iwl_tdls_config_sta_info_res {
2265 __le16 sta_id;
2266 __le16 tx_to_peer_last_seq;
2267} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2268
2269/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002270 * struct iwl_tdls_config_res - TDLS config information from FW
Arik Nemtsov307e4722014-09-15 18:48:59 +03002271 *
2272 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2273 * @sta_info: per-station TDLS config information
2274 */
2275struct iwl_tdls_config_res {
2276 __le32 tx_to_ap_last_seq;
2277 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2278} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2279
Sara Sharondb06f042016-07-05 17:37:58 +03002280#define TX_FIFO_MAX_NUM_9000 8
2281#define TX_FIFO_MAX_NUM 15
2282#define RX_FIFO_MAX_NUM 2
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002283#define TX_FIFO_INTERNAL_MAX_NUM 6
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002284
2285/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002286 * struct iwl_shared_mem_cfg_v1 - Shared memory configuration information
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002287 *
2288 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2289 * accessible)
2290 * @shared_mem_size: shared memory size
2291 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2292 * 0x0 as accessible only via DBGM RDAT)
2293 * @sample_buff_size: internal sample buff size
2294 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2295 * 8000 HW set to 0x0 as not accessible)
2296 * @txfifo_size: size of TXF0 ... TXF7
2297 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2298 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2299 * when paging is not supported this should be 0
2300 * @page_buff_size: size of %page_buff_addr
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002301 * @rxfifo_addr: Start address of rxFifo
2302 * @internal_txfifo_addr: start address of internalFifo
2303 * @internal_txfifo_size: internal fifos' size
2304 *
2305 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2306 * set, the last 3 members don't exist.
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002307 */
Sara Sharondb06f042016-07-05 17:37:58 +03002308struct iwl_shared_mem_cfg_v1 {
2309 __le32 shared_mem_addr;
2310 __le32 shared_mem_size;
2311 __le32 sample_buff_addr;
2312 __le32 sample_buff_size;
2313 __le32 txfifo_addr;
2314 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2315 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2316 __le32 page_buff_addr;
2317 __le32 page_buff_size;
2318 __le32 rxfifo_addr;
2319 __le32 internal_txfifo_addr;
2320 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2321} __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2322
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002323/**
2324 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2325 *
2326 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2327 * @txfifo_size: size of TX FIFOs
2328 * @rxfifo1_addr: RXF1 addr
2329 * @rxfifo1_size: RXF1 size
2330 */
2331struct iwl_shared_mem_lmac_cfg {
2332 __le32 txfifo_addr;
2333 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2334 __le32 rxfifo1_addr;
2335 __le32 rxfifo1_size;
2336
2337} __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2338
2339/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002340 * struct iwl_shared_mem_cfg - Shared memory configuration information
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002341 *
2342 * @shared_mem_addr: shared memory address
2343 * @shared_mem_size: shared memory size
2344 * @sample_buff_addr: internal sample (mon/adc) buff addr
2345 * @sample_buff_size: internal sample buff size
2346 * @rxfifo2_addr: start addr of RXF2
2347 * @rxfifo2_size: size of RXF2
2348 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2349 * when paging is not supported this should be 0
2350 * @page_buff_size: size of %page_buff_addr
2351 * @lmac_num: number of LMACs (1 or 2)
2352 * @lmac_smem: per - LMAC smem data
2353 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002354struct iwl_shared_mem_cfg {
2355 __le32 shared_mem_addr;
2356 __le32 shared_mem_size;
2357 __le32 sample_buff_addr;
2358 __le32 sample_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002359 __le32 rxfifo2_addr;
2360 __le32 rxfifo2_size;
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002361 __le32 page_buff_addr;
2362 __le32 page_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002363 __le32 lmac_num;
2364 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
Sara Sharondb06f042016-07-05 17:37:58 +03002365} __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002366
Sara Sharona07a8f32015-11-15 11:11:59 +02002367/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002368 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
Sara Sharona07a8f32015-11-15 11:11:59 +02002369 *
2370 * @membership_status: a bitmap of MU groups
2371 * @user_position:the position of station in a group. If the station is in the
2372 * group then bits (group * 2) is the position -1
2373 */
2374struct iwl_mu_group_mgmt_cmd {
2375 __le32 reserved;
2376 __le32 membership_status[2];
2377 __le32 user_position[4];
2378} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2379
Sara Sharonf92659a2016-02-03 15:04:49 +02002380/**
2381 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2382 *
2383 * @membership_status: a bitmap of MU groups
2384 * @user_position: the position of station in a group. If the station is in the
2385 * group then bits (group * 2) is the position -1
2386 */
2387struct iwl_mu_group_mgmt_notif {
2388 __le32 membership_status[2];
2389 __le32 user_position[4];
2390} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2391
Sara Sharon0db056d2015-12-29 11:07:15 +02002392#define MAX_STORED_BEACON_SIZE 600
2393
2394/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002395 * struct iwl_stored_beacon_notif - Stored beacon notification
Sara Sharon0db056d2015-12-29 11:07:15 +02002396 *
2397 * @system_time: system time on air rise
2398 * @tsf: TSF on air rise
2399 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002400 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002401 * @channel: channel this beacon was received on
2402 * @rates: rate in ucode internal format
2403 * @byte_count: frame's byte count
2404 */
2405struct iwl_stored_beacon_notif {
2406 __le32 system_time;
2407 __le64 tsf;
2408 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002409 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002410 __le16 channel;
2411 __le32 rates;
2412 __le32 byte_count;
2413 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002414} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002415
Aviya Erenfeld03098262016-02-18 14:09:33 +02002416#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2417
2418enum iwl_lqm_cmd_operatrions {
2419 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2420 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2421};
2422
2423enum iwl_lqm_status {
2424 LQM_STATUS_SUCCESS = 0,
2425 LQM_STATUS_TIMEOUT = 1,
2426 LQM_STATUS_ABORT = 2,
2427};
2428
2429/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002430 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
Johannes Berg83b03192017-05-16 13:28:53 +02002431 * @cmd_operation: command operation to be performed (start or stop)
Aviya Erenfeld03098262016-02-18 14:09:33 +02002432 * as defined above.
2433 * @mac_id: MAC ID the measurement applies to.
2434 * @measurement_time: time of the total measurement to be performed, in uSec.
2435 * @timeout: maximum time allowed until a response is sent, in uSec.
2436 */
2437struct iwl_link_qual_msrmnt_cmd {
2438 __le32 cmd_operation;
2439 __le32 mac_id;
2440 __le32 measurement_time;
2441 __le32 timeout;
2442} __packed /* LQM_CMD_API_S_VER_1 */;
2443
2444/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002445 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
Aviya Erenfeld03098262016-02-18 14:09:33 +02002446 *
2447 * @frequent_stations_air_time: an array containing the total air time
2448 * (in uSec) used by the most frequently transmitting stations.
2449 * @number_of_stations: the number of uniqe stations included in the array
2450 * (a number between 0 to 16)
2451 * @total_air_time_other_stations: the total air time (uSec) used by all the
2452 * stations which are not included in the above report.
2453 * @time_in_measurement_window: the total time in uSec in which a measurement
2454 * took place.
2455 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2456 * measurement
2457 * @mac_id: MAC ID the measurement applies to.
2458 * @status: return status. may be one of the LQM_STATUS_* defined above.
2459 * @reserved: reserved.
2460 */
2461struct iwl_link_qual_msrmnt_notif {
2462 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2463 __le32 number_of_stations;
2464 __le32 total_air_time_other_stations;
2465 __le32 time_in_measurement_window;
2466 __le32 tx_frame_dropped;
2467 __le32 mac_id;
2468 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002469 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002470} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2471
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002472/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002473 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002474 *
2475 * @id_and_color: ID and color of the MAC
2476 */
2477struct iwl_channel_switch_noa_notif {
2478 __le32 id_and_color;
2479} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2480
Ido Yariv2b55f432016-08-23 14:44:59 -04002481/* Operation types for the debug mem access */
2482enum {
2483 DEBUG_MEM_OP_READ = 0,
2484 DEBUG_MEM_OP_WRITE = 1,
2485 DEBUG_MEM_OP_WRITE_BYTES = 2,
2486};
2487
2488#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2489
2490/**
2491 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2492 * @op: DEBUG_MEM_OP_*
2493 * @addr: address to read/write from/to
2494 * @len: in dwords, to read/write
2495 * @data: for write opeations, contains the source buffer
2496 */
2497struct iwl_dbg_mem_access_cmd {
2498 __le32 op;
2499 __le32 addr;
2500 __le32 len;
2501 __le32 data[];
2502} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2503
2504/* Status responses for the debug mem access */
2505enum {
2506 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2507 DEBUG_MEM_STATUS_FAILED = 0x1,
2508 DEBUG_MEM_STATUS_LOCKED = 0x2,
2509 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2510 DEBUG_MEM_STATUS_LENGTH = 0x4,
2511};
2512
2513/**
2514 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2515 * @status: DEBUG_MEM_STATUS_*
2516 * @len: read dwords (0 for write operations)
2517 * @data: contains the read DWs
2518 */
2519struct iwl_dbg_mem_access_rsp {
2520 __le32 status;
2521 __le32 len;
2522 __le32 data[];
2523} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2524
Sara Sharon1f370652016-08-31 18:13:57 +03002525/**
2526 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
2527 */
2528struct iwl_nvm_access_complete_cmd {
2529 __le32 reserved;
2530} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2531
Sara Sharon4399caa2016-12-11 10:32:42 +02002532/**
2533 * enum iwl_extended_cfg_flag - commands driver may send before
2534 * finishing init flow
2535 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2536 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2537 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2538 */
2539enum iwl_extended_cfg_flags {
2540 IWL_INIT_DEBUG_CFG,
2541 IWL_INIT_NVM,
2542 IWL_INIT_PHY,
2543};
2544
2545/**
2546 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2547 * before finishing init flows
2548 * @init_flags: values from iwl_extended_cfg_flags
2549 */
2550struct iwl_init_extended_cfg_cmd {
2551 __le32 init_flags;
2552} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2553
Sara Sharone9e1ba32017-01-08 16:46:14 +02002554/*
2555 * struct iwl_nvm_get_info - request to get NVM data
2556 */
2557struct iwl_nvm_get_info {
2558 __le32 reserved;
2559} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2560
2561/**
2562 * struct iwl_nvm_get_info_general - general NVM data
2563 * @flags: 1 - empty, 0 - valid
2564 * @nvm_version: nvm version
2565 * @board_type: board type
2566 */
2567struct iwl_nvm_get_info_general {
2568 __le32 flags;
2569 __le16 nvm_version;
2570 u8 board_type;
2571 u8 reserved;
2572} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2573
2574/**
2575 * struct iwl_nvm_get_info_sku - mac information
2576 * @enable_24g: band 2.4G enabled
2577 * @enable_5g: band 5G enabled
2578 * @enable_11n: 11n enabled
2579 * @enable_11ac: 11ac enabled
2580 * @mimo_disable: MIMO enabled
2581 * @ext_crypto: Extended crypto enabled
2582 */
2583struct iwl_nvm_get_info_sku {
2584 __le32 enable_24g;
2585 __le32 enable_5g;
2586 __le32 enable_11n;
2587 __le32 enable_11ac;
2588 __le32 mimo_disable;
2589 __le32 ext_crypto;
2590} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2591
2592/**
2593 * struct iwl_nvm_get_info_phy - phy information
2594 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2595 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2596 */
2597struct iwl_nvm_get_info_phy {
2598 __le32 tx_chains;
2599 __le32 rx_chains;
2600} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2601
2602#define IWL_NUM_CHANNELS (51)
2603
2604/**
2605 * struct iwl_nvm_get_info_regulatory - regulatory information
2606 * @lar_enabled: is LAR enabled
2607 * @channel_profile: regulatory data of this channel
Sara Sharone9e1ba32017-01-08 16:46:14 +02002608 */
2609struct iwl_nvm_get_info_regulatory {
2610 __le32 lar_enabled;
2611 __le16 channel_profile[IWL_NUM_CHANNELS];
2612 __le16 reserved;
2613} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2614
2615/**
2616 * struct iwl_nvm_get_info_rsp - response to get NVM data
2617 * @general: general NVM data
2618 * @mac_sku: data relating to MAC sku
2619 * @phy_sku: data relating to PHY sku
2620 * @regulatory: regulatory data
2621 */
2622struct iwl_nvm_get_info_rsp {
2623 struct iwl_nvm_get_info_general general;
2624 struct iwl_nvm_get_info_sku mac_sku;
2625 struct iwl_nvm_get_info_phy phy_sku;
2626 struct iwl_nvm_get_info_regulatory regulatory;
2627} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2628
Johannes Berg15fc1962017-03-10 14:01:42 +01002629/**
2630 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2631 * @isolation: antenna isolation value
2632 */
2633struct iwl_mvm_antenna_coupling_notif {
2634 __le32 isolation;
2635} __packed;
2636
Johannes Berg8ca151b2013-01-24 14:25:36 +01002637#endif /* __fw_api_h__ */