CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/cache/sources/wl/include/msgtrace.h
Views: 3959
1
/*
2
* Trace messages sent over HBUS
3
*
4
* $Copyright Open Broadcom Corporation$
5
*
6
* $Id: msgtrace.h 370068 2012-11-20 21:40:05Z $
7
*/
8
9
#ifndef _MSGTRACE_H
10
#define _MSGTRACE_H
11
12
#ifndef _TYPEDEFS_H_
13
#include <typedefs.h>
14
#endif
15
16
17
/* This marks the start of a packed structure section. */
18
#include <packed_section_start.h>
19
20
#define MSGTRACE_VERSION 1
21
22
/* Message trace header */
23
typedef BWL_PRE_PACKED_STRUCT struct msgtrace_hdr {
24
uint8 version;
25
uint8 trace_type;
26
#define MSGTRACE_HDR_TYPE_MSG 0
27
#define MSGTRACE_HDR_TYPE_LOG 1
28
uint16 len; /* Len of the trace */
29
uint32 seqnum; /* Sequence number of message. Useful if the messsage has been lost
30
* because of DMA error or a bus reset (ex: SDIO Func2)
31
*/
32
/* Msgtrace type only */
33
uint32 discarded_bytes; /* Number of discarded bytes because of trace overflow */
34
uint32 discarded_printf; /* Number of discarded printf because of trace overflow */
35
} BWL_POST_PACKED_STRUCT msgtrace_hdr_t;
36
37
#define MSGTRACE_HDRLEN sizeof(msgtrace_hdr_t)
38
39
/* The hbus driver generates traces when sending a trace message. This causes endless traces.
40
* This flag must be set to TRUE in any hbus traces. The flag is reset in the function msgtrace_put.
41
* This prevents endless traces but generates hasardous lost of traces only in bus device code.
42
* It is recommendat to set this flag in macro SD_TRACE but not in SD_ERROR for avoiding missing
43
* hbus error traces. hbus error trace should not generates endless traces.
44
*/
45
extern bool msgtrace_hbus_trace;
46
47
typedef void (*msgtrace_func_send_t)(void *hdl1, void *hdl2, uint8 *hdr,
48
uint16 hdrlen, uint8 *buf, uint16 buflen);
49
extern void msgtrace_start(void);
50
extern void msgtrace_stop(void);
51
extern int msgtrace_sent(void);
52
extern void msgtrace_put(char *buf, int count);
53
extern void msgtrace_init(void *hdl1, void *hdl2, msgtrace_func_send_t func_send);
54
extern bool msgtrace_event_enabled(void);
55
56
/* This marks the end of a packed structure section. */
57
#include <packed_section_end.h>
58
59
#endif /* _MSGTRACE_H */
60
61