1
2
3
4
5
6
7
8#ifndef _H_CIFS_DEBUG
9#define _H_CIFS_DEBUG
10
11void cifs_dump_mem(char *label, void *data, int length);
12void cifs_dump_detail(void *buf, struct TCP_Server_Info *ptcp_info);
13void cifs_dump_mids(struct TCP_Server_Info *);
14extern bool traceSMB;
15void dump_smb(void *, int);
16#define CIFS_INFO 0x01
17#define CIFS_RC 0x02
18#define CIFS_TIMER 0x04
19
20#define VFS 1
21#define FYI 2
22extern int cifsFYI;
23#ifdef CONFIG_CIFS_DEBUG2
24#define NOISY 4
25#else
26#define NOISY 0
27#endif
28#define ONCE 8
29
30
31
32
33
34#ifdef CONFIG_CIFS_DEBUG
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49#define cifs_info_func(ratefunc, fmt, ...) \
50do { \
51 pr_info_ ## ratefunc("CIFS: " fmt, ##__VA_ARGS__); \
52} while (0)
53
54#define cifs_info(fmt, ...) \
55do { \
56 cifs_info_func(ratelimited, fmt, ##__VA_ARGS__); \
57} while (0)
58
59
60#define cifs_dbg_func(ratefunc, type, fmt, ...) \
61do { \
62 if ((type) & FYI && cifsFYI & CIFS_INFO) { \
63 pr_debug_ ## ratefunc("%s: " \
64 fmt, __FILE__, ##__VA_ARGS__); \
65 } else if ((type) & VFS) { \
66 pr_err_ ## ratefunc("CIFS VFS: " \
67 fmt, ##__VA_ARGS__); \
68 } else if ((type) & NOISY && (NOISY != 0)) { \
69 pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \
70 } \
71} while (0)
72
73#define cifs_dbg(type, fmt, ...) \
74do { \
75 if ((type) & ONCE) \
76 cifs_dbg_func(once, \
77 type, fmt, ##__VA_ARGS__); \
78 else \
79 cifs_dbg_func(ratelimited, \
80 type, fmt, ##__VA_ARGS__); \
81} while (0)
82
83
84
85
86
87#else
88#define cifs_dbg(type, fmt, ...) \
89do { \
90 if (0) \
91 pr_debug(fmt, ##__VA_ARGS__); \
92} while (0)
93
94#define cifs_info(fmt, ...) \
95do { \
96 pr_info("CIFS: "fmt, ##__VA_ARGS__); \
97} while (0)
98#endif
99
100#endif
101