brcmfmac: fix debug printout of event data.
authorHante Meuleman <meuleman@broadcom.com>
Wed, 19 Sep 2012 20:21:09 +0000 (22:21 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 Sep 2012 19:02:05 +0000 (15:02 -0400)
Some events result in printing of the buffer when debug is
enabled. This printing was not very efficient. Changed to
macro so it comes out nice and clean without filling log buffer.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@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_common.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h

index c45270a2a1d95ea0420b38ac3274a70c5a57c7c9..fbecde73f9046047230125739f0cc362ee787df8 100644 (file)
@@ -433,13 +433,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
        }
 
        /* show any appended data */
-       if (datalen) {
-               buf = (unsigned char *) event_data;
-               brcmf_dbg(EVENT, " data (%d) : ", datalen);
-               for (i = 0; i < datalen; i++)
-                       brcmf_dbg(EVENT, " 0x%02x ", *buf++);
-               brcmf_dbg(EVENT, "\n");
-       }
+       brcmf_dbg_hex_dump(datalen, event_data, datalen, "Received data");
 }
 #endif                         /* DEBUG */
 
@@ -530,8 +524,9 @@ brcmf_c_host_event(struct brcmf_pub *drvr, int *ifidx, void *pktdata,
        }
 
 #ifdef DEBUG
-       brcmf_c_show_host_event(event, event_data);
-#endif                         /* DEBUG */
+       if (BRCMF_EVENT_ON())
+               brcmf_c_show_host_event(event, event_data);
+#endif /* DEBUG */
 
        return 0;
 }
index b784920532d31b3ae9deb1ca0453244efb010b39..fb508c2256ddc8a7244b61ad1e6b3fd13b41bf30 100644 (file)
@@ -55,6 +55,7 @@ do {                                                                  \
 #define BRCMF_HDRS_ON()                (brcmf_msg_level & BRCMF_HDRS_VAL)
 #define BRCMF_BYTES_ON()       (brcmf_msg_level & BRCMF_BYTES_VAL)
 #define BRCMF_GLOM_ON()                (brcmf_msg_level & BRCMF_GLOM_VAL)
+#define BRCMF_EVENT_ON()       (brcmf_msg_level & BRCMF_EVENT_VAL)
 
 #else  /* (defined DEBUG) || (defined DEBUG) */
 
@@ -65,6 +66,7 @@ do {                                                                  \
 #define BRCMF_HDRS_ON()                0
 #define BRCMF_BYTES_ON()       0
 #define BRCMF_GLOM_ON()                0
+#define BRCMF_EVENT_ON()       0
 
 #endif                         /* defined(DEBUG) */