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