xref: /freebsd/sys/contrib/dev/iwlwifi/fw/file.h (revision a4128aad8503277614f2d214011ef60a19447b83)
1bfcc09ddSBjoern A. Zeeb /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2bfcc09ddSBjoern A. Zeeb /*
3*a4128aadSBjoern A. Zeeb  * Copyright (C) 2008-2014, 2018-2024 Intel Corporation
4bfcc09ddSBjoern A. Zeeb  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5bfcc09ddSBjoern A. Zeeb  * Copyright (C) 2016-2017 Intel Deutschland GmbH
6bfcc09ddSBjoern A. Zeeb  */
7bfcc09ddSBjoern A. Zeeb #ifndef __iwl_fw_file_h__
8bfcc09ddSBjoern A. Zeeb #define __iwl_fw_file_h__
9bfcc09ddSBjoern A. Zeeb 
10bfcc09ddSBjoern A. Zeeb #include <linux/netdevice.h>
11bfcc09ddSBjoern A. Zeeb #include <linux/nl80211.h>
12bfcc09ddSBjoern A. Zeeb 
13bfcc09ddSBjoern A. Zeeb /* v1/v2 uCode file layout */
14bfcc09ddSBjoern A. Zeeb struct iwl_ucode_header {
15bfcc09ddSBjoern A. Zeeb 	__le32 ver;	/* major/minor/API/serial */
16bfcc09ddSBjoern A. Zeeb 	union {
17bfcc09ddSBjoern A. Zeeb 		struct {
18bfcc09ddSBjoern A. Zeeb 			__le32 inst_size;	/* bytes of runtime code */
19bfcc09ddSBjoern A. Zeeb 			__le32 data_size;	/* bytes of runtime data */
20bfcc09ddSBjoern A. Zeeb 			__le32 init_size;	/* bytes of init code */
21bfcc09ddSBjoern A. Zeeb 			__le32 init_data_size;	/* bytes of init data */
22bfcc09ddSBjoern A. Zeeb 			__le32 boot_size;	/* bytes of bootstrap code */
23*a4128aadSBjoern A. Zeeb 			u8 data[];		/* in same order as sizes */
24bfcc09ddSBjoern A. Zeeb 		} v1;
25bfcc09ddSBjoern A. Zeeb 		struct {
26bfcc09ddSBjoern A. Zeeb 			__le32 build;		/* build number */
27bfcc09ddSBjoern A. Zeeb 			__le32 inst_size;	/* bytes of runtime code */
28bfcc09ddSBjoern A. Zeeb 			__le32 data_size;	/* bytes of runtime data */
29bfcc09ddSBjoern A. Zeeb 			__le32 init_size;	/* bytes of init code */
30bfcc09ddSBjoern A. Zeeb 			__le32 init_data_size;	/* bytes of init data */
31bfcc09ddSBjoern A. Zeeb 			__le32 boot_size;	/* bytes of bootstrap code */
32*a4128aadSBjoern A. Zeeb 			u8 data[];		/* in same order as sizes */
33bfcc09ddSBjoern A. Zeeb 		} v2;
34bfcc09ddSBjoern A. Zeeb 	} u;
35bfcc09ddSBjoern A. Zeeb };
36bfcc09ddSBjoern A. Zeeb 
37bfcc09ddSBjoern A. Zeeb #define IWL_UCODE_TLV_DEBUG_BASE	0x1000005
38bfcc09ddSBjoern A. Zeeb #define IWL_UCODE_TLV_CONST_BASE	0x100
39bfcc09ddSBjoern A. Zeeb 
40bfcc09ddSBjoern A. Zeeb /*
41bfcc09ddSBjoern A. Zeeb  * new TLV uCode file layout
42bfcc09ddSBjoern A. Zeeb  *
43bfcc09ddSBjoern A. Zeeb  * The new TLV file format contains TLVs, that each specify
44bfcc09ddSBjoern A. Zeeb  * some piece of data.
45bfcc09ddSBjoern A. Zeeb  */
46bfcc09ddSBjoern A. Zeeb 
47bfcc09ddSBjoern A. Zeeb enum iwl_ucode_tlv_type {
48bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_INVALID		= 0, /* unused */
49bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_INST		= 1,
50bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_DATA		= 2,
51bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_INIT		= 3,
52bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_INIT_DATA		= 4,
53bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_BOOT		= 5,
54bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_PROBE_MAX_LEN	= 6, /* a u32 value */
55bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_PAN		= 7, /* deprecated -- only used in DVM */
56bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_MEM_DESC		= 7, /* replaces PAN in non-DVM */
57bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_RUNT_EVTLOG_PTR	= 8,
58bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_RUNT_EVTLOG_SIZE	= 9,
59bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_RUNT_ERRLOG_PTR	= 10,
60bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_INIT_EVTLOG_PTR	= 11,
61bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_INIT_EVTLOG_SIZE	= 12,
62bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_INIT_ERRLOG_PTR	= 13,
63bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_ENHANCE_SENS_TBL	= 14,
64bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_PHY_CALIBRATION_SIZE = 15,
65bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_WOWLAN_INST	= 16,
66bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_WOWLAN_DATA	= 17,
67bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS		= 18,
68bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_SEC_RT		= 19,
69bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_SEC_INIT		= 20,
70bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_SEC_WOWLAN	= 21,
71bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_DEF_CALIB		= 22,
72bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_PHY_SKU		= 23,
73bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_SECURE_SEC_RT	= 24,
74bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_SECURE_SEC_INIT	= 25,
75bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_SECURE_SEC_WOWLAN	= 26,
76bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_NUM_OF_CPU	= 27,
77bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CSCHEME		= 28,
78bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_CHANGES_SET	= 29,
79bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_ENABLED_CAPABILITIES	= 30,
80bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_N_SCAN_CHANNELS		= 31,
81bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_PAGING		= 32,
82bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_SEC_RT_USNIFFER	= 34,
83bfcc09ddSBjoern A. Zeeb 	/* 35 is unused */
84bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_VERSION	= 36,
85bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_DBG_DEST	= 38,
86bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_DBG_CONF	= 39,
87bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_DBG_TRIGGER	= 40,
88bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CMD_VERSIONS	= 48,
89bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_GSCAN_CAPA	= 50,
90bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_MEM_SEG	= 51,
91bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_IML		= 52,
92bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_UMAC_DEBUG_ADDRS	= 54,
93bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_LMAC_DEBUG_ADDRS	= 55,
94bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_RECOVERY_INFO	= 57,
95bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_HW_TYPE			= 58,
96bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_FSEQ_VERSION		= 60,
97bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_PHY_INTEGRATION_VERSION	= 61,
98bfcc09ddSBjoern A. Zeeb 
99bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_PNVM_VERSION		= 62,
100bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_PNVM_SKU			= 64,
101bfcc09ddSBjoern A. Zeeb 
102bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_SEC_TABLE_ADDR		= 66,
103bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_D3_KEK_KCK_ADDR		= 67,
1049af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CURRENT_PC		= 68,
105bfcc09ddSBjoern A. Zeeb 
106bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_NUM_STATIONS		= IWL_UCODE_TLV_CONST_BASE + 0,
1079af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_FW_NUM_BEACONS		= IWL_UCODE_TLV_CONST_BASE + 2,
108bfcc09ddSBjoern A. Zeeb 
109bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_TYPE_DEBUG_INFO		= IWL_UCODE_TLV_DEBUG_BASE + 0,
110bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION	= IWL_UCODE_TLV_DEBUG_BASE + 1,
111bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_TYPE_HCMD			= IWL_UCODE_TLV_DEBUG_BASE + 2,
112bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_TYPE_REGIONS		= IWL_UCODE_TLV_DEBUG_BASE + 3,
113bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_TYPE_TRIGGERS		= IWL_UCODE_TLV_DEBUG_BASE + 4,
114bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_TYPE_CONF_SET		= IWL_UCODE_TLV_DEBUG_BASE + 5,
115bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_DEBUG_MAX = IWL_UCODE_TLV_TYPE_TRIGGERS,
116bfcc09ddSBjoern A. Zeeb 
117bfcc09ddSBjoern A. Zeeb 	/* TLVs 0x1000-0x2000 are for internal driver usage */
118bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FW_DBG_DUMP_LST	= 0x1000,
119bfcc09ddSBjoern A. Zeeb };
120bfcc09ddSBjoern A. Zeeb 
121bfcc09ddSBjoern A. Zeeb struct iwl_ucode_tlv {
122bfcc09ddSBjoern A. Zeeb 	__le32 type;		/* see above */
123bfcc09ddSBjoern A. Zeeb 	__le32 length;		/* not including type/length fields */
124d9836fb4SBjoern A. Zeeb 	u8 data[];
125bfcc09ddSBjoern A. Zeeb };
126bfcc09ddSBjoern A. Zeeb 
127bfcc09ddSBjoern A. Zeeb #define IWL_TLV_UCODE_MAGIC		0x0a4c5749
128bfcc09ddSBjoern A. Zeeb #define FW_VER_HUMAN_READABLE_SZ	64
129bfcc09ddSBjoern A. Zeeb 
130bfcc09ddSBjoern A. Zeeb struct iwl_tlv_ucode_header {
131bfcc09ddSBjoern A. Zeeb 	/*
132bfcc09ddSBjoern A. Zeeb 	 * The TLV style ucode header is distinguished from
133bfcc09ddSBjoern A. Zeeb 	 * the v1/v2 style header by first four bytes being
134bfcc09ddSBjoern A. Zeeb 	 * zero, as such is an invalid combination of
135bfcc09ddSBjoern A. Zeeb 	 * major/minor/API/serial versions.
136bfcc09ddSBjoern A. Zeeb 	 */
137bfcc09ddSBjoern A. Zeeb 	__le32 zero;
138bfcc09ddSBjoern A. Zeeb 	__le32 magic;
139bfcc09ddSBjoern A. Zeeb 	u8 human_readable[FW_VER_HUMAN_READABLE_SZ];
140bfcc09ddSBjoern A. Zeeb 	/* major/minor/API/serial or major in new format */
141bfcc09ddSBjoern A. Zeeb 	__le32 ver;
142bfcc09ddSBjoern A. Zeeb 	__le32 build;
143bfcc09ddSBjoern A. Zeeb 	__le64 ignore;
144bfcc09ddSBjoern A. Zeeb 	/*
145bfcc09ddSBjoern A. Zeeb 	 * The data contained herein has a TLV layout,
146bfcc09ddSBjoern A. Zeeb 	 * see above for the TLV header and types.
147bfcc09ddSBjoern A. Zeeb 	 * Note that each TLV is padded to a length
148bfcc09ddSBjoern A. Zeeb 	 * that is a multiple of 4 for alignment.
149bfcc09ddSBjoern A. Zeeb 	 */
1509af1bba4SBjoern A. Zeeb 	u8 data[];
151bfcc09ddSBjoern A. Zeeb };
152bfcc09ddSBjoern A. Zeeb 
153bfcc09ddSBjoern A. Zeeb /*
154bfcc09ddSBjoern A. Zeeb  * ucode TLVs
155bfcc09ddSBjoern A. Zeeb  *
156bfcc09ddSBjoern A. Zeeb  * ability to get extension for: flags & capabilities from ucode binaries files
157bfcc09ddSBjoern A. Zeeb  */
158bfcc09ddSBjoern A. Zeeb struct iwl_ucode_api {
159bfcc09ddSBjoern A. Zeeb 	__le32 api_index;
160bfcc09ddSBjoern A. Zeeb 	__le32 api_flags;
161bfcc09ddSBjoern A. Zeeb } __packed;
162bfcc09ddSBjoern A. Zeeb 
163bfcc09ddSBjoern A. Zeeb struct iwl_ucode_capa {
164bfcc09ddSBjoern A. Zeeb 	__le32 api_index;
165bfcc09ddSBjoern A. Zeeb 	__le32 api_capa;
166bfcc09ddSBjoern A. Zeeb } __packed;
167bfcc09ddSBjoern A. Zeeb 
168bfcc09ddSBjoern A. Zeeb /**
169bfcc09ddSBjoern A. Zeeb  * enum iwl_ucode_tlv_flag - ucode API flags
170bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously
171bfcc09ddSBjoern A. Zeeb  *	was a separate TLV but moved here to save space.
172bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behavior on hidden SSID,
173bfcc09ddSBjoern A. Zeeb  *	treats good CRC threshold as a boolean
174bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w).
175bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: This uCode image supports uAPSD
176bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of block list instead of 64 in scan
177bfcc09ddSBjoern A. Zeeb  *	offload profile config command.
178bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS: D3 image supports up to six
179bfcc09ddSBjoern A. Zeeb  *	(rather than two) IPv6 addresses
180bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_NO_BASIC_SSID: not sending a probe with the SSID element
181bfcc09ddSBjoern A. Zeeb  *	from the probe request template.
182bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL: new NS offload (small version)
183bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version)
184bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD
185bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save
186bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_FLAGS_EBS_SUPPORT: this uCode image supports EBS.
187bfcc09ddSBjoern A. Zeeb  */
188bfcc09ddSBjoern A. Zeeb enum iwl_ucode_tlv_flag {
189bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_PAN			= BIT(0),
190bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_NEWSCAN		= BIT(1),
191bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_MFP			= BIT(2),
192bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_SHORT_BL		= BIT(7),
193bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS	= BIT(10),
194bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_NO_BASIC_SSID	= BIT(12),
195bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL	= BIT(15),
196bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE	= BIT(16),
197bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT	= BIT(24),
198bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_EBS_SUPPORT		= BIT(25),
199bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_FLAGS_P2P_PS_UAPSD	= BIT(26),
200bfcc09ddSBjoern A. Zeeb };
201bfcc09ddSBjoern A. Zeeb 
202bfcc09ddSBjoern A. Zeeb typedef unsigned int __bitwise iwl_ucode_tlv_api_t;
203bfcc09ddSBjoern A. Zeeb 
204bfcc09ddSBjoern A. Zeeb /**
205bfcc09ddSBjoern A. Zeeb  * enum iwl_ucode_tlv_api - ucode api
206bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time
207bfcc09ddSBjoern A. Zeeb  *	longer than the passive one, which is essential for fragmented scan.
208bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source.
209bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params
210bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_NEW_VERSION: new versioning format
211bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_SCAN_TSF_REPORT: Scan start time reported in scan
212bfcc09ddSBjoern A. Zeeb  *	iteration complete notification, and the timestamp reported for RX
213bfcc09ddSBjoern A. Zeeb  *	received during scan, are reported in TSF of the mac specified in the
214bfcc09ddSBjoern A. Zeeb  *	scan request.
215bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_TKIP_MIC_KEYS: This ucode supports version 2 of
216bfcc09ddSBjoern A. Zeeb  *	ADD_MODIFY_STA_KEY_API_S_VER_2.
217bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_STA_TYPE: This ucode supports station type assignement.
218bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_NAN2_VER2: This ucode supports NAN API version 2
219*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_ADAPTIVE_DWELL: support for adaptive dwell in scanning
220bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_NEW_RX_STATS: should new RX STATISTICS API be used
221bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_QUOTA_LOW_LATENCY: Quota command includes a field
222bfcc09ddSBjoern A. Zeeb  *	indicating low latency direction.
223bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_DEPRECATE_TTAK: RX status flag TTAK ok (bit 7) is
224bfcc09ddSBjoern A. Zeeb  *	deprecated.
225bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_ADAPTIVE_DWELL_V2: This ucode supports version 8
226bfcc09ddSBjoern A. Zeeb  *	of scan request: SCAN_REQUEST_CMD_UMAC_API_S_VER_8
227bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_FRAG_EBS: This ucode supports fragmented EBS
228bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_REDUCE_TX_POWER: This ucode supports v5 of
229bfcc09ddSBjoern A. Zeeb  *	the REDUCE_TX_POWER_CMD.
230bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF: This ucode supports the short
231bfcc09ddSBjoern A. Zeeb  *	version of the beacon notification.
232bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_BEACON_FILTER_V4: This ucode supports v4 of
233bfcc09ddSBjoern A. Zeeb  *	BEACON_FILTER_CONFIG_API_S_VER_4.
234bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_REGULATORY_NVM_INFO: This ucode supports v4 of
235bfcc09ddSBjoern A. Zeeb  *	REGULATORY_NVM_GET_INFO_RSP_API_S.
236bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ: This ucode supports v7 of
237bfcc09ddSBjoern A. Zeeb  *	LOCATION_RANGE_REQ_CMD_API_S and v6 of LOCATION_RANGE_RESP_NTFY_API_S.
238bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS: This ucode supports v2 of
239bfcc09ddSBjoern A. Zeeb  *	SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S and v3 of
240bfcc09ddSBjoern A. Zeeb  *	SCAN_OFFLOAD_PROFILES_QUERY_RSP_S.
241bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_MBSSID_HE: This ucode supports v2 of
242bfcc09ddSBjoern A. Zeeb  *	STA_CONTEXT_DOT11AX_API_S
243*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_FTM_RTT_ACCURACY: version 7 of the range response API
244*a4128aadSBjoern A. Zeeb  *	is supported by FW, this indicates the RTT confidence value
245bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_SAR_TABLE_VER: This ucode supports different sar
246bfcc09ddSBjoern A. Zeeb  *	version tables.
247bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_REDUCED_SCAN_CONFIG: This ucode supports v3 of
248bfcc09ddSBjoern A. Zeeb  *	SCAN_CONFIG_DB_CMD_API_S.
249*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_ADWELL_HB_DEF_N_AP: support for setting adaptive dwell
250*a4128aadSBjoern A. Zeeb  *	number of APs in the 5 GHz band
251*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_BAND_IN_RX_DATA: FW reports band number in RX notification
252*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_NO_HOST_DISABLE_TX: Firmware offloaded the station disable tx
253*a4128aadSBjoern A. Zeeb  *	logic.
254*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_INT_DBG_BUF_CLEAR: Firmware supports clearing the debug
255*a4128aadSBjoern A. Zeeb  *	internal buffer
256*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_API_SMART_FIFO_OFFLOAD: Firmware doesn't need the host to
257*a4128aadSBjoern A. Zeeb  *	configure the smart fifo
258bfcc09ddSBjoern A. Zeeb  *
259bfcc09ddSBjoern A. Zeeb  * @NUM_IWL_UCODE_TLV_API: number of bits used
260bfcc09ddSBjoern A. Zeeb  */
261bfcc09ddSBjoern A. Zeeb enum iwl_ucode_tlv_api {
262bfcc09ddSBjoern A. Zeeb 	/* API Set 0 */
263bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_FRAGMENTED_SCAN	= (__force iwl_ucode_tlv_api_t)8,
264bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_WIFI_MCC_UPDATE	= (__force iwl_ucode_tlv_api_t)9,
265bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_LQ_SS_PARAMS		= (__force iwl_ucode_tlv_api_t)18,
266bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_NEW_VERSION		= (__force iwl_ucode_tlv_api_t)20,
267bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_SCAN_TSF_REPORT	= (__force iwl_ucode_tlv_api_t)28,
268bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_TKIP_MIC_KEYS		= (__force iwl_ucode_tlv_api_t)29,
269bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_STA_TYPE		= (__force iwl_ucode_tlv_api_t)30,
270bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_NAN2_VER2		= (__force iwl_ucode_tlv_api_t)31,
271bfcc09ddSBjoern A. Zeeb 	/* API Set 1 */
272bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_ADAPTIVE_DWELL	= (__force iwl_ucode_tlv_api_t)32,
273bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_OCE			= (__force iwl_ucode_tlv_api_t)33,
274bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_NEW_BEACON_TEMPLATE	= (__force iwl_ucode_tlv_api_t)34,
275bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_NEW_RX_STATS		= (__force iwl_ucode_tlv_api_t)35,
276bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_WOWLAN_KEY_MATERIAL	= (__force iwl_ucode_tlv_api_t)36,
277bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_QUOTA_LOW_LATENCY	= (__force iwl_ucode_tlv_api_t)38,
278bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_DEPRECATE_TTAK	= (__force iwl_ucode_tlv_api_t)41,
279bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_ADAPTIVE_DWELL_V2	= (__force iwl_ucode_tlv_api_t)42,
280bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_FRAG_EBS		= (__force iwl_ucode_tlv_api_t)44,
281bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_REDUCE_TX_POWER	= (__force iwl_ucode_tlv_api_t)45,
282bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF	= (__force iwl_ucode_tlv_api_t)46,
283bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_BEACON_FILTER_V4      = (__force iwl_ucode_tlv_api_t)47,
284bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_REGULATORY_NVM_INFO   = (__force iwl_ucode_tlv_api_t)48,
285bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ     = (__force iwl_ucode_tlv_api_t)49,
286bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS    = (__force iwl_ucode_tlv_api_t)50,
287bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_MBSSID_HE		= (__force iwl_ucode_tlv_api_t)52,
288bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_WOWLAN_TCP_SYN_WAKE	= (__force iwl_ucode_tlv_api_t)53,
289bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_FTM_RTT_ACCURACY      = (__force iwl_ucode_tlv_api_t)54,
290bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_SAR_TABLE_VER         = (__force iwl_ucode_tlv_api_t)55,
291bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_REDUCED_SCAN_CONFIG   = (__force iwl_ucode_tlv_api_t)56,
292bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_ADWELL_HB_DEF_N_AP	= (__force iwl_ucode_tlv_api_t)57,
293bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_SCAN_EXT_CHAN_VER	= (__force iwl_ucode_tlv_api_t)58,
294bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_API_BAND_IN_RX_DATA	= (__force iwl_ucode_tlv_api_t)59,
295*a4128aadSBjoern A. Zeeb 	/* API Set 2 */
296*a4128aadSBjoern A. Zeeb 	IWL_UCODE_TLV_API_NO_HOST_DISABLE_TX	= (__force iwl_ucode_tlv_api_t)66,
297*a4128aadSBjoern A. Zeeb 	IWL_UCODE_TLV_API_INT_DBG_BUF_CLEAR     = (__force iwl_ucode_tlv_api_t)67,
298*a4128aadSBjoern A. Zeeb 	IWL_UCODE_TLV_API_SMART_FIFO_OFFLOAD    = (__force iwl_ucode_tlv_api_t)68,
299bfcc09ddSBjoern A. Zeeb 
300bfcc09ddSBjoern A. Zeeb 	NUM_IWL_UCODE_TLV_API
301*a4128aadSBjoern A. Zeeb /*
302*a4128aadSBjoern A. Zeeb  * This construction make both sparse (which cannot increment the previous
303*a4128aadSBjoern A. Zeeb  * member due to its bitwise type) and kernel-doc (which doesn't understand
304*a4128aadSBjoern A. Zeeb  * the ifdef/else properly) work.
305*a4128aadSBjoern A. Zeeb  */
306*a4128aadSBjoern A. Zeeb #ifdef __CHECKER__
307*a4128aadSBjoern A. Zeeb #define __CHECKER_NUM_IWL_UCODE_TLV_API	128
308*a4128aadSBjoern A. Zeeb 		= (__force iwl_ucode_tlv_api_t)__CHECKER_NUM_IWL_UCODE_TLV_API,
309*a4128aadSBjoern A. Zeeb #define NUM_IWL_UCODE_TLV_API __CHECKER_NUM_IWL_UCODE_TLV_API
310bfcc09ddSBjoern A. Zeeb #endif
311bfcc09ddSBjoern A. Zeeb };
312bfcc09ddSBjoern A. Zeeb 
313bfcc09ddSBjoern A. Zeeb typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
314bfcc09ddSBjoern A. Zeeb 
315bfcc09ddSBjoern A. Zeeb /**
316bfcc09ddSBjoern A. Zeeb  * enum iwl_ucode_tlv_capa - ucode capabilities
317bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_D0I3_SUPPORT: supports D0i3
318bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_LAR_SUPPORT: supports Location Aware Regulatory
319bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_UMAC_SCAN: supports UMAC scan.
320bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_BEAMFORMER: supports Beamformer
321bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_TDLS_SUPPORT: support basic TDLS functionality
322bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT: supports insertion of current
323bfcc09ddSBjoern A. Zeeb  *	tx power value into TPC Report action frame and Link Measurement Report
324bfcc09ddSBjoern A. Zeeb  *	action frame
325bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT: supports updating current
326bfcc09ddSBjoern A. Zeeb  *	channel in DS parameter set element in probe requests.
327bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT: supports adding TPC Report IE in
328bfcc09ddSBjoern A. Zeeb  *	probe requests.
329bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT: supports Quiet Period requests
330bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_DQA_SUPPORT: supports dynamic queue allocation (DQA),
331bfcc09ddSBjoern A. Zeeb  *	which also implies support for the scheduler configuration command
332bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH: supports TDLS channel switching
333bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG: Consolidated D3-D0 image
334bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT: supports Hot Spot Command
335bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_CSUM_SUPPORT: supports TCP Checksum Offload
336bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS: support radio and beacon statistics
337bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_P2P_SCM_UAPSD: supports U-APSD on p2p interface when it
338bfcc09ddSBjoern A. Zeeb  *	is standalone or with a BSS station interface in the same binding.
339bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_BT_COEX_PLCR: enabled BT Coex packet level co-running
340bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC: ucode supports LAR updates with different
341bfcc09ddSBjoern A. Zeeb  *	sources for the MCC. This TLV bit is a future replacement to
342bfcc09ddSBjoern A. Zeeb  *	IWL_UCODE_TLV_API_WIFI_MCC_UPDATE. When either is set, multi-source LAR
343bfcc09ddSBjoern A. Zeeb  *	is supported.
344bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_BT_COEX_RRC: supports BT Coex RRC
345bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT: supports gscan (no longer used)
3469af1bba4SBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_FRAGMENTED_PNVM_IMG: supports fragmented PNVM image
347bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_SOC_LATENCY_SUPPORT: the firmware supports setting
348bfcc09ddSBjoern A. Zeeb  *	stabilization latency for SoCs.
349bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_STA_PM_NOTIF: firmware will send STA PM notification
350bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_TLC_OFFLOAD: firmware implements rate scaling algorithm
351bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA: firmware implements quota related
352bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2: firmware implements Coex Schema 2
353bfcc09ddSBjoern A. Zeeb  * IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD: firmware supports CSA command
354bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS: firmware supports ultra high band
355bfcc09ddSBjoern A. Zeeb  *	(6 GHz).
356bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_CS_MODIFY: firmware supports modify action CSA command
357bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE: extended DTS measurement
358bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS: supports short PM timeouts
359bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_BT_MPLUT_SUPPORT: supports bt-coex Multi-priority LUT
360bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_CSA_AND_TBTT_OFFLOAD: the firmware supports CSA
361bfcc09ddSBjoern A. Zeeb  *	countdown offloading. Beacon notifications are not sent to the host.
362bfcc09ddSBjoern A. Zeeb  *	The fw also offloads TBTT alignment.
363bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_BEACON_ANT_SELECTION: firmware will decide on what
364bfcc09ddSBjoern A. Zeeb  *	antenna the beacon should be transmitted
365bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_BEACON_STORING: firmware will store the latest beacon
366bfcc09ddSBjoern A. Zeeb  *	from AP and will send it upon d0i3 exit.
367bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_LAR_SUPPORT_V3: support LAR API V3
368bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_CT_KILL_BY_FW: firmware responsible for CT-kill
369bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT: supports temperature
370bfcc09ddSBjoern A. Zeeb  *	thresholds reporting
371bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_CTDP_SUPPORT: supports cTDP command
372bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_USNIFFER_UNIFIED: supports usniffer enabled in
373bfcc09ddSBjoern A. Zeeb  *	regular image.
374bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG: support getting more shared
375bfcc09ddSBjoern A. Zeeb  *	memory addresses from the firmware.
376bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_LQM_SUPPORT: supports Link Quality Measurement
377bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_TX_POWER_ACK: reduced TX power API has larger
378bfcc09ddSBjoern A. Zeeb  *	command size (command version 4) that supports toggling ACK TX
379bfcc09ddSBjoern A. Zeeb  *	power reduction.
380bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_D3_DEBUG: supports debug recording during D3
381bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT: MCC response support 11ax
382bfcc09ddSBjoern A. Zeeb  *	capability.
383bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_CSI_REPORTING: firmware is capable of being configured
384bfcc09ddSBjoern A. Zeeb  *	to report the CSI information with (certain) RX frames
385bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_FTM_CALIBRATED: has FTM calibrated and thus supports both
386bfcc09ddSBjoern A. Zeeb  *	initiator and responder
387bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload
388bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_PROTECTED_TWT: Supports protection of TWT action frames
389bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_FW_RESET_HANDSHAKE: Supports the firmware handshake in
390bfcc09ddSBjoern A. Zeeb  *	reset flow
391bfcc09ddSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_PASSIVE_6GHZ_SCAN: Support for passive scan on 6GHz PSC
392bfcc09ddSBjoern A. Zeeb  *      channels even when these are not enabled.
393d9836fb4SBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_DUMP_COMPLETE_SUPPORT: Support for indicating dump collection
394d9836fb4SBjoern A. Zeeb  *	complete to FW.
395*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_SPP_AMSDU_SUPPORT: Support SPP (signaling and payload
396*a4128aadSBjoern A. Zeeb  *	protected) A-MSDU.
397*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT: Support secure LTF measurement.
398*a4128aadSBjoern A. Zeeb  * @IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS: Support monitor mode on otherwise
399*a4128aadSBjoern A. Zeeb  *	passive channels
400bfcc09ddSBjoern A. Zeeb  *
401bfcc09ddSBjoern A. Zeeb  * @NUM_IWL_UCODE_TLV_CAPA: number of bits used
402bfcc09ddSBjoern A. Zeeb  */
403bfcc09ddSBjoern A. Zeeb enum iwl_ucode_tlv_capa {
404bfcc09ddSBjoern A. Zeeb 	/* set 0 */
405bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_D0I3_SUPPORT			= (__force iwl_ucode_tlv_capa_t)0,
406bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_LAR_SUPPORT			= (__force iwl_ucode_tlv_capa_t)1,
407bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_UMAC_SCAN			= (__force iwl_ucode_tlv_capa_t)2,
408bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BEAMFORMER			= (__force iwl_ucode_tlv_capa_t)3,
409bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_TDLS_SUPPORT			= (__force iwl_ucode_tlv_capa_t)6,
410bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT	= (__force iwl_ucode_tlv_capa_t)8,
411bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT	= (__force iwl_ucode_tlv_capa_t)9,
412bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT	= (__force iwl_ucode_tlv_capa_t)10,
413bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT		= (__force iwl_ucode_tlv_capa_t)11,
414bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_DQA_SUPPORT			= (__force iwl_ucode_tlv_capa_t)12,
415bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH		= (__force iwl_ucode_tlv_capa_t)13,
416bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG		= (__force iwl_ucode_tlv_capa_t)17,
417bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT		= (__force iwl_ucode_tlv_capa_t)18,
418bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CSUM_SUPPORT			= (__force iwl_ucode_tlv_capa_t)21,
419bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS		= (__force iwl_ucode_tlv_capa_t)22,
420bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_P2P_SCM_UAPSD		= (__force iwl_ucode_tlv_capa_t)26,
421bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BT_COEX_PLCR			= (__force iwl_ucode_tlv_capa_t)28,
422bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC		= (__force iwl_ucode_tlv_capa_t)29,
423bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BT_COEX_RRC			= (__force iwl_ucode_tlv_capa_t)30,
424bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT		= (__force iwl_ucode_tlv_capa_t)31,
425bfcc09ddSBjoern A. Zeeb 
426bfcc09ddSBjoern A. Zeeb 	/* set 1 */
4279af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_FRAGMENTED_PNVM_IMG		= (__force iwl_ucode_tlv_capa_t)32,
428bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SOC_LATENCY_SUPPORT		= (__force iwl_ucode_tlv_capa_t)37,
429bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_STA_PM_NOTIF			= (__force iwl_ucode_tlv_capa_t)38,
430bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT		= (__force iwl_ucode_tlv_capa_t)39,
431bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CDB_SUPPORT			= (__force iwl_ucode_tlv_capa_t)40,
432bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_D0I3_END_FIRST		= (__force iwl_ucode_tlv_capa_t)41,
433bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_TLC_OFFLOAD                  = (__force iwl_ucode_tlv_capa_t)43,
434bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA                = (__force iwl_ucode_tlv_capa_t)44,
435bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2		= (__force iwl_ucode_tlv_capa_t)45,
436bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD		= (__force iwl_ucode_tlv_capa_t)46,
437bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_FTM_CALIBRATED		= (__force iwl_ucode_tlv_capa_t)47,
438bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS		= (__force iwl_ucode_tlv_capa_t)48,
439bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CS_MODIFY			= (__force iwl_ucode_tlv_capa_t)49,
440bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SET_LTR_GEN2			= (__force iwl_ucode_tlv_capa_t)50,
441bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SET_PPAG			= (__force iwl_ucode_tlv_capa_t)52,
442bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_TAS_CFG			= (__force iwl_ucode_tlv_capa_t)53,
443bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SESSION_PROT_CMD		= (__force iwl_ucode_tlv_capa_t)54,
444bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_PROTECTED_TWT		= (__force iwl_ucode_tlv_capa_t)56,
445bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_FW_RESET_HANDSHAKE		= (__force iwl_ucode_tlv_capa_t)57,
446bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_PASSIVE_6GHZ_SCAN		= (__force iwl_ucode_tlv_capa_t)58,
447bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_HIDDEN_6GHZ_SCAN		= (__force iwl_ucode_tlv_capa_t)59,
448bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BROADCAST_TWT		= (__force iwl_ucode_tlv_capa_t)60,
449bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_COEX_HIGH_PRIO		= (__force iwl_ucode_tlv_capa_t)61,
450bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_RFIM_SUPPORT			= (__force iwl_ucode_tlv_capa_t)62,
451d9836fb4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BAID_ML_SUPPORT		= (__force iwl_ucode_tlv_capa_t)63,
452bfcc09ddSBjoern A. Zeeb 
453bfcc09ddSBjoern A. Zeeb 	/* set 2 */
454bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE		= (__force iwl_ucode_tlv_capa_t)64,
455bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS		= (__force iwl_ucode_tlv_capa_t)65,
456bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BT_MPLUT_SUPPORT		= (__force iwl_ucode_tlv_capa_t)67,
457bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_MULTI_QUEUE_RX_SUPPORT	= (__force iwl_ucode_tlv_capa_t)68,
458bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CSA_AND_TBTT_OFFLOAD		= (__force iwl_ucode_tlv_capa_t)70,
459bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BEACON_ANT_SELECTION		= (__force iwl_ucode_tlv_capa_t)71,
460bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BEACON_STORING		= (__force iwl_ucode_tlv_capa_t)72,
461bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_LAR_SUPPORT_V3		= (__force iwl_ucode_tlv_capa_t)73,
462bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CT_KILL_BY_FW		= (__force iwl_ucode_tlv_capa_t)74,
463bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT	= (__force iwl_ucode_tlv_capa_t)75,
464bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CTDP_SUPPORT			= (__force iwl_ucode_tlv_capa_t)76,
465bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_USNIFFER_UNIFIED		= (__force iwl_ucode_tlv_capa_t)77,
466bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG	= (__force iwl_ucode_tlv_capa_t)80,
467bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_LQM_SUPPORT			= (__force iwl_ucode_tlv_capa_t)81,
468bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_TX_POWER_ACK			= (__force iwl_ucode_tlv_capa_t)84,
469bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_D3_DEBUG			= (__force iwl_ucode_tlv_capa_t)87,
470bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_LED_CMD_SUPPORT		= (__force iwl_ucode_tlv_capa_t)88,
471bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT	= (__force iwl_ucode_tlv_capa_t)89,
472bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CSI_REPORTING		= (__force iwl_ucode_tlv_capa_t)90,
473bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_DBG_SUSPEND_RESUME_CMD_SUPP	= (__force iwl_ucode_tlv_capa_t)92,
474bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_DBG_BUF_ALLOC_CMD_SUPP	= (__force iwl_ucode_tlv_capa_t)93,
475bfcc09ddSBjoern A. Zeeb 
476bfcc09ddSBjoern A. Zeeb 	/* set 3 */
477bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_MLME_OFFLOAD			= (__force iwl_ucode_tlv_capa_t)96,
478bfcc09ddSBjoern A. Zeeb 
479bfcc09ddSBjoern A. Zeeb 	/*
480bfcc09ddSBjoern A. Zeeb 	 * @IWL_UCODE_TLV_CAPA_PSC_CHAN_SUPPORT: supports PSC channels
481bfcc09ddSBjoern A. Zeeb 	 */
482bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_PSC_CHAN_SUPPORT		= (__force iwl_ucode_tlv_capa_t)98,
483bfcc09ddSBjoern A. Zeeb 
484bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BIGTK_SUPPORT		= (__force iwl_ucode_tlv_capa_t)100,
485*a4128aadSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SPP_AMSDU_SUPPORT		= (__force iwl_ucode_tlv_capa_t)103,
486bfcc09ddSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_DRAM_FRAG_SUPPORT		= (__force iwl_ucode_tlv_capa_t)104,
487d9836fb4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_DUMP_COMPLETE_SUPPORT	= (__force iwl_ucode_tlv_capa_t)105,
4889af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SYNCED_TIME			= (__force iwl_ucode_tlv_capa_t)106,
4899af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_TIME_SYNC_BOTH_FTM_TM        = (__force iwl_ucode_tlv_capa_t)108,
4909af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_BIGTK_TX_SUPPORT		= (__force iwl_ucode_tlv_capa_t)109,
4919af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_MLD_API_SUPPORT		= (__force iwl_ucode_tlv_capa_t)110,
4929af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SCAN_DONT_TOGGLE_ANT         = (__force iwl_ucode_tlv_capa_t)111,
4939af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT	= (__force iwl_ucode_tlv_capa_t)112,
4949af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_OFFLOAD_BTM_SUPPORT		= (__force iwl_ucode_tlv_capa_t)113,
4959af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_STA_EXP_MFP_SUPPORT		= (__force iwl_ucode_tlv_capa_t)114,
4969af1bba4SBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SNIFF_VALIDATE_SUPPORT	= (__force iwl_ucode_tlv_capa_t)116,
497*a4128aadSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_CHINA_22_REG_SUPPORT		= (__force iwl_ucode_tlv_capa_t)117,
498*a4128aadSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT		= (__force iwl_ucode_tlv_capa_t)121,
499*a4128aadSBjoern A. Zeeb 	IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS	= (__force iwl_ucode_tlv_capa_t)122,
500bfcc09ddSBjoern A. Zeeb 	NUM_IWL_UCODE_TLV_CAPA
501*a4128aadSBjoern A. Zeeb /*
502*a4128aadSBjoern A. Zeeb  * This construction make both sparse (which cannot increment the previous
503*a4128aadSBjoern A. Zeeb  * member due to its bitwise type) and kernel-doc (which doesn't understand
504*a4128aadSBjoern A. Zeeb  * the ifdef/else properly) work.
505*a4128aadSBjoern A. Zeeb  */
506*a4128aadSBjoern A. Zeeb #ifdef __CHECKER__
507*a4128aadSBjoern A. Zeeb #define __CHECKER_NUM_IWL_UCODE_TLV_CAPA	128
508*a4128aadSBjoern A. Zeeb 		= (__force iwl_ucode_tlv_capa_t)__CHECKER_NUM_IWL_UCODE_TLV_CAPA,
509*a4128aadSBjoern A. Zeeb #define NUM_IWL_UCODE_TLV_CAPA __CHECKER_NUM_IWL_UCODE_TLV_CAPA
510bfcc09ddSBjoern A. Zeeb #endif
511bfcc09ddSBjoern A. Zeeb };
512bfcc09ddSBjoern A. Zeeb 
513bfcc09ddSBjoern A. Zeeb /* The default calibrate table size if not specified by firmware file */
514bfcc09ddSBjoern A. Zeeb #define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE	18
515bfcc09ddSBjoern A. Zeeb #define IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE		19
516bfcc09ddSBjoern A. Zeeb #define IWL_MAX_PHY_CALIBRATE_TBL_SIZE			253
517bfcc09ddSBjoern A. Zeeb 
518bfcc09ddSBjoern A. Zeeb /* The default max probe length if not specified by the firmware file */
519bfcc09ddSBjoern A. Zeeb #define IWL_DEFAULT_MAX_PROBE_LENGTH	200
520bfcc09ddSBjoern A. Zeeb 
521bfcc09ddSBjoern A. Zeeb /*
522bfcc09ddSBjoern A. Zeeb  * For 16.0 uCode and above, there is no differentiation between sections,
523bfcc09ddSBjoern A. Zeeb  * just an offset to the HW address.
524bfcc09ddSBjoern A. Zeeb  */
525bfcc09ddSBjoern A. Zeeb #define CPU1_CPU2_SEPARATOR_SECTION	0xFFFFCCCC
526bfcc09ddSBjoern A. Zeeb #define PAGING_SEPARATOR_SECTION	0xAAAABBBB
527bfcc09ddSBjoern A. Zeeb 
528bfcc09ddSBjoern A. Zeeb /* uCode version contains 4 values: Major/Minor/API/Serial */
529bfcc09ddSBjoern A. Zeeb #define IWL_UCODE_MAJOR(ver)	(((ver) & 0xFF000000) >> 24)
530bfcc09ddSBjoern A. Zeeb #define IWL_UCODE_MINOR(ver)	(((ver) & 0x00FF0000) >> 16)
531bfcc09ddSBjoern A. Zeeb #define IWL_UCODE_API(ver)	(((ver) & 0x0000FF00) >> 8)
532bfcc09ddSBjoern A. Zeeb #define IWL_UCODE_SERIAL(ver)	((ver) & 0x000000FF)
533bfcc09ddSBjoern A. Zeeb 
534bfcc09ddSBjoern A. Zeeb /**
535bfcc09ddSBjoern A. Zeeb  * struct iwl_tlv_calib_ctrl - Calibration control struct.
536bfcc09ddSBjoern A. Zeeb  * Sent as part of the phy configuration command.
537bfcc09ddSBjoern A. Zeeb  * @flow_trigger: bitmap for which calibrations to perform according to
538bfcc09ddSBjoern A. Zeeb  *		flow triggers.
539bfcc09ddSBjoern A. Zeeb  * @event_trigger: bitmap for which calibrations to perform according to
540bfcc09ddSBjoern A. Zeeb  *		event triggers.
541bfcc09ddSBjoern A. Zeeb  */
542bfcc09ddSBjoern A. Zeeb struct iwl_tlv_calib_ctrl {
543bfcc09ddSBjoern A. Zeeb 	__le32 flow_trigger;
544bfcc09ddSBjoern A. Zeeb 	__le32 event_trigger;
545bfcc09ddSBjoern A. Zeeb } __packed;
546bfcc09ddSBjoern A. Zeeb 
547bfcc09ddSBjoern A. Zeeb enum iwl_fw_phy_cfg {
548bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_RADIO_TYPE_POS = 0,
549bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_RADIO_TYPE = 0x3 << FW_PHY_CFG_RADIO_TYPE_POS,
550bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_RADIO_STEP_POS = 2,
551bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_RADIO_STEP = 0x3 << FW_PHY_CFG_RADIO_STEP_POS,
552bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_RADIO_DASH_POS = 4,
553bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_RADIO_DASH = 0x3 << FW_PHY_CFG_RADIO_DASH_POS,
554bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_TX_CHAIN_POS = 16,
555bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_TX_CHAIN = 0xf << FW_PHY_CFG_TX_CHAIN_POS,
556bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_RX_CHAIN_POS = 20,
557bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_RX_CHAIN = 0xf << FW_PHY_CFG_RX_CHAIN_POS,
558bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_CHAIN_SAD_POS = 23,
559bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_CHAIN_SAD_ENABLED = 0x1 << FW_PHY_CFG_CHAIN_SAD_POS,
560bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_CHAIN_SAD_ANT_A = 0x2 << FW_PHY_CFG_CHAIN_SAD_POS,
561bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_CHAIN_SAD_ANT_B = 0x4 << FW_PHY_CFG_CHAIN_SAD_POS,
562bfcc09ddSBjoern A. Zeeb 	FW_PHY_CFG_SHARED_CLK = BIT(31),
563bfcc09ddSBjoern A. Zeeb };
564bfcc09ddSBjoern A. Zeeb 
565bfcc09ddSBjoern A. Zeeb enum iwl_fw_dbg_reg_operator {
566bfcc09ddSBjoern A. Zeeb 	CSR_ASSIGN,
567bfcc09ddSBjoern A. Zeeb 	CSR_SETBIT,
568bfcc09ddSBjoern A. Zeeb 	CSR_CLEARBIT,
569bfcc09ddSBjoern A. Zeeb 
570bfcc09ddSBjoern A. Zeeb 	PRPH_ASSIGN,
571bfcc09ddSBjoern A. Zeeb 	PRPH_SETBIT,
572bfcc09ddSBjoern A. Zeeb 	PRPH_CLEARBIT,
573bfcc09ddSBjoern A. Zeeb 
574bfcc09ddSBjoern A. Zeeb 	INDIRECT_ASSIGN,
575bfcc09ddSBjoern A. Zeeb 	INDIRECT_SETBIT,
576bfcc09ddSBjoern A. Zeeb 	INDIRECT_CLEARBIT,
577bfcc09ddSBjoern A. Zeeb 
578bfcc09ddSBjoern A. Zeeb 	PRPH_BLOCKBIT,
579bfcc09ddSBjoern A. Zeeb };
580bfcc09ddSBjoern A. Zeeb 
581bfcc09ddSBjoern A. Zeeb /**
582bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_reg_op - an operation on a register
583bfcc09ddSBjoern A. Zeeb  *
584bfcc09ddSBjoern A. Zeeb  * @op: &enum iwl_fw_dbg_reg_operator
585*a4128aadSBjoern A. Zeeb  * @reserved: reserved
586bfcc09ddSBjoern A. Zeeb  * @addr: offset of the register
587bfcc09ddSBjoern A. Zeeb  * @val: value
588bfcc09ddSBjoern A. Zeeb  */
589bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_reg_op {
590bfcc09ddSBjoern A. Zeeb 	u8 op;
591bfcc09ddSBjoern A. Zeeb 	u8 reserved[3];
592bfcc09ddSBjoern A. Zeeb 	__le32 addr;
593bfcc09ddSBjoern A. Zeeb 	__le32 val;
594bfcc09ddSBjoern A. Zeeb } __packed;
595bfcc09ddSBjoern A. Zeeb 
596bfcc09ddSBjoern A. Zeeb /**
597bfcc09ddSBjoern A. Zeeb  * enum iwl_fw_dbg_monitor_mode - available monitor recording modes
598bfcc09ddSBjoern A. Zeeb  *
599bfcc09ddSBjoern A. Zeeb  * @SMEM_MODE: monitor stores the data in SMEM
600bfcc09ddSBjoern A. Zeeb  * @EXTERNAL_MODE: monitor stores the data in allocated DRAM
601bfcc09ddSBjoern A. Zeeb  * @MARBH_MODE: monitor stores the data in MARBH buffer
602bfcc09ddSBjoern A. Zeeb  * @MIPI_MODE: monitor outputs the data through the MIPI interface
603bfcc09ddSBjoern A. Zeeb  */
604bfcc09ddSBjoern A. Zeeb enum iwl_fw_dbg_monitor_mode {
605bfcc09ddSBjoern A. Zeeb 	SMEM_MODE = 0,
606bfcc09ddSBjoern A. Zeeb 	EXTERNAL_MODE = 1,
607bfcc09ddSBjoern A. Zeeb 	MARBH_MODE = 2,
608bfcc09ddSBjoern A. Zeeb 	MIPI_MODE = 3,
609bfcc09ddSBjoern A. Zeeb };
610bfcc09ddSBjoern A. Zeeb 
611bfcc09ddSBjoern A. Zeeb /**
612bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_mem_seg_tlv - configures the debug data memory segments
613bfcc09ddSBjoern A. Zeeb  *
614bfcc09ddSBjoern A. Zeeb  * @data_type: the memory segment type to record
615bfcc09ddSBjoern A. Zeeb  * @ofs: the memory segment offset
616bfcc09ddSBjoern A. Zeeb  * @len: the memory segment length, in bytes
617bfcc09ddSBjoern A. Zeeb  *
618bfcc09ddSBjoern A. Zeeb  * This parses IWL_UCODE_TLV_FW_MEM_SEG
619bfcc09ddSBjoern A. Zeeb  */
620bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_mem_seg_tlv {
621bfcc09ddSBjoern A. Zeeb 	__le32 data_type;
622bfcc09ddSBjoern A. Zeeb 	__le32 ofs;
623bfcc09ddSBjoern A. Zeeb 	__le32 len;
624bfcc09ddSBjoern A. Zeeb } __packed;
625bfcc09ddSBjoern A. Zeeb 
626bfcc09ddSBjoern A. Zeeb /**
627bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_dest_tlv_v1 - configures the destination of the debug data
628bfcc09ddSBjoern A. Zeeb  *
629bfcc09ddSBjoern A. Zeeb  * @version: version of the TLV - currently 0
630bfcc09ddSBjoern A. Zeeb  * @monitor_mode: &enum iwl_fw_dbg_monitor_mode
631bfcc09ddSBjoern A. Zeeb  * @size_power: buffer size will be 2^(size_power + 11)
632*a4128aadSBjoern A. Zeeb  * @reserved: reserved
633bfcc09ddSBjoern A. Zeeb  * @base_reg: addr of the base addr register (PRPH)
634bfcc09ddSBjoern A. Zeeb  * @end_reg:  addr of the end addr register (PRPH)
635bfcc09ddSBjoern A. Zeeb  * @write_ptr_reg: the addr of the reg of the write pointer
636bfcc09ddSBjoern A. Zeeb  * @wrap_count: the addr of the reg of the wrap_count
637bfcc09ddSBjoern A. Zeeb  * @base_shift: shift right of the base addr reg
638bfcc09ddSBjoern A. Zeeb  * @end_shift: shift right of the end addr reg
639bfcc09ddSBjoern A. Zeeb  * @reg_ops: array of registers operations
640bfcc09ddSBjoern A. Zeeb  *
641bfcc09ddSBjoern A. Zeeb  * This parses IWL_UCODE_TLV_FW_DBG_DEST
642bfcc09ddSBjoern A. Zeeb  */
643bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_dest_tlv_v1 {
644bfcc09ddSBjoern A. Zeeb 	u8 version;
645bfcc09ddSBjoern A. Zeeb 	u8 monitor_mode;
646bfcc09ddSBjoern A. Zeeb 	u8 size_power;
647bfcc09ddSBjoern A. Zeeb 	u8 reserved;
648bfcc09ddSBjoern A. Zeeb 	__le32 base_reg;
649bfcc09ddSBjoern A. Zeeb 	__le32 end_reg;
650bfcc09ddSBjoern A. Zeeb 	__le32 write_ptr_reg;
651bfcc09ddSBjoern A. Zeeb 	__le32 wrap_count;
652bfcc09ddSBjoern A. Zeeb 	u8 base_shift;
653bfcc09ddSBjoern A. Zeeb 	u8 end_shift;
6549af1bba4SBjoern A. Zeeb 	struct iwl_fw_dbg_reg_op reg_ops[];
655bfcc09ddSBjoern A. Zeeb } __packed;
656bfcc09ddSBjoern A. Zeeb 
657bfcc09ddSBjoern A. Zeeb /* Mask of the register for defining the LDBG MAC2SMEM buffer SMEM size */
658bfcc09ddSBjoern A. Zeeb #define IWL_LDBG_M2S_BUF_SIZE_MSK	0x0fff0000
659bfcc09ddSBjoern A. Zeeb /* Mask of the register for defining the LDBG MAC2SMEM SMEM base address */
660bfcc09ddSBjoern A. Zeeb #define IWL_LDBG_M2S_BUF_BA_MSK		0x00000fff
661bfcc09ddSBjoern A. Zeeb /* The smem buffer chunks are in units of 256 bits */
662bfcc09ddSBjoern A. Zeeb #define IWL_M2S_UNIT_SIZE			0x100
663bfcc09ddSBjoern A. Zeeb 
664bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_dest_tlv {
665bfcc09ddSBjoern A. Zeeb 	u8 version;
666bfcc09ddSBjoern A. Zeeb 	u8 monitor_mode;
667bfcc09ddSBjoern A. Zeeb 	u8 size_power;
668bfcc09ddSBjoern A. Zeeb 	u8 reserved;
669bfcc09ddSBjoern A. Zeeb 	__le32 cfg_reg;
670bfcc09ddSBjoern A. Zeeb 	__le32 write_ptr_reg;
671bfcc09ddSBjoern A. Zeeb 	__le32 wrap_count;
672bfcc09ddSBjoern A. Zeeb 	u8 base_shift;
673bfcc09ddSBjoern A. Zeeb 	u8 size_shift;
6749af1bba4SBjoern A. Zeeb 	struct iwl_fw_dbg_reg_op reg_ops[];
675bfcc09ddSBjoern A. Zeeb } __packed;
676bfcc09ddSBjoern A. Zeeb 
677bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_conf_hcmd {
678bfcc09ddSBjoern A. Zeeb 	u8 id;
679bfcc09ddSBjoern A. Zeeb 	u8 reserved;
680bfcc09ddSBjoern A. Zeeb 	__le16 len;
6819af1bba4SBjoern A. Zeeb 	u8 data[];
682bfcc09ddSBjoern A. Zeeb } __packed;
683bfcc09ddSBjoern A. Zeeb 
684bfcc09ddSBjoern A. Zeeb /**
685bfcc09ddSBjoern A. Zeeb  * enum iwl_fw_dbg_trigger_mode - triggers functionalities
686bfcc09ddSBjoern A. Zeeb  *
687bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_TRIGGER_START: when trigger occurs re-conf the dbg mechanism
688bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_TRIGGER_STOP: when trigger occurs pull the dbg data
689bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_TRIGGER_MONITOR_ONLY: when trigger occurs trigger is set to
690bfcc09ddSBjoern A. Zeeb  *	collect only monitor data
691bfcc09ddSBjoern A. Zeeb  */
692bfcc09ddSBjoern A. Zeeb enum iwl_fw_dbg_trigger_mode {
693bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_TRIGGER_START = BIT(0),
694bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_TRIGGER_STOP = BIT(1),
695bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_TRIGGER_MONITOR_ONLY = BIT(2),
696bfcc09ddSBjoern A. Zeeb };
697bfcc09ddSBjoern A. Zeeb 
698bfcc09ddSBjoern A. Zeeb /**
699bfcc09ddSBjoern A. Zeeb  * enum iwl_fw_dbg_trigger_flags - the flags supported by wrt triggers
700bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_FORCE_RESTART: force a firmware restart
701bfcc09ddSBjoern A. Zeeb  */
702bfcc09ddSBjoern A. Zeeb enum iwl_fw_dbg_trigger_flags {
703bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_FORCE_RESTART = BIT(0),
704bfcc09ddSBjoern A. Zeeb };
705bfcc09ddSBjoern A. Zeeb 
706bfcc09ddSBjoern A. Zeeb /**
707bfcc09ddSBjoern A. Zeeb  * enum iwl_fw_dbg_trigger_vif_type - define the VIF type for a trigger
708bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_CONF_VIF_ANY: any vif type
709bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_CONF_VIF_IBSS: IBSS mode
710bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_CONF_VIF_STATION: BSS mode
711bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_CONF_VIF_AP: AP mode
712bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_CONF_VIF_P2P_CLIENT: P2P Client mode
713bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_CONF_VIF_P2P_GO: P2P GO mode
714bfcc09ddSBjoern A. Zeeb  * @IWL_FW_DBG_CONF_VIF_P2P_DEVICE: P2P device
715bfcc09ddSBjoern A. Zeeb  */
716bfcc09ddSBjoern A. Zeeb enum iwl_fw_dbg_trigger_vif_type {
717bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_CONF_VIF_ANY = NL80211_IFTYPE_UNSPECIFIED,
718bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_CONF_VIF_IBSS = NL80211_IFTYPE_ADHOC,
719bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_CONF_VIF_STATION = NL80211_IFTYPE_STATION,
720bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_CONF_VIF_AP = NL80211_IFTYPE_AP,
721bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_CONF_VIF_P2P_CLIENT = NL80211_IFTYPE_P2P_CLIENT,
722bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_CONF_VIF_P2P_GO = NL80211_IFTYPE_P2P_GO,
723bfcc09ddSBjoern A. Zeeb 	IWL_FW_DBG_CONF_VIF_P2P_DEVICE = NL80211_IFTYPE_P2P_DEVICE,
724bfcc09ddSBjoern A. Zeeb };
725bfcc09ddSBjoern A. Zeeb 
726bfcc09ddSBjoern A. Zeeb /**
727bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_tlv - a TLV that describes the trigger
728bfcc09ddSBjoern A. Zeeb  * @id: &enum iwl_fw_dbg_trigger
729bfcc09ddSBjoern A. Zeeb  * @vif_type: &enum iwl_fw_dbg_trigger_vif_type
730bfcc09ddSBjoern A. Zeeb  * @stop_conf_ids: bitmap of configurations this trigger relates to.
731bfcc09ddSBjoern A. Zeeb  *	if the mode is %IWL_FW_DBG_TRIGGER_STOP, then if the bit corresponding
732bfcc09ddSBjoern A. Zeeb  *	to the currently running configuration is set, the data should be
733bfcc09ddSBjoern A. Zeeb  *	collected.
734bfcc09ddSBjoern A. Zeeb  * @stop_delay: how many milliseconds to wait before collecting the data
735bfcc09ddSBjoern A. Zeeb  *	after the STOP trigger fires.
736bfcc09ddSBjoern A. Zeeb  * @mode: &enum iwl_fw_dbg_trigger_mode - can be stop / start of both
737bfcc09ddSBjoern A. Zeeb  * @start_conf_id: if mode is %IWL_FW_DBG_TRIGGER_START, this defines what
738bfcc09ddSBjoern A. Zeeb  *	configuration should be applied when the triggers kicks in.
739bfcc09ddSBjoern A. Zeeb  * @occurrences: number of occurrences. 0 means the trigger will never fire.
740bfcc09ddSBjoern A. Zeeb  * @trig_dis_ms: the time, in milliseconds, after an occurrence of this
741bfcc09ddSBjoern A. Zeeb  *	trigger in which another occurrence should be ignored.
742bfcc09ddSBjoern A. Zeeb  * @flags: &enum iwl_fw_dbg_trigger_flags
743*a4128aadSBjoern A. Zeeb  * @reserved: reserved (for alignment)
744*a4128aadSBjoern A. Zeeb  * @data: trigger data
745bfcc09ddSBjoern A. Zeeb  */
746bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_tlv {
747bfcc09ddSBjoern A. Zeeb 	__le32 id;
748bfcc09ddSBjoern A. Zeeb 	__le32 vif_type;
749bfcc09ddSBjoern A. Zeeb 	__le32 stop_conf_ids;
750bfcc09ddSBjoern A. Zeeb 	__le32 stop_delay;
751bfcc09ddSBjoern A. Zeeb 	u8 mode;
752bfcc09ddSBjoern A. Zeeb 	u8 start_conf_id;
753bfcc09ddSBjoern A. Zeeb 	__le16 occurrences;
754bfcc09ddSBjoern A. Zeeb 	__le16 trig_dis_ms;
755bfcc09ddSBjoern A. Zeeb 	u8 flags;
756bfcc09ddSBjoern A. Zeeb 	u8 reserved[5];
757bfcc09ddSBjoern A. Zeeb 
7589af1bba4SBjoern A. Zeeb 	u8 data[];
759bfcc09ddSBjoern A. Zeeb } __packed;
760bfcc09ddSBjoern A. Zeeb 
761bfcc09ddSBjoern A. Zeeb #define FW_DBG_START_FROM_ALIVE	0
762bfcc09ddSBjoern A. Zeeb #define FW_DBG_CONF_MAX		32
763bfcc09ddSBjoern A. Zeeb #define FW_DBG_INVALID		0xff
764bfcc09ddSBjoern A. Zeeb 
765bfcc09ddSBjoern A. Zeeb /**
766bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_missed_bcon - configures trigger for missed beacons
767bfcc09ddSBjoern A. Zeeb  * @stop_consec_missed_bcon: stop recording if threshold is crossed.
768bfcc09ddSBjoern A. Zeeb  * @stop_consec_missed_bcon_since_rx: stop recording if threshold is crossed.
769bfcc09ddSBjoern A. Zeeb  * @start_consec_missed_bcon: start recording if threshold is crossed.
770bfcc09ddSBjoern A. Zeeb  * @start_consec_missed_bcon_since_rx: start recording if threshold is crossed.
771bfcc09ddSBjoern A. Zeeb  * @reserved1: reserved
772bfcc09ddSBjoern A. Zeeb  * @reserved2: reserved
773bfcc09ddSBjoern A. Zeeb  */
774bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_missed_bcon {
775bfcc09ddSBjoern A. Zeeb 	__le32 stop_consec_missed_bcon;
776bfcc09ddSBjoern A. Zeeb 	__le32 stop_consec_missed_bcon_since_rx;
777bfcc09ddSBjoern A. Zeeb 	__le32 reserved2[2];
778bfcc09ddSBjoern A. Zeeb 	__le32 start_consec_missed_bcon;
779bfcc09ddSBjoern A. Zeeb 	__le32 start_consec_missed_bcon_since_rx;
780bfcc09ddSBjoern A. Zeeb 	__le32 reserved1[2];
781bfcc09ddSBjoern A. Zeeb } __packed;
782bfcc09ddSBjoern A. Zeeb 
783bfcc09ddSBjoern A. Zeeb /**
784bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_cmd - configures trigger for messages from FW.
785*a4128aadSBjoern A. Zeeb  * @cmds: the list of commands to trigger the collection on
786bfcc09ddSBjoern A. Zeeb  */
787bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_cmd {
788bfcc09ddSBjoern A. Zeeb 	struct cmd {
789bfcc09ddSBjoern A. Zeeb 		u8 cmd_id;
790bfcc09ddSBjoern A. Zeeb 		u8 group_id;
791bfcc09ddSBjoern A. Zeeb 	} __packed cmds[16];
792bfcc09ddSBjoern A. Zeeb } __packed;
793bfcc09ddSBjoern A. Zeeb 
794bfcc09ddSBjoern A. Zeeb /**
795*a4128aadSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_stats - configures trigger for statistics
796bfcc09ddSBjoern A. Zeeb  * @stop_offset: the offset of the value to be monitored
797bfcc09ddSBjoern A. Zeeb  * @stop_threshold: the threshold above which to collect
798bfcc09ddSBjoern A. Zeeb  * @start_offset: the offset of the value to be monitored
799bfcc09ddSBjoern A. Zeeb  * @start_threshold: the threshold above which to start recording
800bfcc09ddSBjoern A. Zeeb  */
801bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_stats {
802bfcc09ddSBjoern A. Zeeb 	__le32 stop_offset;
803bfcc09ddSBjoern A. Zeeb 	__le32 stop_threshold;
804bfcc09ddSBjoern A. Zeeb 	__le32 start_offset;
805bfcc09ddSBjoern A. Zeeb 	__le32 start_threshold;
806bfcc09ddSBjoern A. Zeeb } __packed;
807bfcc09ddSBjoern A. Zeeb 
808bfcc09ddSBjoern A. Zeeb /**
809bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_low_rssi - trigger for low beacon RSSI
810bfcc09ddSBjoern A. Zeeb  * @rssi: RSSI value to trigger at
811bfcc09ddSBjoern A. Zeeb  */
812bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_low_rssi {
813bfcc09ddSBjoern A. Zeeb 	__le32 rssi;
814bfcc09ddSBjoern A. Zeeb } __packed;
815bfcc09ddSBjoern A. Zeeb 
816bfcc09ddSBjoern A. Zeeb /**
817bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_mlme - configures trigger for mlme events
818bfcc09ddSBjoern A. Zeeb  * @stop_auth_denied: number of denied authentication to collect
819bfcc09ddSBjoern A. Zeeb  * @stop_auth_timeout: number of authentication timeout to collect
820bfcc09ddSBjoern A. Zeeb  * @stop_rx_deauth: number of Rx deauth before to collect
821bfcc09ddSBjoern A. Zeeb  * @stop_tx_deauth: number of Tx deauth before to collect
822bfcc09ddSBjoern A. Zeeb  * @stop_assoc_denied: number of denied association to collect
823bfcc09ddSBjoern A. Zeeb  * @stop_assoc_timeout: number of association timeout to collect
824bfcc09ddSBjoern A. Zeeb  * @stop_connection_loss: number of connection loss to collect
825bfcc09ddSBjoern A. Zeeb  * @start_auth_denied: number of denied authentication to start recording
826bfcc09ddSBjoern A. Zeeb  * @start_auth_timeout: number of authentication timeout to start recording
827bfcc09ddSBjoern A. Zeeb  * @start_rx_deauth: number of Rx deauth to start recording
828bfcc09ddSBjoern A. Zeeb  * @start_tx_deauth: number of Tx deauth to start recording
829bfcc09ddSBjoern A. Zeeb  * @start_assoc_denied: number of denied association to start recording
830bfcc09ddSBjoern A. Zeeb  * @start_assoc_timeout: number of association timeout to start recording
831bfcc09ddSBjoern A. Zeeb  * @start_connection_loss: number of connection loss to start recording
832bfcc09ddSBjoern A. Zeeb  */
833bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_mlme {
834bfcc09ddSBjoern A. Zeeb 	u8 stop_auth_denied;
835bfcc09ddSBjoern A. Zeeb 	u8 stop_auth_timeout;
836bfcc09ddSBjoern A. Zeeb 	u8 stop_rx_deauth;
837bfcc09ddSBjoern A. Zeeb 	u8 stop_tx_deauth;
838bfcc09ddSBjoern A. Zeeb 
839bfcc09ddSBjoern A. Zeeb 	u8 stop_assoc_denied;
840bfcc09ddSBjoern A. Zeeb 	u8 stop_assoc_timeout;
841bfcc09ddSBjoern A. Zeeb 	u8 stop_connection_loss;
842bfcc09ddSBjoern A. Zeeb 	u8 reserved;
843bfcc09ddSBjoern A. Zeeb 
844bfcc09ddSBjoern A. Zeeb 	u8 start_auth_denied;
845bfcc09ddSBjoern A. Zeeb 	u8 start_auth_timeout;
846bfcc09ddSBjoern A. Zeeb 	u8 start_rx_deauth;
847bfcc09ddSBjoern A. Zeeb 	u8 start_tx_deauth;
848bfcc09ddSBjoern A. Zeeb 
849bfcc09ddSBjoern A. Zeeb 	u8 start_assoc_denied;
850bfcc09ddSBjoern A. Zeeb 	u8 start_assoc_timeout;
851bfcc09ddSBjoern A. Zeeb 	u8 start_connection_loss;
852bfcc09ddSBjoern A. Zeeb 	u8 reserved2;
853bfcc09ddSBjoern A. Zeeb } __packed;
854bfcc09ddSBjoern A. Zeeb 
855bfcc09ddSBjoern A. Zeeb /**
856bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_txq_timer - configures the Tx queue's timer
857bfcc09ddSBjoern A. Zeeb  * @command_queue: timeout for the command queue in ms
858bfcc09ddSBjoern A. Zeeb  * @bss: timeout for the queues of a BSS (except for TDLS queues) in ms
859bfcc09ddSBjoern A. Zeeb  * @softap: timeout for the queues of a softAP in ms
860bfcc09ddSBjoern A. Zeeb  * @p2p_go: timeout for the queues of a P2P GO in ms
861bfcc09ddSBjoern A. Zeeb  * @p2p_client: timeout for the queues of a P2P client in ms
862bfcc09ddSBjoern A. Zeeb  * @p2p_device: timeout for the queues of a P2P device in ms
863bfcc09ddSBjoern A. Zeeb  * @ibss: timeout for the queues of an IBSS in ms
864bfcc09ddSBjoern A. Zeeb  * @tdls: timeout for the queues of a TDLS station in ms
865bfcc09ddSBjoern A. Zeeb  */
866bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_txq_timer {
867bfcc09ddSBjoern A. Zeeb 	__le32 command_queue;
868bfcc09ddSBjoern A. Zeeb 	__le32 bss;
869bfcc09ddSBjoern A. Zeeb 	__le32 softap;
870bfcc09ddSBjoern A. Zeeb 	__le32 p2p_go;
871bfcc09ddSBjoern A. Zeeb 	__le32 p2p_client;
872bfcc09ddSBjoern A. Zeeb 	__le32 p2p_device;
873bfcc09ddSBjoern A. Zeeb 	__le32 ibss;
874bfcc09ddSBjoern A. Zeeb 	__le32 tdls;
875bfcc09ddSBjoern A. Zeeb 	__le32 reserved[4];
876bfcc09ddSBjoern A. Zeeb } __packed;
877bfcc09ddSBjoern A. Zeeb 
878bfcc09ddSBjoern A. Zeeb /**
879bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_time_event - configures a time event trigger
880bfcc09ddSBjoern A. Zeeb  * time_Events: a list of tuples <id, action_bitmap>. The driver will issue a
881bfcc09ddSBjoern A. Zeeb  *	trigger each time a time event notification that relates to time event
882bfcc09ddSBjoern A. Zeeb  *	id with one of the actions in the bitmap is received and
883bfcc09ddSBjoern A. Zeeb  *	BIT(notif->status) is set in status_bitmap.
884bfcc09ddSBjoern A. Zeeb  *
885bfcc09ddSBjoern A. Zeeb  */
886bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_time_event {
887bfcc09ddSBjoern A. Zeeb 	struct {
888bfcc09ddSBjoern A. Zeeb 		__le32 id;
889bfcc09ddSBjoern A. Zeeb 		__le32 action_bitmap;
890bfcc09ddSBjoern A. Zeeb 		__le32 status_bitmap;
891bfcc09ddSBjoern A. Zeeb 	} __packed time_events[16];
892bfcc09ddSBjoern A. Zeeb } __packed;
893bfcc09ddSBjoern A. Zeeb 
894bfcc09ddSBjoern A. Zeeb /**
895bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_ba - configures BlockAck related trigger
896bfcc09ddSBjoern A. Zeeb  * rx_ba_start: tid bitmap to configure on what tid the trigger should occur
897bfcc09ddSBjoern A. Zeeb  *	when an Rx BlockAck session is started.
898bfcc09ddSBjoern A. Zeeb  * rx_ba_stop: tid bitmap to configure on what tid the trigger should occur
899bfcc09ddSBjoern A. Zeeb  *	when an Rx BlockAck session is stopped.
900bfcc09ddSBjoern A. Zeeb  * tx_ba_start: tid bitmap to configure on what tid the trigger should occur
901bfcc09ddSBjoern A. Zeeb  *	when a Tx BlockAck session is started.
902bfcc09ddSBjoern A. Zeeb  * tx_ba_stop: tid bitmap to configure on what tid the trigger should occur
903bfcc09ddSBjoern A. Zeeb  *	when a Tx BlockAck session is stopped.
904bfcc09ddSBjoern A. Zeeb  * rx_bar: tid bitmap to configure on what tid the trigger should occur
905bfcc09ddSBjoern A. Zeeb  *	when a BAR is received (for a Tx BlockAck session).
906bfcc09ddSBjoern A. Zeeb  * tx_bar: tid bitmap to configure on what tid the trigger should occur
907bfcc09ddSBjoern A. Zeeb  *	when a BAR is send (for an Rx BlocAck session).
908bfcc09ddSBjoern A. Zeeb  * frame_timeout: tid bitmap to configure on what tid the trigger should occur
909bfcc09ddSBjoern A. Zeeb  *	when a frame times out in the reordering buffer.
910bfcc09ddSBjoern A. Zeeb  */
911bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_ba {
912bfcc09ddSBjoern A. Zeeb 	__le16 rx_ba_start;
913bfcc09ddSBjoern A. Zeeb 	__le16 rx_ba_stop;
914bfcc09ddSBjoern A. Zeeb 	__le16 tx_ba_start;
915bfcc09ddSBjoern A. Zeeb 	__le16 tx_ba_stop;
916bfcc09ddSBjoern A. Zeeb 	__le16 rx_bar;
917bfcc09ddSBjoern A. Zeeb 	__le16 tx_bar;
918bfcc09ddSBjoern A. Zeeb 	__le16 frame_timeout;
919bfcc09ddSBjoern A. Zeeb } __packed;
920bfcc09ddSBjoern A. Zeeb 
921bfcc09ddSBjoern A. Zeeb /**
922bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_tdls - configures trigger for TDLS events.
923bfcc09ddSBjoern A. Zeeb  * @action_bitmap: the TDLS action to trigger the collection upon
924bfcc09ddSBjoern A. Zeeb  * @peer_mode: trigger on specific peer or all
925bfcc09ddSBjoern A. Zeeb  * @peer: the TDLS peer to trigger the collection on
926bfcc09ddSBjoern A. Zeeb  */
927bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_tdls {
928bfcc09ddSBjoern A. Zeeb 	u8 action_bitmap;
929bfcc09ddSBjoern A. Zeeb 	u8 peer_mode;
930bfcc09ddSBjoern A. Zeeb 	u8 peer[ETH_ALEN];
931bfcc09ddSBjoern A. Zeeb 	u8 reserved[4];
932bfcc09ddSBjoern A. Zeeb } __packed;
933bfcc09ddSBjoern A. Zeeb 
934bfcc09ddSBjoern A. Zeeb /**
935bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_trigger_tx_status - configures trigger for tx response
936bfcc09ddSBjoern A. Zeeb  *  status.
937bfcc09ddSBjoern A. Zeeb  * @statuses: the list of statuses to trigger the collection on
938bfcc09ddSBjoern A. Zeeb  */
939bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_trigger_tx_status {
940bfcc09ddSBjoern A. Zeeb 	struct tx_status {
941bfcc09ddSBjoern A. Zeeb 		u8 status;
942bfcc09ddSBjoern A. Zeeb 		u8 reserved[3];
943bfcc09ddSBjoern A. Zeeb 	} __packed statuses[16];
944bfcc09ddSBjoern A. Zeeb 	__le32 reserved[2];
945bfcc09ddSBjoern A. Zeeb } __packed;
946bfcc09ddSBjoern A. Zeeb 
947bfcc09ddSBjoern A. Zeeb /**
948bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_dbg_conf_tlv - a TLV that describes a debug configuration.
949bfcc09ddSBjoern A. Zeeb  * @id: conf id
950bfcc09ddSBjoern A. Zeeb  * @usniffer: should the uSniffer image be used
951bfcc09ddSBjoern A. Zeeb  * @num_of_hcmds: how many HCMDs to send are present here
952bfcc09ddSBjoern A. Zeeb  * @hcmd: a variable length host command to be sent to apply the configuration.
953bfcc09ddSBjoern A. Zeeb  *	If there is more than one HCMD to send, they will appear one after the
954bfcc09ddSBjoern A. Zeeb  *	other and be sent in the order that they appear in.
955bfcc09ddSBjoern A. Zeeb  * This parses IWL_UCODE_TLV_FW_DBG_CONF. The user can add up-to
956bfcc09ddSBjoern A. Zeeb  * %FW_DBG_CONF_MAX configuration per run.
957bfcc09ddSBjoern A. Zeeb  */
958bfcc09ddSBjoern A. Zeeb struct iwl_fw_dbg_conf_tlv {
959bfcc09ddSBjoern A. Zeeb 	u8 id;
960bfcc09ddSBjoern A. Zeeb 	u8 usniffer;
961bfcc09ddSBjoern A. Zeeb 	u8 reserved;
962bfcc09ddSBjoern A. Zeeb 	u8 num_of_hcmds;
963bfcc09ddSBjoern A. Zeeb 	struct iwl_fw_dbg_conf_hcmd hcmd;
964bfcc09ddSBjoern A. Zeeb } __packed;
965bfcc09ddSBjoern A. Zeeb 
966bfcc09ddSBjoern A. Zeeb #define IWL_FW_CMD_VER_UNKNOWN 99
967bfcc09ddSBjoern A. Zeeb 
968bfcc09ddSBjoern A. Zeeb /**
969bfcc09ddSBjoern A. Zeeb  * struct iwl_fw_cmd_version - firmware command version entry
970bfcc09ddSBjoern A. Zeeb  * @cmd: command ID
971bfcc09ddSBjoern A. Zeeb  * @group: group ID
972bfcc09ddSBjoern A. Zeeb  * @cmd_ver: command version
973bfcc09ddSBjoern A. Zeeb  * @notif_ver: notification version
974bfcc09ddSBjoern A. Zeeb  */
975bfcc09ddSBjoern A. Zeeb struct iwl_fw_cmd_version {
976bfcc09ddSBjoern A. Zeeb 	u8 cmd;
977bfcc09ddSBjoern A. Zeeb 	u8 group;
978bfcc09ddSBjoern A. Zeeb 	u8 cmd_ver;
979bfcc09ddSBjoern A. Zeeb 	u8 notif_ver;
980bfcc09ddSBjoern A. Zeeb } __packed;
981bfcc09ddSBjoern A. Zeeb 
982bfcc09ddSBjoern A. Zeeb struct iwl_fw_tcm_error_addr {
983bfcc09ddSBjoern A. Zeeb 	__le32 addr;
984bfcc09ddSBjoern A. Zeeb }; /* FW_TLV_TCM_ERROR_INFO_ADDRS_S */
985bfcc09ddSBjoern A. Zeeb 
986bfcc09ddSBjoern A. Zeeb struct iwl_fw_dump_exclude {
987bfcc09ddSBjoern A. Zeeb 	__le32 addr, size;
988bfcc09ddSBjoern A. Zeeb };
989bfcc09ddSBjoern A. Zeeb 
990bfcc09ddSBjoern A. Zeeb static inline size_t _iwl_tlv_array_len(const struct iwl_ucode_tlv *tlv,
991bfcc09ddSBjoern A. Zeeb 					size_t fixed_size, size_t var_size)
992bfcc09ddSBjoern A. Zeeb {
993bfcc09ddSBjoern A. Zeeb 	size_t var_len = le32_to_cpu(tlv->length) - fixed_size;
994bfcc09ddSBjoern A. Zeeb 
995bfcc09ddSBjoern A. Zeeb 	if (WARN_ON(var_len % var_size))
996bfcc09ddSBjoern A. Zeeb 		return 0;
997bfcc09ddSBjoern A. Zeeb 
998bfcc09ddSBjoern A. Zeeb 	return var_len / var_size;
999bfcc09ddSBjoern A. Zeeb }
1000bfcc09ddSBjoern A. Zeeb 
1001bfcc09ddSBjoern A. Zeeb #define iwl_tlv_array_len(_tlv_ptr, _struct_ptr, _memb)			\
1002bfcc09ddSBjoern A. Zeeb 	_iwl_tlv_array_len((_tlv_ptr), sizeof(*(_struct_ptr)),		\
1003bfcc09ddSBjoern A. Zeeb 			   sizeof(_struct_ptr->_memb[0]))
1004bfcc09ddSBjoern A. Zeeb 
1005*a4128aadSBjoern A. Zeeb #define iwl_tlv_array_len_with_size(_tlv_ptr, _struct_ptr, _size)	\
1006*a4128aadSBjoern A. Zeeb 	_iwl_tlv_array_len((_tlv_ptr), sizeof(*(_struct_ptr)), _size)
1007bfcc09ddSBjoern A. Zeeb #endif  /* __iwl_fw_file_h__ */
1008