blob: 612546334545c3d384fe18a46ed57f897ddf1b53 [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,
298 SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
David Spinadel35a000b2013-08-28 09:29:43 +0300299 MATCH_FOUND_NOTIFICATION = 0xd9,
David Spinadelfb98be52014-05-04 12:51:10 +0300300 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100301
302 /* Phy */
Johannes Berg15fc1962017-03-10 14:01:42 +0100303 /**
304 * @PHY_CONFIGURATION_CMD: &struct iwl_phy_cfg_cmd
305 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100306 PHY_CONFIGURATION_CMD = 0x6a,
307 CALIB_RES_NOTIF_PHY_DB = 0x6b,
Sara Sharon176aa602016-08-31 19:03:01 +0300308 PHY_DB_CMD = 0x6c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100309
Gregory Greenmance792912015-06-02 18:06:16 +0300310 /* ToF - 802.11mc FTM */
311 TOF_CMD = 0x10,
312 TOF_NOTIFICATION = 0x11,
313
Johannes Berg15fc1962017-03-10 14:01:42 +0100314 /**
315 * @POWER_TABLE_CMD: &struct iwl_device_power_cmd
316 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100317 POWER_TABLE_CMD = 0x77,
Alexander Bondar175a70b2013-04-14 20:59:37 +0300318 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300319 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100320
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300321 /* Thermal Throttling*/
322 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
323
Matti Gottlieb0becb372015-05-31 09:18:30 +0300324 /* Set/Get DC2DC frequency tune */
325 DC2DC_CONFIG_CMD = 0x83,
326
Johannes Berg15fc1962017-03-10 14:01:42 +0100327 /**
328 * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd
329 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100330 NVM_ACCESS_CMD = 0x88,
331
332 SET_CALIB_DEFAULT_CMD = 0x8e,
333
Ilan Peer571765c2013-03-05 15:26:03 +0200334 BEACON_NOTIFICATION = 0x90,
Johannes Bergb7bea642017-03-31 10:48:17 +0200335 /**
336 * @BEACON_TEMPLATE_CMD:
337 * Uses one of &struct iwl_mac_beacon_cmd_v6,
338 * &struct iwl_mac_beacon_cmd_v7 or &struct iwl_mac_beacon_cmd
339 * depending on the device version.
340 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100341 BEACON_TEMPLATE_CMD = 0x91,
Johannes Berg15fc1962017-03-10 14:01:42 +0100342 /**
343 * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
344 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100345 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg15fc1962017-03-10 14:01:42 +0100346
347 /**
348 * @STATISTICS_CMD: &struct iwl_statistics_cmd
349 */
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100350 STATISTICS_CMD = 0x9c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100351
352 /**
353 * @STATISTICS_NOTIFICATION:
354 * one of &struct iwl_notif_statistics_v10,
355 * &struct iwl_notif_statistics_v11,
356 * &struct iwl_notif_statistics_cdb
357 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100358 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg3e56ead2013-02-15 22:23:18 +0100359 EOSP_NOTIFICATION = 0x9e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100360
361 /**
362 * @REDUCE_TX_POWER_CMD:
363 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
364 */
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300365 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100366
367 /* RF-KILL commands and notifications */
368 CARD_STATE_CMD = 0xa0,
369 CARD_STATE_NOTIFICATION = 0xa1,
370
Hila Gonend64048e2013-03-13 18:00:03 +0200371 MISSED_BEACONS_NOTIFICATION = 0xa2,
372
Johannes Berg15fc1962017-03-10 14:01:42 +0100373 /**
374 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
375 */
Alexander Bondare811ada2013-03-10 15:29:44 +0200376 MAC_PM_POWER_TABLE = 0xa9,
377
Johannes Berg15fc1962017-03-10 14:01:42 +0100378 /**
379 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
380 */
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200381 MFUART_LOAD_NOTIFICATION = 0xb1,
382
Johannes Berg15fc1962017-03-10 14:01:42 +0100383 /**
384 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
385 */
Sara Sharon43413a92015-12-31 11:49:18 +0200386 RSS_CONFIG_CMD = 0xb3,
387
Johannes Berg6857df82017-03-15 14:06:53 +0100388 /**
389 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
390 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100391 REPLY_RX_PHY_CMD = 0xc0,
Johannes Berg6857df82017-03-15 14:06:53 +0100392
393 /**
394 * @REPLY_RX_MPDU_CMD:
395 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
396 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100397 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg13555e82015-09-02 16:16:49 +0200398 FRAME_RELEASE = 0xc3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100399 BA_NOTIF = 0xc5,
400
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200401 /* Location Aware Regulatory */
Johannes Berg15fc1962017-03-10 14:01:42 +0100402 /**
403 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
404 */
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200405 MCC_UPDATE_CMD = 0xc8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100406
407 /**
408 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
409 */
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200410 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200411
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300412 MARKER_CMD = 0xcb,
413
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200414 /* BT Coex */
415 BT_COEX_PRIO_TABLE = 0xcc,
416 BT_COEX_PROT_ENV = 0xcd,
Johannes Berg15fc1962017-03-10 14:01:42 +0100417 /**
418 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
419 */
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200420 BT_PROFILE_NOTIFICATION = 0xce,
Johannes Berg15fc1962017-03-10 14:01:42 +0100421 /**
422 * @BT_CONFIG: &struct iwl_bt_coex_cmd
423 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300424 BT_CONFIG = 0x9b,
425 BT_COEX_UPDATE_SW_BOOST = 0x5a,
426 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
427 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100428 /**
429 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
430 */
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300431 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200432
Johannes Berg15fc1962017-03-10 14:01:42 +0100433 /**
434 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
435 */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200436 REPLY_SF_CFG_CMD = 0xd1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100437 /**
438 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
439 */
Hila Gonen7df15b12012-12-12 11:16:19 +0200440 REPLY_BEACON_FILTERING_CMD = 0xd2,
441
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300442 /* DTS measurements */
443 CMD_DTS_MEASUREMENT_TRIGGER = 0xdc,
444 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
445
Johannes Berg8ca151b2013-01-24 14:25:36 +0100446 REPLY_DEBUG_CMD = 0xf0,
Golan Ben Ami321c2102015-07-27 17:02:35 +0300447 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100448 DEBUG_LOG_MSG = 0xf7,
449
Eliad Pellerc87163b2014-01-08 10:11:11 +0200450 BCAST_FILTER_CMD = 0xcf,
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300451 MCAST_FILTER_CMD = 0xd0,
452
Johannes Berg15fc1962017-03-10 14:01:42 +0100453 /**
454 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
455 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100456 D3_CONFIG_CMD = 0xd3,
457 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
458 OFFLOADS_QUERY_CMD = 0xd5,
459 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300460 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100461
Johannes Berg15fc1962017-03-10 14:01:42 +0100462 /**
463 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
464 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100465 WOWLAN_PATTERNS = 0xe0,
Johannes Berg15fc1962017-03-10 14:01:42 +0100466
467 /**
468 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
469 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100470 WOWLAN_CONFIGURATION = 0xe1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100471 /**
472 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
473 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100474 WOWLAN_TSC_RSC_PARAM = 0xe2,
Johannes Berg15fc1962017-03-10 14:01:42 +0100475 /**
476 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
477 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100478 WOWLAN_TKIP_PARAM = 0xe3,
Johannes Berg15fc1962017-03-10 14:01:42 +0100479 /**
480 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
481 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100482 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
Johannes Berg15fc1962017-03-10 14:01:42 +0100483 /**
484 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
485 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100486 WOWLAN_GET_STATUSES = 0xe5,
487 WOWLAN_TX_POWER_PER_DB = 0xe6,
488
489 /* and for NetDetect */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200490 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
491 SCAN_OFFLOAD_HOTSPOTS_CONFIG_CMD = 0x58,
492 SCAN_OFFLOAD_HOTSPOTS_QUERY_CMD = 0x59,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100493};
494
Sharon Dvir39bdb172015-10-15 18:18:09 +0300495/* Please keep this enum *SORTED* by hex value.
496 * Needed for binary search, otherwise a warning will be triggered.
497 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200498enum iwl_mac_conf_subcmd_ids {
499 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
500 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200501 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200502};
503
Johannes Berg15fc1962017-03-10 14:01:42 +0100504/**
505 * enum iwl_phy_ops_subcmd_ids - PHY group commands
506 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300507enum iwl_phy_ops_subcmd_ids {
508 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200509 CTDP_CONFIG_CMD = 0x03,
Johannes Berg15fc1962017-03-10 14:01:42 +0100510
511 /**
512 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
513 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200514 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200515 GEO_TX_POWER_LIMIT = 0x05,
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200516 CT_KILL_NOTIFICATION = 0xFE,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300517 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
518};
519
Johannes Berg15fc1962017-03-10 14:01:42 +0100520/**
521 * enum iwl_system_subcmd_ids - system group command IDs
522 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200523enum iwl_system_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100524 /**
525 * @SHARED_MEM_CFG_CMD:
526 * response in &struct iwl_shared_mem_cfg or
527 * &struct iwl_shared_mem_cfg_v1
528 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200529 SHARED_MEM_CFG_CMD = 0x0,
Sara Sharon4399caa2016-12-11 10:32:42 +0200530 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200531};
532
Johannes Berg15fc1962017-03-10 14:01:42 +0100533/**
534 * enum iwl_data_path_subcmd_ids - data path group commands
535 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200536enum iwl_data_path_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100537 /**
538 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
539 */
Liad Kaufman97d5be72015-08-31 14:33:23 +0300540 DQA_ENABLE_CMD = 0x0,
Sara Sharona07a8f32015-11-15 11:11:59 +0200541 UPDATE_MU_GROUPS_CMD = 0x1,
Sara Sharon94bb4482015-12-16 18:48:28 +0200542 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg65e25482016-04-13 14:24:22 +0200543 STA_PM_NOTIF = 0xFD,
Sara Sharonf92659a2016-02-03 15:04:49 +0200544 MU_GROUP_MGMT_NOTIF = 0xFE,
Sara Sharon94bb4482015-12-16 18:48:28 +0200545 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200546};
547
Sara Sharon0db056d2015-12-29 11:07:15 +0200548enum iwl_prot_offload_subcmd_ids {
549 STORED_BEACON_NTF = 0xFF,
550};
551
Sara Sharon1f370652016-08-31 18:13:57 +0300552enum iwl_regulatory_and_nvm_subcmd_ids {
553 NVM_ACCESS_COMPLETE = 0x0,
Sara Sharone9e1ba32017-01-08 16:46:14 +0200554 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300555};
556
Johannes Berge6138c92017-05-04 10:00:03 +0200557/**
558 * enum iwl_debug_cmds - debug commands
559 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200560enum iwl_debug_cmds {
Johannes Berge6138c92017-05-04 10:00:03 +0200561 /**
562 * @LMAC_RD_WR:
563 * LMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
564 * &struct iwl_dbg_mem_access_rsp
565 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400566 LMAC_RD_WR = 0x0,
Johannes Berge6138c92017-05-04 10:00:03 +0200567 /**
568 * @UMAC_RD_WR:
569 * UMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
570 * &struct iwl_dbg_mem_access_rsp
571 */
Ido Yariv2b55f432016-08-23 14:44:59 -0400572 UMAC_RD_WR = 0x1,
Johannes Berge6138c92017-05-04 10:00:03 +0200573 /**
574 * @MFU_ASSERT_DUMP_NTF:
575 * &struct iwl_mfu_assert_dump_notif
576 */
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200577 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400578};
579
Johannes Berg72361c32017-03-09 17:06:45 +0100580/**
581 * enum iwl_mvm_command_groups - command groups for the firmware
582 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
583 * @LONG_GROUP: legacy group with long header, also uses command IDs
584 * from &enum iwl_legacy_cmds
585 * @SYSTEM_GROUP: system group, uses command IDs from
586 * &enum iwl_system_subcmd_ids
587 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
588 * &enum iwl_mac_conf_subcmd_ids
589 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
590 * &enum iwl_phy_ops_subcmd_ids
591 * @DATA_PATH_GROUP: data path group, uses command IDs from
592 * &enum iwl_data_path_subcmd_ids
Johannes Berg72361c32017-03-09 17:06:45 +0100593 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
594 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
595 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
596 * &enum iwl_prot_offload_subcmd_ids
597 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
598 * &enum iwl_regulatory_and_nvm_subcmd_ids
599 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
600 */
601enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300602 LEGACY_GROUP = 0x0,
603 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200604 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200605 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300606 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200607 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200608 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300609 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400610 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300611};
612
Johannes Berg8ca151b2013-01-24 14:25:36 +0100613/**
614 * struct iwl_cmd_response - generic response struct for most commands
615 * @status: status of the command asked, changes for each one
616 */
617struct iwl_cmd_response {
618 __le32 status;
619};
620
621/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300622 * struct iwl_dqa_enable_cmd
623 * @cmd_queue: the TXQ number of the command queue
624 */
625struct iwl_dqa_enable_cmd {
626 __le32 cmd_queue;
627} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
628
629/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100630 * struct iwl_tx_ant_cfg_cmd
631 * @valid: valid antenna configuration
632 */
633struct iwl_tx_ant_cfg_cmd {
634 __le32 valid;
635} __packed;
636
Johannes Berg31a658b2017-03-09 15:56:57 +0100637/**
638 * struct iwl_calib_ctrl - Calibration control struct.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100639 * Sent as part of the phy configuration command.
640 * @flow_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100641 * flow triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100642 * @event_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100643 * event triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100644 */
645struct iwl_calib_ctrl {
646 __le32 flow_trigger;
647 __le32 event_trigger;
648} __packed;
649
650/* This enum defines the bitmap of various calibrations to enable in both
651 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
652 */
653enum iwl_calib_cfg {
654 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
655 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
656 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
657 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
658 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
659 IWL_CALIB_CFG_DC_IDX = BIT(5),
660 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
661 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
662 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
663 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
664 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
665 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
666 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
667 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
668 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
669 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
670 IWL_CALIB_CFG_DAC_IDX = BIT(16),
671 IWL_CALIB_CFG_ABS_IDX = BIT(17),
672 IWL_CALIB_CFG_AGC_IDX = BIT(18),
673};
674
Johannes Berg31a658b2017-03-09 15:56:57 +0100675/**
676 * struct iwl_phy_cfg_cmd - Phy configuration command
677 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
678 * @calib_control: calibration control data
Johannes Berg8ca151b2013-01-24 14:25:36 +0100679 */
680struct iwl_phy_cfg_cmd {
681 __le32 phy_cfg;
682 struct iwl_calib_ctrl calib_control;
683} __packed;
684
685#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
686#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
687#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
688#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
689#define PHY_CFG_TX_CHAIN_A BIT(8)
690#define PHY_CFG_TX_CHAIN_B BIT(9)
691#define PHY_CFG_TX_CHAIN_C BIT(10)
692#define PHY_CFG_RX_CHAIN_A BIT(12)
693#define PHY_CFG_RX_CHAIN_B BIT(13)
694#define PHY_CFG_RX_CHAIN_C BIT(14)
695
696
Johannes Bergd69f0a22017-03-14 10:58:16 +0100697/**
698 * enum iwl_nvm_access_op - NVM access opcode
699 * @IWL_NVM_READ: read NVM
700 * @IWL_NVM_WRITE: write NVM
701 */
702enum iwl_nvm_access_op {
703 IWL_NVM_READ = 0,
704 IWL_NVM_WRITE = 1,
705};
706
707/**
708 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
709 * @NVM_ACCESS_TARGET_CACHE: access the cache
710 * @NVM_ACCESS_TARGET_OTP: access the OTP
711 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
712 */
713enum iwl_nvm_access_target {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100714 NVM_ACCESS_TARGET_CACHE = 0,
715 NVM_ACCESS_TARGET_OTP = 1,
716 NVM_ACCESS_TARGET_EEPROM = 2,
717};
718
Johannes Bergd69f0a22017-03-14 10:58:16 +0100719/**
720 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
721 * @NVM_SECTION_TYPE_SW: software section
722 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
723 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
724 * @NVM_SECTION_TYPE_PRODUCTION: production section
725 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
726 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
727 * @NVM_MAX_NUM_SECTIONS: number of sections
728 */
729enum iwl_nvm_section_type {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200730 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200731 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200732 NVM_SECTION_TYPE_CALIBRATION = 4,
733 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200734 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200735 NVM_SECTION_TYPE_PHY_SKU = 12,
736 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100737};
738
739/**
Johannes Berg67625862017-03-14 11:01:27 +0100740 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
741 * @op_code: &enum iwl_nvm_access_op
742 * @target: &enum iwl_nvm_access_target
743 * @type: &enum iwl_nvm_section_type
Johannes Berg8ca151b2013-01-24 14:25:36 +0100744 * @offset: offset in bytes into the section
745 * @length: in bytes, to read/write
746 * @data: if write operation, the data to write. On read its empty
747 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200748struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100749 u8 op_code;
750 u8 target;
751 __le16 type;
752 __le16 offset;
753 __le16 length;
754 u8 data[];
755} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
756
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300757#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
758
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100759/**
760 * struct iwl_fw_paging_cmd_v1 - paging layout
761 *
762 * (FW_PAGING_BLOCK_CMD = 0x4f)
763 *
764 * Send to FW the paging layout in the driver.
765 *
766 * @flags: various flags for the command
767 * @block_size: the block size in powers of 2
768 * @block_num: number of blocks specified in the command.
769 * @device_phy_addr: virtual addresses from device side
770 */
771struct iwl_fw_paging_cmd_v1 {
772 __le32 flags;
773 __le32 block_size;
774 __le32 block_num;
775 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
776} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
777
778/**
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300779 * struct iwl_fw_paging_cmd - paging layout
780 *
781 * (FW_PAGING_BLOCK_CMD = 0x4f)
782 *
783 * Send to FW the paging layout in the driver.
784 *
785 * @flags: various flags for the command
786 * @block_size: the block size in powers of 2
787 * @block_num: number of blocks specified in the command.
788 * @device_phy_addr: virtual addresses from device side
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100789 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300790struct iwl_fw_paging_cmd {
791 __le32 flags;
792 __le32 block_size;
793 __le32 block_num;
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100794 __le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
Sara Sharond975d722016-07-04 11:52:07 +0300795} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300796
Matti Gottliebe1120182015-07-19 11:15:07 +0300797/*
798 * Fw items ID's
799 *
800 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
801 * download
802 */
803enum iwl_fw_item_id {
804 IWL_FW_ITEM_ID_PAGING = 3,
805};
806
807/*
808 * struct iwl_fw_get_item_cmd - get an item from the fw
809 */
810struct iwl_fw_get_item_cmd {
811 __le32 item_id;
812} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
813
Golan Ben Ami321c2102015-07-27 17:02:35 +0300814#define CONT_REC_COMMAND_SIZE 80
815#define ENABLE_CONT_RECORDING 0x15
816#define DISABLE_CONT_RECORDING 0x16
817
818/*
819 * struct iwl_continuous_record_mode - recording mode
820 */
821struct iwl_continuous_record_mode {
822 __le16 enable_recording;
823} __packed;
824
825/*
826 * struct iwl_continuous_record_cmd - enable/disable continuous recording
827 */
828struct iwl_continuous_record_cmd {
829 struct iwl_continuous_record_mode record_mode;
830 u8 pad[CONT_REC_COMMAND_SIZE -
831 sizeof(struct iwl_continuous_record_mode)];
832} __packed;
833
Matti Gottliebe1120182015-07-19 11:15:07 +0300834struct iwl_fw_get_item_resp {
835 __le32 item_id;
836 __le32 item_byte_cnt;
837 __le32 item_val;
838} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
839
Johannes Berg8ca151b2013-01-24 14:25:36 +0100840/**
841 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
842 * @offset: offset in bytes into the section
843 * @length: in bytes, either how much was written or read
844 * @type: NVM_SECTION_TYPE_*
845 * @status: 0 for success, fail otherwise
846 * @data: if read operation, the data returned. Empty on write.
847 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200848struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100849 __le16 offset;
850 __le16 length;
851 __le16 type;
852 __le16 status;
853 u8 data[];
854} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
855
856/* MVM_ALIVE 0x1 */
857
858/* alive response is_valid values */
859#define ALIVE_RESP_UCODE_OK BIT(0)
860#define ALIVE_RESP_RFKILL BIT(1)
861
862/* alive response ver_type values */
863enum {
864 FW_TYPE_HW = 0,
865 FW_TYPE_PROT = 1,
866 FW_TYPE_AP = 2,
867 FW_TYPE_WOWLAN = 3,
868 FW_TYPE_TIMING = 4,
869 FW_TYPE_WIPAN = 5
870};
871
872/* alive response ver_subtype values */
873enum {
874 FW_SUBTYPE_FULL_FEATURE = 0,
875 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
876 FW_SUBTYPE_REDUCED = 2,
877 FW_SUBTYPE_ALIVE_ONLY = 3,
878 FW_SUBTYPE_WOWLAN = 4,
879 FW_SUBTYPE_AP_SUBTYPE = 5,
880 FW_SUBTYPE_WIPAN = 6,
881 FW_SUBTYPE_INITIALIZE = 9
882};
883
884#define IWL_ALIVE_STATUS_ERR 0xDEAD
885#define IWL_ALIVE_STATUS_OK 0xCAFE
886
887#define IWL_ALIVE_FLG_RFKILL BIT(0)
888
Sara Sharon5c228d62016-11-24 13:48:27 +0200889struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200890 __le32 ucode_minor;
891 __le32 ucode_major;
892 u8 ver_subtype;
893 u8 ver_type;
894 u8 mac;
895 u8 opt;
896 __le32 timestamp;
897 __le32 error_event_table_ptr; /* SRAM address for error log */
898 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
899 __le32 cpu_register_ptr;
900 __le32 dbgm_config_ptr;
901 __le32 alive_counter_ptr;
902 __le32 scd_base_ptr; /* SRAM address for SCD */
903 __le32 st_fwrd_addr; /* pointer to Store and forward */
904 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +0200905} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
906
907struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200908 __le32 umac_minor; /* UMAC version: minor */
909 __le32 umac_major; /* UMAC version: major */
910 __le32 error_info_addr; /* SRAM address for UMAC error log */
911 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +0200912} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
913
914struct mvm_alive_resp_v3 {
915 __le16 status;
916 __le16 flags;
917 struct iwl_lmac_alive lmac_data;
918 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200919} __packed; /* ALIVE_RES_API_S_VER_3 */
920
Sara Sharon5c228d62016-11-24 13:48:27 +0200921struct mvm_alive_resp {
922 __le16 status;
923 __le16 flags;
924 struct iwl_lmac_alive lmac_data[2];
925 struct iwl_umac_alive umac_data;
926} __packed; /* ALIVE_RES_API_S_VER_4 */
927
Johannes Berg8ca151b2013-01-24 14:25:36 +0100928/* Error response/notification */
929enum {
930 FW_ERR_UNKNOWN_CMD = 0x0,
931 FW_ERR_INVALID_CMD_PARAM = 0x1,
932 FW_ERR_SERVICE = 0x2,
933 FW_ERR_ARC_MEMORY = 0x3,
934 FW_ERR_ARC_CODE = 0x4,
935 FW_ERR_WATCH_DOG = 0x5,
936 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
937 FW_ERR_WEP_KEY_SIZE = 0x11,
938 FW_ERR_OBSOLETE_FUNC = 0x12,
939 FW_ERR_UNEXPECTED = 0xFE,
940 FW_ERR_FATAL = 0xFF
941};
942
943/**
944 * struct iwl_error_resp - FW error indication
945 * ( REPLY_ERROR = 0x2 )
946 * @error_type: one of FW_ERR_*
947 * @cmd_id: the command ID for which the error occured
948 * @bad_cmd_seq_num: sequence number of the erroneous command
949 * @error_service: which service created the error, applicable only if
950 * error_type = 2, otherwise 0
951 * @timestamp: TSF in usecs.
952 */
953struct iwl_error_resp {
954 __le32 error_type;
955 u8 cmd_id;
956 u8 reserved1;
957 __le16 bad_cmd_seq_num;
958 __le32 error_service;
959 __le64 timestamp;
960} __packed;
961
962
963/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100964#define MAX_MACS_IN_BINDING (3)
965#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +0100966
Johannes Bergd69f0a22017-03-14 10:58:16 +0100967/**
968 * enum iwl_mvm_id_and_color - ID and color fields in context dword
969 * @FW_CTXT_ID_POS: position of the ID
970 * @FW_CTXT_ID_MSK: mask of the ID
971 * @FW_CTXT_COLOR_POS: position of the color
972 * @FW_CTXT_COLOR_MSK: mask of the color
973 * @FW_CTXT_INVALID: value used to indicate unused/invalid
974 */
975enum iwl_mvm_id_and_color {
976 FW_CTXT_ID_POS = 0,
977 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
978 FW_CTXT_COLOR_POS = 8,
979 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
980 FW_CTXT_INVALID = 0xffffffff,
981};
Johannes Berg8ca151b2013-01-24 14:25:36 +0100982
983#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
984 (_color << FW_CTXT_COLOR_POS))
985
986/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +0200987enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100988 FW_CTXT_ACTION_STUB = 0,
989 FW_CTXT_ACTION_ADD,
990 FW_CTXT_ACTION_MODIFY,
991 FW_CTXT_ACTION_REMOVE,
992 FW_CTXT_ACTION_NUM
993}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
994
995/* Time Events */
996
997/* Time Event types, according to MAC type */
998enum iwl_time_event_type {
999 /* BSS Station Events */
1000 TE_BSS_STA_AGGRESSIVE_ASSOC,
1001 TE_BSS_STA_ASSOC,
1002 TE_BSS_EAP_DHCP_PROT,
1003 TE_BSS_QUIET_PERIOD,
1004
1005 /* P2P Device Events */
1006 TE_P2P_DEVICE_DISCOVERABLE,
1007 TE_P2P_DEVICE_LISTEN,
1008 TE_P2P_DEVICE_ACTION_SCAN,
1009 TE_P2P_DEVICE_FULL_SCAN,
1010
1011 /* P2P Client Events */
1012 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
1013 TE_P2P_CLIENT_ASSOC,
1014 TE_P2P_CLIENT_QUIET_PERIOD,
1015
1016 /* P2P GO Events */
1017 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02001018 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +01001019 TE_P2P_GO_CT_WINDOW,
1020
1021 /* WiDi Sync Events */
1022 TE_WIDI_TX_SYNC,
1023
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001024 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +03001025 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001026
Johannes Berg8ca151b2013-01-24 14:25:36 +01001027 TE_MAX
1028}; /* MAC_EVENT_TYPE_API_E_VER_1 */
1029
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001030
1031
1032/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001033
1034/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001035 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1036 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1037 * the first fragment is scheduled.
1038 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1039 * the first 2 fragments are scheduled.
1040 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1041 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001042 *
1043 * Other than the constant defined above, specifying a fragmentation value 'x'
1044 * means that the event can be fragmented but only the first 'x' will be
1045 * scheduled.
1046 */
1047enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001048 TE_V1_FRAG_NONE = 0,
1049 TE_V1_FRAG_SINGLE = 1,
1050 TE_V1_FRAG_DUAL = 2,
1051 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +01001052};
1053
Johannes Berg8ca151b2013-01-24 14:25:36 +01001054/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001055#define TE_V1_FRAG_MAX_MSK 0x0fffffff
1056/* Repeat the time event endlessly (until removed) */
1057#define TE_V1_REPEAT_ENDLESS 0xffffffff
1058/* If a Time Event has bounded repetitions, this is the maximal value */
1059#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1060
1061/* Time Event dependencies: none, on another TE, or in a specific time */
1062enum {
1063 TE_V1_INDEPENDENT = 0,
1064 TE_V1_DEP_OTHER = BIT(0),
1065 TE_V1_DEP_TSF = BIT(1),
1066 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1067}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1068
1069/*
1070 * @TE_V1_NOTIF_NONE: no notifications
1071 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1072 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1073 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1074 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1075 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1076 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1077 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1078 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1079 *
1080 * Supported Time event notifications configuration.
1081 * A notification (both event and fragment) includes a status indicating weather
1082 * the FW was able to schedule the event or not. For fragment start/end
1083 * notification the status is always success. There is no start/end fragment
1084 * notification for monolithic events.
1085 */
1086enum {
1087 TE_V1_NOTIF_NONE = 0,
1088 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1089 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1090 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1091 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1092 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1093 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1094 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1095 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1096}; /* MAC_EVENT_ACTION_API_E_VER_2 */
1097
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001098/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001099
1100/*
1101 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1102 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1103 * the first fragment is scheduled.
1104 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1105 * the first 2 fragments are scheduled.
1106 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1107 * number of fragments are valid.
1108 *
1109 * Other than the constant defined above, specifying a fragmentation value 'x'
1110 * means that the event can be fragmented but only the first 'x' will be
1111 * scheduled.
1112 */
1113enum {
1114 TE_V2_FRAG_NONE = 0,
1115 TE_V2_FRAG_SINGLE = 1,
1116 TE_V2_FRAG_DUAL = 2,
1117 TE_V2_FRAG_MAX = 0xfe,
1118 TE_V2_FRAG_ENDLESS = 0xff
1119};
1120
1121/* Repeat the time event endlessly (until removed) */
1122#define TE_V2_REPEAT_ENDLESS 0xff
1123/* If a Time Event has bounded repetitions, this is the maximal value */
1124#define TE_V2_REPEAT_MAX 0xfe
1125
1126#define TE_V2_PLACEMENT_POS 12
1127#define TE_V2_ABSENCE_POS 15
1128
Johannes Bergd69f0a22017-03-14 10:58:16 +01001129/**
1130 * enum iwl_time_event_policy - Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001131 * A notification (both event and fragment) includes a status indicating weather
1132 * the FW was able to schedule the event or not. For fragment start/end
1133 * notification the status is always success. There is no start/end fragment
1134 * notification for monolithic events.
1135 *
1136 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1137 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1138 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1139 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1140 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1141 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1142 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1143 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1144 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
Johannes Bergd69f0a22017-03-14 10:58:16 +01001145 * @T2_V2_START_IMMEDIATELY: start time event immediately
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001146 * @TE_V2_DEP_OTHER: depends on another time event
1147 * @TE_V2_DEP_TSF: depends on a specific time
1148 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1149 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1150 */
Johannes Bergd69f0a22017-03-14 10:58:16 +01001151enum iwl_time_event_policy {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001152 TE_V2_DEFAULT_POLICY = 0x0,
1153
1154 /* notifications (event start/stop, fragment start/stop) */
1155 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1156 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1157 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1158 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1159
1160 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1161 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1162 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1163 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +02001164 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001165
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001166 /* placement characteristics */
1167 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1168 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1169 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1170
1171 /* are we present or absent during the Time Event. */
1172 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1173};
1174
1175/**
Johannes Berg67625862017-03-14 11:01:27 +01001176 * struct iwl_time_event_cmd - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001177 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1178 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1179 * ( TIME_EVENT_CMD = 0x29 )
Johannes Berg67625862017-03-14 11:01:27 +01001180 * @id_and_color: ID and color of the relevant MAC,
1181 * &enum iwl_mvm_id_and_color
1182 * @action: action to perform, one of &enum iwl_phy_ctxt_action
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001183 * @id: this field has two meanings, depending on the action:
1184 * If the action is ADD, then it means the type of event to add.
1185 * For all other actions it is the unique event ID assigned when the
1186 * event was added by the FW.
1187 * @apply_time: When to start the Time Event (in GP2)
1188 * @max_delay: maximum delay to event's start (apply time), in TU
1189 * @depends_on: the unique ID of the event we depend on (if any)
1190 * @interval: interval between repetitions, in TU
1191 * @duration: duration of event in TU
1192 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1193 * @max_frags: maximal number of fragments the Time Event can be divided to
1194 * @policy: defines whether uCode shall notify the host or other uCode modules
1195 * on event and/or fragment start and/or end
1196 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1197 * TE_EVENT_SOCIOPATHIC
Johannes Berg67625862017-03-14 11:01:27 +01001198 * using TE_ABSENCE and using TE_NOTIF_*,
1199 * &enum iwl_time_event_policy
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001200 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001201struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001202 /* COMMON_INDEX_HDR_API_S_VER_1 */
1203 __le32 id_and_color;
1204 __le32 action;
1205 __le32 id;
1206 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1207 __le32 apply_time;
1208 __le32 max_delay;
1209 __le32 depends_on;
1210 __le32 interval;
1211 __le32 duration;
1212 u8 repeat;
1213 u8 max_frags;
1214 __le16 policy;
1215} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1216
Johannes Berg8ca151b2013-01-24 14:25:36 +01001217/**
1218 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1219 * @status: bit 0 indicates success, all others specify errors
1220 * @id: the Time Event type
1221 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
Johannes Berg67625862017-03-14 11:01:27 +01001222 * @id_and_color: ID and color of the relevant MAC,
1223 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001224 */
1225struct iwl_time_event_resp {
1226 __le32 status;
1227 __le32 id;
1228 __le32 unique_id;
1229 __le32 id_and_color;
1230} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1231
1232/**
1233 * struct iwl_time_event_notif - notifications of time event start/stop
1234 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1235 * @timestamp: action timestamp in GP2
1236 * @session_id: session's unique id
1237 * @unique_id: unique id of the Time Event itself
1238 * @id_and_color: ID and color of the relevant MAC
Johannes Berg67625862017-03-14 11:01:27 +01001239 * @action: &enum iwl_time_event_policy
Johannes Berg8ca151b2013-01-24 14:25:36 +01001240 * @status: true if scheduled, false otherwise (not executed)
1241 */
1242struct iwl_time_event_notif {
1243 __le32 timestamp;
1244 __le32 session_id;
1245 __le32 unique_id;
1246 __le32 id_and_color;
1247 __le32 action;
1248 __le32 status;
1249} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1250
1251
1252/* Bindings and Time Quota */
1253
1254/**
Johannes Berg4d151c22017-03-14 11:04:06 +01001255 * struct iwl_binding_cmd_v1 - configuring bindings
1256 * ( BINDING_CONTEXT_CMD = 0x2b )
1257 * @id_and_color: ID and color of the relevant Binding,
1258 * &enum iwl_mvm_id_and_color
1259 * @action: action to perform, one of FW_CTXT_ACTION_*
1260 * @macs: array of MAC id and colors which belong to the binding,
1261 * &enum iwl_mvm_id_and_color
1262 * @phy: PHY id and color which belongs to the binding,
1263 * &enum iwl_mvm_id_and_color
1264 */
1265struct iwl_binding_cmd_v1 {
1266 /* COMMON_INDEX_HDR_API_S_VER_1 */
1267 __le32 id_and_color;
1268 __le32 action;
1269 /* BINDING_DATA_API_S_VER_1 */
1270 __le32 macs[MAX_MACS_IN_BINDING];
1271 __le32 phy;
1272} __packed; /* BINDING_CMD_API_S_VER_1 */
1273
1274/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001275 * struct iwl_binding_cmd - configuring bindings
1276 * ( BINDING_CONTEXT_CMD = 0x2b )
Johannes Berg67625862017-03-14 11:01:27 +01001277 * @id_and_color: ID and color of the relevant Binding,
1278 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001279 * @action: action to perform, one of FW_CTXT_ACTION_*
1280 * @macs: array of MAC id and colors which belong to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001281 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001282 * @phy: PHY id and color which belongs to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001283 * &enum iwl_mvm_id_and_color
Sara Sharon9415af72016-11-17 13:57:32 +02001284 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001285 */
1286struct iwl_binding_cmd {
1287 /* COMMON_INDEX_HDR_API_S_VER_1 */
1288 __le32 id_and_color;
1289 __le32 action;
1290 /* BINDING_DATA_API_S_VER_1 */
1291 __le32 macs[MAX_MACS_IN_BINDING];
1292 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001293 __le32 lmac_id;
1294} __packed; /* BINDING_CMD_API_S_VER_2 */
1295
Johannes Berg4d151c22017-03-14 11:04:06 +01001296#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
Sara Sharon9415af72016-11-17 13:57:32 +02001297#define IWL_LMAC_24G_INDEX 0
1298#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001299
Ilan Peer35adfd62013-02-04 13:16:24 +02001300/* The maximal number of fragments in the FW's schedule session */
1301#define IWL_MVM_MAX_QUOTA 128
1302
Johannes Berg8ca151b2013-01-24 14:25:36 +01001303/**
1304 * struct iwl_time_quota_data - configuration of time quota per binding
Johannes Berg67625862017-03-14 11:01:27 +01001305 * @id_and_color: ID and color of the relevant Binding,
1306 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001307 * @quota: absolute time quota in TU. The scheduler will try to divide the
1308 * remainig quota (after Time Events) according to this quota.
1309 * @max_duration: max uninterrupted context duration in TU
1310 */
1311struct iwl_time_quota_data {
1312 __le32 id_and_color;
1313 __le32 quota;
1314 __le32 max_duration;
1315} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1316
1317/**
1318 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1319 * ( TIME_QUOTA_CMD = 0x2c )
1320 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001321 * Note: on non-CDB the fourth one is the auxilary mac and is
1322 * essentially zero.
1323 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001324 */
1325struct iwl_time_quota_cmd {
1326 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1327} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1328
1329
1330/* PHY context */
1331
1332/* Supported bands */
1333#define PHY_BAND_5 (0)
1334#define PHY_BAND_24 (1)
1335
1336/* Supported channel width, vary if there is VHT support */
1337#define PHY_VHT_CHANNEL_MODE20 (0x0)
1338#define PHY_VHT_CHANNEL_MODE40 (0x1)
1339#define PHY_VHT_CHANNEL_MODE80 (0x2)
1340#define PHY_VHT_CHANNEL_MODE160 (0x3)
1341
1342/*
1343 * Control channel position:
1344 * For legacy set bit means upper channel, otherwise lower.
1345 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1346 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1347 * center_freq
1348 * |
1349 * 40Mhz |_______|_______|
1350 * 80Mhz |_______|_______|_______|_______|
1351 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1352 * code 011 010 001 000 | 100 101 110 111
1353 */
1354#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1355#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1356#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1357#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1358#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1359#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1360#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1361#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1362
1363/*
1364 * @band: PHY_BAND_*
1365 * @channel: channel number
1366 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1367 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1368 */
1369struct iwl_fw_channel_info {
1370 u8 band;
1371 u8 channel;
1372 u8 width;
1373 u8 ctrl_pos;
1374} __packed;
1375
1376#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1377#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1378 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1379#define PHY_RX_CHAIN_VALID_POS (1)
1380#define PHY_RX_CHAIN_VALID_MSK \
1381 (0x7 << PHY_RX_CHAIN_VALID_POS)
1382#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1383#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1384 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1385#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1386#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1387 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1388#define PHY_RX_CHAIN_CNT_POS (10)
1389#define PHY_RX_CHAIN_CNT_MSK \
1390 (0x3 << PHY_RX_CHAIN_CNT_POS)
1391#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1392#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1393 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1394#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1395#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1396 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1397
1398/* TODO: fix the value, make it depend on firmware at runtime? */
1399#define NUM_PHY_CTX 3
1400
1401/* TODO: complete missing documentation */
1402/**
1403 * struct iwl_phy_context_cmd - config of the PHY context
1404 * ( PHY_CONTEXT_CMD = 0x8 )
1405 * @id_and_color: ID and color of the relevant Binding
1406 * @action: action to perform, one of FW_CTXT_ACTION_*
1407 * @apply_time: 0 means immediate apply and context switch.
1408 * other value means apply new params after X usecs
1409 * @tx_param_color: ???
1410 * @channel_info:
1411 * @txchain_info: ???
1412 * @rxchain_info: ???
1413 * @acquisition_data: ???
1414 * @dsp_cfg_flags: set to 0
1415 */
1416struct iwl_phy_context_cmd {
1417 /* COMMON_INDEX_HDR_API_S_VER_1 */
1418 __le32 id_and_color;
1419 __le32 action;
1420 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1421 __le32 apply_time;
1422 __le32 tx_param_color;
1423 struct iwl_fw_channel_info ci;
1424 __le32 txchain_info;
1425 __le32 rxchain_info;
1426 __le32 acquisition_data;
1427 __le32 dsp_cfg_flags;
1428} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1429
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001430/*
1431 * Aux ROC command
1432 *
1433 * Command requests the firmware to create a time event for a certain duration
1434 * and remain on the given channel. This is done by using the Aux framework in
1435 * the FW.
1436 * The command was first used for Hot Spot issues - but can be used regardless
1437 * to Hot Spot.
1438 *
1439 * ( HOT_SPOT_CMD 0x53 )
1440 *
1441 * @id_and_color: ID and color of the MAC
1442 * @action: action to perform, one of FW_CTXT_ACTION_*
1443 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1444 * event_unique_id should be the id of the time event assigned by ucode.
1445 * Otherwise ignore the event_unique_id.
1446 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1447 * activity.
1448 * @channel_info: channel info
1449 * @node_addr: Our MAC Address
1450 * @reserved: reserved for alignment
1451 * @apply_time: GP2 value to start (should always be the current GP2 value)
1452 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1453 * time by which start of the event is allowed to be postponed.
1454 * @duration: event duration in TU To calculate event duration:
1455 * timeEventDuration = min(duration, remainingQuota)
1456 */
1457struct iwl_hs20_roc_req {
1458 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1459 __le32 id_and_color;
1460 __le32 action;
1461 __le32 event_unique_id;
1462 __le32 sta_id_and_color;
1463 struct iwl_fw_channel_info channel_info;
1464 u8 node_addr[ETH_ALEN];
1465 __le16 reserved;
1466 __le32 apply_time;
1467 __le32 apply_time_max_delay;
1468 __le32 duration;
1469} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1470
1471/*
1472 * values for AUX ROC result values
1473 */
1474enum iwl_mvm_hot_spot {
1475 HOT_SPOT_RSP_STATUS_OK,
1476 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1477 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1478};
1479
1480/*
1481 * Aux ROC command response
1482 *
1483 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1484 * driver the uid of the timevent.
1485 *
1486 * ( HOT_SPOT_CMD 0x53 )
1487 *
1488 * @event_unique_id: Unique ID of time event assigned by ucode
1489 * @status: Return status 0 is success, all the rest used for specific errors
1490 */
1491struct iwl_hs20_roc_res {
1492 __le32 event_unique_id;
1493 __le32 status;
1494} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1495
Johannes Berg8ca151b2013-01-24 14:25:36 +01001496/**
1497 * struct iwl_radio_version_notif - information on the radio version
1498 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
1499 * @radio_flavor:
1500 * @radio_step:
1501 * @radio_dash:
1502 */
1503struct iwl_radio_version_notif {
1504 __le32 radio_flavor;
1505 __le32 radio_step;
1506 __le32 radio_dash;
1507} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1508
1509enum iwl_card_state_flags {
1510 CARD_ENABLED = 0x00,
1511 HW_CARD_DISABLED = 0x01,
1512 SW_CARD_DISABLED = 0x02,
1513 CT_KILL_CARD_DISABLED = 0x04,
1514 HALT_CARD_DISABLED = 0x08,
1515 CARD_DISABLED_MSK = 0x0f,
1516 CARD_IS_RX_ON = 0x10,
1517};
1518
1519/**
1520 * struct iwl_radio_version_notif - information on the radio version
1521 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1522 * @flags: %iwl_card_state_flags
1523 */
1524struct iwl_card_state_notif {
1525 __le32 flags;
1526} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1527
1528/**
Hila Gonend64048e2013-03-13 18:00:03 +02001529 * struct iwl_missed_beacons_notif - information on missed beacons
1530 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1531 * @mac_id: interface ID
1532 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1533 * beacons since last RX.
1534 * @consec_missed_beacons: number of consecutive missed beacons
1535 * @num_expected_beacons:
1536 * @num_recvd_beacons:
1537 */
1538struct iwl_missed_beacons_notif {
1539 __le32 mac_id;
1540 __le32 consec_missed_beacons_since_last_rx;
1541 __le32 consec_missed_beacons;
1542 __le32 num_expected_beacons;
1543 __le32 num_recvd_beacons;
1544} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1545
1546/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001547 * struct iwl_mfuart_load_notif - mfuart image version & status
1548 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1549 * @installed_ver: installed image version
1550 * @external_ver: external image version
1551 * @status: MFUART loading status
1552 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001553 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001554*/
1555struct iwl_mfuart_load_notif {
1556 __le32 installed_ver;
1557 __le32 external_ver;
1558 __le32 status;
1559 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001560 /* image size valid only in v2 of the command */
1561 __le32 image_size;
1562} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001563
1564/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001565 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1566 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1567 * @assert_id: mfuart assert id that cause the notif
1568 * @curr_reset_num: number of asserts since uptime
1569 * @index_num: current chunk id
1570 * @parts_num: total number of chunks
1571 * @data_size: number of data bytes sent
1572 * @data: data buffer
1573 */
1574struct iwl_mfu_assert_dump_notif {
1575 __le32 assert_id;
1576 __le32 curr_reset_num;
1577 __le16 index_num;
1578 __le16 parts_num;
1579 __le32 data_size;
1580 __le32 data[0];
1581} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1582
1583/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001584 * struct iwl_set_calib_default_cmd - set default value for calibration.
1585 * ( SET_CALIB_DEFAULT_CMD = 0x8e )
1586 * @calib_index: the calibration to set value for
1587 * @length: of data
1588 * @data: the value to set for the calibration result
1589 */
1590struct iwl_set_calib_default_cmd {
1591 __le16 calib_index;
1592 __le16 length;
1593 u8 data[0];
1594} __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
1595
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001596#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001597#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001598
1599/**
1600 * struct iwl_mcast_filter_cmd - configure multicast filter.
1601 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1602 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1603 * to identify network interface adopted in host-device IF.
1604 * It is used by FW as index in array of addresses. This array has
1605 * MAX_PORT_ID_NUM members.
1606 * @count: Number of MAC addresses in the array
1607 * @pass_all: Set 1 to pass all multicast packets.
1608 * @bssid: current association BSSID.
1609 * @addr_list: Place holder for array of MAC addresses.
1610 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1611 */
1612struct iwl_mcast_filter_cmd {
1613 u8 filter_own;
1614 u8 port_id;
1615 u8 count;
1616 u8 pass_all;
1617 u8 bssid[6];
1618 u8 reserved[2];
1619 u8 addr_list[0];
1620} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1621
Eliad Pellerc87163b2014-01-08 10:11:11 +02001622#define MAX_BCAST_FILTERS 8
1623#define MAX_BCAST_FILTER_ATTRS 2
1624
1625/**
1626 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1627 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1628 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1629 * start of ip payload).
1630 */
1631enum iwl_mvm_bcast_filter_attr_offset {
1632 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1633 BCAST_FILTER_OFFSET_IP_END = 1,
1634};
1635
1636/**
1637 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1638 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1639 * @offset: starting offset of this pattern.
1640 * @val: value to match - big endian (MSB is the first
1641 * byte to match from offset pos).
1642 * @mask: mask to match (big endian).
1643 */
1644struct iwl_fw_bcast_filter_attr {
1645 u8 offset_type;
1646 u8 offset;
1647 __le16 reserved1;
1648 __be32 val;
1649 __be32 mask;
1650} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1651
1652/**
1653 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1654 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1655 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1656 */
1657enum iwl_mvm_bcast_filter_frame_type {
1658 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1659 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1660};
1661
1662/**
1663 * struct iwl_fw_bcast_filter - broadcast filter
1664 * @discard: discard frame (1) or let it pass (0).
1665 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
1666 * @num_attrs: number of valid attributes in this filter.
1667 * @attrs: attributes of this filter. a filter is considered matched
1668 * only when all its attributes are matched (i.e. AND relationship)
1669 */
1670struct iwl_fw_bcast_filter {
1671 u8 discard;
1672 u8 frame_type;
1673 u8 num_attrs;
1674 u8 reserved1;
1675 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1676} __packed; /* BCAST_FILTER_S_VER_1 */
1677
Sara Sharon3af512d62015-07-22 11:38:40 +03001678#define BA_WINDOW_STREAMS_MAX 16
1679#define BA_WINDOW_STATUS_TID_MSK 0x000F
1680#define BA_WINDOW_STATUS_STA_ID_POS 4
1681#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1682#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1683
1684/**
1685 * struct iwl_ba_window_status_notif - reordering window's status notification
1686 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1687 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1688 * @start_seq_num: the start sequence number of the bitmap
1689 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1690 */
1691struct iwl_ba_window_status_notif {
1692 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1693 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1694 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1695 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1696} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1697
Eliad Pellerc87163b2014-01-08 10:11:11 +02001698/**
1699 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1700 * @default_discard: default action for this mac (discard (1) / pass (0)).
1701 * @attached_filters: bitmap of relevant filters for this mac.
1702 */
1703struct iwl_fw_bcast_mac {
1704 u8 default_discard;
1705 u8 reserved1;
1706 __le16 attached_filters;
1707} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1708
1709/**
1710 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1711 * @disable: enable (0) / disable (1)
1712 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1713 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
1714 * @filters: broadcast filters
1715 * @macs: broadcast filtering configuration per-mac
1716 */
1717struct iwl_bcast_filter_cmd {
1718 u8 disable;
1719 u8 max_bcast_filters;
1720 u8 max_macs;
1721 u8 reserved1;
1722 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1723 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1724} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1725
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001726/*
1727 * enum iwl_mvm_marker_id - maker ids
1728 *
1729 * The ids for different type of markers to insert into the usniffer logs
1730 */
1731enum iwl_mvm_marker_id {
1732 MARKER_ID_TX_FRAME_LATENCY = 1,
1733}; /* MARKER_ID_API_E_VER_1 */
1734
1735/**
1736 * struct iwl_mvm_marker - mark info into the usniffer logs
1737 *
1738 * (MARKER_CMD = 0xcb)
1739 *
1740 * Mark the UTC time stamp into the usniffer logs together with additional
1741 * metadata, so the usniffer output can be parsed.
1742 * In the command response the ucode will return the GP2 time.
1743 *
1744 * @dw_len: The amount of dwords following this byte including this byte.
1745 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1746 * @reserved: reserved.
1747 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1748 * @metadata: additional meta data that will be written to the unsiffer log
1749 */
1750struct iwl_mvm_marker {
Johannes Berg1644be92017-05-16 13:21:52 +02001751 u8 dw_len;
1752 u8 marker_id;
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001753 __le16 reserved;
1754 __le64 timestamp;
1755 __le32 metadata[0];
1756} __packed; /* MARKER_API_S_VER_1 */
1757
Matti Gottlieb0becb372015-05-31 09:18:30 +03001758/*
1759 * enum iwl_dc2dc_config_id - flag ids
1760 *
1761 * Ids of dc2dc configuration flags
1762 */
1763enum iwl_dc2dc_config_id {
1764 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1765 DCDC_FREQ_TUNE_SET = 0x2,
1766}; /* MARKER_ID_API_E_VER_1 */
1767
1768/**
1769 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1770 *
1771 * (DC2DC_CONFIG_CMD = 0x83)
1772 *
1773 * Set/Get & configure dc2dc values.
1774 * The command always returns the current dc2dc values.
1775 *
1776 * @flags: set/get dc2dc
1777 * @enable_low_power_mode: not used.
1778 * @dc2dc_freq_tune0: frequency divider - digital domain
1779 * @dc2dc_freq_tune1: frequency divider - analog domain
1780 */
1781struct iwl_dc2dc_config_cmd {
1782 __le32 flags;
1783 __le32 enable_low_power_mode; /* not used */
1784 __le32 dc2dc_freq_tune0;
1785 __le32 dc2dc_freq_tune1;
1786} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1787
1788/**
1789 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1790 *
1791 * Current dc2dc values returned by the FW.
1792 *
1793 * @dc2dc_freq_tune0: frequency divider - digital domain
1794 * @dc2dc_freq_tune1: frequency divider - analog domain
1795 */
1796struct iwl_dc2dc_config_resp {
1797 __le32 dc2dc_freq_tune0;
1798 __le32 dc2dc_freq_tune1;
1799} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1800
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001801/***********************************
1802 * Smart Fifo API
1803 ***********************************/
1804/* Smart Fifo state */
1805enum iwl_sf_state {
1806 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1807 SF_FULL_ON,
1808 SF_UNINIT,
1809 SF_INIT_OFF,
1810 SF_HW_NUM_STATES
1811};
1812
1813/* Smart Fifo possible scenario */
1814enum iwl_sf_scenario {
1815 SF_SCENARIO_SINGLE_UNICAST,
1816 SF_SCENARIO_AGG_UNICAST,
1817 SF_SCENARIO_MULTICAST,
1818 SF_SCENARIO_BA_RESP,
1819 SF_SCENARIO_TX_RESP,
1820 SF_NUM_SCENARIO
1821};
1822
1823#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
1824#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
1825
1826/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02001827#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001828#define SF_W_MARK_MIMO2 8192
1829#define SF_W_MARK_MIMO3 6144
1830#define SF_W_MARK_LEGACY 4096
1831#define SF_W_MARK_SCAN 4096
1832
Eran Hararyf4a3ee42015-02-08 13:58:50 +02001833/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
1834#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1835#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1836#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1837#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1838#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
1839#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1840#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
1841#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
1842#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
1843#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
1844
1845/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001846#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1847#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1848#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1849#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1850#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
1851#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
1852#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
1853#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
1854#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
1855#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
1856
1857#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
1858
Eran Harary161bdb72014-07-27 08:03:06 +03001859#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
1860
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001861/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001862 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
1863 * @state: smart fifo state, types listed in &enum iwl_sf_state.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001864 * @watermark: Minimum allowed availabe free space in RXF for transient state.
1865 * @long_delay_timeouts: aging and idle timer values for each scenario
1866 * in long delay state.
1867 * @full_on_timeouts: timer values for each scenario in full on state.
1868 */
1869struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001870 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001871 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
1872 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1873 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1874} __packed; /* SF_CFG_API_S_VER_2 */
1875
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001876/***********************************
1877 * Location Aware Regulatory (LAR) API - MCC updates
1878 ***********************************/
1879
1880/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001881 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001882 * regulatory profile according to the given MCC (Mobile Country Code).
1883 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1884 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1885 * MCC in the cmd response will be the relevant MCC in the NVM.
1886 * @mcc: given mobile country code
1887 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1888 * @reserved: reserved for alignment
1889 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001890struct iwl_mcc_update_cmd_v1 {
1891 __le16 mcc;
1892 u8 source_id;
1893 u8 reserved;
1894} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
1895
1896/**
1897 * struct iwl_mcc_update_cmd - Request the device to update geographic
1898 * regulatory profile according to the given MCC (Mobile Country Code).
1899 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1900 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1901 * MCC in the cmd response will be the relevant MCC in the NVM.
1902 * @mcc: given mobile country code
1903 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1904 * @reserved: reserved for alignment
1905 * @key: integrity key for MCC API OEM testing
1906 * @reserved2: reserved
1907 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001908struct iwl_mcc_update_cmd {
1909 __le16 mcc;
1910 u8 source_id;
1911 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001912 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01001913 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001914} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001915
1916/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001917 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001918 * Contains the new channel control profile map, if changed, and the new MCC
1919 * (mobile country code).
1920 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02001921 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001922 * @mcc: the new applied MCC
1923 * @cap: capabilities for all channels which matches the MCC
1924 * @source_id: the MCC source, see iwl_mcc_source
1925 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1926 * channels, depending on platform)
1927 * @channels: channel control data map, DWORD for each channel. Only the first
1928 * 16bits are used.
1929 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001930struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001931 __le32 status;
1932 __le16 mcc;
1933 u8 cap;
1934 u8 source_id;
1935 __le32 n_channels;
1936 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001937} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
1938
1939/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001940 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001941 * Contains the new channel control profile map, if changed, and the new MCC
1942 * (mobile country code).
1943 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
1944 * @status: see &enum iwl_mcc_update_status
1945 * @mcc: the new applied MCC
1946 * @cap: capabilities for all channels which matches the MCC
1947 * @source_id: the MCC source, see iwl_mcc_source
1948 * @time: time elapsed from the MCC test start (in 30 seconds TU)
1949 * @reserved: reserved.
1950 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1951 * channels, depending on platform)
1952 * @channels: channel control data map, DWORD for each channel. Only the first
1953 * 16bits are used.
1954 */
1955struct iwl_mcc_update_resp {
1956 __le32 status;
1957 __le16 mcc;
1958 u8 cap;
1959 u8 source_id;
1960 __le16 time;
1961 __le16 reserved;
1962 __le32 n_channels;
1963 __le32 channels[0];
1964} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001965
1966/**
1967 * struct iwl_mcc_chub_notif - chub notifies of mcc change
1968 * (MCC_CHUB_UPDATE_CMD = 0xc9)
1969 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
1970 * the cellular and connectivity cores that gets updates of the mcc, and
1971 * notifies the ucode directly of any mcc change.
1972 * The ucode requests the driver to request the device to update geographic
1973 * regulatory profile according to the given MCC (Mobile Country Code).
1974 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1975 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1976 * MCC in the cmd response will be the relevant MCC in the NVM.
1977 * @mcc: given mobile country code
1978 * @source_id: identity of the change originator, see iwl_mcc_source
1979 * @reserved1: reserved for alignment
1980 */
1981struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01001982 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001983 u8 source_id;
1984 u8 reserved1;
1985} __packed; /* LAR_MCC_NOTIFY_S */
1986
1987enum iwl_mcc_update_status {
1988 MCC_RESP_NEW_CHAN_PROFILE,
1989 MCC_RESP_SAME_CHAN_PROFILE,
1990 MCC_RESP_INVALID,
1991 MCC_RESP_NVM_DISABLED,
1992 MCC_RESP_ILLEGAL,
1993 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001994 MCC_RESP_TEST_MODE_ACTIVE,
1995 MCC_RESP_TEST_MODE_NOT_ACTIVE,
1996 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001997};
1998
1999enum iwl_mcc_source {
2000 MCC_SOURCE_OLD_FW = 0,
2001 MCC_SOURCE_ME = 1,
2002 MCC_SOURCE_BIOS = 2,
2003 MCC_SOURCE_3G_LTE_HOST = 3,
2004 MCC_SOURCE_3G_LTE_DEVICE = 4,
2005 MCC_SOURCE_WIFI = 5,
2006 MCC_SOURCE_RESERVED = 6,
2007 MCC_SOURCE_DEFAULT = 7,
2008 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02002009 MCC_SOURCE_MCC_API = 9,
2010 MCC_SOURCE_GET_CURRENT = 0x10,
2011 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02002012};
2013
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002014/* DTS measurements */
2015
2016enum iwl_dts_measurement_flags {
2017 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
2018 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
2019};
2020
2021/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002022 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002023 *
Johannes Berg31a658b2017-03-09 15:56:57 +01002024 * @flags: indicates which measurements we want as specified in
2025 * &enum iwl_dts_measurement_flags
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002026 */
2027struct iwl_dts_measurement_cmd {
2028 __le32 flags;
2029} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2030
2031/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03002032* enum iwl_dts_control_measurement_mode - DTS measurement type
2033* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2034* back (latest value. Not waiting for new value). Use automatic
2035* SW DTS configuration.
2036* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2037* trigger DTS reading and provide read back temperature read
2038* when available.
2039* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2040* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2041* without measurement trigger.
2042*/
2043enum iwl_dts_control_measurement_mode {
2044 DTS_AUTOMATIC = 0,
2045 DTS_REQUEST_READ = 1,
2046 DTS_OVER_WRITE = 2,
2047 DTS_DIRECT_WITHOUT_MEASURE = 3,
2048};
2049
2050/**
2051* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2052* @DTS_USE_TOP: Top
2053* @DTS_USE_CHAIN_A: chain A
2054* @DTS_USE_CHAIN_B: chain B
2055* @DTS_USE_CHAIN_C: chain C
2056* @XTAL_TEMPERATURE - read temperature from xtal
2057*/
2058enum iwl_dts_used {
2059 DTS_USE_TOP = 0,
2060 DTS_USE_CHAIN_A = 1,
2061 DTS_USE_CHAIN_B = 2,
2062 DTS_USE_CHAIN_C = 3,
2063 XTAL_TEMPERATURE = 4,
2064};
2065
2066/**
2067* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2068* @DTS_BIT6_MODE: bit 6 mode
2069* @DTS_BIT8_MODE: bit 8 mode
2070*/
2071enum iwl_dts_bit_mode {
2072 DTS_BIT6_MODE = 0,
2073 DTS_BIT8_MODE = 1,
2074};
2075
2076/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002077 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
Arik Nemtsov78efc702015-10-06 12:22:47 +03002078 * @control_mode: see &enum iwl_dts_control_measurement_mode
2079 * @temperature: used when over write DTS mode is selected
2080 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2081 * @avg_factor: average factor to DTS in request DTS read mode
2082 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2083 * @step_duration: step duration for the DTS
2084 */
2085struct iwl_ext_dts_measurement_cmd {
2086 __le32 control_mode;
2087 __le32 temperature;
2088 __le32 sensor;
2089 __le32 avg_factor;
2090 __le32 bit_mode;
2091 __le32 step_duration;
2092} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2093
2094/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002095 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002096 *
2097 * @temp: the measured temperature
2098 * @voltage: the measured voltage
2099 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002100struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002101 __le32 temp;
2102 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002103} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2104
2105/**
2106 * struct iwl_dts_measurement_notif_v2 - measurements notification
2107 *
2108 * @temp: the measured temperature
2109 * @voltage: the measured voltage
2110 * @threshold_idx: the trip index that was crossed
2111 */
2112struct iwl_dts_measurement_notif_v2 {
2113 __le32 temp;
2114 __le32 voltage;
2115 __le32 threshold_idx;
2116} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002117
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02002118/**
2119 * struct ct_kill_notif - CT-kill entry notification
2120 *
2121 * @temperature: the current temperature in celsius
2122 * @reserved: reserved
2123 */
2124struct ct_kill_notif {
2125 __le16 temperature;
2126 __le16 reserved;
2127} __packed; /* GRP_PHY_CT_KILL_NTF */
2128
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002129/**
2130* enum ctdp_cmd_operation - CTDP command operations
2131* @CTDP_CMD_OPERATION_START: update the current budget
2132* @CTDP_CMD_OPERATION_STOP: stop ctdp
Chaya Rachel Ivgi3b9449b2017-05-08 15:14:01 +03002133* @CTDP_CMD_OPERATION_REPORT: get the average budget
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002134*/
2135enum iwl_mvm_ctdp_cmd_operation {
2136 CTDP_CMD_OPERATION_START = 0x1,
2137 CTDP_CMD_OPERATION_STOP = 0x2,
2138 CTDP_CMD_OPERATION_REPORT = 0x4,
2139};/* CTDP_CMD_OPERATION_TYPE_E */
2140
2141/**
2142 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2143 *
2144 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2145 * @budget: the budget in milliwatt
2146 * @window_size: defined in API but not used
2147 */
2148struct iwl_mvm_ctdp_cmd {
2149 __le32 operation;
2150 __le32 budget;
2151 __le32 window_size;
2152} __packed;
2153
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002154#define IWL_MAX_DTS_TRIPS 8
2155
2156/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002157 * struct temp_report_ths_cmd - set temperature thresholds
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002158 *
2159 * @num_temps: number of temperature thresholds passed
2160 * @thresholds: array with the thresholds to be configured
2161 */
2162struct temp_report_ths_cmd {
2163 __le32 num_temps;
2164 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2165} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2166
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002167/***********************************
2168 * TDLS API
2169 ***********************************/
2170
2171/* Type of TDLS request */
2172enum iwl_tdls_channel_switch_type {
2173 TDLS_SEND_CHAN_SW_REQ = 0,
2174 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2175 TDLS_MOVE_CH,
2176}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2177
2178/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002179 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002180 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2181 * received from peer
2182 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2183 * to the TDLS off-channel communication. For instance if the DTIM is
2184 * 200TU and the TDLS peer is to be given 25% of the time, the value
2185 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2186 * @switch_time: switch time the peer sent in its channel switch timing IE
Johannes Berg83b03192017-05-16 13:28:53 +02002187 * @switch_timeout: switch timeout the peer sent in its channel switch timing IE
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002188 */
2189struct iwl_tdls_channel_switch_timing {
2190 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2191 __le32 max_offchan_duration; /* given in micro-seconds */
2192 __le32 switch_time; /* given in micro-seconds */
2193 __le32 switch_timeout; /* given in micro-seconds */
2194} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2195
2196#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2197
2198/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002199 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002200 *
2201 * A template representing a TDLS channel-switch request or response frame
2202 *
2203 * @switch_time_offset: offset to the channel switch timing IE in the template
2204 * @tx_cmd: Tx parameters for the frame
2205 * @data: frame data
2206 */
2207struct iwl_tdls_channel_switch_frame {
2208 __le32 switch_time_offset;
2209 struct iwl_tx_cmd tx_cmd;
2210 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2211} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2212
2213/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002214 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002215 *
2216 * The command is sent to initiate a channel switch and also in response to
2217 * incoming TDLS channel-switch request/response packets from remote peers.
2218 *
2219 * @switch_type: see &enum iwl_tdls_channel_switch_type
2220 * @peer_sta_id: station id of TDLS peer
2221 * @ci: channel we switch to
2222 * @timing: timing related data for command
2223 * @frame: channel-switch request/response template, depending to switch_type
2224 */
2225struct iwl_tdls_channel_switch_cmd {
2226 u8 switch_type;
2227 __le32 peer_sta_id;
2228 struct iwl_fw_channel_info ci;
2229 struct iwl_tdls_channel_switch_timing timing;
2230 struct iwl_tdls_channel_switch_frame frame;
2231} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2232
2233/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002234 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002235 *
2236 * @status: non-zero on success
2237 * @offchannel_duration: duration given in microseconds
2238 * @sta_id: peer currently performing the channel-switch with
2239 */
2240struct iwl_tdls_channel_switch_notif {
2241 __le32 status;
2242 __le32 offchannel_duration;
2243 __le32 sta_id;
2244} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2245
Arik Nemtsov307e4722014-09-15 18:48:59 +03002246/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002247 * struct iwl_tdls_sta_info - TDLS station info
Arik Nemtsov307e4722014-09-15 18:48:59 +03002248 *
2249 * @sta_id: station id of the TDLS peer
2250 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2251 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2252 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2253 */
2254struct iwl_tdls_sta_info {
2255 u8 sta_id;
2256 u8 tx_to_peer_tid;
2257 __le16 tx_to_peer_ssn;
2258 __le32 is_initiator;
2259} __packed; /* TDLS_STA_INFO_VER_1 */
2260
2261/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002262 * struct iwl_tdls_config_cmd - TDLS basic config command
Arik Nemtsov307e4722014-09-15 18:48:59 +03002263 *
2264 * @id_and_color: MAC id and color being configured
2265 * @tdls_peer_count: amount of currently connected TDLS peers
2266 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2267 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2268 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2269 * @pti_req_data_offset: offset of network-level data for the PTI template
2270 * @pti_req_tx_cmd: Tx parameters for PTI request template
2271 * @pti_req_template: PTI request template data
2272 */
2273struct iwl_tdls_config_cmd {
2274 __le32 id_and_color; /* mac id and color */
2275 u8 tdls_peer_count;
2276 u8 tx_to_ap_tid;
2277 __le16 tx_to_ap_ssn;
2278 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2279
2280 __le32 pti_req_data_offset;
2281 struct iwl_tx_cmd pti_req_tx_cmd;
2282 u8 pti_req_template[0];
2283} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2284
2285/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002286 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
Arik Nemtsov307e4722014-09-15 18:48:59 +03002287 *
2288 * @sta_id: station id of the TDLS peer
2289 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2290 * the peer
2291 */
2292struct iwl_tdls_config_sta_info_res {
2293 __le16 sta_id;
2294 __le16 tx_to_peer_last_seq;
2295} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2296
2297/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002298 * struct iwl_tdls_config_res - TDLS config information from FW
Arik Nemtsov307e4722014-09-15 18:48:59 +03002299 *
2300 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2301 * @sta_info: per-station TDLS config information
2302 */
2303struct iwl_tdls_config_res {
2304 __le32 tx_to_ap_last_seq;
2305 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2306} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2307
Sara Sharondb06f042016-07-05 17:37:58 +03002308#define TX_FIFO_MAX_NUM_9000 8
2309#define TX_FIFO_MAX_NUM 15
2310#define RX_FIFO_MAX_NUM 2
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002311#define TX_FIFO_INTERNAL_MAX_NUM 6
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002312
2313/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002314 * struct iwl_shared_mem_cfg_v1 - Shared memory configuration information
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002315 *
2316 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2317 * accessible)
2318 * @shared_mem_size: shared memory size
2319 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2320 * 0x0 as accessible only via DBGM RDAT)
2321 * @sample_buff_size: internal sample buff size
2322 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2323 * 8000 HW set to 0x0 as not accessible)
2324 * @txfifo_size: size of TXF0 ... TXF7
2325 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2326 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2327 * when paging is not supported this should be 0
2328 * @page_buff_size: size of %page_buff_addr
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002329 * @rxfifo_addr: Start address of rxFifo
2330 * @internal_txfifo_addr: start address of internalFifo
2331 * @internal_txfifo_size: internal fifos' size
2332 *
2333 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2334 * set, the last 3 members don't exist.
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002335 */
Sara Sharondb06f042016-07-05 17:37:58 +03002336struct iwl_shared_mem_cfg_v1 {
2337 __le32 shared_mem_addr;
2338 __le32 shared_mem_size;
2339 __le32 sample_buff_addr;
2340 __le32 sample_buff_size;
2341 __le32 txfifo_addr;
2342 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2343 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2344 __le32 page_buff_addr;
2345 __le32 page_buff_size;
2346 __le32 rxfifo_addr;
2347 __le32 internal_txfifo_addr;
2348 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2349} __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2350
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002351/**
2352 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2353 *
2354 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2355 * @txfifo_size: size of TX FIFOs
2356 * @rxfifo1_addr: RXF1 addr
2357 * @rxfifo1_size: RXF1 size
2358 */
2359struct iwl_shared_mem_lmac_cfg {
2360 __le32 txfifo_addr;
2361 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2362 __le32 rxfifo1_addr;
2363 __le32 rxfifo1_size;
2364
2365} __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2366
2367/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002368 * struct iwl_shared_mem_cfg - Shared memory configuration information
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002369 *
2370 * @shared_mem_addr: shared memory address
2371 * @shared_mem_size: shared memory size
2372 * @sample_buff_addr: internal sample (mon/adc) buff addr
2373 * @sample_buff_size: internal sample buff size
2374 * @rxfifo2_addr: start addr of RXF2
2375 * @rxfifo2_size: size of RXF2
2376 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2377 * when paging is not supported this should be 0
2378 * @page_buff_size: size of %page_buff_addr
2379 * @lmac_num: number of LMACs (1 or 2)
2380 * @lmac_smem: per - LMAC smem data
2381 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002382struct iwl_shared_mem_cfg {
2383 __le32 shared_mem_addr;
2384 __le32 shared_mem_size;
2385 __le32 sample_buff_addr;
2386 __le32 sample_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002387 __le32 rxfifo2_addr;
2388 __le32 rxfifo2_size;
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002389 __le32 page_buff_addr;
2390 __le32 page_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002391 __le32 lmac_num;
2392 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
Sara Sharondb06f042016-07-05 17:37:58 +03002393} __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002394
Sara Sharona07a8f32015-11-15 11:11:59 +02002395/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002396 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
Sara Sharona07a8f32015-11-15 11:11:59 +02002397 *
2398 * @membership_status: a bitmap of MU groups
2399 * @user_position:the position of station in a group. If the station is in the
2400 * group then bits (group * 2) is the position -1
2401 */
2402struct iwl_mu_group_mgmt_cmd {
2403 __le32 reserved;
2404 __le32 membership_status[2];
2405 __le32 user_position[4];
2406} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2407
Sara Sharonf92659a2016-02-03 15:04:49 +02002408/**
2409 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2410 *
2411 * @membership_status: a bitmap of MU groups
2412 * @user_position: the position of station in a group. If the station is in the
2413 * group then bits (group * 2) is the position -1
2414 */
2415struct iwl_mu_group_mgmt_notif {
2416 __le32 membership_status[2];
2417 __le32 user_position[4];
2418} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2419
Sara Sharon0db056d2015-12-29 11:07:15 +02002420#define MAX_STORED_BEACON_SIZE 600
2421
2422/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002423 * struct iwl_stored_beacon_notif - Stored beacon notification
Sara Sharon0db056d2015-12-29 11:07:15 +02002424 *
2425 * @system_time: system time on air rise
2426 * @tsf: TSF on air rise
2427 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002428 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002429 * @channel: channel this beacon was received on
2430 * @rates: rate in ucode internal format
2431 * @byte_count: frame's byte count
2432 */
2433struct iwl_stored_beacon_notif {
2434 __le32 system_time;
2435 __le64 tsf;
2436 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002437 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002438 __le16 channel;
2439 __le32 rates;
2440 __le32 byte_count;
2441 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002442} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002443
Aviya Erenfeld03098262016-02-18 14:09:33 +02002444#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2445
2446enum iwl_lqm_cmd_operatrions {
2447 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2448 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2449};
2450
2451enum iwl_lqm_status {
2452 LQM_STATUS_SUCCESS = 0,
2453 LQM_STATUS_TIMEOUT = 1,
2454 LQM_STATUS_ABORT = 2,
2455};
2456
2457/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002458 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
Johannes Berg83b03192017-05-16 13:28:53 +02002459 * @cmd_operation: command operation to be performed (start or stop)
Aviya Erenfeld03098262016-02-18 14:09:33 +02002460 * as defined above.
2461 * @mac_id: MAC ID the measurement applies to.
2462 * @measurement_time: time of the total measurement to be performed, in uSec.
2463 * @timeout: maximum time allowed until a response is sent, in uSec.
2464 */
2465struct iwl_link_qual_msrmnt_cmd {
2466 __le32 cmd_operation;
2467 __le32 mac_id;
2468 __le32 measurement_time;
2469 __le32 timeout;
2470} __packed /* LQM_CMD_API_S_VER_1 */;
2471
2472/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002473 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
Aviya Erenfeld03098262016-02-18 14:09:33 +02002474 *
2475 * @frequent_stations_air_time: an array containing the total air time
2476 * (in uSec) used by the most frequently transmitting stations.
2477 * @number_of_stations: the number of uniqe stations included in the array
2478 * (a number between 0 to 16)
2479 * @total_air_time_other_stations: the total air time (uSec) used by all the
2480 * stations which are not included in the above report.
2481 * @time_in_measurement_window: the total time in uSec in which a measurement
2482 * took place.
2483 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2484 * measurement
2485 * @mac_id: MAC ID the measurement applies to.
2486 * @status: return status. may be one of the LQM_STATUS_* defined above.
2487 * @reserved: reserved.
2488 */
2489struct iwl_link_qual_msrmnt_notif {
2490 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2491 __le32 number_of_stations;
2492 __le32 total_air_time_other_stations;
2493 __le32 time_in_measurement_window;
2494 __le32 tx_frame_dropped;
2495 __le32 mac_id;
2496 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002497 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002498} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2499
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002500/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002501 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002502 *
2503 * @id_and_color: ID and color of the MAC
2504 */
2505struct iwl_channel_switch_noa_notif {
2506 __le32 id_and_color;
2507} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2508
Ido Yariv2b55f432016-08-23 14:44:59 -04002509/* Operation types for the debug mem access */
2510enum {
2511 DEBUG_MEM_OP_READ = 0,
2512 DEBUG_MEM_OP_WRITE = 1,
2513 DEBUG_MEM_OP_WRITE_BYTES = 2,
2514};
2515
2516#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2517
2518/**
2519 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2520 * @op: DEBUG_MEM_OP_*
2521 * @addr: address to read/write from/to
2522 * @len: in dwords, to read/write
2523 * @data: for write opeations, contains the source buffer
2524 */
2525struct iwl_dbg_mem_access_cmd {
2526 __le32 op;
2527 __le32 addr;
2528 __le32 len;
2529 __le32 data[];
2530} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2531
2532/* Status responses for the debug mem access */
2533enum {
2534 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2535 DEBUG_MEM_STATUS_FAILED = 0x1,
2536 DEBUG_MEM_STATUS_LOCKED = 0x2,
2537 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2538 DEBUG_MEM_STATUS_LENGTH = 0x4,
2539};
2540
2541/**
2542 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2543 * @status: DEBUG_MEM_STATUS_*
2544 * @len: read dwords (0 for write operations)
2545 * @data: contains the read DWs
2546 */
2547struct iwl_dbg_mem_access_rsp {
2548 __le32 status;
2549 __le32 len;
2550 __le32 data[];
2551} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2552
Sara Sharon1f370652016-08-31 18:13:57 +03002553/**
2554 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
2555 */
2556struct iwl_nvm_access_complete_cmd {
2557 __le32 reserved;
2558} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2559
Sara Sharon4399caa2016-12-11 10:32:42 +02002560/**
2561 * enum iwl_extended_cfg_flag - commands driver may send before
2562 * finishing init flow
2563 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2564 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2565 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2566 */
2567enum iwl_extended_cfg_flags {
2568 IWL_INIT_DEBUG_CFG,
2569 IWL_INIT_NVM,
2570 IWL_INIT_PHY,
2571};
2572
2573/**
2574 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2575 * before finishing init flows
2576 * @init_flags: values from iwl_extended_cfg_flags
2577 */
2578struct iwl_init_extended_cfg_cmd {
2579 __le32 init_flags;
2580} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2581
Sara Sharone9e1ba32017-01-08 16:46:14 +02002582/*
2583 * struct iwl_nvm_get_info - request to get NVM data
2584 */
2585struct iwl_nvm_get_info {
2586 __le32 reserved;
2587} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2588
2589/**
2590 * struct iwl_nvm_get_info_general - general NVM data
2591 * @flags: 1 - empty, 0 - valid
2592 * @nvm_version: nvm version
2593 * @board_type: board type
2594 */
2595struct iwl_nvm_get_info_general {
2596 __le32 flags;
2597 __le16 nvm_version;
2598 u8 board_type;
2599 u8 reserved;
2600} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2601
2602/**
2603 * struct iwl_nvm_get_info_sku - mac information
2604 * @enable_24g: band 2.4G enabled
2605 * @enable_5g: band 5G enabled
2606 * @enable_11n: 11n enabled
2607 * @enable_11ac: 11ac enabled
2608 * @mimo_disable: MIMO enabled
2609 * @ext_crypto: Extended crypto enabled
2610 */
2611struct iwl_nvm_get_info_sku {
2612 __le32 enable_24g;
2613 __le32 enable_5g;
2614 __le32 enable_11n;
2615 __le32 enable_11ac;
2616 __le32 mimo_disable;
2617 __le32 ext_crypto;
2618} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2619
2620/**
2621 * struct iwl_nvm_get_info_phy - phy information
2622 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2623 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2624 */
2625struct iwl_nvm_get_info_phy {
2626 __le32 tx_chains;
2627 __le32 rx_chains;
2628} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2629
2630#define IWL_NUM_CHANNELS (51)
2631
2632/**
2633 * struct iwl_nvm_get_info_regulatory - regulatory information
2634 * @lar_enabled: is LAR enabled
2635 * @channel_profile: regulatory data of this channel
Sara Sharone9e1ba32017-01-08 16:46:14 +02002636 */
2637struct iwl_nvm_get_info_regulatory {
2638 __le32 lar_enabled;
2639 __le16 channel_profile[IWL_NUM_CHANNELS];
2640 __le16 reserved;
2641} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2642
2643/**
2644 * struct iwl_nvm_get_info_rsp - response to get NVM data
2645 * @general: general NVM data
2646 * @mac_sku: data relating to MAC sku
2647 * @phy_sku: data relating to PHY sku
2648 * @regulatory: regulatory data
2649 */
2650struct iwl_nvm_get_info_rsp {
2651 struct iwl_nvm_get_info_general general;
2652 struct iwl_nvm_get_info_sku mac_sku;
2653 struct iwl_nvm_get_info_phy phy_sku;
2654 struct iwl_nvm_get_info_regulatory regulatory;
2655} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2656
Johannes Berg15fc1962017-03-10 14:01:42 +01002657/**
2658 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2659 * @isolation: antenna isolation value
2660 */
2661struct iwl_mvm_antenna_coupling_notif {
2662 __le32 isolation;
2663} __packed;
2664
Johannes Berg8ca151b2013-01-24 14:25:36 +01002665#endif /* __fw_api_h__ */