treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / ethernet / chelsio / cxgb4 / cudbg_lib_common.h
blob9fac777b0b24d5460db09ea1a6515394985f61d6
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2017 Chelsio Communications. All rights reserved.
4 */
6 #ifndef __CUDBG_LIB_COMMON_H__
7 #define __CUDBG_LIB_COMMON_H__
9 #define CUDBG_SIGNATURE 67856866 /* CUDB in ascii */
11 enum cudbg_dump_type {
12 CUDBG_DUMP_TYPE_MINI = 1,
15 enum cudbg_compression_type {
16 CUDBG_COMPRESSION_NONE = 1,
17 CUDBG_COMPRESSION_ZLIB,
20 struct cudbg_hdr {
21 u32 signature;
22 u32 hdr_len;
23 u16 major_ver;
24 u16 minor_ver;
25 u32 data_len;
26 u32 hdr_flags;
27 u16 max_entities;
28 u8 chip_ver;
29 u8 dump_type:3;
30 u8 reserved1:1;
31 u8 compress_type:4;
32 u32 reserved[8];
35 struct cudbg_entity_hdr {
36 u32 entity_type;
37 u32 start_offset;
38 u32 size;
39 int hdr_flags;
40 u32 sys_warn;
41 u32 sys_err;
42 u8 num_pad;
43 u8 flag; /* bit 0 is used to indicate ext data */
44 u8 reserved1[2];
45 u32 next_ext_offset; /* pointer to next extended entity meta data */
46 u32 reserved[5];
49 struct cudbg_ver_hdr {
50 u32 signature;
51 u16 revision;
52 u16 size;
55 struct cudbg_buffer {
56 u32 size;
57 u32 offset;
58 char *data;
61 struct cudbg_error {
62 int sys_err;
63 int sys_warn;
64 int app_err;
67 #define CDUMP_MAX_COMP_BUF_SIZE ((64 * 1024) - 1)
68 #define CUDBG_CHUNK_SIZE ((CDUMP_MAX_COMP_BUF_SIZE / 1024) * 1024)
70 int cudbg_get_buff(struct cudbg_init *pdbg_init,
71 struct cudbg_buffer *pdbg_buff, u32 size,
72 struct cudbg_buffer *pin_buff);
73 void cudbg_put_buff(struct cudbg_init *pdbg_init,
74 struct cudbg_buffer *pin_buff);
75 void cudbg_update_buff(struct cudbg_buffer *pin_buff,
76 struct cudbg_buffer *pout_buff);
77 #endif /* __CUDBG_LIB_COMMON_H__ */