^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* bug in tracepoint.h, it should include this */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) /* sparse isn't too happy with all macros... */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef __CHECKER__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <net/cfg80211.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include "driver-ops.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include "debug.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define CREATE_TRACE_POINTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include "trace.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "trace_msg.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #ifdef CONFIG_MAC80211_MESSAGE_TRACING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) void __sdata_info(const char *fmt, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct va_format vaf = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .fmt = fmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) va_list args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) va_start(args, fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) vaf.va = &args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) pr_info("%pV", &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) trace_mac80211_info(&vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) va_end(args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) void __sdata_dbg(bool print, const char *fmt, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct va_format vaf = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) .fmt = fmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) va_list args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) va_start(args, fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) vaf.va = &args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) if (print)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) pr_debug("%pV", &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) trace_mac80211_dbg(&vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) va_end(args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) void __sdata_err(const char *fmt, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) struct va_format vaf = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) .fmt = fmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) va_list args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) va_start(args, fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) vaf.va = &args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) pr_err("%pV", &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) trace_mac80211_err(&vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) va_end(args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) struct va_format vaf = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) .fmt = fmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) va_list args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) va_start(args, fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) vaf.va = &args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) if (print)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) wiphy_dbg(wiphy, "%pV", &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) trace_mac80211_dbg(&vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) va_end(args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) #endif