1 /******************************************************************************
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.
8 * Copyright (C) 2018 Intel Corporation
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * The full GNU General Public License is included in this distribution
20 * in the file called COPYING.
22 * Contact Information:
23 * Intel Linux Wireless <linuxwifi@intel.com>
24 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
28 * Copyright (C) 2018 Intel Corporation
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
35 * * Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * * Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in
39 * the documentation and/or other materials provided with the
41 * * Neither the name Intel Corporation nor the names of its
42 * contributors may be used to endorse or promote products derived
43 * from this software without specific prior written permission.
45 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
46 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
47 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
48 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
49 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
52 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
53 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
55 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 *****************************************************************************/
58 #ifndef __iwl_fw_dbg_tlv_h__
59 #define __iwl_fw_dbg_tlv_h__
61 #include <linux/bitops.h>
64 * struct iwl_fw_ini_header: Common Header for all debug group TLV's structures
65 * @tlv_version: version info
66 * @apply_point: &enum iwl_fw_ini_apply_point
67 * @data: TLV data followed
69 struct iwl_fw_ini_header {
73 } __packed; /* FW_INI_HEADER_TLV_S */
76 * struct iwl_fw_ini_allocation_tlv - (IWL_FW_INI_TLV_TYPE_BUFFER_ALLOCATION)
77 * buffer allocation TLV - for debug
79 * @iwl_fw_ini_header: header
80 * @allocation_id: &enum iwl_fw_ini_allocation_id - to bind allocation and hcmd
81 * if needed (DBGC1/DBGC2/SDFX/...)
82 * @buffer_location: type of iwl_fw_ini_buffer_location
83 * @size: size in bytes
84 * @max_fragments: the maximum allowed fragmentation in the desired memory
86 * @min_frag_size: the minimum allowed fragmentation size in bytes
88 struct iwl_fw_ini_allocation_tlv {
89 struct iwl_fw_ini_header header;
91 __le32 buffer_location;
95 } __packed; /* FW_INI_BUFFER_ALLOCATION_TLV_S_VER_1 */
98 * struct iwl_fw_ini_hcmd (IWL_FW_INI_TLV_TYPE_HCMD)
99 * Generic Host command pass through TLV
101 * @id: the debug configuration command type for instance: 0xf6 / 0xf5 / DHC
102 * @group: the desired cmd group
103 * @padding: all zeros for dword alignment
104 * @data: all of the relevant command (0xf6/0xf5) to be sent
106 struct iwl_fw_ini_hcmd {
111 } __packed; /* FW_INI_HCMD_S */
114 * struct iwl_fw_ini_hcmd_tlv
116 * @hcmd: a variable length host-command to be sent to apply the configuration.
118 struct iwl_fw_ini_hcmd_tlv {
119 struct iwl_fw_ini_header header;
120 struct iwl_fw_ini_hcmd hcmd;
121 } __packed; /* FW_INI_HCMD_TLV_S_VER_1 */
124 * struct iwl_fw_ini_debug_flow_tlv (IWL_FW_INI_TLV_TYPE_DEBUG_FLOW)
127 * @debug_flow_cfg: &enum iwl_fw_ini_debug_flow
129 struct iwl_fw_ini_debug_flow_tlv {
130 struct iwl_fw_ini_header header;
131 __le32 debug_flow_cfg;
132 } __packed; /* FW_INI_DEBUG_FLOW_TLV_S_VER_1 */
134 #define IWL_FW_INI_MAX_REGION_ID 20
135 #define IWL_FW_INI_MAX_NAME 32
137 * struct iwl_fw_ini_region_cfg
138 * @region_id: ID of this dump configuration
139 * @region_type: &enum iwl_fw_ini_region_type
140 * @num_regions: amount of regions in the address array.
141 * @allocation_id: For DRAM type field substitutes for allocation_id.
142 * @name_len: name length
143 * @name: file name to use for this region
144 * @size: size of the data, in bytes.(unused for IWL_FW_INI_REGION_DRAM_BUFFER)
145 * @start_addr: array of addresses. (unused for IWL_FW_INI_REGION_DRAM_BUFFER)
147 struct iwl_fw_ini_region_cfg {
151 u8 name[IWL_FW_INI_MAX_NAME];
154 __le32 allocation_id;
158 } __packed; /* FW_INI_REGION_CONFIG_S */
161 * struct iwl_fw_ini_region_tlv - (IWL_FW_INI_TLV_TYPE_REGION_CFG)
162 * DUMP sections define IDs and triggers that use those IDs TLV
164 * @num_regions: how many different region section and IDs are coming next
165 * @iwl_fw_ini_dump dump_config: list of dump configurations
167 struct iwl_fw_ini_region_tlv {
168 struct iwl_fw_ini_header header;
170 struct iwl_fw_ini_region_cfg region_config[];
171 } __packed; /* FW_INI_REGION_CFG_S */
174 * struct iwl_fw_ini_trigger - (IWL_FW_INI_TLV_TYPE_DUMP_CFG)
175 * Region sections define IDs and triggers that use those IDs TLV
177 * @trigger_id: enum &iwl_fw_ini_tigger_id
178 * @ignore_default: override FW TLV with binary TLV
179 * @dump_delay: delay from trigger fire to dump, in usec
180 * @occurrences: max amount of times to be fired
181 * @ignore_consec: ignore consecutive triggers, in usec
182 * @force_restart: force FW restart
183 * @multi_dut: initiate debug dump data on several DUTs
184 * @trigger_data: generic data to be utilized per trigger
185 * @num_regions: number of dump regions defined for this trigger
188 struct iwl_fw_ini_trigger {
190 __le32 ignore_default;
193 __le32 ignore_consec;
194 __le32 force_restart;
199 } __packed; /* FW_INI_TRIGGER_CONFIG_S */
202 * struct iwl_fw_ini_trigger_tlv - (IWL_FW_INI_TLV_TYPE_TRIGGERS_CFG)
203 * DUMP sections define IDs and triggers that use those IDs TLV
206 * @num_triggers: how many different triggers section and IDs are coming next
207 * @trigger_config: list of trigger configurations
209 struct iwl_fw_ini_trigger_tlv {
210 struct iwl_fw_ini_header header;
212 struct iwl_fw_ini_trigger trigger_config[];
213 } __packed; /* FW_INI_TRIGGER_CFG_S */
216 * enum iwl_fw_ini_trigger_id
217 * @IWL_FW_TRIGGER_ID_FW_ASSERT: FW assert
218 * @IWL_FW_TRIGGER_ID_FW_TFD_Q_HANG: TFD queue hang
219 * @IWL_FW_TRIGGER_ID_FW_HW_ERROR: HW assert
220 * @IWL_FW_TRIGGER_ID_FW_TRIGGER_ERROR: FW error notification
221 * @IWL_FW_TRIGGER_ID_FW_TRIGGER_WARNING: FW warning notification
222 * @IWL_FW_TRIGGER_ID_FW_TRIGGER_INFO: FW info notification
223 * @IWL_FW_TRIGGER_ID_FW_TRIGGER_DEBUG: FW debug notification
224 * @IWL_FW_TRIGGER_ID_USER_TRIGGER: User trigger
225 * @IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_INACTIVITY: peer inactivity
226 * @FW_DEBUG_TLV_TRIGGER_ID_HOST_DID_INITIATED_EVENT: undefined
227 * @IWL_FW_TRIGGER_ID_HOST_TX_LATENCY_THRESHOLD_CROSSED: TX latency
228 * threshold was crossed
229 * @IWL_FW_TRIGGER_ID_HOST_TX_RESPONSE_STATUS_FAILED: TX failed
230 * @IWL_FW_TRIGGER_ID_HOST_OS_REQ_DEAUTH_PEER: Deauth initiated by host
231 * @IWL_FW_TRIGGER_ID_HOST_STOP_GO_REQUEST: stop GO request
232 * @IWL_FW_TRIGGER_ID_HOST_START_GO_REQUEST: start GO request
233 * @IWL_FW_TRIGGER_ID_HOST_JOIN_GROUP_REQUEST: join P2P group request
234 * @IWL_FW_TRIGGER_ID_HOST_SCAN_START: scan started event
235 * @IWL_FW_TRIGGER_ID_HOST_SCAN_SUBMITTED: undefined
236 * @IWL_FW_TRIGGER_ID_HOST_SCAN_PARAMS: undefined
237 * @IWL_FW_TRIGGER_ID_HOST_CHECK_FOR_HANG: undefined
238 * @IWL_FW_TRIGGER_ID_HOST_BAR_RECEIVED: BAR frame was received
239 * @IWL_FW_TRIGGER_ID_HOST_AGG_TX_RESPONSE_STATUS_FAILED: agg TX failed
240 * @IWL_FW_TRIGGER_ID_HOST_EAPOL_TX_RESPONSE_FAILED: EAPOL TX failed
241 * @IWL_FW_TRIGGER_ID_HOST_FAKE_TX_RESPONSE_SUSPECTED: suspicious TX response
242 * @IWL_FW_TRIGGER_ID_HOST_AUTH_REQ_FROM_ASSOC_CLIENT: received suspicious auth
243 * @IWL_FW_TRIGGER_ID_HOST_ROAM_COMPLETE: roaming was completed
244 * @IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAST_FAILED: fast assoc failed
245 * @IWL_FW_TRIGGER_ID_HOST_D3_START: D3 start
246 * @IWL_FW_TRIGGER_ID_HOST_D3_END: D3 end
247 * @IWL_FW_TRIGGER_ID_HOST_BSS_MISSED_BEACONS: missed beacon events
248 * @IWL_FW_TRIGGER_ID_HOST_P2P_CLIENT_MISSED_BEACONS: P2P missed beacon events
249 * @IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_TX_FAILURES: undefined
250 * @IWL_FW_TRIGGER_ID_HOST_TX_WFD_ACTION_FRAME_FAILED: undefined
251 * @IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAILED: authentication / association
253 * @IWL_FW_TRIGGER_ID_HOST_SCAN_COMPLETE: scan complete event
254 * @IWL_FW_TRIGGER_ID_HOST_SCAN_ABORT: scan abort complete
255 * @IWL_FW_TRIGGER_ID_HOST_NIC_ALIVE: nic alive message was received
256 * @IWL_FW_TRIGGER_ID_HOST_CHANNEL_SWITCH_COMPLETE: CSA was completed
257 * @IWL_FW_TRIGGER_ID_NUM: number of trigger IDs
259 enum iwl_fw_ini_trigger_id {
260 /* Errors triggers */
261 IWL_FW_TRIGGER_ID_FW_ASSERT = 1,
262 IWL_FW_TRIGGER_ID_FW_TFD_Q_HANG = 2,
263 IWL_FW_TRIGGER_ID_FW_HW_ERROR = 3,
264 /* Generic triggers */
265 IWL_FW_TRIGGER_ID_FW_TRIGGER_ERROR = 4,
266 IWL_FW_TRIGGER_ID_FW_TRIGGER_WARNING = 5,
267 IWL_FW_TRIGGER_ID_FW_TRIGGER_INFO = 6,
268 IWL_FW_TRIGGER_ID_FW_TRIGGER_DEBUG = 7,
270 IWL_FW_TRIGGER_ID_USER_TRIGGER = 8,
272 IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_INACTIVITY = 9,
273 IWL_FW_TRIGGER_ID_HOST_DID_INITIATED_EVENT = 10,
274 IWL_FW_TRIGGER_ID_HOST_TX_LATENCY_THRESHOLD_CROSSED = 11,
275 IWL_FW_TRIGGER_ID_HOST_TX_RESPONSE_STATUS_FAILED = 12,
276 IWL_FW_TRIGGER_ID_HOST_OS_REQ_DEAUTH_PEER = 13,
277 IWL_FW_TRIGGER_ID_HOST_STOP_GO_REQUEST = 14,
278 IWL_FW_TRIGGER_ID_HOST_START_GO_REQUEST = 15,
279 IWL_FW_TRIGGER_ID_HOST_JOIN_GROUP_REQUEST = 16,
280 IWL_FW_TRIGGER_ID_HOST_SCAN_START = 17,
281 IWL_FW_TRIGGER_ID_HOST_SCAN_SUBITTED = 18,
282 IWL_FW_TRIGGER_ID_HOST_SCAN_PARAMS = 19,
283 IWL_FW_TRIGGER_ID_HOST_CHECK_FOR_HANG = 20,
284 IWL_FW_TRIGGER_ID_HOST_BAR_RECEIVED = 21,
285 IWL_FW_TRIGGER_ID_HOST_AGG_TX_RESPONSE_STATUS_FAILED = 22,
286 IWL_FW_TRIGGER_ID_HOST_EAPOL_TX_RESPONSE_FAILED = 23,
287 IWL_FW_TRIGGER_ID_HOST_FAKE_TX_RESPONSE_SUSPECTED = 24,
288 IWL_FW_TRIGGER_ID_HOST_AUTH_REQ_FROM_ASSOC_CLIENT = 25,
289 IWL_FW_TRIGGER_ID_HOST_ROAM_COMPLETE = 26,
290 IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAST_FAILED = 27,
291 IWL_FW_TRIGGER_ID_HOST_D3_START = 28,
292 IWL_FW_TRIGGER_ID_HOST_D3_END = 29,
293 IWL_FW_TRIGGER_ID_HOST_BSS_MISSED_BEACONS = 30,
294 IWL_FW_TRIGGER_ID_HOST_P2P_CLIENT_MISSED_BEACONS = 31,
295 IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_TX_FAILURES = 32,
296 IWL_FW_TRIGGER_ID_HOST_TX_WFD_ACTION_FRAME_FAILED = 33,
297 IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAILED = 34,
298 IWL_FW_TRIGGER_ID_HOST_SCAN_COMPLETE = 35,
299 IWL_FW_TRIGGER_ID_HOST_SCAN_ABORT = 36,
300 IWL_FW_TRIGGER_ID_HOST_NIC_ALIVE = 37,
301 IWL_FW_TRIGGER_ID_HOST_CHANNEL_SWITCH_COMPLETE = 38,
302 IWL_FW_TRIGGER_ID_NUM,
303 }; /* FW_INI_TRIGGER_ID_E_VER_1 */
306 * enum iwl_fw_ini_apply_point
307 * @IWL_FW_INI_APPLY_INVALID: invalid
308 * @IWL_FW_INI_APPLY_EARLY: pre loading FW
309 * @IWL_FW_INI_APPLY_AFTER_ALIVE: first cmd from host after alive
310 * @IWL_FW_INI_APPLY_POST_INIT: last cmd in initialization sequence
311 * @IWL_FW_INI_APPLY_MISSED_BEACONS: missed beacons notification
312 * @IWL_FW_INI_APPLY_SCAN_COMPLETE: scan completed
313 * @IWL_FW_INI_APPLY_NUM: number of apply points
315 enum iwl_fw_ini_apply_point {
316 IWL_FW_INI_APPLY_INVALID,
317 IWL_FW_INI_APPLY_EARLY,
318 IWL_FW_INI_APPLY_AFTER_ALIVE,
319 IWL_FW_INI_APPLY_POST_INIT,
320 IWL_FW_INI_APPLY_MISSED_BEACONS,
321 IWL_FW_INI_APPLY_SCAN_COMPLETE,
322 IWL_FW_INI_APPLY_NUM,
323 }; /* FW_INI_APPLY_POINT_E_VER_1 */
326 * enum iwl_fw_ini_allocation_id
327 * @IWL_FW_INI_ALLOCATION_INVALID: invalid
328 * @IWL_FW_INI_ALLOCATION_ID_DBGC1: allocation meant for DBGC1 configuration
329 * @IWL_FW_INI_ALLOCATION_ID_DBGC2: allocation meant for DBGC2 configuration
330 * @IWL_FW_INI_ALLOCATION_ID_DBGC3: allocation meant for DBGC3 configuration
331 * @IWL_FW_INI_ALLOCATION_ID_SDFX: for SDFX module
332 * @IWL_FW_INI_ALLOCATION_ID_FW_DUMP: used for crash and runtime dumps
333 * @IWL_FW_INI_ALLOCATION_ID_USER_DEFINED: for future user scenarios
335 enum iwl_fw_ini_allocation_id {
336 IWL_FW_INI_ALLOCATION_INVALID,
337 IWL_FW_INI_ALLOCATION_ID_DBGC1,
338 IWL_FW_INI_ALLOCATION_ID_DBGC2,
339 IWL_FW_INI_ALLOCATION_ID_DBGC3,
340 IWL_FW_INI_ALLOCATION_ID_SDFX,
341 IWL_FW_INI_ALLOCATION_ID_FW_DUMP,
342 IWL_FW_INI_ALLOCATION_ID_USER_DEFINED,
343 }; /* FW_INI_ALLOCATION_ID_E_VER_1 */
346 * enum iwl_fw_ini_buffer_location
347 * @IWL_FW_INI_LOCATION_INVALID: invalid
348 * @IWL_FW_INI_LOCATION_SRAM_PATH: SRAM location
349 * @IWL_FW_INI_LOCATION_DRAM_PATH: DRAM location
351 enum iwl_fw_ini_buffer_location {
352 IWL_FW_INI_LOCATION_SRAM_INVALID,
353 IWL_FW_INI_LOCATION_SRAM_PATH,
354 IWL_FW_INI_LOCATION_DRAM_PATH,
355 }; /* FW_INI_BUFFER_LOCATION_E_VER_1 */
358 * enum iwl_fw_ini_debug_flow
359 * @IWL_FW_INI_DEBUG_INVALID: invalid
360 * @IWL_FW_INI_DEBUG_DBTR_FLOW: undefined
361 * @IWL_FW_INI_DEBUG_TB2DTF_FLOW: undefined
363 enum iwl_fw_ini_debug_flow {
364 IWL_FW_INI_DEBUG_INVALID,
365 IWL_FW_INI_DEBUG_DBTR_FLOW,
366 IWL_FW_INI_DEBUG_TB2DTF_FLOW,
367 }; /* FW_INI_DEBUG_FLOW_E_VER_1 */
370 * enum iwl_fw_ini_region_type
371 * @IWL_FW_INI_REGION_INVALID: invalid
372 * @IWL_FW_INI_REGION_DEVICE_MEMORY: device internal memory
373 * @IWL_FW_INI_REGION_PERIPHERY_MAC: periphery registers of MAC
374 * @IWL_FW_INI_REGION_PERIPHERY_PHY: periphery registers of PHY
375 * @IWL_FW_INI_REGION_PERIPHERY_AUX: periphery registers of AUX
376 * @IWL_FW_INI_REGION_DRAM_BUFFER: DRAM buffer
377 * @IWL_FW_INI_REGION_DRAM_IMR: IMR memory
378 * @IWL_FW_INI_REGION_INTERNAL_BUFFER: undefined
379 * @IWL_FW_INI_REGION_TXF: TX fifos
380 * @IWL_FW_INI_REGION_RXF: RX fifo
381 * @IWL_FW_INI_REGION_PAGING: paging memory
382 * @IWL_FW_INI_REGION_CSR: CSR registers
383 * @IWL_FW_INI_REGION_NUM: number of region types
385 enum iwl_fw_ini_region_type {
386 IWL_FW_INI_REGION_INVALID,
387 IWL_FW_INI_REGION_DEVICE_MEMORY,
388 IWL_FW_INI_REGION_PERIPHERY_MAC,
389 IWL_FW_INI_REGION_PERIPHERY_PHY,
390 IWL_FW_INI_REGION_PERIPHERY_AUX,
391 IWL_FW_INI_REGION_DRAM_BUFFER,
392 IWL_FW_INI_REGION_DRAM_IMR,
393 IWL_FW_INI_REGION_INTERNAL_BUFFER,
394 IWL_FW_INI_REGION_TXF,
395 IWL_FW_INI_REGION_RXF,
396 IWL_FW_INI_REGION_PAGING,
397 IWL_FW_INI_REGION_CSR,
398 IWL_FW_INI_REGION_NUM
399 }; /* FW_INI_REGION_TYPE_E_VER_1*/