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