Commit 1ce4784e authored by Sukesh Srikakula's avatar Sukesh Srikakula Committed by Greg Kroah-Hartman

staging: brcm80211: Better debug support added to brcmfmac driver

With the current implementation there is no way to selectively enable
required debug messages, as all the messages are currently under WL_DBG.
With this fix, we are introducing several log levels which will enable
us to print only the required debug messages.
WL_ERR --> Prints error messages
WL_CONN --> Prints all debug messages pertaining to connection
management
WL_SCAN --> Prints all debug messages pertaining to scanning
WL_TRACE --> Prints all trace(Enter/Exit) sequence of cfg80211 calls
WL_INFO --> Prints all informational messages.
By default, only WL_ERR messages are enabled.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: default avatarBrett Rudley <brudley@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 65dd4892
......@@ -586,6 +586,8 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
}
DHD_EVENT(("EVENT: %s, event ID = %d\n", event_name, event_type));
DHD_EVENT(("flags 0x%04x, status %d, reason %d, auth_type %d MAC %s\n",
flags, status, reason, auth_type, eabuf));
if (flags & WLC_EVENT_MSG_LINK)
link = true;
......
......@@ -1946,7 +1946,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
strcpy(fw_path, wl_cfg80211_get_fwname());
strcpy(nv_path, wl_cfg80211_get_nvramname());
}
wl_cfg80211_dbg_level(DBG_CFG80211_GET());
}
/* Set up the watchdog timer */
......
......@@ -29,13 +29,14 @@ struct wl_security;
struct wl_ibss;
#define WL_DBG_NONE 0
#define WL_DBG_DBG (1 << 2)
#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_DBG | WL_DBG_INFO | WL_DBG_ERR) << 1)
#define WL_DBG_MASK ((WL_DBG_INFO | WL_DBG_ERR | WL_DBG_TRACE) | \
(WL_DBG_SCAN) | (WL_DBG_CONN))
#define WL_DBG_LEVEL 1 /* 0 invalidates all debug messages.
default is 1 */
#define WL_ERR(fmt, args...) \
do { \
if (wl_dbg_level & WL_DBG_ERR) { \
......@@ -46,6 +47,7 @@ do { \
} \
} while (0)
#if (defined BCMDBG)
#define WL_INFO(fmt, args...) \
do { \
if (wl_dbg_level & WL_DBG_INFO) { \
......@@ -56,17 +58,43 @@ do { \
} \
} while (0)
#if (WL_DBG_LEVEL > 0)
#define WL_DBG(fmt, args...) \
#define WL_TRACE(fmt, args...) \
do { \
if (wl_dbg_level & WL_DBG_DBG) { \
printk(KERN_ERR "DEBUG @%s :" fmt, \
if (wl_dbg_level & WL_DBG_TRACE) { \
if (net_ratelimit()) { \
printk(KERN_ERR "TRACE @%s : " fmt, \
__func__, ##args); \
} \
} \
} while (0)
#define WL_SCAN(fmt, args...) \
do { \
if (wl_dbg_level & WL_DBG_SCAN) { \
if (net_ratelimit()) { \
printk(KERN_ERR "SCAN @%s : " fmt, \
__func__, ##args); \
} \
} \
} while (0)
#define WL_CONN(fmt, args...) \
do { \
if (wl_dbg_level & WL_DBG_CONN) { \
if (net_ratelimit()) { \
printk(KERN_ERR "CONN @%s : " fmt, \
__func__, ##args); \
} \
} \
} while (0)
#else /* !(WL_DBG_LEVEL > 0) */
#define WL_DBG(fmt, args...) noprintk(fmt, ##args)
#endif /* (WL_DBG_LEVEL > 0) */
#else /* (defined BCMDBG) */
#define WL_INFO(fmt, args...)
#define WL_TRACE(fmt, args...)
#define WL_SCAN(fmt, args...)
#define WL_CONN(fmt, args...)
#endif /* (defined BCMDBG) */
#define WL_SCAN_RETRY_MAX 3 /* used for ibss scan */
#define WL_NUM_SCAN_MAX 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment