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_entity.h"
24 #include "cudbg_lib.h"
25 
26 typedef int (*cudbg_collect_callback_t)(struct cudbg_init *pdbg_init,
27 					struct cudbg_buffer *dbg_buff,
28 					struct cudbg_error *cudbg_err);
29 
30 struct cxgb4_collect_entity {
31 	enum cudbg_dbg_entity_type entity;
32 	cudbg_collect_callback_t collect_cb;
33 };
34 
35 enum CXGB4_ETHTOOL_DUMP_FLAGS {
36 	CXGB4_ETH_DUMP_NONE = ETH_FW_DUMP_DISABLE,
37 	CXGB4_ETH_DUMP_MEM = (1 << 0), /* On-Chip Memory Dumps */
38 	CXGB4_ETH_DUMP_HW = (1 << 1), /* various FW and HW dumps */
39 };
40 
41 u32 cxgb4_get_dump_length(struct adapter *adap, u32 flag);
42 int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
43 			u32 flag);
44 void cxgb4_init_ethtool_dump(struct adapter *adapter);
45 #endif /* __CXGB4_CUDBG_H__ */
46