Loading...
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2/*
3 * Copyright (C) 2018-2023 Intel Corporation
4 */
5#ifndef __iwl_dbg_tlv_h__
6#define __iwl_dbg_tlv_h__
7
8#include <linux/device.h>
9#include <linux/types.h>
10#include <fw/file.h>
11#include <fw/api/dbg-tlv.h>
12
13#define IWL_DBG_TLV_MAX_PRESET 15
14#define ENABLE_INI (IWL_DBG_TLV_MAX_PRESET + 1)
15
16/**
17 * struct iwl_dbg_tlv_node - debug TLV node
18 * @list: list of &struct iwl_dbg_tlv_node
19 * @tlv: debug TLV
20 */
21struct iwl_dbg_tlv_node {
22 struct list_head list;
23 struct iwl_ucode_tlv tlv;
24};
25
26/**
27 * union iwl_dbg_tlv_tp_data - data that is given in a time point
28 * @fw_pkt: a packet received from the FW
29 */
30union iwl_dbg_tlv_tp_data {
31 struct iwl_rx_packet *fw_pkt;
32};
33
34/**
35 * struct iwl_dbg_tlv_time_point_data
36 * @trig_list: list of triggers
37 * @active_trig_list: list of active triggers
38 * @hcmd_list: list of host commands
39 * @config_list: list of configuration
40 */
41struct iwl_dbg_tlv_time_point_data {
42 struct list_head trig_list;
43 struct list_head active_trig_list;
44 struct list_head hcmd_list;
45 struct list_head config_list;
46};
47
48struct iwl_trans;
49struct iwl_fw_runtime;
50
51void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans);
52void iwl_dbg_tlv_free(struct iwl_trans *trans);
53void iwl_dbg_tlv_alloc(struct iwl_trans *trans, const struct iwl_ucode_tlv *tlv,
54 bool ext);
55void iwl_dbg_tlv_init(struct iwl_trans *trans);
56void _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,
59 bool sync);
60void iwl_dbg_tlv_init_cfg(struct iwl_fw_runtime *fwrt);
61
62static inline void iwl_dbg_tlv_time_point(struct iwl_fw_runtime *fwrt,
63 enum iwl_fw_ini_time_point tp_id,
64 union iwl_dbg_tlv_tp_data *tp_data)
65{
66 _iwl_dbg_tlv_time_point(fwrt, tp_id, tp_data, false);
67}
68
69static inline void iwl_dbg_tlv_time_point_sync(struct iwl_fw_runtime *fwrt,
70 enum iwl_fw_ini_time_point tp_id,
71 union iwl_dbg_tlv_tp_data *tp_data)
72{
73 _iwl_dbg_tlv_time_point(fwrt, tp_id, tp_data, true);
74}
75
76void iwl_dbg_tlv_del_timers(struct iwl_trans *trans);
77
78#endif /* __iwl_dbg_tlv_h__*/
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2/*
3 * Copyright (C) 2018-2020 Intel Corporation
4 */
5#ifndef __iwl_dbg_tlv_h__
6#define __iwl_dbg_tlv_h__
7
8#include <linux/device.h>
9#include <linux/types.h>
10#include <fw/file.h>
11#include <fw/api/dbg-tlv.h>
12
13/**
14 * struct iwl_dbg_tlv_node - debug TLV node
15 * @list: list of &struct iwl_dbg_tlv_node
16 * @tlv: debug TLV
17 */
18struct iwl_dbg_tlv_node {
19 struct list_head list;
20 struct iwl_ucode_tlv tlv;
21};
22
23/**
24 * union iwl_dbg_tlv_tp_data - data that is given in a time point
25 * @fw_pkt: a packet received from the FW
26 */
27union iwl_dbg_tlv_tp_data {
28 struct iwl_rx_packet *fw_pkt;
29};
30
31/**
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
36 */
37struct 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;
41};
42
43struct iwl_trans;
44struct iwl_fw_runtime;
45
46void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans);
47void iwl_dbg_tlv_free(struct iwl_trans *trans);
48void iwl_dbg_tlv_alloc(struct iwl_trans *trans, const struct iwl_ucode_tlv *tlv,
49 bool ext);
50void iwl_dbg_tlv_init(struct iwl_trans *trans);
51void 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);
54void iwl_dbg_tlv_del_timers(struct iwl_trans *trans);
55
56#endif /* __iwl_dbg_tlv_h__*/