summaryrefstree
path: root/kernel/include/linux/platform_data/modem_debug.h
blob: a23a55b355de903a41f8ed2d4ab401260b827c6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __MODEM_DEBUG_H__
#define __MODEM_DEBUG_H__

#include <linux/types.h>
#include <linux/time.h>
#include <linux/spinlock.h>

#define MAX_LOG_LEN	(256 - sizeof(struct timespec) - sizeof(int))
struct log_buff {
	struct timespec ts;
	int level;
	char data[MAX_LOG_LEN];
};

#define MAX_TRACE_SIZE		4096
struct log_buff_circ_queue {
	spinlock_t lock;

	struct log_buff logb[MAX_TRACE_SIZE];
	u32 in;
	u32 out;

	/*
	This flag is set when a log_buff_circ_queue instance becomes full for
	the first time, and must be cleared only after all logs are received by
	the bebugfs.
	*/
	bool full;
};

enum modemctl_event {
	MDM_EVENT_CP_FORCE_RESET,
	MDM_EVENT_CP_FORCE_CRASH,
	MDM_EVENT_CP_ABNORMAL_RX,
	MDM_CRASH_PM_FAIL,
	MDM_CRASH_PM_CP_FAIL,
	MDM_CRASH_INVALID_RB,
	MDM_CRASH_INVALID_IOD,
	MDM_CRASH_INVALID_SKBCB,
	MDM_CRASH_INVALID_SKBIOD,
	MDM_CRASH_NO_MEM,
	MDM_CRASH_PACKET_CRACKED,
	MDM_CRASH_BY_IOSM,
	MDM_CRASH_CMD_RESET = 90,
	MDM_CRASH_CMD_EXIT,
};

int register_cp_crash_notifier(struct notifier_block *nb);
void modemctl_notify_event(enum modemctl_event evt);

extern void evt_log(int level, const char *fmt, ...);

#endif