blob: bf0523d8ca9ae5d2bd7f36fd61bf411cd73a28cd [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 Berg8ca151b2013-01-24 14:25:36 +0100218 /* TX */
219 TX_CMD = 0x1c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100220
221 /**
222 * @TXPATH_FLUSH: &struct iwl_tx_path_flush_cmd
223 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100224 TXPATH_FLUSH = 0x1e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100225
226 /**
227 * @MGMT_MCAST_KEY:
228 * &struct iwl_mvm_mgmt_mcast_key_cmd or
229 * &struct iwl_mvm_mgmt_mcast_key_cmd_v1
230 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100231 MGMT_MCAST_KEY = 0x1f,
232
Avri Altman3edf8ff2014-07-30 11:41:01 +0300233 /* scheduler config */
Johannes Berg15fc1962017-03-10 14:01:42 +0100234 /**
Johannes Berge153c1e2017-03-30 14:23:21 +0200235 * @SCD_QUEUE_CFG: &struct iwl_scd_txq_cfg_cmd for older hardware,
236 * &struct iwl_tx_queue_cfg_cmd with &struct iwl_tx_queue_cfg_rsp
237 * for newer (A000) hardware.
Johannes Berg15fc1962017-03-10 14:01:42 +0100238 */
Avri Altman3edf8ff2014-07-30 11:41:01 +0300239 SCD_QUEUE_CFG = 0x1d,
240
Johannes Berg8ca151b2013-01-24 14:25:36 +0100241 /* global key */
242 WEP_KEY = 0x20,
243
Liad Kaufman04fd2c22014-12-15 17:54:16 +0200244 /* Memory */
245 SHARED_MEM_CFG = 0x25,
246
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300247 /* TDLS */
248 TDLS_CHANNEL_SWITCH_CMD = 0x27,
249 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
Arik Nemtsov307e4722014-09-15 18:48:59 +0300250 TDLS_CONFIG_CMD = 0xa7,
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300251
Johannes Berg15fc1962017-03-10 14:01:42 +0100252 /**
253 * @MAC_CONTEXT_CMD: &struct iwl_mac_ctx_cmd
254 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100255 MAC_CONTEXT_CMD = 0x28,
Johannes Berg15fc1962017-03-10 14:01:42 +0100256
257 /**
258 * @TIME_EVENT_CMD:
259 * &struct iwl_time_event_cmd, response in &struct iwl_time_event_resp
260 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100261 TIME_EVENT_CMD = 0x29, /* both CMD and response */
Johannes Berg15fc1962017-03-10 14:01:42 +0100262 /**
263 * @TIME_EVENT_NOTIFICATION: &struct iwl_time_event_notif
264 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100265 TIME_EVENT_NOTIFICATION = 0x2a,
Johannes Berg15fc1962017-03-10 14:01:42 +0100266 /**
267 * @BINDING_CONTEXT_CMD:
268 * &struct iwl_binding_cmd or &struct iwl_binding_cmd_v1
269 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100270 BINDING_CONTEXT_CMD = 0x2b,
Johannes Berg15fc1962017-03-10 14:01:42 +0100271 /**
272 * @TIME_QUOTA_CMD: &struct iwl_time_quota_cmd
273 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100274 TIME_QUOTA_CMD = 0x2c,
Johannes Berg4ac6cb52013-08-08 09:30:13 +0200275 NON_QOS_TX_COUNTER_CMD = 0x2d,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100276
Johannes Berg15fc1962017-03-10 14:01:42 +0100277 /**
278 * @LQ_CMD: using &struct iwl_lq_cmd
279 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100280 LQ_CMD = 0x4e,
281
Johannes Berg15fc1962017-03-10 14:01:42 +0100282 /**
283 * @FW_PAGING_BLOCK_CMD:
284 * &struct iwl_fw_paging_cmd or &struct iwl_fw_paging_cmd_v1
285 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300286 FW_PAGING_BLOCK_CMD = 0x4f,
287
Johannes Berg8ca151b2013-01-24 14:25:36 +0100288 /* Scan offload */
289 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
290 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300291 HOT_SPOT_CMD = 0x53,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100292 SCAN_OFFLOAD_COMPLETE = 0x6D,
293 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
294 SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
David Spinadel35a000b2013-08-28 09:29:43 +0300295 MATCH_FOUND_NOTIFICATION = 0xd9,
David Spinadelfb98be52014-05-04 12:51:10 +0300296 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100297
298 /* Phy */
Johannes Berg15fc1962017-03-10 14:01:42 +0100299 /**
300 * @PHY_CONFIGURATION_CMD: &struct iwl_phy_cfg_cmd
301 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100302 PHY_CONFIGURATION_CMD = 0x6a,
303 CALIB_RES_NOTIF_PHY_DB = 0x6b,
Sara Sharon176aa602016-08-31 19:03:01 +0300304 PHY_DB_CMD = 0x6c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100305
Gregory Greenmance792912015-06-02 18:06:16 +0300306 /* ToF - 802.11mc FTM */
307 TOF_CMD = 0x10,
308 TOF_NOTIFICATION = 0x11,
309
Johannes Berg15fc1962017-03-10 14:01:42 +0100310 /**
311 * @POWER_TABLE_CMD: &struct iwl_device_power_cmd
312 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100313 POWER_TABLE_CMD = 0x77,
Alexander Bondar175a70b2013-04-14 20:59:37 +0300314 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300315 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100316
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300317 /* Thermal Throttling*/
318 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
319
Matti Gottlieb0becb372015-05-31 09:18:30 +0300320 /* Set/Get DC2DC frequency tune */
321 DC2DC_CONFIG_CMD = 0x83,
322
Johannes Berg15fc1962017-03-10 14:01:42 +0100323 /**
324 * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd
325 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100326 NVM_ACCESS_CMD = 0x88,
327
328 SET_CALIB_DEFAULT_CMD = 0x8e,
329
Ilan Peer571765c2013-03-05 15:26:03 +0200330 BEACON_NOTIFICATION = 0x90,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100331 BEACON_TEMPLATE_CMD = 0x91,
Johannes Berg15fc1962017-03-10 14:01:42 +0100332 /**
333 * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
334 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100335 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg15fc1962017-03-10 14:01:42 +0100336
337 /**
338 * @STATISTICS_CMD: &struct iwl_statistics_cmd
339 */
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100340 STATISTICS_CMD = 0x9c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100341
342 /**
343 * @STATISTICS_NOTIFICATION:
344 * one of &struct iwl_notif_statistics_v10,
345 * &struct iwl_notif_statistics_v11,
346 * &struct iwl_notif_statistics_cdb
347 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100348 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg3e56ead2013-02-15 22:23:18 +0100349 EOSP_NOTIFICATION = 0x9e,
Johannes Berg15fc1962017-03-10 14:01:42 +0100350
351 /**
352 * @REDUCE_TX_POWER_CMD:
353 * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
354 */
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300355 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100356
357 /* RF-KILL commands and notifications */
358 CARD_STATE_CMD = 0xa0,
359 CARD_STATE_NOTIFICATION = 0xa1,
360
Hila Gonend64048e2013-03-13 18:00:03 +0200361 MISSED_BEACONS_NOTIFICATION = 0xa2,
362
Johannes Berg15fc1962017-03-10 14:01:42 +0100363 /**
364 * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
365 */
Alexander Bondare811ada2013-03-10 15:29:44 +0200366 MAC_PM_POWER_TABLE = 0xa9,
367
Johannes Berg15fc1962017-03-10 14:01:42 +0100368 /**
369 * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
370 */
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200371 MFUART_LOAD_NOTIFICATION = 0xb1,
372
Johannes Berg15fc1962017-03-10 14:01:42 +0100373 /**
374 * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
375 */
Sara Sharon43413a92015-12-31 11:49:18 +0200376 RSS_CONFIG_CMD = 0xb3,
377
Johannes Berg6857df82017-03-15 14:06:53 +0100378 /**
379 * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
380 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100381 REPLY_RX_PHY_CMD = 0xc0,
Johannes Berg6857df82017-03-15 14:06:53 +0100382
383 /**
384 * @REPLY_RX_MPDU_CMD:
385 * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
386 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100387 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg13555e82015-09-02 16:16:49 +0200388 FRAME_RELEASE = 0xc3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100389 BA_NOTIF = 0xc5,
390
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200391 /* Location Aware Regulatory */
Johannes Berg15fc1962017-03-10 14:01:42 +0100392 /**
393 * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
394 */
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200395 MCC_UPDATE_CMD = 0xc8,
Johannes Berg15fc1962017-03-10 14:01:42 +0100396
397 /**
398 * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
399 */
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200400 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200401
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300402 MARKER_CMD = 0xcb,
403
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200404 /* BT Coex */
405 BT_COEX_PRIO_TABLE = 0xcc,
406 BT_COEX_PROT_ENV = 0xcd,
Johannes Berg15fc1962017-03-10 14:01:42 +0100407 /**
408 * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
409 */
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200410 BT_PROFILE_NOTIFICATION = 0xce,
Johannes Berg15fc1962017-03-10 14:01:42 +0100411 /**
412 * @BT_CONFIG: &struct iwl_bt_coex_cmd
413 */
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300414 BT_CONFIG = 0x9b,
415 BT_COEX_UPDATE_SW_BOOST = 0x5a,
416 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
417 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Johannes Berg15fc1962017-03-10 14:01:42 +0100418 /**
419 * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
420 */
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300421 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200422
Johannes Berg15fc1962017-03-10 14:01:42 +0100423 /**
424 * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
425 */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200426 REPLY_SF_CFG_CMD = 0xd1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100427 /**
428 * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
429 */
Hila Gonen7df15b12012-12-12 11:16:19 +0200430 REPLY_BEACON_FILTERING_CMD = 0xd2,
431
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300432 /* DTS measurements */
433 CMD_DTS_MEASUREMENT_TRIGGER = 0xdc,
434 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
435
Johannes Berg8ca151b2013-01-24 14:25:36 +0100436 REPLY_DEBUG_CMD = 0xf0,
Golan Ben Ami321c2102015-07-27 17:02:35 +0300437 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100438 DEBUG_LOG_MSG = 0xf7,
439
Eliad Pellerc87163b2014-01-08 10:11:11 +0200440 BCAST_FILTER_CMD = 0xcf,
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300441 MCAST_FILTER_CMD = 0xd0,
442
Johannes Berg15fc1962017-03-10 14:01:42 +0100443 /**
444 * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
445 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100446 D3_CONFIG_CMD = 0xd3,
447 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
448 OFFLOADS_QUERY_CMD = 0xd5,
449 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300450 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100451
Johannes Berg15fc1962017-03-10 14:01:42 +0100452 /**
453 * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
454 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100455 WOWLAN_PATTERNS = 0xe0,
Johannes Berg15fc1962017-03-10 14:01:42 +0100456
457 /**
458 * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
459 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100460 WOWLAN_CONFIGURATION = 0xe1,
Johannes Berg15fc1962017-03-10 14:01:42 +0100461 /**
462 * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
463 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100464 WOWLAN_TSC_RSC_PARAM = 0xe2,
Johannes Berg15fc1962017-03-10 14:01:42 +0100465 /**
466 * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
467 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100468 WOWLAN_TKIP_PARAM = 0xe3,
Johannes Berg15fc1962017-03-10 14:01:42 +0100469 /**
470 * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
471 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100472 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
Johannes Berg15fc1962017-03-10 14:01:42 +0100473 /**
474 * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
475 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100476 WOWLAN_GET_STATUSES = 0xe5,
477 WOWLAN_TX_POWER_PER_DB = 0xe6,
478
479 /* and for NetDetect */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200480 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
481 SCAN_OFFLOAD_HOTSPOTS_CONFIG_CMD = 0x58,
482 SCAN_OFFLOAD_HOTSPOTS_QUERY_CMD = 0x59,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100483};
484
Sharon Dvir39bdb172015-10-15 18:18:09 +0300485/* Please keep this enum *SORTED* by hex value.
486 * Needed for binary search, otherwise a warning will be triggered.
487 */
Aviya Erenfeld03098262016-02-18 14:09:33 +0200488enum iwl_mac_conf_subcmd_ids {
489 LINK_QUALITY_MEASUREMENT_CMD = 0x1,
490 LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200491 CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200492};
493
Johannes Berg15fc1962017-03-10 14:01:42 +0100494/**
495 * enum iwl_phy_ops_subcmd_ids - PHY group commands
496 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300497enum iwl_phy_ops_subcmd_ids {
498 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +0200499 CTDP_CONFIG_CMD = 0x03,
Johannes Berg15fc1962017-03-10 14:01:42 +0100500
501 /**
502 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
503 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200504 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Haim Dreyfussa6bff3c2017-01-19 12:00:46 +0200505 GEO_TX_POWER_LIMIT = 0x05,
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200506 CT_KILL_NOTIFICATION = 0xFE,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300507 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
508};
509
Johannes Berg15fc1962017-03-10 14:01:42 +0100510/**
511 * enum iwl_system_subcmd_ids - system group command IDs
512 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200513enum iwl_system_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100514 /**
515 * @SHARED_MEM_CFG_CMD:
516 * response in &struct iwl_shared_mem_cfg or
517 * &struct iwl_shared_mem_cfg_v1
518 */
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200519 SHARED_MEM_CFG_CMD = 0x0,
Sara Sharon4399caa2016-12-11 10:32:42 +0200520 INIT_EXTENDED_CFG_CMD = 0x03,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200521};
522
Johannes Berg15fc1962017-03-10 14:01:42 +0100523/**
524 * enum iwl_data_path_subcmd_ids - data path group commands
525 */
Sara Sharona07a8f32015-11-15 11:11:59 +0200526enum iwl_data_path_subcmd_ids {
Johannes Berg15fc1962017-03-10 14:01:42 +0100527 /**
528 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
529 */
Liad Kaufman97d5be72015-08-31 14:33:23 +0300530 DQA_ENABLE_CMD = 0x0,
Sara Sharona07a8f32015-11-15 11:11:59 +0200531 UPDATE_MU_GROUPS_CMD = 0x1,
Sara Sharon94bb4482015-12-16 18:48:28 +0200532 TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
Johannes Berg65e25482016-04-13 14:24:22 +0200533 STA_PM_NOTIF = 0xFD,
Sara Sharonf92659a2016-02-03 15:04:49 +0200534 MU_GROUP_MGMT_NOTIF = 0xFE,
Sara Sharon94bb4482015-12-16 18:48:28 +0200535 RX_QUEUES_NOTIFICATION = 0xFF,
Sara Sharona07a8f32015-11-15 11:11:59 +0200536};
537
Sara Sharon0db056d2015-12-29 11:07:15 +0200538enum iwl_prot_offload_subcmd_ids {
539 STORED_BEACON_NTF = 0xFF,
540};
541
Sara Sharon1f370652016-08-31 18:13:57 +0300542enum iwl_regulatory_and_nvm_subcmd_ids {
543 NVM_ACCESS_COMPLETE = 0x0,
Sara Sharone9e1ba32017-01-08 16:46:14 +0200544 NVM_GET_INFO = 0x2,
Sara Sharon1f370652016-08-31 18:13:57 +0300545};
546
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200547enum iwl_debug_cmds {
Ido Yariv2b55f432016-08-23 14:44:59 -0400548 LMAC_RD_WR = 0x0,
549 UMAC_RD_WR = 0x1,
Golan Ben-Amibdccdb82016-11-15 14:45:29 +0200550 MFU_ASSERT_DUMP_NTF = 0xFE,
Ido Yariv2b55f432016-08-23 14:44:59 -0400551};
552
Johannes Berg72361c32017-03-09 17:06:45 +0100553/**
554 * enum iwl_mvm_command_groups - command groups for the firmware
555 * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
556 * @LONG_GROUP: legacy group with long header, also uses command IDs
557 * from &enum iwl_legacy_cmds
558 * @SYSTEM_GROUP: system group, uses command IDs from
559 * &enum iwl_system_subcmd_ids
560 * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
561 * &enum iwl_mac_conf_subcmd_ids
562 * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
563 * &enum iwl_phy_ops_subcmd_ids
564 * @DATA_PATH_GROUP: data path group, uses command IDs from
565 * &enum iwl_data_path_subcmd_ids
566 * @SCAN_GROUP: scan group, uses command IDs from &enum iwl_scan_subcmd_ids
567 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
568 * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
569 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
570 * &enum iwl_prot_offload_subcmd_ids
571 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
572 * &enum iwl_regulatory_and_nvm_subcmd_ids
573 * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
574 */
575enum iwl_mvm_command_groups {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300576 LEGACY_GROUP = 0x0,
577 LONG_GROUP = 0x1,
Golan Ben-Ami5b086412016-02-09 12:57:16 +0200578 SYSTEM_GROUP = 0x2,
Aviya Erenfeld03098262016-02-18 14:09:33 +0200579 MAC_CONF_GROUP = 0x3,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300580 PHY_OPS_GROUP = 0x4,
Sara Sharona07a8f32015-11-15 11:11:59 +0200581 DATA_PATH_GROUP = 0x5,
Sara Sharon0db056d2015-12-29 11:07:15 +0200582 PROT_OFFLOAD_GROUP = 0xb,
Sara Sharon1f370652016-08-31 18:13:57 +0300583 REGULATORY_AND_NVM_GROUP = 0xc,
Ido Yariv2b55f432016-08-23 14:44:59 -0400584 DEBUG_GROUP = 0xf,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300585};
586
Johannes Berg8ca151b2013-01-24 14:25:36 +0100587/**
588 * struct iwl_cmd_response - generic response struct for most commands
589 * @status: status of the command asked, changes for each one
590 */
591struct iwl_cmd_response {
592 __le32 status;
593};
594
595/*
Liad Kaufman97d5be72015-08-31 14:33:23 +0300596 * struct iwl_dqa_enable_cmd
597 * @cmd_queue: the TXQ number of the command queue
598 */
599struct iwl_dqa_enable_cmd {
600 __le32 cmd_queue;
601} __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
602
603/*
Johannes Berg8ca151b2013-01-24 14:25:36 +0100604 * struct iwl_tx_ant_cfg_cmd
605 * @valid: valid antenna configuration
606 */
607struct iwl_tx_ant_cfg_cmd {
608 __le32 valid;
609} __packed;
610
Johannes Berg31a658b2017-03-09 15:56:57 +0100611/**
612 * struct iwl_calib_ctrl - Calibration control struct.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100613 * Sent as part of the phy configuration command.
614 * @flow_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100615 * flow triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100616 * @event_trigger: bitmap for which calibrations to perform according to
Johannes Berg31a658b2017-03-09 15:56:57 +0100617 * event triggers, using &enum iwl_calib_cfg
Johannes Berg8ca151b2013-01-24 14:25:36 +0100618 */
619struct iwl_calib_ctrl {
620 __le32 flow_trigger;
621 __le32 event_trigger;
622} __packed;
623
624/* This enum defines the bitmap of various calibrations to enable in both
625 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
626 */
627enum iwl_calib_cfg {
628 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
629 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
630 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
631 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
632 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
633 IWL_CALIB_CFG_DC_IDX = BIT(5),
634 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
635 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
636 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
637 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
638 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
639 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
640 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
641 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
642 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
643 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
644 IWL_CALIB_CFG_DAC_IDX = BIT(16),
645 IWL_CALIB_CFG_ABS_IDX = BIT(17),
646 IWL_CALIB_CFG_AGC_IDX = BIT(18),
647};
648
Johannes Berg31a658b2017-03-09 15:56:57 +0100649/**
650 * struct iwl_phy_cfg_cmd - Phy configuration command
651 * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
652 * @calib_control: calibration control data
Johannes Berg8ca151b2013-01-24 14:25:36 +0100653 */
654struct iwl_phy_cfg_cmd {
655 __le32 phy_cfg;
656 struct iwl_calib_ctrl calib_control;
657} __packed;
658
659#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
660#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
661#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
662#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
663#define PHY_CFG_TX_CHAIN_A BIT(8)
664#define PHY_CFG_TX_CHAIN_B BIT(9)
665#define PHY_CFG_TX_CHAIN_C BIT(10)
666#define PHY_CFG_RX_CHAIN_A BIT(12)
667#define PHY_CFG_RX_CHAIN_B BIT(13)
668#define PHY_CFG_RX_CHAIN_C BIT(14)
669
670
Johannes Bergd69f0a22017-03-14 10:58:16 +0100671/**
672 * enum iwl_nvm_access_op - NVM access opcode
673 * @IWL_NVM_READ: read NVM
674 * @IWL_NVM_WRITE: write NVM
675 */
676enum iwl_nvm_access_op {
677 IWL_NVM_READ = 0,
678 IWL_NVM_WRITE = 1,
679};
680
681/**
682 * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
683 * @NVM_ACCESS_TARGET_CACHE: access the cache
684 * @NVM_ACCESS_TARGET_OTP: access the OTP
685 * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
686 */
687enum iwl_nvm_access_target {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100688 NVM_ACCESS_TARGET_CACHE = 0,
689 NVM_ACCESS_TARGET_OTP = 1,
690 NVM_ACCESS_TARGET_EEPROM = 2,
691};
692
Johannes Bergd69f0a22017-03-14 10:58:16 +0100693/**
694 * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
695 * @NVM_SECTION_TYPE_SW: software section
696 * @NVM_SECTION_TYPE_REGULATORY: regulatory section
697 * @NVM_SECTION_TYPE_CALIBRATION: calibration section
698 * @NVM_SECTION_TYPE_PRODUCTION: production section
699 * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
700 * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
701 * @NVM_MAX_NUM_SECTIONS: number of sections
702 */
703enum iwl_nvm_section_type {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200704 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200705 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200706 NVM_SECTION_TYPE_CALIBRATION = 4,
707 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200708 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200709 NVM_SECTION_TYPE_PHY_SKU = 12,
710 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100711};
712
713/**
Johannes Berg67625862017-03-14 11:01:27 +0100714 * struct iwl_nvm_access_cmd - Request the device to send an NVM section
715 * @op_code: &enum iwl_nvm_access_op
716 * @target: &enum iwl_nvm_access_target
717 * @type: &enum iwl_nvm_section_type
Johannes Berg8ca151b2013-01-24 14:25:36 +0100718 * @offset: offset in bytes into the section
719 * @length: in bytes, to read/write
720 * @data: if write operation, the data to write. On read its empty
721 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200722struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100723 u8 op_code;
724 u8 target;
725 __le16 type;
726 __le16 offset;
727 __le16 length;
728 u8 data[];
729} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
730
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300731#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
732
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100733/**
734 * struct iwl_fw_paging_cmd_v1 - paging layout
735 *
736 * (FW_PAGING_BLOCK_CMD = 0x4f)
737 *
738 * Send to FW the paging layout in the driver.
739 *
740 * @flags: various flags for the command
741 * @block_size: the block size in powers of 2
742 * @block_num: number of blocks specified in the command.
743 * @device_phy_addr: virtual addresses from device side
744 */
745struct iwl_fw_paging_cmd_v1 {
746 __le32 flags;
747 __le32 block_size;
748 __le32 block_num;
749 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
750} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
751
752/**
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300753 * struct iwl_fw_paging_cmd - paging layout
754 *
755 * (FW_PAGING_BLOCK_CMD = 0x4f)
756 *
757 * Send to FW the paging layout in the driver.
758 *
759 * @flags: various flags for the command
760 * @block_size: the block size in powers of 2
761 * @block_num: number of blocks specified in the command.
762 * @device_phy_addr: virtual addresses from device side
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100763 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300764struct iwl_fw_paging_cmd {
765 __le32 flags;
766 __le32 block_size;
767 __le32 block_num;
Johannes Berg3b43fbc2017-03-13 21:48:39 +0100768 __le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
Sara Sharond975d722016-07-04 11:52:07 +0300769} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300770
Matti Gottliebe1120182015-07-19 11:15:07 +0300771/*
772 * Fw items ID's
773 *
774 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
775 * download
776 */
777enum iwl_fw_item_id {
778 IWL_FW_ITEM_ID_PAGING = 3,
779};
780
781/*
782 * struct iwl_fw_get_item_cmd - get an item from the fw
783 */
784struct iwl_fw_get_item_cmd {
785 __le32 item_id;
786} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
787
Golan Ben Ami321c2102015-07-27 17:02:35 +0300788#define CONT_REC_COMMAND_SIZE 80
789#define ENABLE_CONT_RECORDING 0x15
790#define DISABLE_CONT_RECORDING 0x16
791
792/*
793 * struct iwl_continuous_record_mode - recording mode
794 */
795struct iwl_continuous_record_mode {
796 __le16 enable_recording;
797} __packed;
798
799/*
800 * struct iwl_continuous_record_cmd - enable/disable continuous recording
801 */
802struct iwl_continuous_record_cmd {
803 struct iwl_continuous_record_mode record_mode;
804 u8 pad[CONT_REC_COMMAND_SIZE -
805 sizeof(struct iwl_continuous_record_mode)];
806} __packed;
807
Matti Gottliebe1120182015-07-19 11:15:07 +0300808struct iwl_fw_get_item_resp {
809 __le32 item_id;
810 __le32 item_byte_cnt;
811 __le32 item_val;
812} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
813
Johannes Berg8ca151b2013-01-24 14:25:36 +0100814/**
815 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
816 * @offset: offset in bytes into the section
817 * @length: in bytes, either how much was written or read
818 * @type: NVM_SECTION_TYPE_*
819 * @status: 0 for success, fail otherwise
820 * @data: if read operation, the data returned. Empty on write.
821 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200822struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100823 __le16 offset;
824 __le16 length;
825 __le16 type;
826 __le16 status;
827 u8 data[];
828} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
829
830/* MVM_ALIVE 0x1 */
831
832/* alive response is_valid values */
833#define ALIVE_RESP_UCODE_OK BIT(0)
834#define ALIVE_RESP_RFKILL BIT(1)
835
836/* alive response ver_type values */
837enum {
838 FW_TYPE_HW = 0,
839 FW_TYPE_PROT = 1,
840 FW_TYPE_AP = 2,
841 FW_TYPE_WOWLAN = 3,
842 FW_TYPE_TIMING = 4,
843 FW_TYPE_WIPAN = 5
844};
845
846/* alive response ver_subtype values */
847enum {
848 FW_SUBTYPE_FULL_FEATURE = 0,
849 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
850 FW_SUBTYPE_REDUCED = 2,
851 FW_SUBTYPE_ALIVE_ONLY = 3,
852 FW_SUBTYPE_WOWLAN = 4,
853 FW_SUBTYPE_AP_SUBTYPE = 5,
854 FW_SUBTYPE_WIPAN = 6,
855 FW_SUBTYPE_INITIALIZE = 9
856};
857
858#define IWL_ALIVE_STATUS_ERR 0xDEAD
859#define IWL_ALIVE_STATUS_OK 0xCAFE
860
861#define IWL_ALIVE_FLG_RFKILL BIT(0)
862
Sara Sharon5c228d62016-11-24 13:48:27 +0200863struct iwl_lmac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200864 __le32 ucode_minor;
865 __le32 ucode_major;
866 u8 ver_subtype;
867 u8 ver_type;
868 u8 mac;
869 u8 opt;
870 __le32 timestamp;
871 __le32 error_event_table_ptr; /* SRAM address for error log */
872 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
873 __le32 cpu_register_ptr;
874 __le32 dbgm_config_ptr;
875 __le32 alive_counter_ptr;
876 __le32 scd_base_ptr; /* SRAM address for SCD */
877 __le32 st_fwrd_addr; /* pointer to Store and forward */
878 __le32 st_fwrd_size;
Sara Sharon5c228d62016-11-24 13:48:27 +0200879} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
880
881struct iwl_umac_alive {
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200882 __le32 umac_minor; /* UMAC version: minor */
883 __le32 umac_major; /* UMAC version: major */
884 __le32 error_info_addr; /* SRAM address for UMAC error log */
885 __le32 dbg_print_buff_addr;
Sara Sharon5c228d62016-11-24 13:48:27 +0200886} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
887
888struct mvm_alive_resp_v3 {
889 __le16 status;
890 __le16 flags;
891 struct iwl_lmac_alive lmac_data;
892 struct iwl_umac_alive umac_data;
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200893} __packed; /* ALIVE_RES_API_S_VER_3 */
894
Sara Sharon5c228d62016-11-24 13:48:27 +0200895struct mvm_alive_resp {
896 __le16 status;
897 __le16 flags;
898 struct iwl_lmac_alive lmac_data[2];
899 struct iwl_umac_alive umac_data;
900} __packed; /* ALIVE_RES_API_S_VER_4 */
901
Johannes Berg8ca151b2013-01-24 14:25:36 +0100902/* Error response/notification */
903enum {
904 FW_ERR_UNKNOWN_CMD = 0x0,
905 FW_ERR_INVALID_CMD_PARAM = 0x1,
906 FW_ERR_SERVICE = 0x2,
907 FW_ERR_ARC_MEMORY = 0x3,
908 FW_ERR_ARC_CODE = 0x4,
909 FW_ERR_WATCH_DOG = 0x5,
910 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
911 FW_ERR_WEP_KEY_SIZE = 0x11,
912 FW_ERR_OBSOLETE_FUNC = 0x12,
913 FW_ERR_UNEXPECTED = 0xFE,
914 FW_ERR_FATAL = 0xFF
915};
916
917/**
918 * struct iwl_error_resp - FW error indication
919 * ( REPLY_ERROR = 0x2 )
920 * @error_type: one of FW_ERR_*
921 * @cmd_id: the command ID for which the error occured
922 * @bad_cmd_seq_num: sequence number of the erroneous command
923 * @error_service: which service created the error, applicable only if
924 * error_type = 2, otherwise 0
925 * @timestamp: TSF in usecs.
926 */
927struct iwl_error_resp {
928 __le32 error_type;
929 u8 cmd_id;
930 u8 reserved1;
931 __le16 bad_cmd_seq_num;
932 __le32 error_service;
933 __le64 timestamp;
934} __packed;
935
936
937/* Common PHY, MAC and Bindings definitions */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100938#define MAX_MACS_IN_BINDING (3)
939#define MAX_BINDINGS (4)
Johannes Berg8ca151b2013-01-24 14:25:36 +0100940
Johannes Bergd69f0a22017-03-14 10:58:16 +0100941/**
942 * enum iwl_mvm_id_and_color - ID and color fields in context dword
943 * @FW_CTXT_ID_POS: position of the ID
944 * @FW_CTXT_ID_MSK: mask of the ID
945 * @FW_CTXT_COLOR_POS: position of the color
946 * @FW_CTXT_COLOR_MSK: mask of the color
947 * @FW_CTXT_INVALID: value used to indicate unused/invalid
948 */
949enum iwl_mvm_id_and_color {
950 FW_CTXT_ID_POS = 0,
951 FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
952 FW_CTXT_COLOR_POS = 8,
953 FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
954 FW_CTXT_INVALID = 0xffffffff,
955};
Johannes Berg8ca151b2013-01-24 14:25:36 +0100956
957#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
958 (_color << FW_CTXT_COLOR_POS))
959
960/* Possible actions on PHYs, MACs and Bindings */
Sara Sharon730a1892017-02-07 18:37:40 +0200961enum iwl_phy_ctxt_action {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100962 FW_CTXT_ACTION_STUB = 0,
963 FW_CTXT_ACTION_ADD,
964 FW_CTXT_ACTION_MODIFY,
965 FW_CTXT_ACTION_REMOVE,
966 FW_CTXT_ACTION_NUM
967}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
968
969/* Time Events */
970
971/* Time Event types, according to MAC type */
972enum iwl_time_event_type {
973 /* BSS Station Events */
974 TE_BSS_STA_AGGRESSIVE_ASSOC,
975 TE_BSS_STA_ASSOC,
976 TE_BSS_EAP_DHCP_PROT,
977 TE_BSS_QUIET_PERIOD,
978
979 /* P2P Device Events */
980 TE_P2P_DEVICE_DISCOVERABLE,
981 TE_P2P_DEVICE_LISTEN,
982 TE_P2P_DEVICE_ACTION_SCAN,
983 TE_P2P_DEVICE_FULL_SCAN,
984
985 /* P2P Client Events */
986 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
987 TE_P2P_CLIENT_ASSOC,
988 TE_P2P_CLIENT_QUIET_PERIOD,
989
990 /* P2P GO Events */
991 TE_P2P_GO_ASSOC_PROT,
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200992 TE_P2P_GO_REPETITIVET_NOA,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100993 TE_P2P_GO_CT_WINDOW,
994
995 /* WiDi Sync Events */
996 TE_WIDI_TX_SYNC,
997
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +0300998 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +0300999 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +03001000
Johannes Berg8ca151b2013-01-24 14:25:36 +01001001 TE_MAX
1002}; /* MAC_EVENT_TYPE_API_E_VER_1 */
1003
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001004
1005
1006/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +01001007
1008/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001009 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
1010 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1011 * the first fragment is scheduled.
1012 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
1013 * the first 2 fragments are scheduled.
1014 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1015 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001016 *
1017 * Other than the constant defined above, specifying a fragmentation value 'x'
1018 * means that the event can be fragmented but only the first 'x' will be
1019 * scheduled.
1020 */
1021enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001022 TE_V1_FRAG_NONE = 0,
1023 TE_V1_FRAG_SINGLE = 1,
1024 TE_V1_FRAG_DUAL = 2,
1025 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +01001026};
1027
Johannes Berg8ca151b2013-01-24 14:25:36 +01001028/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001029#define TE_V1_FRAG_MAX_MSK 0x0fffffff
1030/* Repeat the time event endlessly (until removed) */
1031#define TE_V1_REPEAT_ENDLESS 0xffffffff
1032/* If a Time Event has bounded repetitions, this is the maximal value */
1033#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
1034
1035/* Time Event dependencies: none, on another TE, or in a specific time */
1036enum {
1037 TE_V1_INDEPENDENT = 0,
1038 TE_V1_DEP_OTHER = BIT(0),
1039 TE_V1_DEP_TSF = BIT(1),
1040 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
1041}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
1042
1043/*
1044 * @TE_V1_NOTIF_NONE: no notifications
1045 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
1046 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
1047 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
1048 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
1049 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1050 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1051 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
1052 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
1053 *
1054 * Supported Time event notifications configuration.
1055 * A notification (both event and fragment) includes a status indicating weather
1056 * the FW was able to schedule the event or not. For fragment start/end
1057 * notification the status is always success. There is no start/end fragment
1058 * notification for monolithic events.
1059 */
1060enum {
1061 TE_V1_NOTIF_NONE = 0,
1062 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
1063 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
1064 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
1065 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
1066 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
1067 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
1068 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
1069 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
1070}; /* MAC_EVENT_ACTION_API_E_VER_2 */
1071
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001072/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001073
1074/*
1075 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
1076 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
1077 * the first fragment is scheduled.
1078 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
1079 * the first 2 fragments are scheduled.
1080 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
1081 * number of fragments are valid.
1082 *
1083 * Other than the constant defined above, specifying a fragmentation value 'x'
1084 * means that the event can be fragmented but only the first 'x' will be
1085 * scheduled.
1086 */
1087enum {
1088 TE_V2_FRAG_NONE = 0,
1089 TE_V2_FRAG_SINGLE = 1,
1090 TE_V2_FRAG_DUAL = 2,
1091 TE_V2_FRAG_MAX = 0xfe,
1092 TE_V2_FRAG_ENDLESS = 0xff
1093};
1094
1095/* Repeat the time event endlessly (until removed) */
1096#define TE_V2_REPEAT_ENDLESS 0xff
1097/* If a Time Event has bounded repetitions, this is the maximal value */
1098#define TE_V2_REPEAT_MAX 0xfe
1099
1100#define TE_V2_PLACEMENT_POS 12
1101#define TE_V2_ABSENCE_POS 15
1102
Johannes Bergd69f0a22017-03-14 10:58:16 +01001103/**
1104 * enum iwl_time_event_policy - Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001105 * A notification (both event and fragment) includes a status indicating weather
1106 * the FW was able to schedule the event or not. For fragment start/end
1107 * notification the status is always success. There is no start/end fragment
1108 * notification for monolithic events.
1109 *
1110 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
1111 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
1112 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
1113 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
1114 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
1115 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
1116 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
1117 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
1118 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
Johannes Bergd69f0a22017-03-14 10:58:16 +01001119 * @T2_V2_START_IMMEDIATELY: start time event immediately
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001120 * @TE_V2_DEP_OTHER: depends on another time event
1121 * @TE_V2_DEP_TSF: depends on a specific time
1122 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
1123 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
1124 */
Johannes Bergd69f0a22017-03-14 10:58:16 +01001125enum iwl_time_event_policy {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001126 TE_V2_DEFAULT_POLICY = 0x0,
1127
1128 /* notifications (event start/stop, fragment start/stop) */
1129 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
1130 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
1131 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
1132 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
1133
1134 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
1135 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
1136 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
1137 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +02001138 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001139
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001140 /* placement characteristics */
1141 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
1142 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
1143 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
1144
1145 /* are we present or absent during the Time Event. */
1146 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
1147};
1148
1149/**
Johannes Berg67625862017-03-14 11:01:27 +01001150 * struct iwl_time_event_cmd - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001151 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
1152 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
1153 * ( TIME_EVENT_CMD = 0x29 )
Johannes Berg67625862017-03-14 11:01:27 +01001154 * @id_and_color: ID and color of the relevant MAC,
1155 * &enum iwl_mvm_id_and_color
1156 * @action: action to perform, one of &enum iwl_phy_ctxt_action
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001157 * @id: this field has two meanings, depending on the action:
1158 * If the action is ADD, then it means the type of event to add.
1159 * For all other actions it is the unique event ID assigned when the
1160 * event was added by the FW.
1161 * @apply_time: When to start the Time Event (in GP2)
1162 * @max_delay: maximum delay to event's start (apply time), in TU
1163 * @depends_on: the unique ID of the event we depend on (if any)
1164 * @interval: interval between repetitions, in TU
1165 * @duration: duration of event in TU
1166 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
1167 * @max_frags: maximal number of fragments the Time Event can be divided to
1168 * @policy: defines whether uCode shall notify the host or other uCode modules
1169 * on event and/or fragment start and/or end
1170 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
1171 * TE_EVENT_SOCIOPATHIC
Johannes Berg67625862017-03-14 11:01:27 +01001172 * using TE_ABSENCE and using TE_NOTIF_*,
1173 * &enum iwl_time_event_policy
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001174 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +03001175struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +03001176 /* COMMON_INDEX_HDR_API_S_VER_1 */
1177 __le32 id_and_color;
1178 __le32 action;
1179 __le32 id;
1180 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
1181 __le32 apply_time;
1182 __le32 max_delay;
1183 __le32 depends_on;
1184 __le32 interval;
1185 __le32 duration;
1186 u8 repeat;
1187 u8 max_frags;
1188 __le16 policy;
1189} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
1190
Johannes Berg8ca151b2013-01-24 14:25:36 +01001191/**
1192 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
1193 * @status: bit 0 indicates success, all others specify errors
1194 * @id: the Time Event type
1195 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
Johannes Berg67625862017-03-14 11:01:27 +01001196 * @id_and_color: ID and color of the relevant MAC,
1197 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001198 */
1199struct iwl_time_event_resp {
1200 __le32 status;
1201 __le32 id;
1202 __le32 unique_id;
1203 __le32 id_and_color;
1204} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
1205
1206/**
1207 * struct iwl_time_event_notif - notifications of time event start/stop
1208 * ( TIME_EVENT_NOTIFICATION = 0x2a )
1209 * @timestamp: action timestamp in GP2
1210 * @session_id: session's unique id
1211 * @unique_id: unique id of the Time Event itself
1212 * @id_and_color: ID and color of the relevant MAC
Johannes Berg67625862017-03-14 11:01:27 +01001213 * @action: &enum iwl_time_event_policy
Johannes Berg8ca151b2013-01-24 14:25:36 +01001214 * @status: true if scheduled, false otherwise (not executed)
1215 */
1216struct iwl_time_event_notif {
1217 __le32 timestamp;
1218 __le32 session_id;
1219 __le32 unique_id;
1220 __le32 id_and_color;
1221 __le32 action;
1222 __le32 status;
1223} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
1224
1225
1226/* Bindings and Time Quota */
1227
1228/**
Johannes Berg4d151c22017-03-14 11:04:06 +01001229 * struct iwl_binding_cmd_v1 - configuring bindings
1230 * ( BINDING_CONTEXT_CMD = 0x2b )
1231 * @id_and_color: ID and color of the relevant Binding,
1232 * &enum iwl_mvm_id_and_color
1233 * @action: action to perform, one of FW_CTXT_ACTION_*
1234 * @macs: array of MAC id and colors which belong to the binding,
1235 * &enum iwl_mvm_id_and_color
1236 * @phy: PHY id and color which belongs to the binding,
1237 * &enum iwl_mvm_id_and_color
1238 */
1239struct iwl_binding_cmd_v1 {
1240 /* COMMON_INDEX_HDR_API_S_VER_1 */
1241 __le32 id_and_color;
1242 __le32 action;
1243 /* BINDING_DATA_API_S_VER_1 */
1244 __le32 macs[MAX_MACS_IN_BINDING];
1245 __le32 phy;
1246} __packed; /* BINDING_CMD_API_S_VER_1 */
1247
1248/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001249 * struct iwl_binding_cmd - configuring bindings
1250 * ( BINDING_CONTEXT_CMD = 0x2b )
Johannes Berg67625862017-03-14 11:01:27 +01001251 * @id_and_color: ID and color of the relevant Binding,
1252 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001253 * @action: action to perform, one of FW_CTXT_ACTION_*
1254 * @macs: array of MAC id and colors which belong to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001255 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001256 * @phy: PHY id and color which belongs to the binding
Johannes Berg67625862017-03-14 11:01:27 +01001257 * &enum iwl_mvm_id_and_color
Sara Sharon9415af72016-11-17 13:57:32 +02001258 * @lmac_id: the lmac id the binding belongs to
Johannes Berg8ca151b2013-01-24 14:25:36 +01001259 */
1260struct iwl_binding_cmd {
1261 /* COMMON_INDEX_HDR_API_S_VER_1 */
1262 __le32 id_and_color;
1263 __le32 action;
1264 /* BINDING_DATA_API_S_VER_1 */
1265 __le32 macs[MAX_MACS_IN_BINDING];
1266 __le32 phy;
Sara Sharon9415af72016-11-17 13:57:32 +02001267 __le32 lmac_id;
1268} __packed; /* BINDING_CMD_API_S_VER_2 */
1269
Johannes Berg4d151c22017-03-14 11:04:06 +01001270#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
Sara Sharon9415af72016-11-17 13:57:32 +02001271#define IWL_LMAC_24G_INDEX 0
1272#define IWL_LMAC_5G_INDEX 1
Johannes Berg8ca151b2013-01-24 14:25:36 +01001273
Ilan Peer35adfd62013-02-04 13:16:24 +02001274/* The maximal number of fragments in the FW's schedule session */
1275#define IWL_MVM_MAX_QUOTA 128
1276
Johannes Berg8ca151b2013-01-24 14:25:36 +01001277/**
1278 * struct iwl_time_quota_data - configuration of time quota per binding
Johannes Berg67625862017-03-14 11:01:27 +01001279 * @id_and_color: ID and color of the relevant Binding,
1280 * &enum iwl_mvm_id_and_color
Johannes Berg8ca151b2013-01-24 14:25:36 +01001281 * @quota: absolute time quota in TU. The scheduler will try to divide the
1282 * remainig quota (after Time Events) according to this quota.
1283 * @max_duration: max uninterrupted context duration in TU
1284 */
1285struct iwl_time_quota_data {
1286 __le32 id_and_color;
1287 __le32 quota;
1288 __le32 max_duration;
1289} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
1290
1291/**
1292 * struct iwl_time_quota_cmd - configuration of time quota between bindings
1293 * ( TIME_QUOTA_CMD = 0x2c )
1294 * @quotas: allocations per binding
Sara Sharon9415af72016-11-17 13:57:32 +02001295 * Note: on non-CDB the fourth one is the auxilary mac and is
1296 * essentially zero.
1297 * On CDB the fourth one is a regular binding.
Johannes Berg8ca151b2013-01-24 14:25:36 +01001298 */
1299struct iwl_time_quota_cmd {
1300 struct iwl_time_quota_data quotas[MAX_BINDINGS];
1301} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
1302
1303
1304/* PHY context */
1305
1306/* Supported bands */
1307#define PHY_BAND_5 (0)
1308#define PHY_BAND_24 (1)
1309
1310/* Supported channel width, vary if there is VHT support */
1311#define PHY_VHT_CHANNEL_MODE20 (0x0)
1312#define PHY_VHT_CHANNEL_MODE40 (0x1)
1313#define PHY_VHT_CHANNEL_MODE80 (0x2)
1314#define PHY_VHT_CHANNEL_MODE160 (0x3)
1315
1316/*
1317 * Control channel position:
1318 * For legacy set bit means upper channel, otherwise lower.
1319 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
1320 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
1321 * center_freq
1322 * |
1323 * 40Mhz |_______|_______|
1324 * 80Mhz |_______|_______|_______|_______|
1325 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
1326 * code 011 010 001 000 | 100 101 110 111
1327 */
1328#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
1329#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
1330#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
1331#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
1332#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
1333#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
1334#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
1335#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
1336
1337/*
1338 * @band: PHY_BAND_*
1339 * @channel: channel number
1340 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
1341 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
1342 */
1343struct iwl_fw_channel_info {
1344 u8 band;
1345 u8 channel;
1346 u8 width;
1347 u8 ctrl_pos;
1348} __packed;
1349
1350#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1351#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1352 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1353#define PHY_RX_CHAIN_VALID_POS (1)
1354#define PHY_RX_CHAIN_VALID_MSK \
1355 (0x7 << PHY_RX_CHAIN_VALID_POS)
1356#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1357#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1358 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1359#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1360#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1361 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1362#define PHY_RX_CHAIN_CNT_POS (10)
1363#define PHY_RX_CHAIN_CNT_MSK \
1364 (0x3 << PHY_RX_CHAIN_CNT_POS)
1365#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1366#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1367 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1368#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1369#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1370 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1371
1372/* TODO: fix the value, make it depend on firmware at runtime? */
1373#define NUM_PHY_CTX 3
1374
1375/* TODO: complete missing documentation */
1376/**
1377 * struct iwl_phy_context_cmd - config of the PHY context
1378 * ( PHY_CONTEXT_CMD = 0x8 )
1379 * @id_and_color: ID and color of the relevant Binding
1380 * @action: action to perform, one of FW_CTXT_ACTION_*
1381 * @apply_time: 0 means immediate apply and context switch.
1382 * other value means apply new params after X usecs
1383 * @tx_param_color: ???
1384 * @channel_info:
1385 * @txchain_info: ???
1386 * @rxchain_info: ???
1387 * @acquisition_data: ???
1388 * @dsp_cfg_flags: set to 0
1389 */
1390struct iwl_phy_context_cmd {
1391 /* COMMON_INDEX_HDR_API_S_VER_1 */
1392 __le32 id_and_color;
1393 __le32 action;
1394 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1395 __le32 apply_time;
1396 __le32 tx_param_color;
1397 struct iwl_fw_channel_info ci;
1398 __le32 txchain_info;
1399 __le32 rxchain_info;
1400 __le32 acquisition_data;
1401 __le32 dsp_cfg_flags;
1402} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1403
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001404/*
1405 * Aux ROC command
1406 *
1407 * Command requests the firmware to create a time event for a certain duration
1408 * and remain on the given channel. This is done by using the Aux framework in
1409 * the FW.
1410 * The command was first used for Hot Spot issues - but can be used regardless
1411 * to Hot Spot.
1412 *
1413 * ( HOT_SPOT_CMD 0x53 )
1414 *
1415 * @id_and_color: ID and color of the MAC
1416 * @action: action to perform, one of FW_CTXT_ACTION_*
1417 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1418 * event_unique_id should be the id of the time event assigned by ucode.
1419 * Otherwise ignore the event_unique_id.
1420 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1421 * activity.
1422 * @channel_info: channel info
1423 * @node_addr: Our MAC Address
1424 * @reserved: reserved for alignment
1425 * @apply_time: GP2 value to start (should always be the current GP2 value)
1426 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1427 * time by which start of the event is allowed to be postponed.
1428 * @duration: event duration in TU To calculate event duration:
1429 * timeEventDuration = min(duration, remainingQuota)
1430 */
1431struct iwl_hs20_roc_req {
1432 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1433 __le32 id_and_color;
1434 __le32 action;
1435 __le32 event_unique_id;
1436 __le32 sta_id_and_color;
1437 struct iwl_fw_channel_info channel_info;
1438 u8 node_addr[ETH_ALEN];
1439 __le16 reserved;
1440 __le32 apply_time;
1441 __le32 apply_time_max_delay;
1442 __le32 duration;
1443} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1444
1445/*
1446 * values for AUX ROC result values
1447 */
1448enum iwl_mvm_hot_spot {
1449 HOT_SPOT_RSP_STATUS_OK,
1450 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1451 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1452};
1453
1454/*
1455 * Aux ROC command response
1456 *
1457 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1458 * driver the uid of the timevent.
1459 *
1460 * ( HOT_SPOT_CMD 0x53 )
1461 *
1462 * @event_unique_id: Unique ID of time event assigned by ucode
1463 * @status: Return status 0 is success, all the rest used for specific errors
1464 */
1465struct iwl_hs20_roc_res {
1466 __le32 event_unique_id;
1467 __le32 status;
1468} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1469
Johannes Berg8ca151b2013-01-24 14:25:36 +01001470/**
1471 * struct iwl_radio_version_notif - information on the radio version
1472 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
1473 * @radio_flavor:
1474 * @radio_step:
1475 * @radio_dash:
1476 */
1477struct iwl_radio_version_notif {
1478 __le32 radio_flavor;
1479 __le32 radio_step;
1480 __le32 radio_dash;
1481} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1482
1483enum iwl_card_state_flags {
1484 CARD_ENABLED = 0x00,
1485 HW_CARD_DISABLED = 0x01,
1486 SW_CARD_DISABLED = 0x02,
1487 CT_KILL_CARD_DISABLED = 0x04,
1488 HALT_CARD_DISABLED = 0x08,
1489 CARD_DISABLED_MSK = 0x0f,
1490 CARD_IS_RX_ON = 0x10,
1491};
1492
1493/**
1494 * struct iwl_radio_version_notif - information on the radio version
1495 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1496 * @flags: %iwl_card_state_flags
1497 */
1498struct iwl_card_state_notif {
1499 __le32 flags;
1500} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1501
1502/**
Hila Gonend64048e2013-03-13 18:00:03 +02001503 * struct iwl_missed_beacons_notif - information on missed beacons
1504 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1505 * @mac_id: interface ID
1506 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1507 * beacons since last RX.
1508 * @consec_missed_beacons: number of consecutive missed beacons
1509 * @num_expected_beacons:
1510 * @num_recvd_beacons:
1511 */
1512struct iwl_missed_beacons_notif {
1513 __le32 mac_id;
1514 __le32 consec_missed_beacons_since_last_rx;
1515 __le32 consec_missed_beacons;
1516 __le32 num_expected_beacons;
1517 __le32 num_recvd_beacons;
1518} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1519
1520/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001521 * struct iwl_mfuart_load_notif - mfuart image version & status
1522 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1523 * @installed_ver: installed image version
1524 * @external_ver: external image version
1525 * @status: MFUART loading status
1526 * @duration: MFUART loading time
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001527 * @image_size: MFUART image size in bytes
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001528*/
1529struct iwl_mfuart_load_notif {
1530 __le32 installed_ver;
1531 __le32 external_ver;
1532 __le32 status;
1533 __le32 duration;
Golan Ben-Ami19f63c52016-11-07 17:40:43 +02001534 /* image size valid only in v2 of the command */
1535 __le32 image_size;
1536} __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001537
1538/**
Golan Ben-Amibdccdb82016-11-15 14:45:29 +02001539 * struct iwl_mfu_assert_dump_notif - mfuart dump logs
1540 * ( MFU_ASSERT_DUMP_NTF = 0xfe )
1541 * @assert_id: mfuart assert id that cause the notif
1542 * @curr_reset_num: number of asserts since uptime
1543 * @index_num: current chunk id
1544 * @parts_num: total number of chunks
1545 * @data_size: number of data bytes sent
1546 * @data: data buffer
1547 */
1548struct iwl_mfu_assert_dump_notif {
1549 __le32 assert_id;
1550 __le32 curr_reset_num;
1551 __le16 index_num;
1552 __le16 parts_num;
1553 __le32 data_size;
1554 __le32 data[0];
1555} __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
1556
1557/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001558 * struct iwl_set_calib_default_cmd - set default value for calibration.
1559 * ( SET_CALIB_DEFAULT_CMD = 0x8e )
1560 * @calib_index: the calibration to set value for
1561 * @length: of data
1562 * @data: the value to set for the calibration result
1563 */
1564struct iwl_set_calib_default_cmd {
1565 __le16 calib_index;
1566 __le16 length;
1567 u8 data[0];
1568} __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
1569
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001570#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001571#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001572
1573/**
1574 * struct iwl_mcast_filter_cmd - configure multicast filter.
1575 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1576 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1577 * to identify network interface adopted in host-device IF.
1578 * It is used by FW as index in array of addresses. This array has
1579 * MAX_PORT_ID_NUM members.
1580 * @count: Number of MAC addresses in the array
1581 * @pass_all: Set 1 to pass all multicast packets.
1582 * @bssid: current association BSSID.
1583 * @addr_list: Place holder for array of MAC addresses.
1584 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1585 */
1586struct iwl_mcast_filter_cmd {
1587 u8 filter_own;
1588 u8 port_id;
1589 u8 count;
1590 u8 pass_all;
1591 u8 bssid[6];
1592 u8 reserved[2];
1593 u8 addr_list[0];
1594} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1595
Eliad Pellerc87163b2014-01-08 10:11:11 +02001596#define MAX_BCAST_FILTERS 8
1597#define MAX_BCAST_FILTER_ATTRS 2
1598
1599/**
1600 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1601 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1602 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1603 * start of ip payload).
1604 */
1605enum iwl_mvm_bcast_filter_attr_offset {
1606 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1607 BCAST_FILTER_OFFSET_IP_END = 1,
1608};
1609
1610/**
1611 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1612 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1613 * @offset: starting offset of this pattern.
1614 * @val: value to match - big endian (MSB is the first
1615 * byte to match from offset pos).
1616 * @mask: mask to match (big endian).
1617 */
1618struct iwl_fw_bcast_filter_attr {
1619 u8 offset_type;
1620 u8 offset;
1621 __le16 reserved1;
1622 __be32 val;
1623 __be32 mask;
1624} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1625
1626/**
1627 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1628 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1629 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1630 */
1631enum iwl_mvm_bcast_filter_frame_type {
1632 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1633 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1634};
1635
1636/**
1637 * struct iwl_fw_bcast_filter - broadcast filter
1638 * @discard: discard frame (1) or let it pass (0).
1639 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
1640 * @num_attrs: number of valid attributes in this filter.
1641 * @attrs: attributes of this filter. a filter is considered matched
1642 * only when all its attributes are matched (i.e. AND relationship)
1643 */
1644struct iwl_fw_bcast_filter {
1645 u8 discard;
1646 u8 frame_type;
1647 u8 num_attrs;
1648 u8 reserved1;
1649 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1650} __packed; /* BCAST_FILTER_S_VER_1 */
1651
Sara Sharon3af512d62015-07-22 11:38:40 +03001652#define BA_WINDOW_STREAMS_MAX 16
1653#define BA_WINDOW_STATUS_TID_MSK 0x000F
1654#define BA_WINDOW_STATUS_STA_ID_POS 4
1655#define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
1656#define BA_WINDOW_STATUS_VALID_MSK BIT(9)
1657
1658/**
1659 * struct iwl_ba_window_status_notif - reordering window's status notification
1660 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
1661 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
1662 * @start_seq_num: the start sequence number of the bitmap
1663 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
1664 */
1665struct iwl_ba_window_status_notif {
1666 __le64 bitmap[BA_WINDOW_STREAMS_MAX];
1667 __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
1668 __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
1669 __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
1670} __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
1671
Eliad Pellerc87163b2014-01-08 10:11:11 +02001672/**
1673 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1674 * @default_discard: default action for this mac (discard (1) / pass (0)).
1675 * @attached_filters: bitmap of relevant filters for this mac.
1676 */
1677struct iwl_fw_bcast_mac {
1678 u8 default_discard;
1679 u8 reserved1;
1680 __le16 attached_filters;
1681} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1682
1683/**
1684 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1685 * @disable: enable (0) / disable (1)
1686 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1687 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
1688 * @filters: broadcast filters
1689 * @macs: broadcast filtering configuration per-mac
1690 */
1691struct iwl_bcast_filter_cmd {
1692 u8 disable;
1693 u8 max_bcast_filters;
1694 u8 max_macs;
1695 u8 reserved1;
1696 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1697 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1698} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1699
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001700/*
1701 * enum iwl_mvm_marker_id - maker ids
1702 *
1703 * The ids for different type of markers to insert into the usniffer logs
1704 */
1705enum iwl_mvm_marker_id {
1706 MARKER_ID_TX_FRAME_LATENCY = 1,
1707}; /* MARKER_ID_API_E_VER_1 */
1708
1709/**
1710 * struct iwl_mvm_marker - mark info into the usniffer logs
1711 *
1712 * (MARKER_CMD = 0xcb)
1713 *
1714 * Mark the UTC time stamp into the usniffer logs together with additional
1715 * metadata, so the usniffer output can be parsed.
1716 * In the command response the ucode will return the GP2 time.
1717 *
1718 * @dw_len: The amount of dwords following this byte including this byte.
1719 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1720 * @reserved: reserved.
1721 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1722 * @metadata: additional meta data that will be written to the unsiffer log
1723 */
1724struct iwl_mvm_marker {
1725 u8 dwLen;
1726 u8 markerId;
1727 __le16 reserved;
1728 __le64 timestamp;
1729 __le32 metadata[0];
1730} __packed; /* MARKER_API_S_VER_1 */
1731
Matti Gottlieb0becb372015-05-31 09:18:30 +03001732/*
1733 * enum iwl_dc2dc_config_id - flag ids
1734 *
1735 * Ids of dc2dc configuration flags
1736 */
1737enum iwl_dc2dc_config_id {
1738 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1739 DCDC_FREQ_TUNE_SET = 0x2,
1740}; /* MARKER_ID_API_E_VER_1 */
1741
1742/**
1743 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1744 *
1745 * (DC2DC_CONFIG_CMD = 0x83)
1746 *
1747 * Set/Get & configure dc2dc values.
1748 * The command always returns the current dc2dc values.
1749 *
1750 * @flags: set/get dc2dc
1751 * @enable_low_power_mode: not used.
1752 * @dc2dc_freq_tune0: frequency divider - digital domain
1753 * @dc2dc_freq_tune1: frequency divider - analog domain
1754 */
1755struct iwl_dc2dc_config_cmd {
1756 __le32 flags;
1757 __le32 enable_low_power_mode; /* not used */
1758 __le32 dc2dc_freq_tune0;
1759 __le32 dc2dc_freq_tune1;
1760} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1761
1762/**
1763 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1764 *
1765 * Current dc2dc values returned by the FW.
1766 *
1767 * @dc2dc_freq_tune0: frequency divider - digital domain
1768 * @dc2dc_freq_tune1: frequency divider - analog domain
1769 */
1770struct iwl_dc2dc_config_resp {
1771 __le32 dc2dc_freq_tune0;
1772 __le32 dc2dc_freq_tune1;
1773} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1774
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001775/***********************************
1776 * Smart Fifo API
1777 ***********************************/
1778/* Smart Fifo state */
1779enum iwl_sf_state {
1780 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1781 SF_FULL_ON,
1782 SF_UNINIT,
1783 SF_INIT_OFF,
1784 SF_HW_NUM_STATES
1785};
1786
1787/* Smart Fifo possible scenario */
1788enum iwl_sf_scenario {
1789 SF_SCENARIO_SINGLE_UNICAST,
1790 SF_SCENARIO_AGG_UNICAST,
1791 SF_SCENARIO_MULTICAST,
1792 SF_SCENARIO_BA_RESP,
1793 SF_SCENARIO_TX_RESP,
1794 SF_NUM_SCENARIO
1795};
1796
1797#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
1798#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
1799
1800/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02001801#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001802#define SF_W_MARK_MIMO2 8192
1803#define SF_W_MARK_MIMO3 6144
1804#define SF_W_MARK_LEGACY 4096
1805#define SF_W_MARK_SCAN 4096
1806
Eran Hararyf4a3ee42015-02-08 13:58:50 +02001807/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
1808#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1809#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1810#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1811#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1812#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
1813#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1814#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
1815#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
1816#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
1817#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
1818
1819/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001820#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1821#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1822#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1823#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1824#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
1825#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
1826#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
1827#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
1828#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
1829#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
1830
1831#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
1832
Eran Harary161bdb72014-07-27 08:03:06 +03001833#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
1834
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001835/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001836 * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
1837 * @state: smart fifo state, types listed in &enum iwl_sf_state.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001838 * @watermark: Minimum allowed availabe free space in RXF for transient state.
1839 * @long_delay_timeouts: aging and idle timer values for each scenario
1840 * in long delay state.
1841 * @full_on_timeouts: timer values for each scenario in full on state.
1842 */
1843struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001844 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001845 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
1846 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1847 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1848} __packed; /* SF_CFG_API_S_VER_2 */
1849
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001850/***********************************
1851 * Location Aware Regulatory (LAR) API - MCC updates
1852 ***********************************/
1853
1854/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001855 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001856 * regulatory profile according to the given MCC (Mobile Country Code).
1857 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1858 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1859 * MCC in the cmd response will be the relevant MCC in the NVM.
1860 * @mcc: given mobile country code
1861 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1862 * @reserved: reserved for alignment
1863 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001864struct iwl_mcc_update_cmd_v1 {
1865 __le16 mcc;
1866 u8 source_id;
1867 u8 reserved;
1868} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
1869
1870/**
1871 * struct iwl_mcc_update_cmd - Request the device to update geographic
1872 * regulatory profile according to the given MCC (Mobile Country Code).
1873 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1874 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1875 * MCC in the cmd response will be the relevant MCC in the NVM.
1876 * @mcc: given mobile country code
1877 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1878 * @reserved: reserved for alignment
1879 * @key: integrity key for MCC API OEM testing
1880 * @reserved2: reserved
1881 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001882struct iwl_mcc_update_cmd {
1883 __le16 mcc;
1884 u8 source_id;
1885 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001886 __le32 key;
Johannes Bergaed35822017-03-13 12:47:37 +01001887 u8 reserved2[20];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001888} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001889
1890/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001891 * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001892 * Contains the new channel control profile map, if changed, and the new MCC
1893 * (mobile country code).
1894 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02001895 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001896 * @mcc: the new applied MCC
1897 * @cap: capabilities for all channels which matches the MCC
1898 * @source_id: the MCC source, see iwl_mcc_source
1899 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1900 * channels, depending on platform)
1901 * @channels: channel control data map, DWORD for each channel. Only the first
1902 * 16bits are used.
1903 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001904struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001905 __le32 status;
1906 __le16 mcc;
1907 u8 cap;
1908 u8 source_id;
1909 __le32 n_channels;
1910 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001911} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
1912
1913/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001914 * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001915 * Contains the new channel control profile map, if changed, and the new MCC
1916 * (mobile country code).
1917 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
1918 * @status: see &enum iwl_mcc_update_status
1919 * @mcc: the new applied MCC
1920 * @cap: capabilities for all channels which matches the MCC
1921 * @source_id: the MCC source, see iwl_mcc_source
1922 * @time: time elapsed from the MCC test start (in 30 seconds TU)
1923 * @reserved: reserved.
1924 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1925 * channels, depending on platform)
1926 * @channels: channel control data map, DWORD for each channel. Only the first
1927 * 16bits are used.
1928 */
1929struct iwl_mcc_update_resp {
1930 __le32 status;
1931 __le16 mcc;
1932 u8 cap;
1933 u8 source_id;
1934 __le16 time;
1935 __le16 reserved;
1936 __le32 n_channels;
1937 __le32 channels[0];
1938} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001939
1940/**
1941 * struct iwl_mcc_chub_notif - chub notifies of mcc change
1942 * (MCC_CHUB_UPDATE_CMD = 0xc9)
1943 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
1944 * the cellular and connectivity cores that gets updates of the mcc, and
1945 * notifies the ucode directly of any mcc change.
1946 * The ucode requests the driver to request the device to update geographic
1947 * regulatory profile according to the given MCC (Mobile Country Code).
1948 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1949 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1950 * MCC in the cmd response will be the relevant MCC in the NVM.
1951 * @mcc: given mobile country code
1952 * @source_id: identity of the change originator, see iwl_mcc_source
1953 * @reserved1: reserved for alignment
1954 */
1955struct iwl_mcc_chub_notif {
Johannes Berg56c1f3c2017-03-13 12:07:52 +01001956 __le16 mcc;
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001957 u8 source_id;
1958 u8 reserved1;
1959} __packed; /* LAR_MCC_NOTIFY_S */
1960
1961enum iwl_mcc_update_status {
1962 MCC_RESP_NEW_CHAN_PROFILE,
1963 MCC_RESP_SAME_CHAN_PROFILE,
1964 MCC_RESP_INVALID,
1965 MCC_RESP_NVM_DISABLED,
1966 MCC_RESP_ILLEGAL,
1967 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001968 MCC_RESP_TEST_MODE_ACTIVE,
1969 MCC_RESP_TEST_MODE_NOT_ACTIVE,
1970 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001971};
1972
1973enum iwl_mcc_source {
1974 MCC_SOURCE_OLD_FW = 0,
1975 MCC_SOURCE_ME = 1,
1976 MCC_SOURCE_BIOS = 2,
1977 MCC_SOURCE_3G_LTE_HOST = 3,
1978 MCC_SOURCE_3G_LTE_DEVICE = 4,
1979 MCC_SOURCE_WIFI = 5,
1980 MCC_SOURCE_RESERVED = 6,
1981 MCC_SOURCE_DEFAULT = 7,
1982 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001983 MCC_SOURCE_MCC_API = 9,
1984 MCC_SOURCE_GET_CURRENT = 0x10,
1985 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001986};
1987
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001988/* DTS measurements */
1989
1990enum iwl_dts_measurement_flags {
1991 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
1992 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
1993};
1994
1995/**
Johannes Berg31a658b2017-03-09 15:56:57 +01001996 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001997 *
Johannes Berg31a658b2017-03-09 15:56:57 +01001998 * @flags: indicates which measurements we want as specified in
1999 * &enum iwl_dts_measurement_flags
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002000 */
2001struct iwl_dts_measurement_cmd {
2002 __le32 flags;
2003} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
2004
2005/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03002006* enum iwl_dts_control_measurement_mode - DTS measurement type
2007* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
2008* back (latest value. Not waiting for new value). Use automatic
2009* SW DTS configuration.
2010* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
2011* trigger DTS reading and provide read back temperature read
2012* when available.
2013* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
2014* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
2015* without measurement trigger.
2016*/
2017enum iwl_dts_control_measurement_mode {
2018 DTS_AUTOMATIC = 0,
2019 DTS_REQUEST_READ = 1,
2020 DTS_OVER_WRITE = 2,
2021 DTS_DIRECT_WITHOUT_MEASURE = 3,
2022};
2023
2024/**
2025* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
2026* @DTS_USE_TOP: Top
2027* @DTS_USE_CHAIN_A: chain A
2028* @DTS_USE_CHAIN_B: chain B
2029* @DTS_USE_CHAIN_C: chain C
2030* @XTAL_TEMPERATURE - read temperature from xtal
2031*/
2032enum iwl_dts_used {
2033 DTS_USE_TOP = 0,
2034 DTS_USE_CHAIN_A = 1,
2035 DTS_USE_CHAIN_B = 2,
2036 DTS_USE_CHAIN_C = 3,
2037 XTAL_TEMPERATURE = 4,
2038};
2039
2040/**
2041* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
2042* @DTS_BIT6_MODE: bit 6 mode
2043* @DTS_BIT8_MODE: bit 8 mode
2044*/
2045enum iwl_dts_bit_mode {
2046 DTS_BIT6_MODE = 0,
2047 DTS_BIT8_MODE = 1,
2048};
2049
2050/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002051 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
Arik Nemtsov78efc702015-10-06 12:22:47 +03002052 * @control_mode: see &enum iwl_dts_control_measurement_mode
2053 * @temperature: used when over write DTS mode is selected
2054 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
2055 * @avg_factor: average factor to DTS in request DTS read mode
2056 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
2057 * @step_duration: step duration for the DTS
2058 */
2059struct iwl_ext_dts_measurement_cmd {
2060 __le32 control_mode;
2061 __le32 temperature;
2062 __le32 sensor;
2063 __le32 avg_factor;
2064 __le32 bit_mode;
2065 __le32 step_duration;
2066} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
2067
2068/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002069 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002070 *
2071 * @temp: the measured temperature
2072 * @voltage: the measured voltage
2073 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002074struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002075 __le32 temp;
2076 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002077} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
2078
2079/**
2080 * struct iwl_dts_measurement_notif_v2 - measurements notification
2081 *
2082 * @temp: the measured temperature
2083 * @voltage: the measured voltage
2084 * @threshold_idx: the trip index that was crossed
2085 */
2086struct iwl_dts_measurement_notif_v2 {
2087 __le32 temp;
2088 __le32 voltage;
2089 __le32 threshold_idx;
2090} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03002091
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02002092/**
2093 * struct ct_kill_notif - CT-kill entry notification
2094 *
2095 * @temperature: the current temperature in celsius
2096 * @reserved: reserved
2097 */
2098struct ct_kill_notif {
2099 __le16 temperature;
2100 __le16 reserved;
2101} __packed; /* GRP_PHY_CT_KILL_NTF */
2102
Chaya Rachel Ivgi5c89e7b2016-01-05 10:34:47 +02002103/**
2104* enum ctdp_cmd_operation - CTDP command operations
2105* @CTDP_CMD_OPERATION_START: update the current budget
2106* @CTDP_CMD_OPERATION_STOP: stop ctdp
2107* @CTDP_CMD_OPERATION_REPORT: get the avgerage budget
2108*/
2109enum iwl_mvm_ctdp_cmd_operation {
2110 CTDP_CMD_OPERATION_START = 0x1,
2111 CTDP_CMD_OPERATION_STOP = 0x2,
2112 CTDP_CMD_OPERATION_REPORT = 0x4,
2113};/* CTDP_CMD_OPERATION_TYPE_E */
2114
2115/**
2116 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
2117 *
2118 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
2119 * @budget: the budget in milliwatt
2120 * @window_size: defined in API but not used
2121 */
2122struct iwl_mvm_ctdp_cmd {
2123 __le32 operation;
2124 __le32 budget;
2125 __le32 window_size;
2126} __packed;
2127
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002128#define IWL_MAX_DTS_TRIPS 8
2129
2130/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002131 * struct temp_report_ths_cmd - set temperature thresholds
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02002132 *
2133 * @num_temps: number of temperature thresholds passed
2134 * @thresholds: array with the thresholds to be configured
2135 */
2136struct temp_report_ths_cmd {
2137 __le32 num_temps;
2138 __le16 thresholds[IWL_MAX_DTS_TRIPS];
2139} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
2140
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002141/***********************************
2142 * TDLS API
2143 ***********************************/
2144
2145/* Type of TDLS request */
2146enum iwl_tdls_channel_switch_type {
2147 TDLS_SEND_CHAN_SW_REQ = 0,
2148 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
2149 TDLS_MOVE_CH,
2150}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
2151
2152/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002153 * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002154 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
2155 * received from peer
2156 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
2157 * to the TDLS off-channel communication. For instance if the DTIM is
2158 * 200TU and the TDLS peer is to be given 25% of the time, the value
2159 * given will be 50TU, or 50 * 1024 if translated into microseconds.
2160 * @switch_time: switch time the peer sent in its channel switch timing IE
2161 * @switch_timout: switch timeout the peer sent in its channel switch timing IE
2162 */
2163struct iwl_tdls_channel_switch_timing {
2164 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
2165 __le32 max_offchan_duration; /* given in micro-seconds */
2166 __le32 switch_time; /* given in micro-seconds */
2167 __le32 switch_timeout; /* given in micro-seconds */
2168} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
2169
2170#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
2171
2172/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002173 * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002174 *
2175 * A template representing a TDLS channel-switch request or response frame
2176 *
2177 * @switch_time_offset: offset to the channel switch timing IE in the template
2178 * @tx_cmd: Tx parameters for the frame
2179 * @data: frame data
2180 */
2181struct iwl_tdls_channel_switch_frame {
2182 __le32 switch_time_offset;
2183 struct iwl_tx_cmd tx_cmd;
2184 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
2185} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
2186
2187/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002188 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002189 *
2190 * The command is sent to initiate a channel switch and also in response to
2191 * incoming TDLS channel-switch request/response packets from remote peers.
2192 *
2193 * @switch_type: see &enum iwl_tdls_channel_switch_type
2194 * @peer_sta_id: station id of TDLS peer
2195 * @ci: channel we switch to
2196 * @timing: timing related data for command
2197 * @frame: channel-switch request/response template, depending to switch_type
2198 */
2199struct iwl_tdls_channel_switch_cmd {
2200 u8 switch_type;
2201 __le32 peer_sta_id;
2202 struct iwl_fw_channel_info ci;
2203 struct iwl_tdls_channel_switch_timing timing;
2204 struct iwl_tdls_channel_switch_frame frame;
2205} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
2206
2207/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002208 * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03002209 *
2210 * @status: non-zero on success
2211 * @offchannel_duration: duration given in microseconds
2212 * @sta_id: peer currently performing the channel-switch with
2213 */
2214struct iwl_tdls_channel_switch_notif {
2215 __le32 status;
2216 __le32 offchannel_duration;
2217 __le32 sta_id;
2218} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
2219
Arik Nemtsov307e4722014-09-15 18:48:59 +03002220/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002221 * struct iwl_tdls_sta_info - TDLS station info
Arik Nemtsov307e4722014-09-15 18:48:59 +03002222 *
2223 * @sta_id: station id of the TDLS peer
2224 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
2225 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
2226 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
2227 */
2228struct iwl_tdls_sta_info {
2229 u8 sta_id;
2230 u8 tx_to_peer_tid;
2231 __le16 tx_to_peer_ssn;
2232 __le32 is_initiator;
2233} __packed; /* TDLS_STA_INFO_VER_1 */
2234
2235/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002236 * struct iwl_tdls_config_cmd - TDLS basic config command
Arik Nemtsov307e4722014-09-15 18:48:59 +03002237 *
2238 * @id_and_color: MAC id and color being configured
2239 * @tdls_peer_count: amount of currently connected TDLS peers
2240 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
2241 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
2242 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
2243 * @pti_req_data_offset: offset of network-level data for the PTI template
2244 * @pti_req_tx_cmd: Tx parameters for PTI request template
2245 * @pti_req_template: PTI request template data
2246 */
2247struct iwl_tdls_config_cmd {
2248 __le32 id_and_color; /* mac id and color */
2249 u8 tdls_peer_count;
2250 u8 tx_to_ap_tid;
2251 __le16 tx_to_ap_ssn;
2252 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
2253
2254 __le32 pti_req_data_offset;
2255 struct iwl_tx_cmd pti_req_tx_cmd;
2256 u8 pti_req_template[0];
2257} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
2258
2259/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002260 * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
Arik Nemtsov307e4722014-09-15 18:48:59 +03002261 *
2262 * @sta_id: station id of the TDLS peer
2263 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
2264 * the peer
2265 */
2266struct iwl_tdls_config_sta_info_res {
2267 __le16 sta_id;
2268 __le16 tx_to_peer_last_seq;
2269} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
2270
2271/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002272 * struct iwl_tdls_config_res - TDLS config information from FW
Arik Nemtsov307e4722014-09-15 18:48:59 +03002273 *
2274 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
2275 * @sta_info: per-station TDLS config information
2276 */
2277struct iwl_tdls_config_res {
2278 __le32 tx_to_ap_last_seq;
2279 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
2280} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
2281
Sara Sharondb06f042016-07-05 17:37:58 +03002282#define TX_FIFO_MAX_NUM_9000 8
2283#define TX_FIFO_MAX_NUM 15
2284#define RX_FIFO_MAX_NUM 2
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002285#define TX_FIFO_INTERNAL_MAX_NUM 6
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002286
2287/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002288 * struct iwl_shared_mem_cfg_v1 - Shared memory configuration information
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002289 *
2290 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
2291 * accessible)
2292 * @shared_mem_size: shared memory size
2293 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
2294 * 0x0 as accessible only via DBGM RDAT)
2295 * @sample_buff_size: internal sample buff size
2296 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
2297 * 8000 HW set to 0x0 as not accessible)
2298 * @txfifo_size: size of TXF0 ... TXF7
2299 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
2300 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2301 * when paging is not supported this should be 0
2302 * @page_buff_size: size of %page_buff_addr
Golan Ben-Ami5b086412016-02-09 12:57:16 +02002303 * @rxfifo_addr: Start address of rxFifo
2304 * @internal_txfifo_addr: start address of internalFifo
2305 * @internal_txfifo_size: internal fifos' size
2306 *
2307 * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
2308 * set, the last 3 members don't exist.
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002309 */
Sara Sharondb06f042016-07-05 17:37:58 +03002310struct iwl_shared_mem_cfg_v1 {
2311 __le32 shared_mem_addr;
2312 __le32 shared_mem_size;
2313 __le32 sample_buff_addr;
2314 __le32 sample_buff_size;
2315 __le32 txfifo_addr;
2316 __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
2317 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
2318 __le32 page_buff_addr;
2319 __le32 page_buff_size;
2320 __le32 rxfifo_addr;
2321 __le32 internal_txfifo_addr;
2322 __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
2323} __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
2324
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002325/**
2326 * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
2327 *
2328 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
2329 * @txfifo_size: size of TX FIFOs
2330 * @rxfifo1_addr: RXF1 addr
2331 * @rxfifo1_size: RXF1 size
2332 */
2333struct iwl_shared_mem_lmac_cfg {
2334 __le32 txfifo_addr;
2335 __le32 txfifo_size[TX_FIFO_MAX_NUM];
2336 __le32 rxfifo1_addr;
2337 __le32 rxfifo1_size;
2338
2339} __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
2340
2341/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002342 * struct iwl_shared_mem_cfg - Shared memory configuration information
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002343 *
2344 * @shared_mem_addr: shared memory address
2345 * @shared_mem_size: shared memory size
2346 * @sample_buff_addr: internal sample (mon/adc) buff addr
2347 * @sample_buff_size: internal sample buff size
2348 * @rxfifo2_addr: start addr of RXF2
2349 * @rxfifo2_size: size of RXF2
2350 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
2351 * when paging is not supported this should be 0
2352 * @page_buff_size: size of %page_buff_addr
2353 * @lmac_num: number of LMACs (1 or 2)
2354 * @lmac_smem: per - LMAC smem data
2355 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002356struct iwl_shared_mem_cfg {
2357 __le32 shared_mem_addr;
2358 __le32 shared_mem_size;
2359 __le32 sample_buff_addr;
2360 __le32 sample_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002361 __le32 rxfifo2_addr;
2362 __le32 rxfifo2_size;
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002363 __le32 page_buff_addr;
2364 __le32 page_buff_size;
Sara Sharonfa1f2b62017-01-26 12:40:25 +02002365 __le32 lmac_num;
2366 struct iwl_shared_mem_lmac_cfg lmac_smem[2];
Sara Sharondb06f042016-07-05 17:37:58 +03002367} __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
Liad Kaufman04fd2c22014-12-15 17:54:16 +02002368
Sara Sharona07a8f32015-11-15 11:11:59 +02002369/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002370 * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
Sara Sharona07a8f32015-11-15 11:11:59 +02002371 *
2372 * @membership_status: a bitmap of MU groups
2373 * @user_position:the position of station in a group. If the station is in the
2374 * group then bits (group * 2) is the position -1
2375 */
2376struct iwl_mu_group_mgmt_cmd {
2377 __le32 reserved;
2378 __le32 membership_status[2];
2379 __le32 user_position[4];
2380} __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
2381
Sara Sharonf92659a2016-02-03 15:04:49 +02002382/**
2383 * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
2384 *
2385 * @membership_status: a bitmap of MU groups
2386 * @user_position: the position of station in a group. If the station is in the
2387 * group then bits (group * 2) is the position -1
2388 */
2389struct iwl_mu_group_mgmt_notif {
2390 __le32 membership_status[2];
2391 __le32 user_position[4];
2392} __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
2393
Sara Sharon0db056d2015-12-29 11:07:15 +02002394#define MAX_STORED_BEACON_SIZE 600
2395
2396/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002397 * struct iwl_stored_beacon_notif - Stored beacon notification
Sara Sharon0db056d2015-12-29 11:07:15 +02002398 *
2399 * @system_time: system time on air rise
2400 * @tsf: TSF on air rise
2401 * @beacon_timestamp: beacon on air rise
Sara Sharon34118c22016-11-08 18:34:42 +02002402 * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
Sara Sharon0db056d2015-12-29 11:07:15 +02002403 * @channel: channel this beacon was received on
2404 * @rates: rate in ucode internal format
2405 * @byte_count: frame's byte count
2406 */
2407struct iwl_stored_beacon_notif {
2408 __le32 system_time;
2409 __le64 tsf;
2410 __le32 beacon_timestamp;
Sara Sharon34118c22016-11-08 18:34:42 +02002411 __le16 band;
Sara Sharon0db056d2015-12-29 11:07:15 +02002412 __le16 channel;
2413 __le32 rates;
2414 __le32 byte_count;
2415 u8 data[MAX_STORED_BEACON_SIZE];
Sara Sharon34118c22016-11-08 18:34:42 +02002416} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
Sara Sharon0db056d2015-12-29 11:07:15 +02002417
Aviya Erenfeld03098262016-02-18 14:09:33 +02002418#define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
2419
2420enum iwl_lqm_cmd_operatrions {
2421 LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
2422 LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
2423};
2424
2425enum iwl_lqm_status {
2426 LQM_STATUS_SUCCESS = 0,
2427 LQM_STATUS_TIMEOUT = 1,
2428 LQM_STATUS_ABORT = 2,
2429};
2430
2431/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002432 * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
Aviya Erenfeld03098262016-02-18 14:09:33 +02002433 * @cmd_operatrion: command operation to be performed (start or stop)
2434 * as defined above.
2435 * @mac_id: MAC ID the measurement applies to.
2436 * @measurement_time: time of the total measurement to be performed, in uSec.
2437 * @timeout: maximum time allowed until a response is sent, in uSec.
2438 */
2439struct iwl_link_qual_msrmnt_cmd {
2440 __le32 cmd_operation;
2441 __le32 mac_id;
2442 __le32 measurement_time;
2443 __le32 timeout;
2444} __packed /* LQM_CMD_API_S_VER_1 */;
2445
2446/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002447 * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
Aviya Erenfeld03098262016-02-18 14:09:33 +02002448 *
2449 * @frequent_stations_air_time: an array containing the total air time
2450 * (in uSec) used by the most frequently transmitting stations.
2451 * @number_of_stations: the number of uniqe stations included in the array
2452 * (a number between 0 to 16)
2453 * @total_air_time_other_stations: the total air time (uSec) used by all the
2454 * stations which are not included in the above report.
2455 * @time_in_measurement_window: the total time in uSec in which a measurement
2456 * took place.
2457 * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
2458 * measurement
2459 * @mac_id: MAC ID the measurement applies to.
2460 * @status: return status. may be one of the LQM_STATUS_* defined above.
2461 * @reserved: reserved.
2462 */
2463struct iwl_link_qual_msrmnt_notif {
2464 __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
2465 __le32 number_of_stations;
2466 __le32 total_air_time_other_stations;
2467 __le32 time_in_measurement_window;
2468 __le32 tx_frame_dropped;
2469 __le32 mac_id;
2470 __le32 status;
Johannes Bergaed35822017-03-13 12:47:37 +01002471 u8 reserved[12];
Aviya Erenfeld03098262016-02-18 14:09:33 +02002472} __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
2473
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002474/**
Johannes Berg31a658b2017-03-09 15:56:57 +01002475 * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +02002476 *
2477 * @id_and_color: ID and color of the MAC
2478 */
2479struct iwl_channel_switch_noa_notif {
2480 __le32 id_and_color;
2481} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
2482
Ido Yariv2b55f432016-08-23 14:44:59 -04002483/* Operation types for the debug mem access */
2484enum {
2485 DEBUG_MEM_OP_READ = 0,
2486 DEBUG_MEM_OP_WRITE = 1,
2487 DEBUG_MEM_OP_WRITE_BYTES = 2,
2488};
2489
2490#define DEBUG_MEM_MAX_SIZE_DWORDS 32
2491
2492/**
2493 * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
2494 * @op: DEBUG_MEM_OP_*
2495 * @addr: address to read/write from/to
2496 * @len: in dwords, to read/write
2497 * @data: for write opeations, contains the source buffer
2498 */
2499struct iwl_dbg_mem_access_cmd {
2500 __le32 op;
2501 __le32 addr;
2502 __le32 len;
2503 __le32 data[];
2504} __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
2505
2506/* Status responses for the debug mem access */
2507enum {
2508 DEBUG_MEM_STATUS_SUCCESS = 0x0,
2509 DEBUG_MEM_STATUS_FAILED = 0x1,
2510 DEBUG_MEM_STATUS_LOCKED = 0x2,
2511 DEBUG_MEM_STATUS_HIDDEN = 0x3,
2512 DEBUG_MEM_STATUS_LENGTH = 0x4,
2513};
2514
2515/**
2516 * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
2517 * @status: DEBUG_MEM_STATUS_*
2518 * @len: read dwords (0 for write operations)
2519 * @data: contains the read DWs
2520 */
2521struct iwl_dbg_mem_access_rsp {
2522 __le32 status;
2523 __le32 len;
2524 __le32 data[];
2525} __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
2526
Sara Sharon1f370652016-08-31 18:13:57 +03002527/**
2528 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
2529 */
2530struct iwl_nvm_access_complete_cmd {
2531 __le32 reserved;
2532} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
2533
Sara Sharon4399caa2016-12-11 10:32:42 +02002534/**
2535 * enum iwl_extended_cfg_flag - commands driver may send before
2536 * finishing init flow
2537 * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
2538 * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
2539 * @IWL_INIT_PHY: driver is going to send PHY_DB commands
2540 */
2541enum iwl_extended_cfg_flags {
2542 IWL_INIT_DEBUG_CFG,
2543 IWL_INIT_NVM,
2544 IWL_INIT_PHY,
2545};
2546
2547/**
2548 * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
2549 * before finishing init flows
2550 * @init_flags: values from iwl_extended_cfg_flags
2551 */
2552struct iwl_init_extended_cfg_cmd {
2553 __le32 init_flags;
2554} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
2555
Sara Sharone9e1ba32017-01-08 16:46:14 +02002556/*
2557 * struct iwl_nvm_get_info - request to get NVM data
2558 */
2559struct iwl_nvm_get_info {
2560 __le32 reserved;
2561} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
2562
2563/**
2564 * struct iwl_nvm_get_info_general - general NVM data
2565 * @flags: 1 - empty, 0 - valid
2566 * @nvm_version: nvm version
2567 * @board_type: board type
2568 */
2569struct iwl_nvm_get_info_general {
2570 __le32 flags;
2571 __le16 nvm_version;
2572 u8 board_type;
2573 u8 reserved;
2574} __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
2575
2576/**
2577 * struct iwl_nvm_get_info_sku - mac information
2578 * @enable_24g: band 2.4G enabled
2579 * @enable_5g: band 5G enabled
2580 * @enable_11n: 11n enabled
2581 * @enable_11ac: 11ac enabled
2582 * @mimo_disable: MIMO enabled
2583 * @ext_crypto: Extended crypto enabled
2584 */
2585struct iwl_nvm_get_info_sku {
2586 __le32 enable_24g;
2587 __le32 enable_5g;
2588 __le32 enable_11n;
2589 __le32 enable_11ac;
2590 __le32 mimo_disable;
2591 __le32 ext_crypto;
2592} __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
2593
2594/**
2595 * struct iwl_nvm_get_info_phy - phy information
2596 * @tx_chains: BIT 0 chain A, BIT 1 chain B
2597 * @rx_chains: BIT 0 chain A, BIT 1 chain B
2598 */
2599struct iwl_nvm_get_info_phy {
2600 __le32 tx_chains;
2601 __le32 rx_chains;
2602} __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
2603
2604#define IWL_NUM_CHANNELS (51)
2605
2606/**
2607 * struct iwl_nvm_get_info_regulatory - regulatory information
2608 * @lar_enabled: is LAR enabled
2609 * @channel_profile: regulatory data of this channel
2610 * @regulatory: regulatory data, see &enum iwl_nvm_channel_flags for data
2611 */
2612struct iwl_nvm_get_info_regulatory {
2613 __le32 lar_enabled;
2614 __le16 channel_profile[IWL_NUM_CHANNELS];
2615 __le16 reserved;
2616} __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
2617
2618/**
2619 * struct iwl_nvm_get_info_rsp - response to get NVM data
2620 * @general: general NVM data
2621 * @mac_sku: data relating to MAC sku
2622 * @phy_sku: data relating to PHY sku
2623 * @regulatory: regulatory data
2624 */
2625struct iwl_nvm_get_info_rsp {
2626 struct iwl_nvm_get_info_general general;
2627 struct iwl_nvm_get_info_sku mac_sku;
2628 struct iwl_nvm_get_info_phy phy_sku;
2629 struct iwl_nvm_get_info_regulatory regulatory;
2630} __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
2631
Johannes Berg15fc1962017-03-10 14:01:42 +01002632/**
2633 * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
2634 * @isolation: antenna isolation value
2635 */
2636struct iwl_mvm_antenna_coupling_notif {
2637 __le32 isolation;
2638} __packed;
2639
Johannes Berg8ca151b2013-01-24 14:25:36 +01002640#endif /* __fw_api_h__ */