1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 /* QLogic qed NIC Driver
3  * Copyright (c) 2015 QLogic Corporation
4  * Copyright (c) 2019-2020 Marvell International Ltd.
5  */
6 
7 #ifndef _QED_DEBUGFS_H
8 #define _QED_DEBUGFS_H
9 
10 enum qed_dbg_features {
11 	DBG_FEATURE_GRC,
12 	DBG_FEATURE_IDLE_CHK,
13 	DBG_FEATURE_MCP_TRACE,
14 	DBG_FEATURE_REG_FIFO,
15 	DBG_FEATURE_IGU_FIFO,
16 	DBG_FEATURE_PROTECTION_OVERRIDE,
17 	DBG_FEATURE_FW_ASSERTS,
18 	DBG_FEATURE_ILT,
19 	DBG_FEATURE_NUM
20 };
21 
22 /* Forward Declaration */
23 struct qed_dev;
24 struct qed_hwfn;
25 
26 int qed_dbg_grc(struct qed_dev *cdev, void *buffer, u32 *num_dumped_bytes);
27 int qed_dbg_grc_size(struct qed_dev *cdev);
28 int qed_dbg_idle_chk(struct qed_dev *cdev, void *buffer,
29 		     u32 *num_dumped_bytes);
30 int qed_dbg_idle_chk_size(struct qed_dev *cdev);
31 int qed_dbg_reg_fifo(struct qed_dev *cdev, void *buffer,
32 		     u32 *num_dumped_bytes);
33 int qed_dbg_reg_fifo_size(struct qed_dev *cdev);
34 int qed_dbg_igu_fifo(struct qed_dev *cdev, void *buffer,
35 		     u32 *num_dumped_bytes);
36 int qed_dbg_igu_fifo_size(struct qed_dev *cdev);
37 int qed_dbg_protection_override(struct qed_dev *cdev, void *buffer,
38 				u32 *num_dumped_bytes);
39 int qed_dbg_protection_override_size(struct qed_dev *cdev);
40 int qed_dbg_fw_asserts(struct qed_dev *cdev, void *buffer,
41 		       u32 *num_dumped_bytes);
42 int qed_dbg_fw_asserts_size(struct qed_dev *cdev);
43 int qed_dbg_ilt(struct qed_dev *cdev, void *buffer, u32 *num_dumped_bytes);
44 int qed_dbg_ilt_size(struct qed_dev *cdev);
45 int qed_dbg_mcp_trace(struct qed_dev *cdev, void *buffer,
46 		      u32 *num_dumped_bytes);
47 int qed_dbg_mcp_trace_size(struct qed_dev *cdev);
48 int qed_dbg_all_data(struct qed_dev *cdev, void *buffer);
49 int qed_dbg_all_data_size(struct qed_dev *cdev);
50 u8 qed_get_debug_engine(struct qed_dev *cdev);
51 void qed_set_debug_engine(struct qed_dev *cdev, int engine_number);
52 int qed_dbg_feature(struct qed_dev *cdev, void *buffer,
53 		    enum qed_dbg_features feature, u32 *num_dumped_bytes);
54 int qed_dbg_feature_size(struct qed_dev *cdev, enum qed_dbg_features feature);
55 
56 void qed_dbg_pf_init(struct qed_dev *cdev);
57 void qed_dbg_pf_exit(struct qed_dev *cdev);
58 
59 #endif
60