1 /*
2  *  Copyright (C) 2017 Chelsio Communications.  All rights reserved.
3  *
4  *  This program is free software; you can redistribute it and/or modify it
5  *  under the terms and conditions of the GNU General Public License,
6  *  version 2, as published by the Free Software Foundation.
7  *
8  *  This program is distributed in the hope it will be useful, but WITHOUT
9  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11  *  more details.
12  *
13  *  The full GNU General Public License is included in this distribution in
14  *  the file called "COPYING".
15  *
16  */
17 
18 #ifndef __CXGB4_CUDBG_H__
19 #define __CXGB4_CUDBG_H__
20 
21 #include "cudbg_if.h"
22 #include "cudbg_lib_common.h"
23 #include "cudbg_lib.h"
24 
25 typedef int (*cudbg_collect_callback_t)(struct cudbg_init *pdbg_init,
26 					struct cudbg_buffer *dbg_buff,
27 					struct cudbg_error *cudbg_err);
28 
29 struct cxgb4_collect_entity {
30 	enum cudbg_dbg_entity_type entity;
31 	cudbg_collect_callback_t collect_cb;
32 };
33 
34 enum CXGB4_ETHTOOL_DUMP_FLAGS {
35 	CXGB4_ETH_DUMP_NONE = ETH_FW_DUMP_DISABLE,
36 	CXGB4_ETH_DUMP_MEM = (1 << 0), /* On-Chip Memory Dumps */
37 	CXGB4_ETH_DUMP_HW = (1 << 1), /* various FW and HW dumps */
38 };
39 
40 u32 cxgb4_get_dump_length(struct adapter *adap, u32 flag);
41 int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
42 			u32 flag);
43 void cxgb4_init_ethtool_dump(struct adapter *adapter);
44 #endif /* __CXGB4_CUDBG_H__ */
45