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