1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LMC_DEBUG_H_
3 #define _LMC_DEBUG_H_
4 
5 #ifdef DEBUG
6 #ifdef LMC_PACKET_LOG
7 #define LMC_CONSOLE_LOG(x,y,z) lmcConsoleLog((x), (y), (z))
8 #else
9 #define LMC_CONSOLE_LOG(x,y,z)
10 #endif
11 #else
12 #define LMC_CONSOLE_LOG(x,y,z)
13 #endif
14 
15 
16 
17 /* Debug --- Event log definitions --- */
18 /* EVENTLOGSIZE*EVENTLOGARGS needs to be a power of 2 */
19 #define LMC_EVENTLOGSIZE 1024	/* number of events in eventlog */
20 #define LMC_EVENTLOGARGS 4		/* number of args for each event */
21 
22 /* event indicators */
23 #define LMC_EVENT_XMT           1
24 #define LMC_EVENT_XMTEND        2
25 #define LMC_EVENT_XMTINT        3
26 #define LMC_EVENT_RCVINT        4
27 #define LMC_EVENT_RCVEND        5
28 #define LMC_EVENT_INT           6
29 #define LMC_EVENT_XMTINTTMO     7
30 #define LMC_EVENT_XMTPRCTMO     8
31 #define LMC_EVENT_INTEND        9
32 #define LMC_EVENT_RESET1       10
33 #define LMC_EVENT_RESET2       11
34 #define LMC_EVENT_FORCEDRESET  12
35 #define LMC_EVENT_WATCHDOG     13
36 #define LMC_EVENT_BADPKTSURGE  14
37 #define LMC_EVENT_TBUSY0       15
38 #define LMC_EVENT_TBUSY1       16
39 
40 
41 #ifdef DEBUG
42 extern u32 lmcEventLogIndex;
43 extern u32 lmcEventLogBuf[LMC_EVENTLOGSIZE * LMC_EVENTLOGARGS];
44 #define LMC_EVENT_LOG(x, y, z) lmcEventLog((x), (y), (z))
45 #else
46 #define LMC_EVENT_LOG(x,y,z)
47 #endif /* end ifdef _DBG_EVENTLOG */
48 
49 void lmcConsoleLog(char *type, unsigned char *ucData, int iLen);
50 void lmcEventLog(u32 EventNum, u32 arg2, u32 arg3);
51 
52 #endif
53