brcmfmac: consolidate debug macros in wl_cfg80211
authorArend van Spriel <arend@broadcom.com>
Wed, 5 Dec 2012 14:25:59 +0000 (15:25 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 10 Dec 2012 20:47:26 +0000 (15:47 -0500)
The source file wl_cfg80211.c has its own debug macros and levels.
This patch maps the macros to the ones used in the rest of the
brcmfmac driver.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h

index 61967fc472e1ed508e9646b05cfa4f0f4db04496..f2ab01cd796600643c94f6e98da09429d2cbedaf 100644 (file)
@@ -31,6 +31,8 @@
 #define BRCMF_BTA_VAL  0x0800
 #define BRCMF_FIL_VAL  0x1000
 #define BRCMF_USB_VAL  0x2000
+#define BRCMF_SCAN_VAL 0x4000
+#define BRCMF_CONN_VAL 0x8000
 
 /* Macro for error messages. net_ratelimit() is used when driver
  * debugging is not selected. When debugging the driver error
index 4ddd58f1e9fe4ad079b0e1a6b26c33515e8dd9de..b321813d0832888b8c1ffbed9fcbec089e6e8761 100644 (file)
@@ -87,8 +87,6 @@
 #define BRCMF_ASSOC_PARAMS_FIXED_SIZE \
        (sizeof(struct brcmf_assoc_params_le) - sizeof(u16))
 
-static u32 brcmf_dbg_level = WL_DBG_ERR;
-
 static bool check_vif_up(struct brcmf_cfg80211_vif *vif)
 {
        if (!test_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state)) {
index c163e4dea9729cfd620993f3b1c5572066575e36..0e705203940296cb51a3d88159d186fe57b2f320 100644 (file)
 #ifndef _wl_cfg80211_h_
 #define _wl_cfg80211_h_
 
-#define WL_DBG_NONE            0
-#define WL_DBG_CONN            (1 << 5)
-#define WL_DBG_SCAN            (1 << 4)
-#define WL_DBG_TRACE           (1 << 3)
-#define WL_DBG_INFO            (1 << 1)
-#define WL_DBG_ERR             (1 << 0)
-#define WL_DBG_MASK            ((WL_DBG_INFO | WL_DBG_ERR | WL_DBG_TRACE) | \
-                               (WL_DBG_SCAN) | (WL_DBG_CONN))
-
-#define        WL_ERR(fmt, ...)                                        \
-do {                                                           \
-       if (brcmf_dbg_level & WL_DBG_ERR) {                     \
-               if (net_ratelimit()) {                          \
-                       pr_err("ERROR @%s : " fmt,              \
-                              __func__, ##__VA_ARGS__);        \
-               }                                               \
-       }                                                       \
-} while (0)
-
-#if (defined DEBUG)
-#define        WL_INFO(fmt, ...)                                       \
-do {                                                           \
-       if (brcmf_dbg_level & WL_DBG_INFO) {                    \
-               if (net_ratelimit()) {                          \
-                       pr_err("INFO @%s : " fmt,               \
-                              __func__, ##__VA_ARGS__);        \
-               }                                               \
-       }                                                       \
-} while (0)
-
-#define        WL_TRACE(fmt, ...)                                      \
-do {                                                           \
-       if (brcmf_dbg_level & WL_DBG_TRACE) {                   \
-               if (net_ratelimit()) {                          \
-                       pr_err("TRACE @%s : " fmt,              \
-                              __func__, ##__VA_ARGS__);        \
-               }                                               \
-       }                                                       \
-} while (0)
-
-#define        WL_SCAN(fmt, ...)                                       \
-do {                                                           \
-       if (brcmf_dbg_level & WL_DBG_SCAN) {                    \
-               if (net_ratelimit()) {                          \
-                       pr_err("SCAN @%s : " fmt,               \
-                              __func__, ##__VA_ARGS__);        \
-               }                                               \
-       }                                                       \
-} while (0)
-
-#define        WL_CONN(fmt, ...)                                       \
-do {                                                           \
-       if (brcmf_dbg_level & WL_DBG_CONN) {                    \
-               if (net_ratelimit()) {                          \
-                       pr_err("CONN @%s : " fmt,               \
-                              __func__, ##__VA_ARGS__);        \
-               }                                               \
-       }                                                       \
-} while (0)
-
-#else /* (defined DEBUG) */
-#define        WL_INFO(fmt, args...)
-#define        WL_TRACE(fmt, args...)
-#define        WL_SCAN(fmt, args...)
-#define        WL_CONN(fmt, args...)
-#endif /* (defined DEBUG) */
+#include "dhd_dbg.h"
+
+#define        WL_ERR(fmt, ...)        brcmf_err(fmt, ##__VA_ARGS__)
+
+#define        WL_INFO(fmt, ...)       brcmf_dbg(INFO, fmt, ##__VA_ARGS__)
+#define        WL_TRACE(fmt, ...)      brcmf_dbg(TRACE, fmt, ##__VA_ARGS__)
+#define        WL_SCAN(fmt, ...)       brcmf_dbg(SCAN, fmt, ##__VA_ARGS__)
+#define        WL_CONN(fmt, ...)       brcmf_dbg(CONN, fmt, ##__VA_ARGS__)
 
 #define WL_NUM_SCAN_MAX                        10
 #define WL_NUM_PMKIDS_MAX              MAXPMKID