hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: ISC
12 /*
23 * Copyright (c) 2010 Broadcom Corporation
3
- *
4
- * Permission to use, copy, modify, and/or distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
7
- *
8
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
154 */
165
176 #ifndef BRCMFMAC_DEBUG_H
....@@ -45,17 +34,30 @@
4534 #undef pr_fmt
4635 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
4736
48
-__printf(2, 3)
49
-void __brcmf_err(const char *func, const char *fmt, ...);
37
+struct brcmf_bus;
38
+
39
+__printf(3, 4)
40
+void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...);
5041 /* Macro for error messages. When debugging / tracing the driver all error
5142 * messages are important to us.
5243 */
44
+#ifndef brcmf_err
5345 #define brcmf_err(fmt, ...) \
5446 do { \
5547 if (IS_ENABLED(CONFIG_BRCMDBG) || \
5648 IS_ENABLED(CONFIG_BRCM_TRACING) || \
5749 net_ratelimit()) \
58
- __brcmf_err(__func__, fmt, ##__VA_ARGS__); \
50
+ __brcmf_err(NULL, __func__, fmt, ##__VA_ARGS__);\
51
+ } while (0)
52
+#endif
53
+
54
+#define bphy_err(drvr, fmt, ...) \
55
+ do { \
56
+ if (IS_ENABLED(CONFIG_BRCMDBG) || \
57
+ IS_ENABLED(CONFIG_BRCM_TRACING) || \
58
+ net_ratelimit()) \
59
+ wiphy_err((drvr)->wiphy, "%s: " fmt, __func__, \
60
+ ##__VA_ARGS__); \
5961 } while (0)
6062
6163 #if defined(DEBUG) || defined(CONFIG_BRCM_TRACING)
....@@ -114,18 +116,20 @@
114116 struct brcmf_pub;
115117 #ifdef DEBUG
116118 struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr);
117
-int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
118
- int (*read_fn)(struct seq_file *seq, void *data));
119
+void brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
120
+ int (*read_fn)(struct seq_file *seq, void *data));
119121 int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
120122 size_t len);
121123 #else
122
-static inline
123
-int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
124
- int (*read_fn)(struct seq_file *seq, void *data))
124
+static inline struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr)
125125 {
126
- return 0;
126
+ return ERR_PTR(-ENOENT);
127127 }
128128 static inline
129
+void brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
130
+ int (*read_fn)(struct seq_file *seq, void *data))
131
+{ }
132
+static inline
129133 int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
130134 size_t len)
131135 {