2019-05-29 22:18:05 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2017-10-13 21:18:13 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 Chelsio Communications. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CXGB4_CUDBG_H__
|
|
|
|
#define __CXGB4_CUDBG_H__
|
|
|
|
|
|
|
|
#include "cudbg_if.h"
|
|
|
|
#include "cudbg_lib_common.h"
|
2017-12-08 12:18:36 +08:00
|
|
|
#include "cudbg_entity.h"
|
2017-10-13 21:18:14 +08:00
|
|
|
#include "cudbg_lib.h"
|
|
|
|
|
2018-01-17 15:23:47 +08:00
|
|
|
#define CUDBG_DUMP_BUFF_SIZE (32 * 1024 * 1024) /* 32 MB */
|
|
|
|
#define CUDBG_COMPRESS_BUFF_SIZE (4 * 1024 * 1024) /* 4 MB */
|
|
|
|
|
2017-10-13 21:18:14 +08:00
|
|
|
typedef int (*cudbg_collect_callback_t)(struct cudbg_init *pdbg_init,
|
|
|
|
struct cudbg_buffer *dbg_buff,
|
|
|
|
struct cudbg_error *cudbg_err);
|
|
|
|
|
|
|
|
struct cxgb4_collect_entity {
|
|
|
|
enum cudbg_dbg_entity_type entity;
|
|
|
|
cudbg_collect_callback_t collect_cb;
|
|
|
|
};
|
2017-10-13 21:18:13 +08:00
|
|
|
|
|
|
|
enum CXGB4_ETHTOOL_DUMP_FLAGS {
|
|
|
|
CXGB4_ETH_DUMP_NONE = ETH_FW_DUMP_DISABLE,
|
2017-10-13 21:18:15 +08:00
|
|
|
CXGB4_ETH_DUMP_MEM = (1 << 0), /* On-Chip Memory Dumps */
|
2017-10-13 21:18:14 +08:00
|
|
|
CXGB4_ETH_DUMP_HW = (1 << 1), /* various FW and HW dumps */
|
2017-10-13 21:18:13 +08:00
|
|
|
};
|
|
|
|
|
2018-05-02 17:47:19 +08:00
|
|
|
#define CXGB4_ETH_DUMP_ALL (CXGB4_ETH_DUMP_MEM | CXGB4_ETH_DUMP_HW)
|
|
|
|
|
2017-10-13 21:18:13 +08:00
|
|
|
u32 cxgb4_get_dump_length(struct adapter *adap, u32 flag);
|
|
|
|
int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
|
|
|
|
u32 flag);
|
|
|
|
void cxgb4_init_ethtool_dump(struct adapter *adapter);
|
2018-05-02 17:47:19 +08:00
|
|
|
int cxgb4_cudbg_vmcore_add_dump(struct adapter *adap);
|
2017-10-13 21:18:13 +08:00
|
|
|
#endif /* __CXGB4_CUDBG_H__ */
|