Skip to content

Commit c965db4

Browse files
Tomer Tayardavem330
authored andcommitted
qed: Add support for debug data collection
This patch adds the support for dumping and formatting the HW/FW debug data. Signed-off-by: Tomer Tayar <[email protected]> Signed-off-by: Yuval Mintz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 936f060 commit c965db4

File tree

8 files changed

+8919
-12
lines changed

8 files changed

+8919
-12
lines changed

drivers/net/ethernet/qlogic/qed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ obj-$(CONFIG_QED) := qed.o
22

33
qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \
44
qed_int.o qed_main.o qed_mcp.o qed_sp_commands.o qed_spq.o qed_l2.o \
5-
qed_selftest.o qed_dcbx.o
5+
qed_selftest.o qed_dcbx.o qed_debug.o
66
qed-$(CONFIG_QED_SRIOV) += qed_sriov.o qed_vf.o

drivers/net/ethernet/qlogic/qed/qed.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/zlib.h>
2424
#include <linux/hashtable.h>
2525
#include <linux/qed/qed_if.h>
26+
#include "qed_debug.h"
2627
#include "qed_hsi.h"
2728

2829
extern const struct qed_common_ops qed_common_ops_pass;
@@ -395,6 +396,8 @@ struct qed_hwfn {
395396
/* Buffer for unzipping firmware data */
396397
void *unzip_buf;
397398

399+
struct dbg_tools_data dbg_info;
400+
398401
struct qed_simd_fp_handler simd_proto_handler[64];
399402

400403
#ifdef CONFIG_QED_SRIOV
@@ -430,6 +433,19 @@ struct qed_int_params {
430433
u8 fp_msix_cnt;
431434
};
432435

436+
struct qed_dbg_feature {
437+
struct dentry *dentry;
438+
u8 *dump_buf;
439+
u32 buf_size;
440+
u32 dumped_dwords;
441+
};
442+
443+
struct qed_dbg_params {
444+
struct qed_dbg_feature features[DBG_FEATURE_NUM];
445+
u8 engine_for_debug;
446+
bool print_data;
447+
};
448+
433449
struct qed_dev {
434450
u32 dp_module;
435451
u8 dp_level;
@@ -444,6 +460,8 @@ struct qed_dev {
444460
CHIP_REV_IS_A0(dev))
445461
#define QED_IS_BB_B0(dev) (QED_IS_BB(dev) && \
446462
CHIP_REV_IS_B0(dev))
463+
#define QED_IS_AH(dev) ((dev)->type == QED_DEV_TYPE_AH)
464+
#define QED_IS_K2(dev) QED_IS_AH(dev)
447465

448466
#define QED_GET_TYPE(dev) (QED_IS_BB_A0(dev) ? CHIP_BB_A0 : \
449467
QED_IS_BB_B0(dev) ? CHIP_BB_B0 : CHIP_K2)
@@ -544,6 +562,8 @@ struct qed_dev {
544562
} protocol_ops;
545563
void *ops_cookie;
546564

565+
struct qed_dbg_params dbg_params;
566+
547567
const struct firmware *firmware;
548568
};
549569

0 commit comments

Comments
 (0)