blob: 5e4014a872228447d876e25c1bef5d0e248cb016 [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
Johannes Berg8ca151b2013-01-24 14:25:36 +010010 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
23 * USA
24 *
25 * The full GNU General Public License is included in this distribution
Emmanuel Grumbach410dc5a2013-02-18 09:22:28 +020026 * in the file called COPYING.
Johannes Berg8ca151b2013-01-24 14:25:36 +010027 *
28 * Contact Information:
29 * Intel Linux Wireless <ilw@linux.intel.com>
30 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
31 *
32 * BSD LICENSE
33 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +020034 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Avraham Sternee9219b2015-03-23 15:09:27 +020035 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010036 * All rights reserved.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 *
42 * * Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
44 * * Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in
46 * the documentation and/or other materials provided with the
47 * distribution.
48 * * Neither the name Intel Corporation nor the names of its
49 * contributors may be used to endorse or promote products derived
50 * from this software without specific prior written permission.
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
53 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
54 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
55 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
56 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
58 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 *
64 *****************************************************************************/
65
66#ifndef __fw_api_h__
67#define __fw_api_h__
68
69#include "fw-api-rs.h"
Johannes Bergee6dbb22015-09-02 14:53:39 +020070#include "fw-api-rx.h"
Johannes Berg8ca151b2013-01-24 14:25:36 +010071#include "fw-api-tx.h"
72#include "fw-api-sta.h"
73#include "fw-api-mac.h"
74#include "fw-api-power.h"
75#include "fw-api-d3.h"
Emmanuel Grumbach5b7ff612014-03-11 19:27:45 +020076#include "fw-api-coex.h"
Haim Dreyfusse820c2d2014-04-06 11:19:09 +030077#include "fw-api-scan.h"
Johannes Bergd19ac582015-01-14 15:54:18 +010078#include "fw-api-stats.h"
Gregory Greenmance792912015-06-02 18:06:16 +030079#include "fw-api-tof.h"
Johannes Berg8ca151b2013-01-24 14:25:36 +010080
Eytan Lifshitz19e737c2013-09-09 13:30:15 +020081/* Tx queue numbers */
Johannes Berg8ca151b2013-01-24 14:25:36 +010082enum {
83 IWL_MVM_OFFCHANNEL_QUEUE = 8,
84 IWL_MVM_CMD_QUEUE = 9,
Johannes Berg8ca151b2013-01-24 14:25:36 +010085};
86
Johannes Bergb2d81db2014-08-01 20:48:25 +020087enum iwl_mvm_tx_fifo {
88 IWL_MVM_TX_FIFO_BK = 0,
89 IWL_MVM_TX_FIFO_BE,
90 IWL_MVM_TX_FIFO_VI,
91 IWL_MVM_TX_FIFO_VO,
92 IWL_MVM_TX_FIFO_MCAST = 5,
93 IWL_MVM_TX_FIFO_CMD = 7,
94};
Eytan Lifshitz19e737c2013-09-09 13:30:15 +020095
Johannes Berg8ca151b2013-01-24 14:25:36 +010096#define IWL_MVM_STATION_COUNT 16
97
Arik Nemtsovcf7b4912014-05-15 11:44:40 +030098#define IWL_MVM_TDLS_STA_COUNT 4
99
Johannes Berg8ca151b2013-01-24 14:25:36 +0100100/* commands */
101enum {
102 MVM_ALIVE = 0x1,
103 REPLY_ERROR = 0x2,
Emmanuel Grumbache5046012015-08-17 10:45:50 +0300104 ECHO_CMD = 0x3,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100105
106 INIT_COMPLETE_NOTIF = 0x4,
107
108 /* PHY context commands */
109 PHY_CONTEXT_CMD = 0x8,
110 DBG_CFG = 0x9,
Emmanuel Grumbachb9fae2d2014-02-17 11:24:10 +0200111 ANTENNA_COUPLING_NOTIFICATION = 0xa,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100112
David Spinadeld2496222014-05-20 12:46:37 +0300113 /* UMAC scan commands */
Avraham Sternee9219b2015-03-23 15:09:27 +0200114 SCAN_ITERATION_COMPLETE_UMAC = 0xb5,
David Spinadeld2496222014-05-20 12:46:37 +0300115 SCAN_CFG_CMD = 0xc,
116 SCAN_REQ_UMAC = 0xd,
117 SCAN_ABORT_UMAC = 0xe,
118 SCAN_COMPLETE_UMAC = 0xf,
119
Johannes Berg8ca151b2013-01-24 14:25:36 +0100120 /* station table */
Max Stepanov5a258aa2013-04-07 09:11:21 +0300121 ADD_STA_KEY = 0x17,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100122 ADD_STA = 0x18,
123 REMOVE_STA = 0x19,
124
Matti Gottliebe1120182015-07-19 11:15:07 +0300125 /* paging get item */
126 FW_GET_ITEM_CMD = 0x1a,
127
Johannes Berg8ca151b2013-01-24 14:25:36 +0100128 /* TX */
129 TX_CMD = 0x1c,
130 TXPATH_FLUSH = 0x1e,
131 MGMT_MCAST_KEY = 0x1f,
132
Avri Altman3edf8ff2014-07-30 11:41:01 +0300133 /* scheduler config */
134 SCD_QUEUE_CFG = 0x1d,
135
Johannes Berg8ca151b2013-01-24 14:25:36 +0100136 /* global key */
137 WEP_KEY = 0x20,
138
Liad Kaufman04fd2c22014-12-15 17:54:16 +0200139 /* Memory */
140 SHARED_MEM_CFG = 0x25,
141
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300142 /* TDLS */
143 TDLS_CHANNEL_SWITCH_CMD = 0x27,
144 TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
Arik Nemtsov307e4722014-09-15 18:48:59 +0300145 TDLS_CONFIG_CMD = 0xa7,
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +0300146
Johannes Berg8ca151b2013-01-24 14:25:36 +0100147 /* MAC and Binding commands */
148 MAC_CONTEXT_CMD = 0x28,
149 TIME_EVENT_CMD = 0x29, /* both CMD and response */
150 TIME_EVENT_NOTIFICATION = 0x2a,
151 BINDING_CONTEXT_CMD = 0x2b,
152 TIME_QUOTA_CMD = 0x2c,
Johannes Berg4ac6cb52013-08-08 09:30:13 +0200153 NON_QOS_TX_COUNTER_CMD = 0x2d,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100154
155 LQ_CMD = 0x4e,
156
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300157 /* paging block to FW cpu2 */
158 FW_PAGING_BLOCK_CMD = 0x4f,
159
Johannes Berg8ca151b2013-01-24 14:25:36 +0100160 /* Scan offload */
161 SCAN_OFFLOAD_REQUEST_CMD = 0x51,
162 SCAN_OFFLOAD_ABORT_CMD = 0x52,
Ariej Marjieh720befbf2014-07-07 09:04:58 +0300163 HOT_SPOT_CMD = 0x53,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100164 SCAN_OFFLOAD_COMPLETE = 0x6D,
165 SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
166 SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
David Spinadel35a000b2013-08-28 09:29:43 +0300167 MATCH_FOUND_NOTIFICATION = 0xd9,
David Spinadelfb98be52014-05-04 12:51:10 +0300168 SCAN_ITERATION_COMPLETE = 0xe7,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100169
170 /* Phy */
171 PHY_CONFIGURATION_CMD = 0x6a,
172 CALIB_RES_NOTIF_PHY_DB = 0x6b,
173 /* PHY_DB_CMD = 0x6c, */
174
Gregory Greenmance792912015-06-02 18:06:16 +0300175 /* ToF - 802.11mc FTM */
176 TOF_CMD = 0x10,
177 TOF_NOTIFICATION = 0x11,
178
Alexander Bondare811ada2013-03-10 15:29:44 +0200179 /* Power - legacy power table command */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100180 POWER_TABLE_CMD = 0x77,
Alexander Bondar175a70b2013-04-14 20:59:37 +0300181 PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
Emmanuel Grumbach9180ac52014-09-23 23:02:41 +0300182 LTR_CONFIG = 0xee,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100183
Eytan Lifshitz9ee718a2013-05-19 19:14:41 +0300184 /* Thermal Throttling*/
185 REPLY_THERMAL_MNG_BACKOFF = 0x7e,
186
Matti Gottlieb0becb372015-05-31 09:18:30 +0300187 /* Set/Get DC2DC frequency tune */
188 DC2DC_CONFIG_CMD = 0x83,
189
Johannes Berg8ca151b2013-01-24 14:25:36 +0100190 /* NVM */
191 NVM_ACCESS_CMD = 0x88,
192
193 SET_CALIB_DEFAULT_CMD = 0x8e,
194
Ilan Peer571765c2013-03-05 15:26:03 +0200195 BEACON_NOTIFICATION = 0x90,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100196 BEACON_TEMPLATE_CMD = 0x91,
197 TX_ANT_CONFIGURATION_CMD = 0x98,
Johannes Berg91a8bcd2015-01-14 18:12:41 +0100198 STATISTICS_CMD = 0x9c,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100199 STATISTICS_NOTIFICATION = 0x9d,
Johannes Berg3e56ead2013-02-15 22:23:18 +0100200 EOSP_NOTIFICATION = 0x9e,
Matti Gottlieb88f2fd72013-07-09 15:25:46 +0300201 REDUCE_TX_POWER_CMD = 0x9f,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100202
203 /* RF-KILL commands and notifications */
204 CARD_STATE_CMD = 0xa0,
205 CARD_STATE_NOTIFICATION = 0xa1,
206
Hila Gonend64048e2013-03-13 18:00:03 +0200207 MISSED_BEACONS_NOTIFICATION = 0xa2,
208
Alexander Bondare811ada2013-03-10 15:29:44 +0200209 /* Power - new power table command */
210 MAC_PM_POWER_TABLE = 0xa9,
211
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +0200212 MFUART_LOAD_NOTIFICATION = 0xb1,
213
Johannes Berg8ca151b2013-01-24 14:25:36 +0100214 REPLY_RX_PHY_CMD = 0xc0,
215 REPLY_RX_MPDU_CMD = 0xc1,
216 BA_NOTIF = 0xc5,
217
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200218 /* Location Aware Regulatory */
219 MCC_UPDATE_CMD = 0xc8,
Arik Nemtsov88931cc2014-03-05 12:26:15 +0200220 MCC_CHUB_UPDATE_CMD = 0xc9,
Arik Nemtsovdcaf9f52014-03-04 19:54:12 +0200221
Matti Gottlieba2d79c52014-08-25 14:41:23 +0300222 MARKER_CMD = 0xcb,
223
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200224 /* BT Coex */
225 BT_COEX_PRIO_TABLE = 0xcc,
226 BT_COEX_PROT_ENV = 0xcd,
227 BT_PROFILE_NOTIFICATION = 0xce,
Emmanuel Grumbach430a3bb2014-04-02 09:55:16 +0300228 BT_CONFIG = 0x9b,
229 BT_COEX_UPDATE_SW_BOOST = 0x5a,
230 BT_COEX_UPDATE_CORUN_LUT = 0x5b,
231 BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
Emmanuel Grumbachdac94da2013-06-18 07:35:27 +0300232 BT_COEX_CI = 0x5d,
Emmanuel Grumbachfb3ceb82013-01-14 15:04:01 +0200233
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +0200234 REPLY_SF_CFG_CMD = 0xd1,
Hila Gonen7df15b12012-12-12 11:16:19 +0200235 REPLY_BEACON_FILTERING_CMD = 0xd2,
236
Luciano Coelhoa0a09242014-09-04 12:29:15 +0300237 /* DTS measurements */
238 CMD_DTS_MEASUREMENT_TRIGGER = 0xdc,
239 DTS_MEASUREMENT_NOTIFICATION = 0xdd,
240
Johannes Berg8ca151b2013-01-24 14:25:36 +0100241 REPLY_DEBUG_CMD = 0xf0,
242 DEBUG_LOG_MSG = 0xf7,
243
Eliad Pellerc87163b2014-01-08 10:11:11 +0200244 BCAST_FILTER_CMD = 0xcf,
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +0300245 MCAST_FILTER_CMD = 0xd0,
246
Johannes Berg8ca151b2013-01-24 14:25:36 +0100247 /* D3 commands/notifications */
248 D3_CONFIG_CMD = 0xd3,
249 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
250 OFFLOADS_QUERY_CMD = 0xd5,
251 REMOTE_WAKE_CONFIG_CMD = 0xd6,
Arik Nemtsov98ee7782013-10-02 16:58:09 +0300252 D0I3_END_CMD = 0xed,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100253
254 /* for WoWLAN in particular */
255 WOWLAN_PATTERNS = 0xe0,
256 WOWLAN_CONFIGURATION = 0xe1,
257 WOWLAN_TSC_RSC_PARAM = 0xe2,
258 WOWLAN_TKIP_PARAM = 0xe3,
259 WOWLAN_KEK_KCK_MATERIAL = 0xe4,
260 WOWLAN_GET_STATUSES = 0xe5,
261 WOWLAN_TX_POWER_PER_DB = 0xe6,
262
263 /* and for NetDetect */
Luciano Coelhob04998f2014-11-20 15:58:34 +0200264 SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
265 SCAN_OFFLOAD_HOTSPOTS_CONFIG_CMD = 0x58,
266 SCAN_OFFLOAD_HOTSPOTS_QUERY_CMD = 0x59,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100267
268 REPLY_MAX = 0xff,
269};
270
271/**
272 * struct iwl_cmd_response - generic response struct for most commands
273 * @status: status of the command asked, changes for each one
274 */
275struct iwl_cmd_response {
276 __le32 status;
277};
278
279/*
280 * struct iwl_tx_ant_cfg_cmd
281 * @valid: valid antenna configuration
282 */
283struct iwl_tx_ant_cfg_cmd {
284 __le32 valid;
285} __packed;
286
287/*
288 * Calibration control struct.
289 * Sent as part of the phy configuration command.
290 * @flow_trigger: bitmap for which calibrations to perform according to
291 * flow triggers.
292 * @event_trigger: bitmap for which calibrations to perform according to
293 * event triggers.
294 */
295struct iwl_calib_ctrl {
296 __le32 flow_trigger;
297 __le32 event_trigger;
298} __packed;
299
300/* This enum defines the bitmap of various calibrations to enable in both
301 * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
302 */
303enum iwl_calib_cfg {
304 IWL_CALIB_CFG_XTAL_IDX = BIT(0),
305 IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
306 IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
307 IWL_CALIB_CFG_PAPD_IDX = BIT(3),
308 IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
309 IWL_CALIB_CFG_DC_IDX = BIT(5),
310 IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
311 IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
312 IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
313 IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
314 IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
315 IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
316 IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
317 IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
318 IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
319 IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
320 IWL_CALIB_CFG_DAC_IDX = BIT(16),
321 IWL_CALIB_CFG_ABS_IDX = BIT(17),
322 IWL_CALIB_CFG_AGC_IDX = BIT(18),
323};
324
325/*
326 * Phy configuration command.
327 */
328struct iwl_phy_cfg_cmd {
329 __le32 phy_cfg;
330 struct iwl_calib_ctrl calib_control;
331} __packed;
332
333#define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
334#define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
335#define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
336#define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
337#define PHY_CFG_TX_CHAIN_A BIT(8)
338#define PHY_CFG_TX_CHAIN_B BIT(9)
339#define PHY_CFG_TX_CHAIN_C BIT(10)
340#define PHY_CFG_RX_CHAIN_A BIT(12)
341#define PHY_CFG_RX_CHAIN_B BIT(13)
342#define PHY_CFG_RX_CHAIN_C BIT(14)
343
344
345/* Target of the NVM_ACCESS_CMD */
346enum {
347 NVM_ACCESS_TARGET_CACHE = 0,
348 NVM_ACCESS_TARGET_OTP = 1,
349 NVM_ACCESS_TARGET_EEPROM = 2,
350};
351
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200352/* Section types for NVM_ACCESS_CMD */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100353enum {
Eran Hararyae2b21b2014-01-09 08:08:24 +0200354 NVM_SECTION_TYPE_SW = 1,
Eran Harary77db0a32014-02-04 14:21:38 +0200355 NVM_SECTION_TYPE_REGULATORY = 3,
Eran Hararyae2b21b2014-01-09 08:08:24 +0200356 NVM_SECTION_TYPE_CALIBRATION = 4,
357 NVM_SECTION_TYPE_PRODUCTION = 5,
Eran Harary77db0a32014-02-04 14:21:38 +0200358 NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
Eran Hararyce500072014-12-01 17:53:53 +0200359 NVM_SECTION_TYPE_PHY_SKU = 12,
360 NVM_MAX_NUM_SECTIONS = 13,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100361};
362
363/**
364 * struct iwl_nvm_access_cmd_ver2 - Request the device to send an NVM section
365 * @op_code: 0 - read, 1 - write
366 * @target: NVM_ACCESS_TARGET_*
367 * @type: NVM_SECTION_TYPE_*
368 * @offset: offset in bytes into the section
369 * @length: in bytes, to read/write
370 * @data: if write operation, the data to write. On read its empty
371 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200372struct iwl_nvm_access_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100373 u8 op_code;
374 u8 target;
375 __le16 type;
376 __le16 offset;
377 __le16 length;
378 u8 data[];
379} __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
380
Matti Gottlieba6c4fb42015-07-15 16:19:29 +0300381#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
382
383/*
384 * struct iwl_fw_paging_cmd - paging layout
385 *
386 * (FW_PAGING_BLOCK_CMD = 0x4f)
387 *
388 * Send to FW the paging layout in the driver.
389 *
390 * @flags: various flags for the command
391 * @block_size: the block size in powers of 2
392 * @block_num: number of blocks specified in the command.
393 * @device_phy_addr: virtual addresses from device side
394*/
395struct iwl_fw_paging_cmd {
396 __le32 flags;
397 __le32 block_size;
398 __le32 block_num;
399 __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
400} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
401
Matti Gottliebe1120182015-07-19 11:15:07 +0300402/*
403 * Fw items ID's
404 *
405 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
406 * download
407 */
408enum iwl_fw_item_id {
409 IWL_FW_ITEM_ID_PAGING = 3,
410};
411
412/*
413 * struct iwl_fw_get_item_cmd - get an item from the fw
414 */
415struct iwl_fw_get_item_cmd {
416 __le32 item_id;
417} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
418
419struct iwl_fw_get_item_resp {
420 __le32 item_id;
421 __le32 item_byte_cnt;
422 __le32 item_val;
423} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
424
Johannes Berg8ca151b2013-01-24 14:25:36 +0100425/**
426 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
427 * @offset: offset in bytes into the section
428 * @length: in bytes, either how much was written or read
429 * @type: NVM_SECTION_TYPE_*
430 * @status: 0 for success, fail otherwise
431 * @data: if read operation, the data returned. Empty on write.
432 */
Emmanuel Grumbachb9545b42013-03-06 11:34:44 +0200433struct iwl_nvm_access_resp {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100434 __le16 offset;
435 __le16 length;
436 __le16 type;
437 __le16 status;
438 u8 data[];
439} __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
440
441/* MVM_ALIVE 0x1 */
442
443/* alive response is_valid values */
444#define ALIVE_RESP_UCODE_OK BIT(0)
445#define ALIVE_RESP_RFKILL BIT(1)
446
447/* alive response ver_type values */
448enum {
449 FW_TYPE_HW = 0,
450 FW_TYPE_PROT = 1,
451 FW_TYPE_AP = 2,
452 FW_TYPE_WOWLAN = 3,
453 FW_TYPE_TIMING = 4,
454 FW_TYPE_WIPAN = 5
455};
456
457/* alive response ver_subtype values */
458enum {
459 FW_SUBTYPE_FULL_FEATURE = 0,
460 FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
461 FW_SUBTYPE_REDUCED = 2,
462 FW_SUBTYPE_ALIVE_ONLY = 3,
463 FW_SUBTYPE_WOWLAN = 4,
464 FW_SUBTYPE_AP_SUBTYPE = 5,
465 FW_SUBTYPE_WIPAN = 6,
466 FW_SUBTYPE_INITIALIZE = 9
467};
468
469#define IWL_ALIVE_STATUS_ERR 0xDEAD
470#define IWL_ALIVE_STATUS_OK 0xCAFE
471
472#define IWL_ALIVE_FLG_RFKILL BIT(0)
473
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200474struct mvm_alive_resp_ver1 {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100475 __le16 status;
476 __le16 flags;
477 u8 ucode_minor;
478 u8 ucode_major;
479 __le16 id;
480 u8 api_minor;
481 u8 api_major;
482 u8 ver_subtype;
483 u8 ver_type;
484 u8 mac;
485 u8 opt;
486 __le16 reserved2;
487 __le32 timestamp;
488 __le32 error_event_table_ptr; /* SRAM address for error log */
489 __le32 log_event_table_ptr; /* SRAM address for event log */
490 __le32 cpu_register_ptr;
491 __le32 dbgm_config_ptr;
492 __le32 alive_counter_ptr;
493 __le32 scd_base_ptr; /* SRAM address for SCD */
494} __packed; /* ALIVE_RES_API_S_VER_1 */
495
Eran Harary01a9ca52014-02-03 09:29:57 +0200496struct mvm_alive_resp_ver2 {
497 __le16 status;
498 __le16 flags;
499 u8 ucode_minor;
500 u8 ucode_major;
501 __le16 id;
502 u8 api_minor;
503 u8 api_major;
504 u8 ver_subtype;
505 u8 ver_type;
506 u8 mac;
507 u8 opt;
508 __le16 reserved2;
509 __le32 timestamp;
510 __le32 error_event_table_ptr; /* SRAM address for error log */
511 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
512 __le32 cpu_register_ptr;
513 __le32 dbgm_config_ptr;
514 __le32 alive_counter_ptr;
515 __le32 scd_base_ptr; /* SRAM address for SCD */
516 __le32 st_fwrd_addr; /* pointer to Store and forward */
517 __le32 st_fwrd_size;
518 u8 umac_minor; /* UMAC version: minor */
519 u8 umac_major; /* UMAC version: major */
520 __le16 umac_id; /* UMAC version: id */
521 __le32 error_info_addr; /* SRAM address for UMAC error log */
522 __le32 dbg_print_buff_addr;
523} __packed; /* ALIVE_RES_API_S_VER_2 */
524
Emmanuel Grumbach7e1223b2015-02-03 20:11:48 +0200525struct mvm_alive_resp {
526 __le16 status;
527 __le16 flags;
528 __le32 ucode_minor;
529 __le32 ucode_major;
530 u8 ver_subtype;
531 u8 ver_type;
532 u8 mac;
533 u8 opt;
534 __le32 timestamp;
535 __le32 error_event_table_ptr; /* SRAM address for error log */
536 __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
537 __le32 cpu_register_ptr;
538 __le32 dbgm_config_ptr;
539 __le32 alive_counter_ptr;
540 __le32 scd_base_ptr; /* SRAM address for SCD */
541 __le32 st_fwrd_addr; /* pointer to Store and forward */
542 __le32 st_fwrd_size;
543 __le32 umac_minor; /* UMAC version: minor */
544 __le32 umac_major; /* UMAC version: major */
545 __le32 error_info_addr; /* SRAM address for UMAC error log */
546 __le32 dbg_print_buff_addr;
547} __packed; /* ALIVE_RES_API_S_VER_3 */
548
Johannes Berg8ca151b2013-01-24 14:25:36 +0100549/* Error response/notification */
550enum {
551 FW_ERR_UNKNOWN_CMD = 0x0,
552 FW_ERR_INVALID_CMD_PARAM = 0x1,
553 FW_ERR_SERVICE = 0x2,
554 FW_ERR_ARC_MEMORY = 0x3,
555 FW_ERR_ARC_CODE = 0x4,
556 FW_ERR_WATCH_DOG = 0x5,
557 FW_ERR_WEP_GRP_KEY_INDX = 0x10,
558 FW_ERR_WEP_KEY_SIZE = 0x11,
559 FW_ERR_OBSOLETE_FUNC = 0x12,
560 FW_ERR_UNEXPECTED = 0xFE,
561 FW_ERR_FATAL = 0xFF
562};
563
564/**
565 * struct iwl_error_resp - FW error indication
566 * ( REPLY_ERROR = 0x2 )
567 * @error_type: one of FW_ERR_*
568 * @cmd_id: the command ID for which the error occured
569 * @bad_cmd_seq_num: sequence number of the erroneous command
570 * @error_service: which service created the error, applicable only if
571 * error_type = 2, otherwise 0
572 * @timestamp: TSF in usecs.
573 */
574struct iwl_error_resp {
575 __le32 error_type;
576 u8 cmd_id;
577 u8 reserved1;
578 __le16 bad_cmd_seq_num;
579 __le32 error_service;
580 __le64 timestamp;
581} __packed;
582
583
584/* Common PHY, MAC and Bindings definitions */
585
586#define MAX_MACS_IN_BINDING (3)
587#define MAX_BINDINGS (4)
588#define AUX_BINDING_INDEX (3)
589#define MAX_PHYS (4)
590
591/* Used to extract ID and color from the context dword */
592#define FW_CTXT_ID_POS (0)
593#define FW_CTXT_ID_MSK (0xff << FW_CTXT_ID_POS)
594#define FW_CTXT_COLOR_POS (8)
595#define FW_CTXT_COLOR_MSK (0xff << FW_CTXT_COLOR_POS)
596#define FW_CTXT_INVALID (0xffffffff)
597
598#define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
599 (_color << FW_CTXT_COLOR_POS))
600
601/* Possible actions on PHYs, MACs and Bindings */
602enum {
603 FW_CTXT_ACTION_STUB = 0,
604 FW_CTXT_ACTION_ADD,
605 FW_CTXT_ACTION_MODIFY,
606 FW_CTXT_ACTION_REMOVE,
607 FW_CTXT_ACTION_NUM
608}; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
609
610/* Time Events */
611
612/* Time Event types, according to MAC type */
613enum iwl_time_event_type {
614 /* BSS Station Events */
615 TE_BSS_STA_AGGRESSIVE_ASSOC,
616 TE_BSS_STA_ASSOC,
617 TE_BSS_EAP_DHCP_PROT,
618 TE_BSS_QUIET_PERIOD,
619
620 /* P2P Device Events */
621 TE_P2P_DEVICE_DISCOVERABLE,
622 TE_P2P_DEVICE_LISTEN,
623 TE_P2P_DEVICE_ACTION_SCAN,
624 TE_P2P_DEVICE_FULL_SCAN,
625
626 /* P2P Client Events */
627 TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
628 TE_P2P_CLIENT_ASSOC,
629 TE_P2P_CLIENT_QUIET_PERIOD,
630
631 /* P2P GO Events */
632 TE_P2P_GO_ASSOC_PROT,
633 TE_P2P_GO_REPETITIVE_NOA,
634 TE_P2P_GO_CT_WINDOW,
635
636 /* WiDi Sync Events */
637 TE_WIDI_TX_SYNC,
638
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +0300639 /* Channel Switch NoA */
Luciano Coelhof991e172014-08-26 16:14:10 +0300640 TE_CHANNEL_SWITCH_PERIOD,
Andrei Otcheretianski7f0a7c62014-05-04 11:48:12 +0300641
Johannes Berg8ca151b2013-01-24 14:25:36 +0100642 TE_MAX
643}; /* MAC_EVENT_TYPE_API_E_VER_1 */
644
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300645
646
647/* Time event - defines for command API v1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100648
649/*
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300650 * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
651 * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
652 * the first fragment is scheduled.
653 * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
654 * the first 2 fragments are scheduled.
655 * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
656 * number of fragments are valid.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100657 *
658 * Other than the constant defined above, specifying a fragmentation value 'x'
659 * means that the event can be fragmented but only the first 'x' will be
660 * scheduled.
661 */
662enum {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300663 TE_V1_FRAG_NONE = 0,
664 TE_V1_FRAG_SINGLE = 1,
665 TE_V1_FRAG_DUAL = 2,
666 TE_V1_FRAG_ENDLESS = 0xffffffff
Johannes Berg8ca151b2013-01-24 14:25:36 +0100667};
668
Johannes Berg8ca151b2013-01-24 14:25:36 +0100669/* If a Time Event can be fragmented, this is the max number of fragments */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300670#define TE_V1_FRAG_MAX_MSK 0x0fffffff
671/* Repeat the time event endlessly (until removed) */
672#define TE_V1_REPEAT_ENDLESS 0xffffffff
673/* If a Time Event has bounded repetitions, this is the maximal value */
674#define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
675
676/* Time Event dependencies: none, on another TE, or in a specific time */
677enum {
678 TE_V1_INDEPENDENT = 0,
679 TE_V1_DEP_OTHER = BIT(0),
680 TE_V1_DEP_TSF = BIT(1),
681 TE_V1_EVENT_SOCIOPATHIC = BIT(2),
682}; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
683
684/*
685 * @TE_V1_NOTIF_NONE: no notifications
686 * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
687 * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
688 * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
689 * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
690 * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
691 * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
692 * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
693 * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
694 *
695 * Supported Time event notifications configuration.
696 * A notification (both event and fragment) includes a status indicating weather
697 * the FW was able to schedule the event or not. For fragment start/end
698 * notification the status is always success. There is no start/end fragment
699 * notification for monolithic events.
700 */
701enum {
702 TE_V1_NOTIF_NONE = 0,
703 TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
704 TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
705 TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
706 TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
707 TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
708 TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
709 TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
710 TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
711}; /* MAC_EVENT_ACTION_API_E_VER_2 */
712
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300713/* Time event - defines for command API */
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300714
715/*
716 * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
717 * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
718 * the first fragment is scheduled.
719 * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
720 * the first 2 fragments are scheduled.
721 * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
722 * number of fragments are valid.
723 *
724 * Other than the constant defined above, specifying a fragmentation value 'x'
725 * means that the event can be fragmented but only the first 'x' will be
726 * scheduled.
727 */
728enum {
729 TE_V2_FRAG_NONE = 0,
730 TE_V2_FRAG_SINGLE = 1,
731 TE_V2_FRAG_DUAL = 2,
732 TE_V2_FRAG_MAX = 0xfe,
733 TE_V2_FRAG_ENDLESS = 0xff
734};
735
736/* Repeat the time event endlessly (until removed) */
737#define TE_V2_REPEAT_ENDLESS 0xff
738/* If a Time Event has bounded repetitions, this is the maximal value */
739#define TE_V2_REPEAT_MAX 0xfe
740
741#define TE_V2_PLACEMENT_POS 12
742#define TE_V2_ABSENCE_POS 15
743
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300744/* Time event policy values
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300745 * A notification (both event and fragment) includes a status indicating weather
746 * the FW was able to schedule the event or not. For fragment start/end
747 * notification the status is always success. There is no start/end fragment
748 * notification for monolithic events.
749 *
750 * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
751 * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
752 * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
753 * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
754 * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
755 * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
756 * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
757 * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
758 * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
759 * @TE_V2_DEP_OTHER: depends on another time event
760 * @TE_V2_DEP_TSF: depends on a specific time
761 * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
762 * @TE_V2_ABSENCE: are we present or absent during the Time Event.
763 */
764enum {
765 TE_V2_DEFAULT_POLICY = 0x0,
766
767 /* notifications (event start/stop, fragment start/stop) */
768 TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
769 TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
770 TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
771 TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
772
773 TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
774 TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
775 TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
776 TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
Emmanuel Grumbach1f6bf072014-02-16 15:36:00 +0200777 T2_V2_START_IMMEDIATELY = BIT(11),
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300778
779 TE_V2_NOTIF_MSK = 0xff,
780
781 /* placement characteristics */
782 TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
783 TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
784 TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
785
786 /* are we present or absent during the Time Event. */
787 TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
788};
789
790/**
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300791 * struct iwl_time_event_cmd_api - configuring Time Events
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300792 * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
793 * with version 1. determined by IWL_UCODE_TLV_FLAGS)
794 * ( TIME_EVENT_CMD = 0x29 )
795 * @id_and_color: ID and color of the relevant MAC
796 * @action: action to perform, one of FW_CTXT_ACTION_*
797 * @id: this field has two meanings, depending on the action:
798 * If the action is ADD, then it means the type of event to add.
799 * For all other actions it is the unique event ID assigned when the
800 * event was added by the FW.
801 * @apply_time: When to start the Time Event (in GP2)
802 * @max_delay: maximum delay to event's start (apply time), in TU
803 * @depends_on: the unique ID of the event we depend on (if any)
804 * @interval: interval between repetitions, in TU
805 * @duration: duration of event in TU
806 * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
807 * @max_frags: maximal number of fragments the Time Event can be divided to
808 * @policy: defines whether uCode shall notify the host or other uCode modules
809 * on event and/or fragment start and/or end
810 * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
811 * TE_EVENT_SOCIOPATHIC
812 * using TE_ABSENCE and using TE_NOTIF_*
813 */
Emmanuel Grumbacha373f672014-03-30 08:40:46 +0300814struct iwl_time_event_cmd {
Eytan Lifshitzf8f03c32013-08-07 19:36:42 +0300815 /* COMMON_INDEX_HDR_API_S_VER_1 */
816 __le32 id_and_color;
817 __le32 action;
818 __le32 id;
819 /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
820 __le32 apply_time;
821 __le32 max_delay;
822 __le32 depends_on;
823 __le32 interval;
824 __le32 duration;
825 u8 repeat;
826 u8 max_frags;
827 __le16 policy;
828} __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
829
Johannes Berg8ca151b2013-01-24 14:25:36 +0100830/**
831 * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
832 * @status: bit 0 indicates success, all others specify errors
833 * @id: the Time Event type
834 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
835 * @id_and_color: ID and color of the relevant MAC
836 */
837struct iwl_time_event_resp {
838 __le32 status;
839 __le32 id;
840 __le32 unique_id;
841 __le32 id_and_color;
842} __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
843
844/**
845 * struct iwl_time_event_notif - notifications of time event start/stop
846 * ( TIME_EVENT_NOTIFICATION = 0x2a )
847 * @timestamp: action timestamp in GP2
848 * @session_id: session's unique id
849 * @unique_id: unique id of the Time Event itself
850 * @id_and_color: ID and color of the relevant MAC
851 * @action: one of TE_NOTIF_START or TE_NOTIF_END
852 * @status: true if scheduled, false otherwise (not executed)
853 */
854struct iwl_time_event_notif {
855 __le32 timestamp;
856 __le32 session_id;
857 __le32 unique_id;
858 __le32 id_and_color;
859 __le32 action;
860 __le32 status;
861} __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
862
863
864/* Bindings and Time Quota */
865
866/**
867 * struct iwl_binding_cmd - configuring bindings
868 * ( BINDING_CONTEXT_CMD = 0x2b )
869 * @id_and_color: ID and color of the relevant Binding
870 * @action: action to perform, one of FW_CTXT_ACTION_*
871 * @macs: array of MAC id and colors which belong to the binding
872 * @phy: PHY id and color which belongs to the binding
873 */
874struct iwl_binding_cmd {
875 /* COMMON_INDEX_HDR_API_S_VER_1 */
876 __le32 id_and_color;
877 __le32 action;
878 /* BINDING_DATA_API_S_VER_1 */
879 __le32 macs[MAX_MACS_IN_BINDING];
880 __le32 phy;
881} __packed; /* BINDING_CMD_API_S_VER_1 */
882
Ilan Peer35adfd62013-02-04 13:16:24 +0200883/* The maximal number of fragments in the FW's schedule session */
884#define IWL_MVM_MAX_QUOTA 128
885
Johannes Berg8ca151b2013-01-24 14:25:36 +0100886/**
887 * struct iwl_time_quota_data - configuration of time quota per binding
888 * @id_and_color: ID and color of the relevant Binding
889 * @quota: absolute time quota in TU. The scheduler will try to divide the
890 * remainig quota (after Time Events) according to this quota.
891 * @max_duration: max uninterrupted context duration in TU
892 */
893struct iwl_time_quota_data {
894 __le32 id_and_color;
895 __le32 quota;
896 __le32 max_duration;
897} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
898
899/**
900 * struct iwl_time_quota_cmd - configuration of time quota between bindings
901 * ( TIME_QUOTA_CMD = 0x2c )
902 * @quotas: allocations per binding
903 */
904struct iwl_time_quota_cmd {
905 struct iwl_time_quota_data quotas[MAX_BINDINGS];
906} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
907
908
909/* PHY context */
910
911/* Supported bands */
912#define PHY_BAND_5 (0)
913#define PHY_BAND_24 (1)
914
915/* Supported channel width, vary if there is VHT support */
916#define PHY_VHT_CHANNEL_MODE20 (0x0)
917#define PHY_VHT_CHANNEL_MODE40 (0x1)
918#define PHY_VHT_CHANNEL_MODE80 (0x2)
919#define PHY_VHT_CHANNEL_MODE160 (0x3)
920
921/*
922 * Control channel position:
923 * For legacy set bit means upper channel, otherwise lower.
924 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
925 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
926 * center_freq
927 * |
928 * 40Mhz |_______|_______|
929 * 80Mhz |_______|_______|_______|_______|
930 * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
931 * code 011 010 001 000 | 100 101 110 111
932 */
933#define PHY_VHT_CTRL_POS_1_BELOW (0x0)
934#define PHY_VHT_CTRL_POS_2_BELOW (0x1)
935#define PHY_VHT_CTRL_POS_3_BELOW (0x2)
936#define PHY_VHT_CTRL_POS_4_BELOW (0x3)
937#define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
938#define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
939#define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
940#define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
941
942/*
943 * @band: PHY_BAND_*
944 * @channel: channel number
945 * @width: PHY_[VHT|LEGACY]_CHANNEL_*
946 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
947 */
948struct iwl_fw_channel_info {
949 u8 band;
950 u8 channel;
951 u8 width;
952 u8 ctrl_pos;
953} __packed;
954
955#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
956#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
957 (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
958#define PHY_RX_CHAIN_VALID_POS (1)
959#define PHY_RX_CHAIN_VALID_MSK \
960 (0x7 << PHY_RX_CHAIN_VALID_POS)
961#define PHY_RX_CHAIN_FORCE_SEL_POS (4)
962#define PHY_RX_CHAIN_FORCE_SEL_MSK \
963 (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
964#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
965#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
966 (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
967#define PHY_RX_CHAIN_CNT_POS (10)
968#define PHY_RX_CHAIN_CNT_MSK \
969 (0x3 << PHY_RX_CHAIN_CNT_POS)
970#define PHY_RX_CHAIN_MIMO_CNT_POS (12)
971#define PHY_RX_CHAIN_MIMO_CNT_MSK \
972 (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
973#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
974#define PHY_RX_CHAIN_MIMO_FORCE_MSK \
975 (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
976
977/* TODO: fix the value, make it depend on firmware at runtime? */
978#define NUM_PHY_CTX 3
979
980/* TODO: complete missing documentation */
981/**
982 * struct iwl_phy_context_cmd - config of the PHY context
983 * ( PHY_CONTEXT_CMD = 0x8 )
984 * @id_and_color: ID and color of the relevant Binding
985 * @action: action to perform, one of FW_CTXT_ACTION_*
986 * @apply_time: 0 means immediate apply and context switch.
987 * other value means apply new params after X usecs
988 * @tx_param_color: ???
989 * @channel_info:
990 * @txchain_info: ???
991 * @rxchain_info: ???
992 * @acquisition_data: ???
993 * @dsp_cfg_flags: set to 0
994 */
995struct iwl_phy_context_cmd {
996 /* COMMON_INDEX_HDR_API_S_VER_1 */
997 __le32 id_and_color;
998 __le32 action;
999 /* PHY_CONTEXT_DATA_API_S_VER_1 */
1000 __le32 apply_time;
1001 __le32 tx_param_color;
1002 struct iwl_fw_channel_info ci;
1003 __le32 txchain_info;
1004 __le32 rxchain_info;
1005 __le32 acquisition_data;
1006 __le32 dsp_cfg_flags;
1007} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
1008
Ariej Marjieh720befbf2014-07-07 09:04:58 +03001009/*
1010 * Aux ROC command
1011 *
1012 * Command requests the firmware to create a time event for a certain duration
1013 * and remain on the given channel. This is done by using the Aux framework in
1014 * the FW.
1015 * The command was first used for Hot Spot issues - but can be used regardless
1016 * to Hot Spot.
1017 *
1018 * ( HOT_SPOT_CMD 0x53 )
1019 *
1020 * @id_and_color: ID and color of the MAC
1021 * @action: action to perform, one of FW_CTXT_ACTION_*
1022 * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
1023 * event_unique_id should be the id of the time event assigned by ucode.
1024 * Otherwise ignore the event_unique_id.
1025 * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
1026 * activity.
1027 * @channel_info: channel info
1028 * @node_addr: Our MAC Address
1029 * @reserved: reserved for alignment
1030 * @apply_time: GP2 value to start (should always be the current GP2 value)
1031 * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
1032 * time by which start of the event is allowed to be postponed.
1033 * @duration: event duration in TU To calculate event duration:
1034 * timeEventDuration = min(duration, remainingQuota)
1035 */
1036struct iwl_hs20_roc_req {
1037 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
1038 __le32 id_and_color;
1039 __le32 action;
1040 __le32 event_unique_id;
1041 __le32 sta_id_and_color;
1042 struct iwl_fw_channel_info channel_info;
1043 u8 node_addr[ETH_ALEN];
1044 __le16 reserved;
1045 __le32 apply_time;
1046 __le32 apply_time_max_delay;
1047 __le32 duration;
1048} __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
1049
1050/*
1051 * values for AUX ROC result values
1052 */
1053enum iwl_mvm_hot_spot {
1054 HOT_SPOT_RSP_STATUS_OK,
1055 HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
1056 HOT_SPOT_MAX_NUM_OF_SESSIONS,
1057};
1058
1059/*
1060 * Aux ROC command response
1061 *
1062 * In response to iwl_hs20_roc_req the FW sends this command to notify the
1063 * driver the uid of the timevent.
1064 *
1065 * ( HOT_SPOT_CMD 0x53 )
1066 *
1067 * @event_unique_id: Unique ID of time event assigned by ucode
1068 * @status: Return status 0 is success, all the rest used for specific errors
1069 */
1070struct iwl_hs20_roc_res {
1071 __le32 event_unique_id;
1072 __le32 status;
1073} __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
1074
Johannes Berg8ca151b2013-01-24 14:25:36 +01001075/**
1076 * struct iwl_radio_version_notif - information on the radio version
1077 * ( RADIO_VERSION_NOTIFICATION = 0x68 )
1078 * @radio_flavor:
1079 * @radio_step:
1080 * @radio_dash:
1081 */
1082struct iwl_radio_version_notif {
1083 __le32 radio_flavor;
1084 __le32 radio_step;
1085 __le32 radio_dash;
1086} __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
1087
1088enum iwl_card_state_flags {
1089 CARD_ENABLED = 0x00,
1090 HW_CARD_DISABLED = 0x01,
1091 SW_CARD_DISABLED = 0x02,
1092 CT_KILL_CARD_DISABLED = 0x04,
1093 HALT_CARD_DISABLED = 0x08,
1094 CARD_DISABLED_MSK = 0x0f,
1095 CARD_IS_RX_ON = 0x10,
1096};
1097
1098/**
1099 * struct iwl_radio_version_notif - information on the radio version
1100 * ( CARD_STATE_NOTIFICATION = 0xa1 )
1101 * @flags: %iwl_card_state_flags
1102 */
1103struct iwl_card_state_notif {
1104 __le32 flags;
1105} __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
1106
1107/**
Hila Gonend64048e2013-03-13 18:00:03 +02001108 * struct iwl_missed_beacons_notif - information on missed beacons
1109 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
1110 * @mac_id: interface ID
1111 * @consec_missed_beacons_since_last_rx: number of consecutive missed
1112 * beacons since last RX.
1113 * @consec_missed_beacons: number of consecutive missed beacons
1114 * @num_expected_beacons:
1115 * @num_recvd_beacons:
1116 */
1117struct iwl_missed_beacons_notif {
1118 __le32 mac_id;
1119 __le32 consec_missed_beacons_since_last_rx;
1120 __le32 consec_missed_beacons;
1121 __le32 num_expected_beacons;
1122 __le32 num_recvd_beacons;
1123} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
1124
1125/**
Chaya Rachel Ivgy30269c12014-11-15 21:08:29 +02001126 * struct iwl_mfuart_load_notif - mfuart image version & status
1127 * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
1128 * @installed_ver: installed image version
1129 * @external_ver: external image version
1130 * @status: MFUART loading status
1131 * @duration: MFUART loading time
1132*/
1133struct iwl_mfuart_load_notif {
1134 __le32 installed_ver;
1135 __le32 external_ver;
1136 __le32 status;
1137 __le32 duration;
1138} __packed; /*MFU_LOADER_NTFY_API_S_VER_1*/
1139
1140/**
Johannes Berg8ca151b2013-01-24 14:25:36 +01001141 * struct iwl_set_calib_default_cmd - set default value for calibration.
1142 * ( SET_CALIB_DEFAULT_CMD = 0x8e )
1143 * @calib_index: the calibration to set value for
1144 * @length: of data
1145 * @data: the value to set for the calibration result
1146 */
1147struct iwl_set_calib_default_cmd {
1148 __le16 calib_index;
1149 __le16 length;
1150 u8 data[0];
1151} __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
1152
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001153#define MAX_PORT_ID_NUM 2
Eliad Pellere59647e2013-11-28 14:08:50 +02001154#define MAX_MCAST_FILTERING_ADDRESSES 256
Emmanuel Grumbach51b6b9e2013-05-02 15:01:24 +03001155
1156/**
1157 * struct iwl_mcast_filter_cmd - configure multicast filter.
1158 * @filter_own: Set 1 to filter out multicast packets sent by station itself
1159 * @port_id: Multicast MAC addresses array specifier. This is a strange way
1160 * to identify network interface adopted in host-device IF.
1161 * It is used by FW as index in array of addresses. This array has
1162 * MAX_PORT_ID_NUM members.
1163 * @count: Number of MAC addresses in the array
1164 * @pass_all: Set 1 to pass all multicast packets.
1165 * @bssid: current association BSSID.
1166 * @addr_list: Place holder for array of MAC addresses.
1167 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
1168 */
1169struct iwl_mcast_filter_cmd {
1170 u8 filter_own;
1171 u8 port_id;
1172 u8 count;
1173 u8 pass_all;
1174 u8 bssid[6];
1175 u8 reserved[2];
1176 u8 addr_list[0];
1177} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
1178
Eliad Pellerc87163b2014-01-08 10:11:11 +02001179#define MAX_BCAST_FILTERS 8
1180#define MAX_BCAST_FILTER_ATTRS 2
1181
1182/**
1183 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
1184 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
1185 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
1186 * start of ip payload).
1187 */
1188enum iwl_mvm_bcast_filter_attr_offset {
1189 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
1190 BCAST_FILTER_OFFSET_IP_END = 1,
1191};
1192
1193/**
1194 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
1195 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
1196 * @offset: starting offset of this pattern.
1197 * @val: value to match - big endian (MSB is the first
1198 * byte to match from offset pos).
1199 * @mask: mask to match (big endian).
1200 */
1201struct iwl_fw_bcast_filter_attr {
1202 u8 offset_type;
1203 u8 offset;
1204 __le16 reserved1;
1205 __be32 val;
1206 __be32 mask;
1207} __packed; /* BCAST_FILTER_ATT_S_VER_1 */
1208
1209/**
1210 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
1211 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
1212 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
1213 */
1214enum iwl_mvm_bcast_filter_frame_type {
1215 BCAST_FILTER_FRAME_TYPE_ALL = 0,
1216 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
1217};
1218
1219/**
1220 * struct iwl_fw_bcast_filter - broadcast filter
1221 * @discard: discard frame (1) or let it pass (0).
1222 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
1223 * @num_attrs: number of valid attributes in this filter.
1224 * @attrs: attributes of this filter. a filter is considered matched
1225 * only when all its attributes are matched (i.e. AND relationship)
1226 */
1227struct iwl_fw_bcast_filter {
1228 u8 discard;
1229 u8 frame_type;
1230 u8 num_attrs;
1231 u8 reserved1;
1232 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
1233} __packed; /* BCAST_FILTER_S_VER_1 */
1234
1235/**
1236 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
1237 * @default_discard: default action for this mac (discard (1) / pass (0)).
1238 * @attached_filters: bitmap of relevant filters for this mac.
1239 */
1240struct iwl_fw_bcast_mac {
1241 u8 default_discard;
1242 u8 reserved1;
1243 __le16 attached_filters;
1244} __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
1245
1246/**
1247 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
1248 * @disable: enable (0) / disable (1)
1249 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
1250 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
1251 * @filters: broadcast filters
1252 * @macs: broadcast filtering configuration per-mac
1253 */
1254struct iwl_bcast_filter_cmd {
1255 u8 disable;
1256 u8 max_bcast_filters;
1257 u8 max_macs;
1258 u8 reserved1;
1259 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
1260 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
1261} __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
1262
Matti Gottlieba2d79c52014-08-25 14:41:23 +03001263/*
1264 * enum iwl_mvm_marker_id - maker ids
1265 *
1266 * The ids for different type of markers to insert into the usniffer logs
1267 */
1268enum iwl_mvm_marker_id {
1269 MARKER_ID_TX_FRAME_LATENCY = 1,
1270}; /* MARKER_ID_API_E_VER_1 */
1271
1272/**
1273 * struct iwl_mvm_marker - mark info into the usniffer logs
1274 *
1275 * (MARKER_CMD = 0xcb)
1276 *
1277 * Mark the UTC time stamp into the usniffer logs together with additional
1278 * metadata, so the usniffer output can be parsed.
1279 * In the command response the ucode will return the GP2 time.
1280 *
1281 * @dw_len: The amount of dwords following this byte including this byte.
1282 * @marker_id: A unique marker id (iwl_mvm_marker_id).
1283 * @reserved: reserved.
1284 * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
1285 * @metadata: additional meta data that will be written to the unsiffer log
1286 */
1287struct iwl_mvm_marker {
1288 u8 dwLen;
1289 u8 markerId;
1290 __le16 reserved;
1291 __le64 timestamp;
1292 __le32 metadata[0];
1293} __packed; /* MARKER_API_S_VER_1 */
1294
Matti Gottlieb0becb372015-05-31 09:18:30 +03001295/*
1296 * enum iwl_dc2dc_config_id - flag ids
1297 *
1298 * Ids of dc2dc configuration flags
1299 */
1300enum iwl_dc2dc_config_id {
1301 DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
1302 DCDC_FREQ_TUNE_SET = 0x2,
1303}; /* MARKER_ID_API_E_VER_1 */
1304
1305/**
1306 * struct iwl_dc2dc_config_cmd - configure dc2dc values
1307 *
1308 * (DC2DC_CONFIG_CMD = 0x83)
1309 *
1310 * Set/Get & configure dc2dc values.
1311 * The command always returns the current dc2dc values.
1312 *
1313 * @flags: set/get dc2dc
1314 * @enable_low_power_mode: not used.
1315 * @dc2dc_freq_tune0: frequency divider - digital domain
1316 * @dc2dc_freq_tune1: frequency divider - analog domain
1317 */
1318struct iwl_dc2dc_config_cmd {
1319 __le32 flags;
1320 __le32 enable_low_power_mode; /* not used */
1321 __le32 dc2dc_freq_tune0;
1322 __le32 dc2dc_freq_tune1;
1323} __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
1324
1325/**
1326 * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
1327 *
1328 * Current dc2dc values returned by the FW.
1329 *
1330 * @dc2dc_freq_tune0: frequency divider - digital domain
1331 * @dc2dc_freq_tune1: frequency divider - analog domain
1332 */
1333struct iwl_dc2dc_config_resp {
1334 __le32 dc2dc_freq_tune0;
1335 __le32 dc2dc_freq_tune1;
1336} __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
1337
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001338/***********************************
1339 * Smart Fifo API
1340 ***********************************/
1341/* Smart Fifo state */
1342enum iwl_sf_state {
1343 SF_LONG_DELAY_ON = 0, /* should never be called by driver */
1344 SF_FULL_ON,
1345 SF_UNINIT,
1346 SF_INIT_OFF,
1347 SF_HW_NUM_STATES
1348};
1349
1350/* Smart Fifo possible scenario */
1351enum iwl_sf_scenario {
1352 SF_SCENARIO_SINGLE_UNICAST,
1353 SF_SCENARIO_AGG_UNICAST,
1354 SF_SCENARIO_MULTICAST,
1355 SF_SCENARIO_BA_RESP,
1356 SF_SCENARIO_TX_RESP,
1357 SF_NUM_SCENARIO
1358};
1359
1360#define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
1361#define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
1362
1363/* smart FIFO default values */
Emmanuel Grumbachb4c82ad2014-12-01 16:44:09 +02001364#define SF_W_MARK_SISO 6144
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001365#define SF_W_MARK_MIMO2 8192
1366#define SF_W_MARK_MIMO3 6144
1367#define SF_W_MARK_LEGACY 4096
1368#define SF_W_MARK_SCAN 4096
1369
Eran Hararyf4a3ee42015-02-08 13:58:50 +02001370/* SF Scenarios timers for default configuration (aligned to 32 uSec) */
1371#define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1372#define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1373#define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
1374#define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1375#define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
1376#define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
1377#define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
1378#define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
1379#define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
1380#define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
1381
1382/* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001383#define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1384#define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1385#define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
1386#define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
1387#define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
1388#define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
1389#define SF_BA_IDLE_TIMER 320 /* 300 uSec */
1390#define SF_BA_AGING_TIMER 2016 /* 2 mSec */
1391#define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
1392#define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
1393
1394#define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
1395
Eran Harary161bdb72014-07-27 08:03:06 +03001396#define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
1397
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001398/**
1399 * Smart Fifo configuration command.
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001400 * @state: smart fifo state, types listed in enum %iwl_sf_sate.
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001401 * @watermark: Minimum allowed availabe free space in RXF for transient state.
1402 * @long_delay_timeouts: aging and idle timer values for each scenario
1403 * in long delay state.
1404 * @full_on_timeouts: timer values for each scenario in full on state.
1405 */
1406struct iwl_sf_cfg_cmd {
Emmanuel Grumbach86974bf2014-07-31 14:32:37 +03001407 __le32 state;
Lilach Edelstein1f3b0ff2013-10-06 13:03:32 +02001408 __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
1409 __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1410 __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
1411} __packed; /* SF_CFG_API_S_VER_2 */
1412
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001413/***********************************
1414 * Location Aware Regulatory (LAR) API - MCC updates
1415 ***********************************/
1416
1417/**
1418 * struct iwl_mcc_update_cmd - Request the device to update geographic
1419 * regulatory profile according to the given MCC (Mobile Country Code).
1420 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1421 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1422 * MCC in the cmd response will be the relevant MCC in the NVM.
1423 * @mcc: given mobile country code
1424 * @source_id: the source from where we got the MCC, see iwl_mcc_source
1425 * @reserved: reserved for alignment
1426 */
1427struct iwl_mcc_update_cmd {
1428 __le16 mcc;
1429 u8 source_id;
1430 u8 reserved;
1431} __packed; /* LAR_UPDATE_MCC_CMD_API_S */
1432
1433/**
1434 * iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
1435 * Contains the new channel control profile map, if changed, and the new MCC
1436 * (mobile country code).
1437 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
Jonathan Doron47c8b152014-11-27 16:55:25 +02001438 * @status: see &enum iwl_mcc_update_status
Eran Harary8ba2d7a2015-02-08 11:41:43 +02001439 * @mcc: the new applied MCC
1440 * @cap: capabilities for all channels which matches the MCC
1441 * @source_id: the MCC source, see iwl_mcc_source
1442 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
1443 * channels, depending on platform)
1444 * @channels: channel control data map, DWORD for each channel. Only the first
1445 * 16bits are used.
1446 */
1447struct iwl_mcc_update_resp {
1448 __le32 status;
1449 __le16 mcc;
1450 u8 cap;
1451 u8 source_id;
1452 __le32 n_channels;
1453 __le32 channels[0];
1454} __packed; /* LAR_UPDATE_MCC_CMD_RESP_S */
1455
1456/**
1457 * struct iwl_mcc_chub_notif - chub notifies of mcc change
1458 * (MCC_CHUB_UPDATE_CMD = 0xc9)
1459 * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
1460 * the cellular and connectivity cores that gets updates of the mcc, and
1461 * notifies the ucode directly of any mcc change.
1462 * The ucode requests the driver to request the device to update geographic
1463 * regulatory profile according to the given MCC (Mobile Country Code).
1464 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
1465 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
1466 * MCC in the cmd response will be the relevant MCC in the NVM.
1467 * @mcc: given mobile country code
1468 * @source_id: identity of the change originator, see iwl_mcc_source
1469 * @reserved1: reserved for alignment
1470 */
1471struct iwl_mcc_chub_notif {
1472 u16 mcc;
1473 u8 source_id;
1474 u8 reserved1;
1475} __packed; /* LAR_MCC_NOTIFY_S */
1476
1477enum iwl_mcc_update_status {
1478 MCC_RESP_NEW_CHAN_PROFILE,
1479 MCC_RESP_SAME_CHAN_PROFILE,
1480 MCC_RESP_INVALID,
1481 MCC_RESP_NVM_DISABLED,
1482 MCC_RESP_ILLEGAL,
1483 MCC_RESP_LOW_PRIORITY,
1484};
1485
1486enum iwl_mcc_source {
1487 MCC_SOURCE_OLD_FW = 0,
1488 MCC_SOURCE_ME = 1,
1489 MCC_SOURCE_BIOS = 2,
1490 MCC_SOURCE_3G_LTE_HOST = 3,
1491 MCC_SOURCE_3G_LTE_DEVICE = 4,
1492 MCC_SOURCE_WIFI = 5,
1493 MCC_SOURCE_RESERVED = 6,
1494 MCC_SOURCE_DEFAULT = 7,
1495 MCC_SOURCE_UNINITIALIZED = 8,
1496 MCC_SOURCE_GET_CURRENT = 0x10
1497};
1498
Luciano Coelhoa0a09242014-09-04 12:29:15 +03001499/* DTS measurements */
1500
1501enum iwl_dts_measurement_flags {
1502 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
1503 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
1504};
1505
1506/**
1507 * iwl_dts_measurement_cmd - request DTS temperature and/or voltage measurements
1508 *
1509 * @flags: indicates which measurements we want as specified in &enum
1510 * iwl_dts_measurement_flags
1511 */
1512struct iwl_dts_measurement_cmd {
1513 __le32 flags;
1514} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
1515
1516/**
1517 * iwl_dts_measurement_notif - notification received with the measurements
1518 *
1519 * @temp: the measured temperature
1520 * @voltage: the measured voltage
1521 */
1522struct iwl_dts_measurement_notif {
1523 __le32 temp;
1524 __le32 voltage;
1525} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S */
1526
Arik Nemtsov77c5d7e2014-09-11 13:10:08 +03001527/***********************************
1528 * TDLS API
1529 ***********************************/
1530
1531/* Type of TDLS request */
1532enum iwl_tdls_channel_switch_type {
1533 TDLS_SEND_CHAN_SW_REQ = 0,
1534 TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
1535 TDLS_MOVE_CH,
1536}; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
1537
1538/**
1539 * Switch timing sub-element in a TDLS channel-switch command
1540 * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
1541 * received from peer
1542 * @max_offchan_duration: What amount of microseconds out of a DTIM is given
1543 * to the TDLS off-channel communication. For instance if the DTIM is
1544 * 200TU and the TDLS peer is to be given 25% of the time, the value
1545 * given will be 50TU, or 50 * 1024 if translated into microseconds.
1546 * @switch_time: switch time the peer sent in its channel switch timing IE
1547 * @switch_timout: switch timeout the peer sent in its channel switch timing IE
1548 */
1549struct iwl_tdls_channel_switch_timing {
1550 __le32 frame_timestamp; /* GP2 time of peer packet Rx */
1551 __le32 max_offchan_duration; /* given in micro-seconds */
1552 __le32 switch_time; /* given in micro-seconds */
1553 __le32 switch_timeout; /* given in micro-seconds */
1554} __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
1555
1556#define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
1557
1558/**
1559 * TDLS channel switch frame template
1560 *
1561 * A template representing a TDLS channel-switch request or response frame
1562 *
1563 * @switch_time_offset: offset to the channel switch timing IE in the template
1564 * @tx_cmd: Tx parameters for the frame
1565 * @data: frame data
1566 */
1567struct iwl_tdls_channel_switch_frame {
1568 __le32 switch_time_offset;
1569 struct iwl_tx_cmd tx_cmd;
1570 u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
1571} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
1572
1573/**
1574 * TDLS channel switch command
1575 *
1576 * The command is sent to initiate a channel switch and also in response to
1577 * incoming TDLS channel-switch request/response packets from remote peers.
1578 *
1579 * @switch_type: see &enum iwl_tdls_channel_switch_type
1580 * @peer_sta_id: station id of TDLS peer
1581 * @ci: channel we switch to
1582 * @timing: timing related data for command
1583 * @frame: channel-switch request/response template, depending to switch_type
1584 */
1585struct iwl_tdls_channel_switch_cmd {
1586 u8 switch_type;
1587 __le32 peer_sta_id;
1588 struct iwl_fw_channel_info ci;
1589 struct iwl_tdls_channel_switch_timing timing;
1590 struct iwl_tdls_channel_switch_frame frame;
1591} __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
1592
1593/**
1594 * TDLS channel switch start notification
1595 *
1596 * @status: non-zero on success
1597 * @offchannel_duration: duration given in microseconds
1598 * @sta_id: peer currently performing the channel-switch with
1599 */
1600struct iwl_tdls_channel_switch_notif {
1601 __le32 status;
1602 __le32 offchannel_duration;
1603 __le32 sta_id;
1604} __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
1605
Arik Nemtsov307e4722014-09-15 18:48:59 +03001606/**
1607 * TDLS station info
1608 *
1609 * @sta_id: station id of the TDLS peer
1610 * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
1611 * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
1612 * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
1613 */
1614struct iwl_tdls_sta_info {
1615 u8 sta_id;
1616 u8 tx_to_peer_tid;
1617 __le16 tx_to_peer_ssn;
1618 __le32 is_initiator;
1619} __packed; /* TDLS_STA_INFO_VER_1 */
1620
1621/**
1622 * TDLS basic config command
1623 *
1624 * @id_and_color: MAC id and color being configured
1625 * @tdls_peer_count: amount of currently connected TDLS peers
1626 * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
1627 * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
1628 * @sta_info: per-station info. Only the first tdls_peer_count entries are set
1629 * @pti_req_data_offset: offset of network-level data for the PTI template
1630 * @pti_req_tx_cmd: Tx parameters for PTI request template
1631 * @pti_req_template: PTI request template data
1632 */
1633struct iwl_tdls_config_cmd {
1634 __le32 id_and_color; /* mac id and color */
1635 u8 tdls_peer_count;
1636 u8 tx_to_ap_tid;
1637 __le16 tx_to_ap_ssn;
1638 struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
1639
1640 __le32 pti_req_data_offset;
1641 struct iwl_tx_cmd pti_req_tx_cmd;
1642 u8 pti_req_template[0];
1643} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
1644
1645/**
1646 * TDLS per-station config information from FW
1647 *
1648 * @sta_id: station id of the TDLS peer
1649 * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
1650 * the peer
1651 */
1652struct iwl_tdls_config_sta_info_res {
1653 __le16 sta_id;
1654 __le16 tx_to_peer_last_seq;
1655} __packed; /* TDLS_STA_INFO_RSP_VER_1 */
1656
1657/**
1658 * TDLS config information from FW
1659 *
1660 * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
1661 * @sta_info: per-station TDLS config information
1662 */
1663struct iwl_tdls_config_res {
1664 __le32 tx_to_ap_last_seq;
1665 struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
1666} __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
1667
Liad Kaufman04fd2c22014-12-15 17:54:16 +02001668#define TX_FIFO_MAX_NUM 8
1669#define RX_FIFO_MAX_NUM 2
1670
1671/**
1672 * Shared memory configuration information from the FW
1673 *
1674 * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
1675 * accessible)
1676 * @shared_mem_size: shared memory size
1677 * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
1678 * 0x0 as accessible only via DBGM RDAT)
1679 * @sample_buff_size: internal sample buff size
1680 * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
1681 * 8000 HW set to 0x0 as not accessible)
1682 * @txfifo_size: size of TXF0 ... TXF7
1683 * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
1684 * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
1685 * when paging is not supported this should be 0
1686 * @page_buff_size: size of %page_buff_addr
1687 */
1688struct iwl_shared_mem_cfg {
1689 __le32 shared_mem_addr;
1690 __le32 shared_mem_size;
1691 __le32 sample_buff_addr;
1692 __le32 sample_buff_size;
1693 __le32 txfifo_addr;
1694 __le32 txfifo_size[TX_FIFO_MAX_NUM];
1695 __le32 rxfifo_size[RX_FIFO_MAX_NUM];
1696 __le32 page_buff_addr;
1697 __le32 page_buff_size;
1698} __packed; /* SHARED_MEM_ALLOC_API_S_VER_1 */
1699
Johannes Berg8ca151b2013-01-24 14:25:36 +01001700#endif /* __fw_api_h__ */