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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
/*
* Copyright (c) 2011, 2014-2015 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _DBGLOG_COMMON_H_
#define _DBGLOG_COMMON_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "dbglog_id.h"
#include "dbglog.h"
#define MAX_DBG_MSGS 256
#define ATH6KL_FWLOG_PAYLOAD_SIZE 1500
#define DBGLOG_PRINT_PREFIX "FWLOG: "
/* Handy Macros to read data length and type from FW */
#define WLAN_DIAG_0_TYPE_S 0
#define WLAN_DIAG_0_TYPE 0x000000ff
#define WLAN_DIAG_0_TYPE_GET(x) WMI_F_MS(x, WLAN_DIAG_0_TYPE)
#define WLAN_DIAG_0_TYPE_SET(x, y) WMI_F_RMW(x, y, WLAN_DIAG_0_TYPE)
/* bits 8-15 reserved */
/* length includes the size of wlan_diag_data */
#define WLAN_DIAG_0_LEN_S 16
#define WLAN_DIAG_0_LEN 0xffff0000
#define WLAN_DIAG_0_LEN_GET(x) WMI_F_MS(x, WLAN_DIAG_0_LEN)
#define WLAN_DIAG_0_LEN_SET(x, y) WMI_F_RMW(x, y, WLAN_DIAG_0_LEN)
#define CNSS_DIAG_SLEEP_INTERVAL 5 /* In secs */
#define ATH6KL_FWLOG_MAX_ENTRIES 20
#define ATH6KL_FWLOG_PAYLOAD_SIZE 1500
#define DIAG_WLAN_DRIVER_UNLOADED 6
#define DIAG_WLAN_DRIVER_LOADED 7
#define DIAG_TYPE_LOGS 1
#define DIAG_TYPE_EVENTS 2
typedef enum {
DBGLOG_PROCESS_DEFAULT = 0,
DBGLOG_PROCESS_PRINT_RAW, /* print them in debug view */
DBGLOG_PROCESS_POOL_RAW, /* user buffer pool to save them */
DBGLOG_PROCESS_NET_RAW, /* user buffer pool to save them */
DBGLOG_PROCESS_MAX,
} dbglog_process_t;
enum cnss_diag_type {
DIAG_TYPE_FW_EVENT, /* send fw event- to diag */
DIAG_TYPE_FW_LOG, /* send log event- to diag */
DIAG_TYPE_FW_DEBUG_MSG, /* send dbg message- to diag */
DIAG_TYPE_INIT_REQ, /* cnss_diag initialization- from diag */
DIAG_TYPE_FW_MSG, /* fw msg command-to diag */
DIAG_TYPE_HOST_MSG, /* host command-to diag */
DIAG_TYPE_CRASH_INJECT, /*crash inject-from diag */
DIAG_TYPE_DBG_LEVEL, /* DBG LEVEL-from diag */
};
enum wlan_diag_config_type {
DIAG_VERSION_INFO,
};
enum wlan_diag_frame_type {
WLAN_DIAG_TYPE_CONFIG,
WLAN_DIAG_TYPE_EVENT,
WLAN_DIAG_TYPE_LOG,
WLAN_DIAG_TYPE_MSG,
WLAN_DIAG_TYPE_LEGACY_MSG,
};
/* log/event are always 32-bit aligned. Padding is inserted after
* optional payload to satisify this requirement */
struct wlan_diag_data {
unsigned int word0; /* type, length */
unsigned int target_time;
unsigned int code; /* Diag log or event Code */
uint8_t payload[0];
};
struct dbglog_slot {
unsigned int diag_type;
unsigned int timestamp;
unsigned int length;
unsigned int dropped;
/* max ATH6KL_FWLOG_PAYLOAD_SIZE bytes */
uint8_t payload[0];
} __packed;
typedef struct event_report_s {
unsigned int diag_type;
unsigned short event_id;
unsigned short length;
} event_report_t;
/*
* Custom debug_print handlers
* Args:
* module Id
* vap id
* debug msg id
* Time stamp
* no of arguments
* pointer to the buffer holding the args
*/
typedef A_BOOL (*module_dbg_print)(A_UINT32, A_UINT16, A_UINT32,
A_UINT32, A_UINT16, A_UINT32 *);
/** Register module specific dbg print*/
void dbglog_reg_modprint(A_UINT32 mod_id, module_dbg_print printfn);
#ifdef __cplusplus
}
#endif
#endif /* _DBGLOG_COMMON_H_ */
|