forked from Evlers/esp8089_wifi_drivers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
esp_debug.h
99 lines (79 loc) · 2.57 KB
/
esp_debug.h
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
/*
* Copyright (c) 2011-2014 Espressif System.
*
* esp debug
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _DEBUG_H_
#define _DEBUG_H_
#ifdef ASSERT_PANIC
#define ESSERT(v) BUG_ON(!(v))
#else
#define ESSERT(v) if(!(v)) printk("ESSERT:%s %d\n", __FILE__, __LINE__)
#endif
#include <linux/slab.h>
#include <linux/debugfs.h>
#include <asm/uaccess.h>
typedef enum {
ESP_BOOL,
ESP_U8,
ESP_U16,
ESP_U32,
ESP_U64
} esp_type;
struct dentry *esp_dump_var(const char *name, struct dentry *parent, void *value, esp_type type);
struct dentry *esp_dump_array(const char *name, struct dentry *parent, struct debugfs_blob_wrapper *blob);
struct dentry *esp_dump(const char *name, struct dentry *parent, void *data, int size);
struct dentry *esp_debugfs_add_sub_dir(const char *name);
int esp_debugfs_init(void);
void esp_debugfs_exit(void);
typedef enum {
ESP_DBG_ERROR = BIT(0),
ESP_DBG_TRACE = BIT(1),
ESP_DBG_LOG = BIT(2),
ESP_DBG = BIT(3),
ESP_SHOW = BIT(4),
ESP_DBG_TXAMPDU = BIT(5),
ESP_DBG_OP = BIT(6),
ESP_DBG_PS = BIT(7),
ESP_ATE = BIT(8),
ESP_DBG_ALL = 0xffffffff
} esp_dbg_type;
extern unsigned int esp_msg_level;
#ifdef ESP_ANDROID_LOGGER
extern bool log_off;
#endif /* ESP_ANDROID_LOGGER */
#ifdef ESP_ANDROID_LOGGER
#include "esp_file.h"
#define esp_dbg(mask, fmt, args...) do { \
if (esp_msg_level & mask) \
{ \
if (log_off) \
printk(fmt, ##args); \
else \
logger_write(4, "esp_wifi", fmt, ##args); \
} \
} while (0)
#else
#define esp_dbg(mask, fmt, args...) do { \
if (esp_msg_level & mask) \
printk(fmt, ##args); \
} while (0)
#endif /* ESP_ANDROID_LOGGER */
void show_buf(u8 *buf, u32 len);
#ifdef HOST_RC
struct sip_rc_status;
struct ieee80211_tx_rate;
void esp_show_rcstatus(struct sip_rc_status *rcstatus);
void esp_show_tx_rates(struct ieee80211_tx_rate *rates);
#endif /* HOST_RC */
#endif /* _DEBUG_H_ */