1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2018-2021 Intel Corporation
5 #ifndef __iwl_dbg_tlv_h__
6 #define __iwl_dbg_tlv_h__
8 #include <linux/device.h>
9 #include <linux/types.h>
11 #include <fw/api/dbg-tlv.h>
14 * struct iwl_dbg_tlv_node - debug TLV node
15 * @list: list of &struct iwl_dbg_tlv_node
18 struct iwl_dbg_tlv_node {
19 struct list_head list;
20 struct iwl_ucode_tlv tlv;
24 * union iwl_dbg_tlv_tp_data - data that is given in a time point
25 * @fw_pkt: a packet received from the FW
27 union iwl_dbg_tlv_tp_data {
28 struct iwl_rx_packet *fw_pkt;
32 * struct iwl_dbg_tlv_time_point_data
33 * @trig_list: list of triggers
34 * @active_trig_list: list of active triggers
35 * @hcmd_list: list of host commands
37 struct iwl_dbg_tlv_time_point_data {
38 struct list_head trig_list;
39 struct list_head active_trig_list;
40 struct list_head hcmd_list;
44 struct iwl_fw_runtime;
46 void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans);
47 void iwl_dbg_tlv_free(struct iwl_trans *trans);
48 void iwl_dbg_tlv_alloc(struct iwl_trans *trans, const struct iwl_ucode_tlv *tlv,
50 void iwl_dbg_tlv_init(struct iwl_trans *trans);
51 void _iwl_dbg_tlv_time_point(struct iwl_fw_runtime *fwrt,
52 enum iwl_fw_ini_time_point tp_id,
53 union iwl_dbg_tlv_tp_data *tp_data,
56 static inline void iwl_dbg_tlv_time_point(struct iwl_fw_runtime *fwrt,
57 enum iwl_fw_ini_time_point tp_id,
58 union iwl_dbg_tlv_tp_data *tp_data)
60 _iwl_dbg_tlv_time_point(fwrt, tp_id, tp_data, false);
63 static inline void iwl_dbg_tlv_time_point_sync(struct iwl_fw_runtime *fwrt,
64 enum iwl_fw_ini_time_point tp_id,
65 union iwl_dbg_tlv_tp_data *tp_data)
67 _iwl_dbg_tlv_time_point(fwrt, tp_id, tp_data, true);
70 void iwl_dbg_tlv_del_timers(struct iwl_trans *trans);
72 #endif /* __iwl_dbg_tlv_h__*/