1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (C) 2005-2011, 2021-2022 Intel Corporation
5 #include <linux/device.h>
6 #include <linux/interrupt.h>
7 #include <linux/export.h>
10 #include "iwl-devtrace.h"
12 #define __iwl_fn(fn) \
13 void __iwl_ ##fn(struct device *dev, const char *fmt, ...) \
15 struct va_format vaf = { \
20 va_start(args, fmt); \
22 dev_ ##fn(dev, "%pV", &vaf); \
23 trace_iwlwifi_ ##fn(&vaf); \
28 IWL_EXPORT_SYMBOL(__iwl_warn
);
30 IWL_EXPORT_SYMBOL(__iwl_info
);
32 IWL_EXPORT_SYMBOL(__iwl_crit
);
34 void __iwl_err(struct device
*dev
, enum iwl_err_mode mode
, const char *fmt
, ...)
36 struct va_format vaf
= {
43 case IWL_ERR_MODE_RATELIMIT
:
47 case IWL_ERR_MODE_REGULAR
:
48 case IWL_ERR_MODE_RFKILL
:
51 if (mode
== IWL_ERR_MODE_RFKILL
)
52 dev_err(dev
, "(RFKILL) %pV", &vaf
);
54 dev_err(dev
, "%pV", &vaf
);
61 trace_iwlwifi_err(&vaf
);
64 IWL_EXPORT_SYMBOL(__iwl_err
);
66 #if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWLWIFI_DEVICE_TRACING)
67 void __iwl_dbg(struct device
*dev
,
68 u32 level
, bool limit
, const char *function
,
71 struct va_format vaf
= {
78 #ifdef CONFIG_IWLWIFI_DEBUG
79 if (iwl_have_debug_level(level
) &&
80 (!limit
|| net_ratelimit()))
81 dev_printk(KERN_DEBUG
, dev
, "%s %pV", function
, &vaf
);
83 trace_iwlwifi_dbg(level
, function
, &vaf
);
86 IWL_EXPORT_SYMBOL(__iwl_dbg
);