blob: e692098a9f1e31999934f5491f55235dfdd7427b [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
Matti Gottlieb6fa52432016-01-04 13:38:41 +020010 * Copyright(c) 2016 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
Matti Gottlieb6fa52432016-01-04 13:38:41 +020037 * Copyright(c) 2016 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
Eytan Lifshitz19e737c2013-09-09 13:30:15 +020083/* Tx queue numbers */
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
Johannes Bergb2d81db2014-08-01 20:48:25 +020089enum iwl_mvm_tx_fifo {
90 IWL_MVM_TX_FIFO_BK = 0,
91 IWL_MVM_TX_FIFO_BE,
92 IWL_MVM_TX_FIFO_VI,
93 IWL_MVM_TX_FIFO_VO,
94 IWL_MVM_TX_FIFO_MCAST = 5,
95 IWL_MVM_TX_FIFO_CMD = 7,
96};
Eytan Lifshitz19e737c2013-09-09 13:30:15 +020097
Johannes Berg8ca151b2013-01-24 14:25:36 +010098#define IWL_MVM_STATION_COUNT 16
99
Arik Nemtsovcf7b4912014-05-15 11:44:40 +0300100#define IWL_MVM_TDLS_STA_COUNT 4
101
Johannes Berg8ca151b2013-01-24 14:25:36 +0100102/* commands */
103enum {
104 MVM_ALIVE = 0x1,
105 REPLY_ERROR = 0x2,
Emmanuel Grumbache5046012015-08-17 10:45:50 +0300106 ECHO_CMD = 0x3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100107
108 INIT_COMPLETE_NOTIF = 0x4,
109
110 /* PHY context commands */
111 PHY_CONTEXT_CMD = 0x8,
112 DBG_CFG = 0x9,
Emmanuel Grumbachb9fae2d2014-02-17 11:24:10 +0200113 ANTENNA_COUPLING_NOTIFICATION = 0xa,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100114
David Spinadeld2496222014-05-20 12:46:37 +0300115 /* UMAC scan commands */
Avraham Sternee9219b2015-03-23 15:09:27 +0200116 SCAN_ITERATION_COMPLETE_UMAC = 0xb5,
David Spinadeld2496222014-05-20 12:46:37 +0300117 SCAN_CFG_CMD = 0xc,
118 SCAN_REQ_UMAC = 0xd,
119 SCAN_ABORT_UMAC = 0xe,
120 SCAN_COMPLETE_UMAC = 0xf,
121
Johannes Berg8ca151b2013-01-24 14:25:36 +0100122 /* station table */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300123 ADD_STA_KEY = 0x17,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100124 ADD_STA = 0x18,
125 REMOVE_STA = 0x19,
126
Matti Gottliebe1120182015-07-19 11:15:07 +0300127 /* paging get item */
128 FW_GET_ITEM_CMD = 0x1a,
129
Johannes Berg8ca151b2013-01-24 14:25:36 +0100130 /* TX */
131 TX_CMD = 0x1c,
132 TXPATH_FLUSH = 0x1e,
133 MGMT_MCAST_KEY = 0x1f,
134
Avri Altman3edf8ff2014-07-30 11:41:01 +0300135 /* scheduler config */
136 SCD_QUEUE_CFG = 0x1d,
137
Johannes Berg8ca151b2013-01-24 14:25:36 +0100138 /* global key */
139 WEP_KEY = 0x20,
140
Liad Kaufman04fd2c22014-12-15 17:54:16 +0200141 /* Memory */
142 SHARED_MEM_CFG = 0x25,
143
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300144 /* TDLS */
145 TDLS_CHANNEL_SWITCH_CMD = 0x27,
146 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
Arik Nemtsov307e4722014-09-15 18:48:59 +0300147 TDLS_CONFIG_CMD = 0xa7,
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300148
Johannes Berg8ca151b2013-01-24 14:25:36 +0100149 /* MAC and Binding commands */
150 MAC_CONTEXT_CMD = 0x28,
151 TIME_EVENT_CMD = 0x29, /* both CMD and response */
152 TIME_EVENT_NOTIFICATION = 0x2a,
153 BINDING_CONTEXT_CMD = 0x2b,
154 TIME_QUOTA_CMD = 0x2c,
Johannes Berg4ac6cb52013-08-08 09:30:13 +0200155 NON_QOS_TX_COUNTER_CMD = 0x2d,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100156
157 LQ_CMD = 0x4e,
158
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300159 /* paging block to FW cpu2 */
160 FW_PAGING_BLOCK_CMD = 0x4f,
161
Johannes Berg8ca151b2013-01-24 14:25:36 +0100162 /* Scan offload */
163 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
164 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300165 HOT_SPOT_CMD = 0x53,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100166 SCAN_OFFLOAD_COMPLETE = 0x6D,
167 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
168 SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
David Spinadel35a000b2013-08-28 09:29:43 +0300169 MATCH_FOUND_NOTIFICATION = 0xd9,
David Spinadelfb98be52014-05-04 12:51:10 +0300170 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100171
172 /* Phy */
173 PHY_CONFIGURATION_CMD = 0x6a,
174 CALIB_RES_NOTIF_PHY_DB = 0x6b,
175 /* PHY_DB_CMD = 0x6c, */
176
Gregory Greenmance792912015-06-02 18:06:16 +0300177 /* ToF - 802.11mc FTM */
178 TOF_CMD = 0x10,
179 TOF_NOTIFICATION = 0x11,
180
Alexander Bondare811ada2013-03-10 15:29:44 +0200181 /* Power - legacy power table command */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100182 POWER_TABLE_CMD = 0x77,
Alexander Bondar175a70b2013-04-14 20:59:37 +0300183 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300184 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100185
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300186 /* Thermal Throttling*/
187 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
188
Matti Gottlieb0becb372015-05-31 09:18:30 +0300189 /* Set/Get DC2DC frequency tune */
190 DC2DC_CONFIG_CMD = 0x83,
191
Johannes Berg8ca151b2013-01-24 14:25:36 +0100192 /* NVM */
193 NVM_ACCESS_CMD = 0x88,
194
195 SET_CALIB_DEFAULT_CMD = 0x8e,
196
Ilan Peer571765c2013-03-05 15:26:03 +0200197 BEACON_NOTIFICATION = 0x90,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100198 BEACON_TEMPLATE_CMD = 0x91,
199 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100200 STATISTICS_CMD = 0x9c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100201 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg3e56ead2013-02-15 22:23:18 +0100202 EOSP_NOTIFICATION = 0x9e,
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300203 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100204
205 /* RF-KILL commands and notifications */
206 CARD_STATE_CMD = 0xa0,
207 CARD_STATE_NOTIFICATION = 0xa1,
208
Hila Gonend64048e2013-03-13 18:00:03 +0200209 MISSED_BEACONS_NOTIFICATION = 0xa2,
210
Alexander Bondare811ada2013-03-10 15:29:44 +0200211 /* Power - new power table command */
212 MAC_PM_POWER_TABLE = 0xa9,
213
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200214 MFUART_LOAD_NOTIFICATION = 0xb1,
215
Sara Sharon43413a92015-12-31 11:49:18 +0200216 RSS_CONFIG_CMD = 0xb3,
217
Johannes Berg8ca151b2013-01-24 14:25:36 +0100218 REPLY_RX_PHY_CMD = 0xc0,
219 REPLY_RX_MPDU_CMD = 0xc1,
Johannes Berg13555e82015-09-02 16:16:49 +0200220 FRAME_RELEASE = 0xc3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100221 BA_NOTIF = 0xc5,
222
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200223 /* Location Aware Regulatory */
224 MCC_UPDATE_CMD = 0xc8,
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200225 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200226
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300227 MARKER_CMD = 0xcb,
228
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200229 /* BT Coex */
230 BT_COEX_PRIO_TABLE = 0xcc,
231 BT_COEX_PROT_ENV = 0xcd,
232 BT_PROFILE_NOTIFICATION = 0xce,
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300233 BT_CONFIG = 0x9b,
234 BT_COEX_UPDATE_SW_BOOST = 0x5a,
235 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
236 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300237 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200238
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200239 REPLY_SF_CFG_CMD = 0xd1,
Hila Gonen7df15b12012-12-12 11:16:19 +0200240 REPLY_BEACON_FILTERING_CMD = 0xd2,
241
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300242 /* DTS measurements */
243 CMD_DTS_MEASUREMENT_TRIGGER = 0xdc,
244 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
245
Johannes Berg8ca151b2013-01-24 14:25:36 +0100246 REPLY_DEBUG_CMD = 0xf0,
Golan Ben Ami321c2102015-07-27 17:02:35 +0300247 LDBG_CONFIG_CMD = 0xf6,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100248 DEBUG_LOG_MSG = 0xf7,
249
Eliad Pellerc87163b2014-01-08 10:11:11 +0200250 BCAST_FILTER_CMD = 0xcf,
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300251 MCAST_FILTER_CMD = 0xd0,
252
Johannes Berg8ca151b2013-01-24 14:25:36 +0100253 /* D3 commands/notifications */
254 D3_CONFIG_CMD = 0xd3,
255 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
256 OFFLOADS_QUERY_CMD = 0xd5,
257 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300258 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100259
260 /* for WoWLAN in particular */
261 WOWLAN_PATTERNS = 0xe0,
262 WOWLAN_CONFIGURATION = 0xe1,
263 WOWLAN_TSC_RSC_PARAM = 0xe2,
264 WOWLAN_TKIP_PARAM = 0xe3,
265 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
266 WOWLAN_GET_STATUSES = 0xe5,
267 WOWLAN_TX_POWER_PER_DB = 0xe6,
268
269 /* and for NetDetect */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200270 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
271 SCAN_OFFLOAD_HOTSPOTS_CONFIG_CMD = 0x58,
272 SCAN_OFFLOAD_HOTSPOTS_QUERY_CMD = 0x59,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100273
274 REPLY_MAX = 0xff,
275};
276
Sharon Dvir39bdb172015-10-15 18:18:09 +0300277/* Please keep this enum *SORTED* by hex value.
278 * Needed for binary search, otherwise a warning will be triggered.
279 */
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300280enum iwl_phy_ops_subcmd_ids {
281 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +0200282 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +0200283 CT_KILL_NOTIFICATION = 0xFE,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300284 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
285};
286
Sara Sharon0db056d2015-12-29 11:07:15 +0200287enum iwl_prot_offload_subcmd_ids {
288 STORED_BEACON_NTF = 0xFF,
289};
290
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300291/* command groups */
292enum {
Sharon Dvir39bdb172015-10-15 18:18:09 +0300293 LEGACY_GROUP = 0x0,
294 LONG_GROUP = 0x1,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300295 PHY_OPS_GROUP = 0x4,
Sara Sharon0db056d2015-12-29 11:07:15 +0200296 PROT_OFFLOAD_GROUP = 0xb,
Aviya Erenfeld09eef332015-09-01 19:34:38 +0300297};
298
Johannes Berg8ca151b2013-01-24 14:25:36 +0100299/**
300 * struct iwl_cmd_response - generic response struct for most commands
301 * @status: status of the command asked, changes for each one
302 */
303struct iwl_cmd_response {
304 __le32 status;
305};
306
307/*
308 * struct iwl_tx_ant_cfg_cmd
309 * @valid: valid antenna configuration
310 */
311struct iwl_tx_ant_cfg_cmd {
312 __le32 valid;
313} __packed;
314
315/*
316 * Calibration control struct.
317 * Sent as part of the phy configuration command.
318 * @flow_trigger: bitmap for which calibrations to perform according to
319 * flow triggers.
320 * @event_trigger: bitmap for which calibrations to perform according to
321 * event triggers.
322 */
323struct iwl_calib_ctrl {
324 __le32 flow_trigger;
325 __le32 event_trigger;
326} __packed;
327
328/* This enum defines the bitmap of various calibrations to enable in both
329 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
330 */
331enum iwl_calib_cfg {
332 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
333 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
334 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
335 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
336 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
337 IWL_CALIB_CFG_DC_IDX = BIT(5),
338 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
339 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
340 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
341 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
342 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
343 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
344 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
345 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
346 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
347 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
348 IWL_CALIB_CFG_DAC_IDX = BIT(16),
349 IWL_CALIB_CFG_ABS_IDX = BIT(17),
350 IWL_CALIB_CFG_AGC_IDX = BIT(18),
351};
352
353/*
354 * Phy configuration command.
355 */
356struct iwl_phy_cfg_cmd {
357 __le32 phy_cfg;
358 struct iwl_calib_ctrl calib_control;
359} __packed;
360
361#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
362#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
363#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
364#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
365#define PHY_CFG_TX_CHAIN_A BIT(8)
366#define PHY_CFG_TX_CHAIN_B BIT(9)
367#define PHY_CFG_TX_CHAIN_C BIT(10)
368#define PHY_CFG_RX_CHAIN_A BIT(12)
369#define PHY_CFG_RX_CHAIN_B BIT(13)
370#define PHY_CFG_RX_CHAIN_C BIT(14)
371
372
373/* Target of the NVM_ACCESS_CMD */
374enum {
375 NVM_ACCESS_TARGET_CACHE = 0,
376 NVM_ACCESS_TARGET_OTP = 1,
377 NVM_ACCESS_TARGET_EEPROM = 2,
378};
379
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200380/* Section types for NVM_ACCESS_CMD */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100381enum {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200382 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200383 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200384 NVM_SECTION_TYPE_CALIBRATION = 4,
385 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200386 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200387 NVM_SECTION_TYPE_PHY_SKU = 12,
388 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100389};
390
391/**
392 * struct iwl_nvm_access_cmd_ver2 - Request the device to send an NVM section
393 * @op_code: 0 - read, 1 - write
394 * @target: NVM_ACCESS_TARGET_*
395 * @type: NVM_SECTION_TYPE_*
396 * @offset: offset in bytes into the section
397 * @length: in bytes, to read/write
398 * @data: if write operation, the data to write. On read its empty
399 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200400struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100401 u8 op_code;
402 u8 target;
403 __le16 type;
404 __le16 offset;
405 __le16 length;
406 u8 data[];
407} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
408
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300409#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
410
411/*
412 * struct iwl_fw_paging_cmd - paging layout
413 *
414 * (FW_PAGING_BLOCK_CMD = 0x4f)
415 *
416 * Send to FW the paging layout in the driver.
417 *
418 * @flags: various flags for the command
419 * @block_size: the block size in powers of 2
420 * @block_num: number of blocks specified in the command.
421 * @device_phy_addr: virtual addresses from device side
422*/
423struct iwl_fw_paging_cmd {
424 __le32 flags;
425 __le32 block_size;
426 __le32 block_num;
427 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
428} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
429
Matti Gottliebe1120182015-07-19 11:15:07 +0300430/*
431 * Fw items ID's
432 *
433 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
434 * download
435 */
436enum iwl_fw_item_id {
437 IWL_FW_ITEM_ID_PAGING = 3,
438};
439
440/*
441 * struct iwl_fw_get_item_cmd - get an item from the fw
442 */
443struct iwl_fw_get_item_cmd {
444 __le32 item_id;
445} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
446
Golan Ben Ami321c2102015-07-27 17:02:35 +0300447#define CONT_REC_COMMAND_SIZE 80
448#define ENABLE_CONT_RECORDING 0x15
449#define DISABLE_CONT_RECORDING 0x16
450
451/*
452 * struct iwl_continuous_record_mode - recording mode
453 */
454struct iwl_continuous_record_mode {
455 __le16 enable_recording;
456} __packed;
457
458/*
459 * struct iwl_continuous_record_cmd - enable/disable continuous recording
460 */
461struct iwl_continuous_record_cmd {
462 struct iwl_continuous_record_mode record_mode;
463 u8 pad[CONT_REC_COMMAND_SIZE -
464 sizeof(struct iwl_continuous_record_mode)];
465} __packed;
466
Matti Gottliebe1120182015-07-19 11:15:07 +0300467struct iwl_fw_get_item_resp {
468 __le32 item_id;
469 __le32 item_byte_cnt;
470 __le32 item_val;
471} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
472
Johannes Berg8ca151b2013-01-24 14:25:36 +0100473/**
474 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
475 * @offset: offset in bytes into the section
476 * @length: in bytes, either how much was written or read
477 * @type: NVM_SECTION_TYPE_*
478 * @status: 0 for success, fail otherwise
479 * @data: if read operation, the data returned. Empty on write.
480 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200481struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100482 __le16 offset;
483 __le16 length;
484 __le16 type;
485 __le16 status;
486 u8 data[];
487} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
488
489/* MVM_ALIVE 0x1 */
490
491/* alive response is_valid values */
492#define ALIVE_RESP_UCODE_OK BIT(0)
493#define ALIVE_RESP_RFKILL BIT(1)
494
495/* alive response ver_type values */
496enum {
497 FW_TYPE_HW = 0,
498 FW_TYPE_PROT = 1,
499 FW_TYPE_AP = 2,
500 FW_TYPE_WOWLAN = 3,
501 FW_TYPE_TIMING = 4,
502 FW_TYPE_WIPAN = 5
503};
504
505/* alive response ver_subtype values */
506enum {
507 FW_SUBTYPE_FULL_FEATURE = 0,
508 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
509 FW_SUBTYPE_REDUCED = 2,
510 FW_SUBTYPE_ALIVE_ONLY = 3,
511 FW_SUBTYPE_WOWLAN = 4,
512 FW_SUBTYPE_AP_SUBTYPE = 5,
513 FW_SUBTYPE_WIPAN = 6,
514 FW_SUBTYPE_INITIALIZE = 9
515};
516
517#define IWL_ALIVE_STATUS_ERR 0xDEAD
518#define IWL_ALIVE_STATUS_OK 0xCAFE
519
520#define IWL_ALIVE_FLG_RFKILL BIT(0)
521
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200522struct mvm_alive_resp_ver1 {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100523 __le16 status;
524 __le16 flags;
525 u8 ucode_minor;
526 u8 ucode_major;
527 __le16 id;
528 u8 api_minor;
529 u8 api_major;
530 u8 ver_subtype;
531 u8 ver_type;
532 u8 mac;
533 u8 opt;
534 __le16 reserved2;
535 __le32 timestamp;
536 __le32 error_event_table_ptr; /* SRAM address for error log */
537 __le32 log_event_table_ptr; /* SRAM address for event log */
538 __le32 cpu_register_ptr;
539 __le32 dbgm_config_ptr;
540 __le32 alive_counter_ptr;
541 __le32 scd_base_ptr; /* SRAM address for SCD */
542} __packed; /* ALIVE_RES_API_S_VER_1 */
543
Eran Harary01a9ca52014-02-03 09:29:57 +0200544struct mvm_alive_resp_ver2 {
545 __le16 status;
546 __le16 flags;
547 u8 ucode_minor;
548 u8 ucode_major;
549 __le16 id;
550 u8 api_minor;
551 u8 api_major;
552 u8 ver_subtype;
553 u8 ver_type;
554 u8 mac;
555 u8 opt;
556 __le16 reserved2;
557 __le32 timestamp;
558 __le32 error_event_table_ptr; /* SRAM address for error log */
559 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
560 __le32 cpu_register_ptr;
561 __le32 dbgm_config_ptr;
562 __le32 alive_counter_ptr;
563 __le32 scd_base_ptr; /* SRAM address for SCD */
564 __le32 st_fwrd_addr; /* pointer to Store and forward */
565 __le32 st_fwrd_size;
566 u8 umac_minor; /* UMAC version: minor */
567 u8 umac_major; /* UMAC version: major */
568 __le16 umac_id; /* UMAC version: id */
569 __le32 error_info_addr; /* SRAM address for UMAC error log */
570 __le32 dbg_print_buff_addr;
571} __packed; /* ALIVE_RES_API_S_VER_2 */
572
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200573struct mvm_alive_resp {
574 __le16 status;
575 __le16 flags;
576 __le32 ucode_minor;
577 __le32 ucode_major;
578 u8 ver_subtype;
579 u8 ver_type;
580 u8 mac;
581 u8 opt;
582 __le32 timestamp;
583 __le32 error_event_table_ptr; /* SRAM address for error log */
584 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
585 __le32 cpu_register_ptr;
586 __le32 dbgm_config_ptr;
587 __le32 alive_counter_ptr;
588 __le32 scd_base_ptr; /* SRAM address for SCD */
589 __le32 st_fwrd_addr; /* pointer to Store and forward */
590 __le32 st_fwrd_size;
591 __le32 umac_minor; /* UMAC version: minor */
592 __le32 umac_major; /* UMAC version: major */
593 __le32 error_info_addr; /* SRAM address for UMAC error log */
594 __le32 dbg_print_buff_addr;
595} __packed; /* ALIVE_RES_API_S_VER_3 */
596
Johannes Berg8ca151b2013-01-24 14:25:36 +0100597/* Error response/notification */
598enum {
599 FW_ERR_UNKNOWN_CMD = 0x0,
600 FW_ERR_INVALID_CMD_PARAM = 0x1,
601 FW_ERR_SERVICE = 0x2,
602 FW_ERR_ARC_MEMORY = 0x3,
603 FW_ERR_ARC_CODE = 0x4,
604 FW_ERR_WATCH_DOG = 0x5,
605 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
606 FW_ERR_WEP_KEY_SIZE = 0x11,
607 FW_ERR_OBSOLETE_FUNC = 0x12,
608 FW_ERR_UNEXPECTED = 0xFE,
609 FW_ERR_FATAL = 0xFF
610};
611
612/**
613 * struct iwl_error_resp - FW error indication
614 * ( REPLY_ERROR = 0x2 )
615 * @error_type: one of FW_ERR_*
616 * @cmd_id: the command ID for which the error occured
617 * @bad_cmd_seq_num: sequence number of the erroneous command
618 * @error_service: which service created the error, applicable only if
619 * error_type = 2, otherwise 0
620 * @timestamp: TSF in usecs.
621 */
622struct iwl_error_resp {
623 __le32 error_type;
624 u8 cmd_id;
625 u8 reserved1;
626 __le16 bad_cmd_seq_num;
627 __le32 error_service;
628 __le64 timestamp;
629} __packed;
630
631
632/* Common PHY, MAC and Bindings definitions */
633
634#define MAX_MACS_IN_BINDING (3)
635#define MAX_BINDINGS (4)
636#define AUX_BINDING_INDEX (3)
637#define MAX_PHYS (4)
638
639/* Used to extract ID and color from the context dword */
640#define FW_CTXT_ID_POS (0)
641#define FW_CTXT_ID_MSK (0xff << FW_CTXT_ID_POS)
642#define FW_CTXT_COLOR_POS (8)
643#define FW_CTXT_COLOR_MSK (0xff << FW_CTXT_COLOR_POS)
644#define FW_CTXT_INVALID (0xffffffff)
645
646#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
647 (_color << FW_CTXT_COLOR_POS))
648
649/* Possible actions on PHYs, MACs and Bindings */
650enum {
651 FW_CTXT_ACTION_STUB = 0,
652 FW_CTXT_ACTION_ADD,
653 FW_CTXT_ACTION_MODIFY,
654 FW_CTXT_ACTION_REMOVE,
655 FW_CTXT_ACTION_NUM
656}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
657
658/* Time Events */
659
660/* Time Event types, according to MAC type */
661enum iwl_time_event_type {
662 /* BSS Station Events */
663 TE_BSS_STA_AGGRESSIVE_ASSOC,
664 TE_BSS_STA_ASSOC,
665 TE_BSS_EAP_DHCP_PROT,
666 TE_BSS_QUIET_PERIOD,
667
668 /* P2P Device Events */
669 TE_P2P_DEVICE_DISCOVERABLE,
670 TE_P2P_DEVICE_LISTEN,
671 TE_P2P_DEVICE_ACTION_SCAN,
672 TE_P2P_DEVICE_FULL_SCAN,
673
674 /* P2P Client Events */
675 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
676 TE_P2P_CLIENT_ASSOC,
677 TE_P2P_CLIENT_QUIET_PERIOD,
678
679 /* P2P GO Events */
680 TE_P2P_GO_ASSOC_PROT,
681 TE_P2P_GO_REPETITIVE_NOA,
682 TE_P2P_GO_CT_WINDOW,
683
684 /* WiDi Sync Events */
685 TE_WIDI_TX_SYNC,
686
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +0300687 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +0300688 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +0300689
Johannes Berg8ca151b2013-01-24 14:25:36 +0100690 TE_MAX
691}; /* MAC_EVENT_TYPE_API_E_VER_1 */
692
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300693
694
695/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100696
697/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300698 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
699 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
700 * the first fragment is scheduled.
701 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
702 * the first 2 fragments are scheduled.
703 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
704 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100705 *
706 * Other than the constant defined above, specifying a fragmentation value 'x'
707 * means that the event can be fragmented but only the first 'x' will be
708 * scheduled.
709 */
710enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300711 TE_V1_FRAG_NONE = 0,
712 TE_V1_FRAG_SINGLE = 1,
713 TE_V1_FRAG_DUAL = 2,
714 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +0100715};
716
Johannes Berg8ca151b2013-01-24 14:25:36 +0100717/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300718#define TE_V1_FRAG_MAX_MSK 0x0fffffff
719/* Repeat the time event endlessly (until removed) */
720#define TE_V1_REPEAT_ENDLESS 0xffffffff
721/* If a Time Event has bounded repetitions, this is the maximal value */
722#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
723
724/* Time Event dependencies: none, on another TE, or in a specific time */
725enum {
726 TE_V1_INDEPENDENT = 0,
727 TE_V1_DEP_OTHER = BIT(0),
728 TE_V1_DEP_TSF = BIT(1),
729 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
730}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
731
732/*
733 * @TE_V1_NOTIF_NONE: no notifications
734 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
735 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
736 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
737 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
738 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
739 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
740 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
741 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
742 *
743 * Supported Time event notifications configuration.
744 * A notification (both event and fragment) includes a status indicating weather
745 * the FW was able to schedule the event or not. For fragment start/end
746 * notification the status is always success. There is no start/end fragment
747 * notification for monolithic events.
748 */
749enum {
750 TE_V1_NOTIF_NONE = 0,
751 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
752 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
753 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
754 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
755 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
756 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
757 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
758 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
759}; /* MAC_EVENT_ACTION_API_E_VER_2 */
760
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300761/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300762
763/*
764 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
765 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
766 * the first fragment is scheduled.
767 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
768 * the first 2 fragments are scheduled.
769 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
770 * number of fragments are valid.
771 *
772 * Other than the constant defined above, specifying a fragmentation value 'x'
773 * means that the event can be fragmented but only the first 'x' will be
774 * scheduled.
775 */
776enum {
777 TE_V2_FRAG_NONE = 0,
778 TE_V2_FRAG_SINGLE = 1,
779 TE_V2_FRAG_DUAL = 2,
780 TE_V2_FRAG_MAX = 0xfe,
781 TE_V2_FRAG_ENDLESS = 0xff
782};
783
784/* Repeat the time event endlessly (until removed) */
785#define TE_V2_REPEAT_ENDLESS 0xff
786/* If a Time Event has bounded repetitions, this is the maximal value */
787#define TE_V2_REPEAT_MAX 0xfe
788
789#define TE_V2_PLACEMENT_POS 12
790#define TE_V2_ABSENCE_POS 15
791
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300792/* Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300793 * A notification (both event and fragment) includes a status indicating weather
794 * the FW was able to schedule the event or not. For fragment start/end
795 * notification the status is always success. There is no start/end fragment
796 * notification for monolithic events.
797 *
798 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
799 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
800 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
801 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
802 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
803 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
804 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
805 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
806 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
807 * @TE_V2_DEP_OTHER: depends on another time event
808 * @TE_V2_DEP_TSF: depends on a specific time
809 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
810 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
811 */
812enum {
813 TE_V2_DEFAULT_POLICY = 0x0,
814
815 /* notifications (event start/stop, fragment start/stop) */
816 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
817 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
818 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
819 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
820
821 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
822 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
823 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
824 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +0200825 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300826
827 TE_V2_NOTIF_MSK = 0xff,
828
829 /* placement characteristics */
830 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
831 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
832 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
833
834 /* are we present or absent during the Time Event. */
835 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
836};
837
838/**
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300839 * struct iwl_time_event_cmd_api - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300840 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
841 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
842 * ( TIME_EVENT_CMD = 0x29 )
843 * @id_and_color: ID and color of the relevant MAC
844 * @action: action to perform, one of FW_CTXT_ACTION_*
845 * @id: this field has two meanings, depending on the action:
846 * If the action is ADD, then it means the type of event to add.
847 * For all other actions it is the unique event ID assigned when the
848 * event was added by the FW.
849 * @apply_time: When to start the Time Event (in GP2)
850 * @max_delay: maximum delay to event's start (apply time), in TU
851 * @depends_on: the unique ID of the event we depend on (if any)
852 * @interval: interval between repetitions, in TU
853 * @duration: duration of event in TU
854 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
855 * @max_frags: maximal number of fragments the Time Event can be divided to
856 * @policy: defines whether uCode shall notify the host or other uCode modules
857 * on event and/or fragment start and/or end
858 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
859 * TE_EVENT_SOCIOPATHIC
860 * using TE_ABSENCE and using TE_NOTIF_*
861 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300862struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300863 /* COMMON_INDEX_HDR_API_S_VER_1 */
864 __le32 id_and_color;
865 __le32 action;
866 __le32 id;
867 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
868 __le32 apply_time;
869 __le32 max_delay;
870 __le32 depends_on;
871 __le32 interval;
872 __le32 duration;
873 u8 repeat;
874 u8 max_frags;
875 __le16 policy;
876} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
877
Johannes Berg8ca151b2013-01-24 14:25:36 +0100878/**
879 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
880 * @status: bit 0 indicates success, all others specify errors
881 * @id: the Time Event type
882 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
883 * @id_and_color: ID and color of the relevant MAC
884 */
885struct iwl_time_event_resp {
886 __le32 status;
887 __le32 id;
888 __le32 unique_id;
889 __le32 id_and_color;
890} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
891
892/**
893 * struct iwl_time_event_notif - notifications of time event start/stop
894 * ( TIME_EVENT_NOTIFICATION = 0x2a )
895 * @timestamp: action timestamp in GP2
896 * @session_id: session's unique id
897 * @unique_id: unique id of the Time Event itself
898 * @id_and_color: ID and color of the relevant MAC
899 * @action: one of TE_NOTIF_START or TE_NOTIF_END
900 * @status: true if scheduled, false otherwise (not executed)
901 */
902struct iwl_time_event_notif {
903 __le32 timestamp;
904 __le32 session_id;
905 __le32 unique_id;
906 __le32 id_and_color;
907 __le32 action;
908 __le32 status;
909} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
910
911
912/* Bindings and Time Quota */
913
914/**
915 * struct iwl_binding_cmd - configuring bindings
916 * ( BINDING_CONTEXT_CMD = 0x2b )
917 * @id_and_color: ID and color of the relevant Binding
918 * @action: action to perform, one of FW_CTXT_ACTION_*
919 * @macs: array of MAC id and colors which belong to the binding
920 * @phy: PHY id and color which belongs to the binding
921 */
922struct iwl_binding_cmd {
923 /* COMMON_INDEX_HDR_API_S_VER_1 */
924 __le32 id_and_color;
925 __le32 action;
926 /* BINDING_DATA_API_S_VER_1 */
927 __le32 macs[MAX_MACS_IN_BINDING];
928 __le32 phy;
929} __packed; /* BINDING_CMD_API_S_VER_1 */
930
Ilan Peer35adfd62013-02-04 13:16:24 +0200931/* The maximal number of fragments in the FW's schedule session */
932#define IWL_MVM_MAX_QUOTA 128
933
Johannes Berg8ca151b2013-01-24 14:25:36 +0100934/**
935 * struct iwl_time_quota_data - configuration of time quota per binding
936 * @id_and_color: ID and color of the relevant Binding
937 * @quota: absolute time quota in TU. The scheduler will try to divide the
938 * remainig quota (after Time Events) according to this quota.
939 * @max_duration: max uninterrupted context duration in TU
940 */
941struct iwl_time_quota_data {
942 __le32 id_and_color;
943 __le32 quota;
944 __le32 max_duration;
945} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
946
947/**
948 * struct iwl_time_quota_cmd - configuration of time quota between bindings
949 * ( TIME_QUOTA_CMD = 0x2c )
950 * @quotas: allocations per binding
951 */
952struct iwl_time_quota_cmd {
953 struct iwl_time_quota_data quotas[MAX_BINDINGS];
954} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
955
956
957/* PHY context */
958
959/* Supported bands */
960#define PHY_BAND_5 (0)
961#define PHY_BAND_24 (1)
962
963/* Supported channel width, vary if there is VHT support */
964#define PHY_VHT_CHANNEL_MODE20 (0x0)
965#define PHY_VHT_CHANNEL_MODE40 (0x1)
966#define PHY_VHT_CHANNEL_MODE80 (0x2)
967#define PHY_VHT_CHANNEL_MODE160 (0x3)
968
969/*
970 * Control channel position:
971 * For legacy set bit means upper channel, otherwise lower.
972 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
973 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
974 * center_freq
975 * |
976 * 40Mhz |_______|_______|
977 * 80Mhz |_______|_______|_______|_______|
978 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
979 * code 011 010 001 000 | 100 101 110 111
980 */
981#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
982#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
983#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
984#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
985#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
986#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
987#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
988#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
989
990/*
991 * @band: PHY_BAND_*
992 * @channel: channel number
993 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
994 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
995 */
996struct iwl_fw_channel_info {
997 u8 band;
998 u8 channel;
999 u8 width;
1000 u8 ctrl_pos;
1001} __packed;
1002
1003#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
1004#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
1005 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
1006#define PHY_RX_CHAIN_VALID_POS (1)
1007#define PHY_RX_CHAIN_VALID_MSK \
1008 (0x7 << PHY_RX_CHAIN_VALID_POS)
1009#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
1010#define PHY_RX_CHAIN_FORCE_SEL_MSK \
1011 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
1012#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
1013#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
1014 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
1015#define PHY_RX_CHAIN_CNT_POS (10)
1016#define PHY_RX_CHAIN_CNT_MSK \
1017 (0x3 << PHY_RX_CHAIN_CNT_POS)
1018#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
1019#define PHY_RX_CHAIN_MIMO_CNT_MSK \
1020 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
1021#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
1022#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
1023 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
1024
1025/* TODO: fix the value, make it depend on firmware at runtime? */
1026#define NUM_PHY_CTX 3
1027
1028/* TODO: complete missing documentation */
1029/**
1030 * struct iwl_phy_context_cmd - config of the PHY context
1031 * ( PHY_CONTEXT_CMD = 0x8 )
1032 * @id_and_color: ID and color of the relevant Binding
1033 * @action: action to perform, one of FW_CTXT_ACTION_*
1034 * @apply_time: 0 means immediate apply and context switch.
1035 * other value means apply new params after X usecs
1036 * @tx_param_color: ???
1037 * @channel_info:
1038 * @txchain_info: ???
1039 * @rxchain_info: ???
1040 * @acquisition_data: ???
1041 * @dsp_cfg_flags: set to 0
1042 */
1043struct iwl_phy_context_cmd {
1044 /* COMMON_INDEX_HDR_API_S_VER_1 */
1045 __le32 id_and_color;
1046 __le32 action;
1047 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1048 __le32 apply_time;
1049 __le32 tx_param_color;
1050 struct iwl_fw_channel_info ci;
1051 __le32 txchain_info;
1052 __le32 rxchain_info;
1053 __le32 acquisition_data;
1054 __le32 dsp_cfg_flags;
1055} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1056
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001057/*
1058 * Aux ROC command
1059 *
1060 * Command requests the firmware to create a time event for a certain duration
1061 * and remain on the given channel. This is done by using the Aux framework in
1062 * the FW.
1063 * The command was first used for Hot Spot issues - but can be used regardless
1064 * to Hot Spot.
1065 *
1066 * ( HOT_SPOT_CMD 0x53 )
1067 *
1068 * @id_and_color: ID and color of the MAC
1069 * @action: action to perform, one of FW_CTXT_ACTION_*
1070 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1071 * event_unique_id should be the id of the time event assigned by ucode.
1072 * Otherwise ignore the event_unique_id.
1073 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1074 * activity.
1075 * @channel_info: channel info
1076 * @node_addr: Our MAC Address
1077 * @reserved: reserved for alignment
1078 * @apply_time: GP2 value to start (should always be the current GP2 value)
1079 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1080 * time by which start of the event is allowed to be postponed.
1081 * @duration: event duration in TU To calculate event duration:
1082 * timeEventDuration = min(duration, remainingQuota)
1083 */
1084struct iwl_hs20_roc_req {
1085 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1086 __le32 id_and_color;
1087 __le32 action;
1088 __le32 event_unique_id;
1089 __le32 sta_id_and_color;
1090 struct iwl_fw_channel_info channel_info;
1091 u8 node_addr[ETH_ALEN];
1092 __le16 reserved;
1093 __le32 apply_time;
1094 __le32 apply_time_max_delay;
1095 __le32 duration;
1096} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1097
1098/*
1099 * values for AUX ROC result values
1100 */
1101enum iwl_mvm_hot_spot {
1102 HOT_SPOT_RSP_STATUS_OK,
1103 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1104 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1105};
1106
1107/*
1108 * Aux ROC command response
1109 *
1110 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1111 * driver the uid of the timevent.
1112 *
1113 * ( HOT_SPOT_CMD 0x53 )
1114 *
1115 * @event_unique_id: Unique ID of time event assigned by ucode
1116 * @status: Return status 0 is success, all the rest used for specific errors
1117 */
1118struct iwl_hs20_roc_res {
1119 __le32 event_unique_id;
1120 __le32 status;
1121} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1122
Johannes Berg8ca151b2013-01-24 14:25:36 +01001123/**
1124 * struct iwl_radio_version_notif - information on the radio version
1125 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
1126 * @radio_flavor:
1127 * @radio_step:
1128 * @radio_dash:
1129 */
1130struct iwl_radio_version_notif {
1131 __le32 radio_flavor;
1132 __le32 radio_step;
1133 __le32 radio_dash;
1134} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1135
1136enum iwl_card_state_flags {
1137 CARD_ENABLED = 0x00,
1138 HW_CARD_DISABLED = 0x01,
1139 SW_CARD_DISABLED = 0x02,
1140 CT_KILL_CARD_DISABLED = 0x04,
1141 HALT_CARD_DISABLED = 0x08,
1142 CARD_DISABLED_MSK = 0x0f,
1143 CARD_IS_RX_ON = 0x10,
1144};
1145
1146/**
1147 * struct iwl_radio_version_notif - information on the radio version
1148 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1149 * @flags: %iwl_card_state_flags
1150 */
1151struct iwl_card_state_notif {
1152 __le32 flags;
1153} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1154
1155/**
Hila Gonend64048e2013-03-13 18:00:03 +02001156 * struct iwl_missed_beacons_notif - information on missed beacons
1157 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1158 * @mac_id: interface ID
1159 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1160 * beacons since last RX.
1161 * @consec_missed_beacons: number of consecutive missed beacons
1162 * @num_expected_beacons:
1163 * @num_recvd_beacons:
1164 */
1165struct iwl_missed_beacons_notif {
1166 __le32 mac_id;
1167 __le32 consec_missed_beacons_since_last_rx;
1168 __le32 consec_missed_beacons;
1169 __le32 num_expected_beacons;
1170 __le32 num_recvd_beacons;
1171} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1172
1173/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001174 * struct iwl_mfuart_load_notif - mfuart image version & status
1175 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1176 * @installed_ver: installed image version
1177 * @external_ver: external image version
1178 * @status: MFUART loading status
1179 * @duration: MFUART loading time
1180*/
1181struct iwl_mfuart_load_notif {
1182 __le32 installed_ver;
1183 __le32 external_ver;
1184 __le32 status;
1185 __le32 duration;
1186} __packed; /*MFU_LOADER_NTFY_API_S_VER_1*/
1187
1188/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001189 * struct iwl_set_calib_default_cmd - set default value for calibration.
1190 * ( SET_CALIB_DEFAULT_CMD = 0x8e )
1191 * @calib_index: the calibration to set value for
1192 * @length: of data
1193 * @data: the value to set for the calibration result
1194 */
1195struct iwl_set_calib_default_cmd {
1196 __le16 calib_index;
1197 __le16 length;
1198 u8 data[0];
1199} __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
1200
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001201#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001202#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001203
1204/**
1205 * struct iwl_mcast_filter_cmd - configure multicast filter.
1206 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1207 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1208 * to identify network interface adopted in host-device IF.
1209 * It is used by FW as index in array of addresses. This array has
1210 * MAX_PORT_ID_NUM members.
1211 * @count: Number of MAC addresses in the array
1212 * @pass_all: Set 1 to pass all multicast packets.
1213 * @bssid: current association BSSID.
1214 * @addr_list: Place holder for array of MAC addresses.
1215 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1216 */
1217struct iwl_mcast_filter_cmd {
1218 u8 filter_own;
1219 u8 port_id;
1220 u8 count;
1221 u8 pass_all;
1222 u8 bssid[6];
1223 u8 reserved[2];
1224 u8 addr_list[0];
1225} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1226
Eliad Pellerc87163b2014-01-08 10:11:11 +02001227#define MAX_BCAST_FILTERS 8
1228#define MAX_BCAST_FILTER_ATTRS 2
1229
1230/**
1231 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1232 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1233 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1234 * start of ip payload).
1235 */
1236enum iwl_mvm_bcast_filter_attr_offset {
1237 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1238 BCAST_FILTER_OFFSET_IP_END = 1,
1239};
1240
1241/**
1242 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1243 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1244 * @offset: starting offset of this pattern.
1245 * @val: value to match - big endian (MSB is the first
1246 * byte to match from offset pos).
1247 * @mask: mask to match (big endian).
1248 */
1249struct iwl_fw_bcast_filter_attr {
1250 u8 offset_type;
1251 u8 offset;
1252 __le16 reserved1;
1253 __be32 val;
1254 __be32 mask;
1255} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1256
1257/**
1258 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1259 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1260 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1261 */
1262enum iwl_mvm_bcast_filter_frame_type {
1263 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1264 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1265};
1266
1267/**
1268 * struct iwl_fw_bcast_filter - broadcast filter
1269 * @discard: discard frame (1) or let it pass (0).
1270 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
1271 * @num_attrs: number of valid attributes in this filter.
1272 * @attrs: attributes of this filter. a filter is considered matched
1273 * only when all its attributes are matched (i.e. AND relationship)
1274 */
1275struct iwl_fw_bcast_filter {
1276 u8 discard;
1277 u8 frame_type;
1278 u8 num_attrs;
1279 u8 reserved1;
1280 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1281} __packed; /* BCAST_FILTER_S_VER_1 */
1282
1283/**
1284 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1285 * @default_discard: default action for this mac (discard (1) / pass (0)).
1286 * @attached_filters: bitmap of relevant filters for this mac.
1287 */
1288struct iwl_fw_bcast_mac {
1289 u8 default_discard;
1290 u8 reserved1;
1291 __le16 attached_filters;
1292} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1293
1294/**
1295 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1296 * @disable: enable (0) / disable (1)
1297 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1298 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
1299 * @filters: broadcast filters
1300 * @macs: broadcast filtering configuration per-mac
1301 */
1302struct iwl_bcast_filter_cmd {
1303 u8 disable;
1304 u8 max_bcast_filters;
1305 u8 max_macs;
1306 u8 reserved1;
1307 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1308 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1309} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1310
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001311/*
1312 * enum iwl_mvm_marker_id - maker ids
1313 *
1314 * The ids for different type of markers to insert into the usniffer logs
1315 */
1316enum iwl_mvm_marker_id {
1317 MARKER_ID_TX_FRAME_LATENCY = 1,
1318}; /* MARKER_ID_API_E_VER_1 */
1319
1320/**
1321 * struct iwl_mvm_marker - mark info into the usniffer logs
1322 *
1323 * (MARKER_CMD = 0xcb)
1324 *
1325 * Mark the UTC time stamp into the usniffer logs together with additional
1326 * metadata, so the usniffer output can be parsed.
1327 * In the command response the ucode will return the GP2 time.
1328 *
1329 * @dw_len: The amount of dwords following this byte including this byte.
1330 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1331 * @reserved: reserved.
1332 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1333 * @metadata: additional meta data that will be written to the unsiffer log
1334 */
1335struct iwl_mvm_marker {
1336 u8 dwLen;
1337 u8 markerId;
1338 __le16 reserved;
1339 __le64 timestamp;
1340 __le32 metadata[0];
1341} __packed; /* MARKER_API_S_VER_1 */
1342
Matti Gottlieb0becb372015-05-31 09:18:30 +03001343/*
1344 * enum iwl_dc2dc_config_id - flag ids
1345 *
1346 * Ids of dc2dc configuration flags
1347 */
1348enum iwl_dc2dc_config_id {
1349 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1350 DCDC_FREQ_TUNE_SET = 0x2,
1351}; /* MARKER_ID_API_E_VER_1 */
1352
1353/**
1354 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1355 *
1356 * (DC2DC_CONFIG_CMD = 0x83)
1357 *
1358 * Set/Get & configure dc2dc values.
1359 * The command always returns the current dc2dc values.
1360 *
1361 * @flags: set/get dc2dc
1362 * @enable_low_power_mode: not used.
1363 * @dc2dc_freq_tune0: frequency divider - digital domain
1364 * @dc2dc_freq_tune1: frequency divider - analog domain
1365 */
1366struct iwl_dc2dc_config_cmd {
1367 __le32 flags;
1368 __le32 enable_low_power_mode; /* not used */
1369 __le32 dc2dc_freq_tune0;
1370 __le32 dc2dc_freq_tune1;
1371} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1372
1373/**
1374 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1375 *
1376 * Current dc2dc values returned by the FW.
1377 *
1378 * @dc2dc_freq_tune0: frequency divider - digital domain
1379 * @dc2dc_freq_tune1: frequency divider - analog domain
1380 */
1381struct iwl_dc2dc_config_resp {
1382 __le32 dc2dc_freq_tune0;
1383 __le32 dc2dc_freq_tune1;
1384} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1385
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001386/***********************************
1387 * Smart Fifo API
1388 ***********************************/
1389/* Smart Fifo state */
1390enum iwl_sf_state {
1391 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1392 SF_FULL_ON,
1393 SF_UNINIT,
1394 SF_INIT_OFF,
1395 SF_HW_NUM_STATES
1396};
1397
1398/* Smart Fifo possible scenario */
1399enum iwl_sf_scenario {
1400 SF_SCENARIO_SINGLE_UNICAST,
1401 SF_SCENARIO_AGG_UNICAST,
1402 SF_SCENARIO_MULTICAST,
1403 SF_SCENARIO_BA_RESP,
1404 SF_SCENARIO_TX_RESP,
1405 SF_NUM_SCENARIO
1406};
1407
1408#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
1409#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
1410
1411/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02001412#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001413#define SF_W_MARK_MIMO2 8192
1414#define SF_W_MARK_MIMO3 6144
1415#define SF_W_MARK_LEGACY 4096
1416#define SF_W_MARK_SCAN 4096
1417
Eran Hararyf4a3ee42015-02-08 13:58:50 +02001418/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
1419#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1420#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1421#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1422#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1423#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
1424#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1425#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
1426#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
1427#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
1428#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
1429
1430/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001431#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1432#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1433#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1434#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1435#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
1436#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
1437#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
1438#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
1439#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
1440#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
1441
1442#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
1443
Eran Harary161bdb72014-07-27 08:03:06 +03001444#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
1445
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001446/**
1447 * Smart Fifo configuration command.
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001448 * @state: smart fifo state, types listed in enum %iwl_sf_sate.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001449 * @watermark: Minimum allowed availabe free space in RXF for transient state.
1450 * @long_delay_timeouts: aging and idle timer values for each scenario
1451 * in long delay state.
1452 * @full_on_timeouts: timer values for each scenario in full on state.
1453 */
1454struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001455 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001456 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
1457 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1458 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1459} __packed; /* SF_CFG_API_S_VER_2 */
1460
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001461/***********************************
1462 * Location Aware Regulatory (LAR) API - MCC updates
1463 ***********************************/
1464
1465/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001466 * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001467 * regulatory profile according to the given MCC (Mobile Country Code).
1468 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1469 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1470 * MCC in the cmd response will be the relevant MCC in the NVM.
1471 * @mcc: given mobile country code
1472 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1473 * @reserved: reserved for alignment
1474 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001475struct iwl_mcc_update_cmd_v1 {
1476 __le16 mcc;
1477 u8 source_id;
1478 u8 reserved;
1479} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
1480
1481/**
1482 * struct iwl_mcc_update_cmd - Request the device to update geographic
1483 * regulatory profile according to the given MCC (Mobile Country Code).
1484 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1485 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1486 * MCC in the cmd response will be the relevant MCC in the NVM.
1487 * @mcc: given mobile country code
1488 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1489 * @reserved: reserved for alignment
1490 * @key: integrity key for MCC API OEM testing
1491 * @reserved2: reserved
1492 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001493struct iwl_mcc_update_cmd {
1494 __le16 mcc;
1495 u8 source_id;
1496 u8 reserved;
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001497 __le32 key;
1498 __le32 reserved2[5];
1499} __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001500
1501/**
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001502 * iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001503 * Contains the new channel control profile map, if changed, and the new MCC
1504 * (mobile country code).
1505 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02001506 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001507 * @mcc: the new applied MCC
1508 * @cap: capabilities for all channels which matches the MCC
1509 * @source_id: the MCC source, see iwl_mcc_source
1510 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1511 * channels, depending on platform)
1512 * @channels: channel control data map, DWORD for each channel. Only the first
1513 * 16bits are used.
1514 */
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001515struct iwl_mcc_update_resp_v1 {
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001516 __le32 status;
1517 __le16 mcc;
1518 u8 cap;
1519 u8 source_id;
1520 __le32 n_channels;
1521 __le32 channels[0];
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001522} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
1523
1524/**
1525 * iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
1526 * Contains the new channel control profile map, if changed, and the new MCC
1527 * (mobile country code).
1528 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
1529 * @status: see &enum iwl_mcc_update_status
1530 * @mcc: the new applied MCC
1531 * @cap: capabilities for all channels which matches the MCC
1532 * @source_id: the MCC source, see iwl_mcc_source
1533 * @time: time elapsed from the MCC test start (in 30 seconds TU)
1534 * @reserved: reserved.
1535 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1536 * channels, depending on platform)
1537 * @channels: channel control data map, DWORD for each channel. Only the first
1538 * 16bits are used.
1539 */
1540struct iwl_mcc_update_resp {
1541 __le32 status;
1542 __le16 mcc;
1543 u8 cap;
1544 u8 source_id;
1545 __le16 time;
1546 __le16 reserved;
1547 __le32 n_channels;
1548 __le32 channels[0];
1549} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001550
1551/**
1552 * struct iwl_mcc_chub_notif - chub notifies of mcc change
1553 * (MCC_CHUB_UPDATE_CMD = 0xc9)
1554 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
1555 * the cellular and connectivity cores that gets updates of the mcc, and
1556 * notifies the ucode directly of any mcc change.
1557 * The ucode requests the driver to request the device to update geographic
1558 * regulatory profile according to the given MCC (Mobile Country Code).
1559 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1560 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1561 * MCC in the cmd response will be the relevant MCC in the NVM.
1562 * @mcc: given mobile country code
1563 * @source_id: identity of the change originator, see iwl_mcc_source
1564 * @reserved1: reserved for alignment
1565 */
1566struct iwl_mcc_chub_notif {
1567 u16 mcc;
1568 u8 source_id;
1569 u8 reserved1;
1570} __packed; /* LAR_MCC_NOTIFY_S */
1571
1572enum iwl_mcc_update_status {
1573 MCC_RESP_NEW_CHAN_PROFILE,
1574 MCC_RESP_SAME_CHAN_PROFILE,
1575 MCC_RESP_INVALID,
1576 MCC_RESP_NVM_DISABLED,
1577 MCC_RESP_ILLEGAL,
1578 MCC_RESP_LOW_PRIORITY,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001579 MCC_RESP_TEST_MODE_ACTIVE,
1580 MCC_RESP_TEST_MODE_NOT_ACTIVE,
1581 MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001582};
1583
1584enum iwl_mcc_source {
1585 MCC_SOURCE_OLD_FW = 0,
1586 MCC_SOURCE_ME = 1,
1587 MCC_SOURCE_BIOS = 2,
1588 MCC_SOURCE_3G_LTE_HOST = 3,
1589 MCC_SOURCE_3G_LTE_DEVICE = 4,
1590 MCC_SOURCE_WIFI = 5,
1591 MCC_SOURCE_RESERVED = 6,
1592 MCC_SOURCE_DEFAULT = 7,
1593 MCC_SOURCE_UNINITIALIZED = 8,
Matti Gottlieb6fa52432016-01-04 13:38:41 +02001594 MCC_SOURCE_MCC_API = 9,
1595 MCC_SOURCE_GET_CURRENT = 0x10,
1596 MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001597};
1598
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001599/* DTS measurements */
1600
1601enum iwl_dts_measurement_flags {
1602 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
1603 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
1604};
1605
1606/**
1607 * iwl_dts_measurement_cmd - request DTS temperature and/or voltage measurements
1608 *
1609 * @flags: indicates which measurements we want as specified in &enum
1610 * iwl_dts_measurement_flags
1611 */
1612struct iwl_dts_measurement_cmd {
1613 __le32 flags;
1614} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
1615
1616/**
Arik Nemtsov78efc702015-10-06 12:22:47 +03001617* enum iwl_dts_control_measurement_mode - DTS measurement type
1618* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
1619* back (latest value. Not waiting for new value). Use automatic
1620* SW DTS configuration.
1621* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
1622* trigger DTS reading and provide read back temperature read
1623* when available.
1624* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
1625* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
1626* without measurement trigger.
1627*/
1628enum iwl_dts_control_measurement_mode {
1629 DTS_AUTOMATIC = 0,
1630 DTS_REQUEST_READ = 1,
1631 DTS_OVER_WRITE = 2,
1632 DTS_DIRECT_WITHOUT_MEASURE = 3,
1633};
1634
1635/**
1636* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
1637* @DTS_USE_TOP: Top
1638* @DTS_USE_CHAIN_A: chain A
1639* @DTS_USE_CHAIN_B: chain B
1640* @DTS_USE_CHAIN_C: chain C
1641* @XTAL_TEMPERATURE - read temperature from xtal
1642*/
1643enum iwl_dts_used {
1644 DTS_USE_TOP = 0,
1645 DTS_USE_CHAIN_A = 1,
1646 DTS_USE_CHAIN_B = 2,
1647 DTS_USE_CHAIN_C = 3,
1648 XTAL_TEMPERATURE = 4,
1649};
1650
1651/**
1652* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
1653* @DTS_BIT6_MODE: bit 6 mode
1654* @DTS_BIT8_MODE: bit 8 mode
1655*/
1656enum iwl_dts_bit_mode {
1657 DTS_BIT6_MODE = 0,
1658 DTS_BIT8_MODE = 1,
1659};
1660
1661/**
1662 * iwl_ext_dts_measurement_cmd - request extended DTS temperature measurements
1663 * @control_mode: see &enum iwl_dts_control_measurement_mode
1664 * @temperature: used when over write DTS mode is selected
1665 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
1666 * @avg_factor: average factor to DTS in request DTS read mode
1667 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
1668 * @step_duration: step duration for the DTS
1669 */
1670struct iwl_ext_dts_measurement_cmd {
1671 __le32 control_mode;
1672 __le32 temperature;
1673 __le32 sensor;
1674 __le32 avg_factor;
1675 __le32 bit_mode;
1676 __le32 step_duration;
1677} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
1678
1679/**
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02001680 * struct iwl_dts_measurement_notif_v1 - measurements notification
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001681 *
1682 * @temp: the measured temperature
1683 * @voltage: the measured voltage
1684 */
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02001685struct iwl_dts_measurement_notif_v1 {
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001686 __le32 temp;
1687 __le32 voltage;
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02001688} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
1689
1690/**
1691 * struct iwl_dts_measurement_notif_v2 - measurements notification
1692 *
1693 * @temp: the measured temperature
1694 * @voltage: the measured voltage
1695 * @threshold_idx: the trip index that was crossed
1696 */
1697struct iwl_dts_measurement_notif_v2 {
1698 __le32 temp;
1699 __le32 voltage;
1700 __le32 threshold_idx;
1701} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001702
Chaya Rachel Ivgi0a3b7112015-12-16 16:34:55 +02001703/**
1704 * struct ct_kill_notif - CT-kill entry notification
1705 *
1706 * @temperature: the current temperature in celsius
1707 * @reserved: reserved
1708 */
1709struct ct_kill_notif {
1710 __le16 temperature;
1711 __le16 reserved;
1712} __packed; /* GRP_PHY_CT_KILL_NTF */
1713
Chaya Rachel Ivgic221daf2015-12-29 09:54:49 +02001714#define IWL_MAX_DTS_TRIPS 8
1715
1716/**
1717 * struct iwl_temp_report_ths_cmd - set temperature thresholds
1718 *
1719 * @num_temps: number of temperature thresholds passed
1720 * @thresholds: array with the thresholds to be configured
1721 */
1722struct temp_report_ths_cmd {
1723 __le32 num_temps;
1724 __le16 thresholds[IWL_MAX_DTS_TRIPS];
1725} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
1726
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03001727/***********************************
1728 * TDLS API
1729 ***********************************/
1730
1731/* Type of TDLS request */
1732enum iwl_tdls_channel_switch_type {
1733 TDLS_SEND_CHAN_SW_REQ = 0,
1734 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
1735 TDLS_MOVE_CH,
1736}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
1737
1738/**
1739 * Switch timing sub-element in a TDLS channel-switch command
1740 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
1741 * received from peer
1742 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
1743 * to the TDLS off-channel communication. For instance if the DTIM is
1744 * 200TU and the TDLS peer is to be given 25% of the time, the value
1745 * given will be 50TU, or 50 * 1024 if translated into microseconds.
1746 * @switch_time: switch time the peer sent in its channel switch timing IE
1747 * @switch_timout: switch timeout the peer sent in its channel switch timing IE
1748 */
1749struct iwl_tdls_channel_switch_timing {
1750 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
1751 __le32 max_offchan_duration; /* given in micro-seconds */
1752 __le32 switch_time; /* given in micro-seconds */
1753 __le32 switch_timeout; /* given in micro-seconds */
1754} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
1755
1756#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
1757
1758/**
1759 * TDLS channel switch frame template
1760 *
1761 * A template representing a TDLS channel-switch request or response frame
1762 *
1763 * @switch_time_offset: offset to the channel switch timing IE in the template
1764 * @tx_cmd: Tx parameters for the frame
1765 * @data: frame data
1766 */
1767struct iwl_tdls_channel_switch_frame {
1768 __le32 switch_time_offset;
1769 struct iwl_tx_cmd tx_cmd;
1770 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
1771} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
1772
1773/**
1774 * TDLS channel switch command
1775 *
1776 * The command is sent to initiate a channel switch and also in response to
1777 * incoming TDLS channel-switch request/response packets from remote peers.
1778 *
1779 * @switch_type: see &enum iwl_tdls_channel_switch_type
1780 * @peer_sta_id: station id of TDLS peer
1781 * @ci: channel we switch to
1782 * @timing: timing related data for command
1783 * @frame: channel-switch request/response template, depending to switch_type
1784 */
1785struct iwl_tdls_channel_switch_cmd {
1786 u8 switch_type;
1787 __le32 peer_sta_id;
1788 struct iwl_fw_channel_info ci;
1789 struct iwl_tdls_channel_switch_timing timing;
1790 struct iwl_tdls_channel_switch_frame frame;
1791} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
1792
1793/**
1794 * TDLS channel switch start notification
1795 *
1796 * @status: non-zero on success
1797 * @offchannel_duration: duration given in microseconds
1798 * @sta_id: peer currently performing the channel-switch with
1799 */
1800struct iwl_tdls_channel_switch_notif {
1801 __le32 status;
1802 __le32 offchannel_duration;
1803 __le32 sta_id;
1804} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
1805
Arik Nemtsov307e4722014-09-15 18:48:59 +03001806/**
1807 * TDLS station info
1808 *
1809 * @sta_id: station id of the TDLS peer
1810 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
1811 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
1812 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
1813 */
1814struct iwl_tdls_sta_info {
1815 u8 sta_id;
1816 u8 tx_to_peer_tid;
1817 __le16 tx_to_peer_ssn;
1818 __le32 is_initiator;
1819} __packed; /* TDLS_STA_INFO_VER_1 */
1820
1821/**
1822 * TDLS basic config command
1823 *
1824 * @id_and_color: MAC id and color being configured
1825 * @tdls_peer_count: amount of currently connected TDLS peers
1826 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
1827 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
1828 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
1829 * @pti_req_data_offset: offset of network-level data for the PTI template
1830 * @pti_req_tx_cmd: Tx parameters for PTI request template
1831 * @pti_req_template: PTI request template data
1832 */
1833struct iwl_tdls_config_cmd {
1834 __le32 id_and_color; /* mac id and color */
1835 u8 tdls_peer_count;
1836 u8 tx_to_ap_tid;
1837 __le16 tx_to_ap_ssn;
1838 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
1839
1840 __le32 pti_req_data_offset;
1841 struct iwl_tx_cmd pti_req_tx_cmd;
1842 u8 pti_req_template[0];
1843} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
1844
1845/**
1846 * TDLS per-station config information from FW
1847 *
1848 * @sta_id: station id of the TDLS peer
1849 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
1850 * the peer
1851 */
1852struct iwl_tdls_config_sta_info_res {
1853 __le16 sta_id;
1854 __le16 tx_to_peer_last_seq;
1855} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
1856
1857/**
1858 * TDLS config information from FW
1859 *
1860 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
1861 * @sta_info: per-station TDLS config information
1862 */
1863struct iwl_tdls_config_res {
1864 __le32 tx_to_ap_last_seq;
1865 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
1866} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
1867
Liad Kaufman04fd2c22014-12-15 17:54:16 +02001868#define TX_FIFO_MAX_NUM 8
1869#define RX_FIFO_MAX_NUM 2
1870
1871/**
1872 * Shared memory configuration information from the FW
1873 *
1874 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
1875 * accessible)
1876 * @shared_mem_size: shared memory size
1877 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
1878 * 0x0 as accessible only via DBGM RDAT)
1879 * @sample_buff_size: internal sample buff size
1880 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
1881 * 8000 HW set to 0x0 as not accessible)
1882 * @txfifo_size: size of TXF0 ... TXF7
1883 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
1884 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
1885 * when paging is not supported this should be 0
1886 * @page_buff_size: size of %page_buff_addr
1887 */
1888struct iwl_shared_mem_cfg {
1889 __le32 shared_mem_addr;
1890 __le32 shared_mem_size;
1891 __le32 sample_buff_addr;
1892 __le32 sample_buff_size;
1893 __le32 txfifo_addr;
1894 __le32 txfifo_size[TX_FIFO_MAX_NUM];
1895 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
1896 __le32 page_buff_addr;
1897 __le32 page_buff_size;
1898} __packed; /* SHARED_MEM_ALLOC_API_S_VER_1 */
1899
Sara Sharon0db056d2015-12-29 11:07:15 +02001900#define MAX_STORED_BEACON_SIZE 600
1901
1902/**
1903 * Stored beacon notification
1904 *
1905 * @system_time: system time on air rise
1906 * @tsf: TSF on air rise
1907 * @beacon_timestamp: beacon on air rise
1908 * @phy_flags: general phy flags: band, modulation, etc.
1909 * @channel: channel this beacon was received on
1910 * @rates: rate in ucode internal format
1911 * @byte_count: frame's byte count
1912 */
1913struct iwl_stored_beacon_notif {
1914 __le32 system_time;
1915 __le64 tsf;
1916 __le32 beacon_timestamp;
1917 __le16 phy_flags;
1918 __le16 channel;
1919 __le32 rates;
1920 __le32 byte_count;
1921 u8 data[MAX_STORED_BEACON_SIZE];
1922} __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_1 */
1923
Johannes Berg8ca151b2013-01-24 14:25:36 +01001924#endif /* __fw_api_h__ */