18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Copyright (C) 2017 Chelsio Communications.  All rights reserved.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef __CUDBG_IF_H__
78c2ecf20Sopenharmony_ci#define __CUDBG_IF_H__
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci/* Error codes */
108c2ecf20Sopenharmony_ci#define CUDBG_STATUS_NO_MEM -19
118c2ecf20Sopenharmony_ci#define CUDBG_STATUS_ENTITY_NOT_FOUND -24
128c2ecf20Sopenharmony_ci#define CUDBG_STATUS_NOT_IMPLEMENTED -28
138c2ecf20Sopenharmony_ci#define CUDBG_SYSTEM_ERROR -29
148c2ecf20Sopenharmony_ci#define CUDBG_STATUS_CCLK_NOT_DEFINED -32
158c2ecf20Sopenharmony_ci#define CUDBG_STATUS_PARTIAL_DATA -41
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define CUDBG_MAJOR_VERSION 1
188c2ecf20Sopenharmony_ci#define CUDBG_MINOR_VERSION 14
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cienum cudbg_dbg_entity_type {
218c2ecf20Sopenharmony_ci	CUDBG_REG_DUMP = 1,
228c2ecf20Sopenharmony_ci	CUDBG_DEV_LOG = 2,
238c2ecf20Sopenharmony_ci	CUDBG_CIM_LA = 3,
248c2ecf20Sopenharmony_ci	CUDBG_CIM_MA_LA = 4,
258c2ecf20Sopenharmony_ci	CUDBG_CIM_QCFG = 5,
268c2ecf20Sopenharmony_ci	CUDBG_CIM_IBQ_TP0 = 6,
278c2ecf20Sopenharmony_ci	CUDBG_CIM_IBQ_TP1 = 7,
288c2ecf20Sopenharmony_ci	CUDBG_CIM_IBQ_ULP = 8,
298c2ecf20Sopenharmony_ci	CUDBG_CIM_IBQ_SGE0 = 9,
308c2ecf20Sopenharmony_ci	CUDBG_CIM_IBQ_SGE1 = 10,
318c2ecf20Sopenharmony_ci	CUDBG_CIM_IBQ_NCSI = 11,
328c2ecf20Sopenharmony_ci	CUDBG_CIM_OBQ_ULP0 = 12,
338c2ecf20Sopenharmony_ci	CUDBG_CIM_OBQ_ULP1 = 13,
348c2ecf20Sopenharmony_ci	CUDBG_CIM_OBQ_ULP2 = 14,
358c2ecf20Sopenharmony_ci	CUDBG_CIM_OBQ_ULP3 = 15,
368c2ecf20Sopenharmony_ci	CUDBG_CIM_OBQ_SGE = 16,
378c2ecf20Sopenharmony_ci	CUDBG_CIM_OBQ_NCSI = 17,
388c2ecf20Sopenharmony_ci	CUDBG_EDC0 = 18,
398c2ecf20Sopenharmony_ci	CUDBG_EDC1 = 19,
408c2ecf20Sopenharmony_ci	CUDBG_MC0 = 20,
418c2ecf20Sopenharmony_ci	CUDBG_MC1 = 21,
428c2ecf20Sopenharmony_ci	CUDBG_RSS = 22,
438c2ecf20Sopenharmony_ci	CUDBG_RSS_VF_CONF = 25,
448c2ecf20Sopenharmony_ci	CUDBG_PATH_MTU = 27,
458c2ecf20Sopenharmony_ci	CUDBG_PM_STATS = 30,
468c2ecf20Sopenharmony_ci	CUDBG_HW_SCHED = 31,
478c2ecf20Sopenharmony_ci	CUDBG_TP_INDIRECT = 36,
488c2ecf20Sopenharmony_ci	CUDBG_SGE_INDIRECT = 37,
498c2ecf20Sopenharmony_ci	CUDBG_ULPRX_LA = 41,
508c2ecf20Sopenharmony_ci	CUDBG_TP_LA = 43,
518c2ecf20Sopenharmony_ci	CUDBG_MEMINFO = 44,
528c2ecf20Sopenharmony_ci	CUDBG_CIM_PIF_LA = 45,
538c2ecf20Sopenharmony_ci	CUDBG_CLK = 46,
548c2ecf20Sopenharmony_ci	CUDBG_CIM_OBQ_RXQ0 = 47,
558c2ecf20Sopenharmony_ci	CUDBG_CIM_OBQ_RXQ1 = 48,
568c2ecf20Sopenharmony_ci	CUDBG_PCIE_INDIRECT = 50,
578c2ecf20Sopenharmony_ci	CUDBG_PM_INDIRECT = 51,
588c2ecf20Sopenharmony_ci	CUDBG_TID_INFO = 54,
598c2ecf20Sopenharmony_ci	CUDBG_PCIE_CONFIG = 55,
608c2ecf20Sopenharmony_ci	CUDBG_DUMP_CONTEXT = 56,
618c2ecf20Sopenharmony_ci	CUDBG_MPS_TCAM = 57,
628c2ecf20Sopenharmony_ci	CUDBG_VPD_DATA = 58,
638c2ecf20Sopenharmony_ci	CUDBG_LE_TCAM = 59,
648c2ecf20Sopenharmony_ci	CUDBG_CCTRL = 60,
658c2ecf20Sopenharmony_ci	CUDBG_MA_INDIRECT = 61,
668c2ecf20Sopenharmony_ci	CUDBG_ULPTX_LA = 62,
678c2ecf20Sopenharmony_ci	CUDBG_UP_CIM_INDIRECT = 64,
688c2ecf20Sopenharmony_ci	CUDBG_PBT_TABLE = 65,
698c2ecf20Sopenharmony_ci	CUDBG_MBOX_LOG = 66,
708c2ecf20Sopenharmony_ci	CUDBG_HMA_INDIRECT = 67,
718c2ecf20Sopenharmony_ci	CUDBG_HMA = 68,
728c2ecf20Sopenharmony_ci	CUDBG_QDESC = 70,
738c2ecf20Sopenharmony_ci	CUDBG_FLASH = 71,
748c2ecf20Sopenharmony_ci	CUDBG_MAX_ENTITY = 72,
758c2ecf20Sopenharmony_ci};
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_cistruct cudbg_init {
788c2ecf20Sopenharmony_ci	struct adapter *adap; /* Pointer to adapter structure */
798c2ecf20Sopenharmony_ci	void *outbuf; /* Output buffer */
808c2ecf20Sopenharmony_ci	u32 outbuf_size;  /* Output buffer size */
818c2ecf20Sopenharmony_ci	u8 compress_type; /* Type of compression to use */
828c2ecf20Sopenharmony_ci	void *compress_buff; /* Compression buffer */
838c2ecf20Sopenharmony_ci	u32 compress_buff_size; /* Compression buffer size */
848c2ecf20Sopenharmony_ci	void *workspace; /* Workspace for zlib */
858c2ecf20Sopenharmony_ci};
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_cistatic inline unsigned int cudbg_mbytes_to_bytes(unsigned int size)
888c2ecf20Sopenharmony_ci{
898c2ecf20Sopenharmony_ci	return size * 1024 * 1024;
908c2ecf20Sopenharmony_ci}
918c2ecf20Sopenharmony_ci#endif /* __CUDBG_IF_H__ */
92