brcmfmac: limit hex dump on fwil.
authorHante Meuleman <meuleman@broadcom.com>
Thu, 15 Nov 2012 02:46:22 +0000 (18:46 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 16 Nov 2012 19:29:04 +0000 (14:29 -0500)
When debug is turned on for fwil then the whole data buffer is
dumped. In some cases this gives excessive amount of debug. With
this patch the dumps are limited to 64 bytes.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/fwil.c

index 62e0960c1d3ef2751cd56e04c938da8f24cfa517..7e678e9362edda1c1e38d7ab5ce667e9a579bb32 100644 (file)
@@ -29,6 +29,9 @@
 #include "fwil.h"
 
 
+#define MAX_HEX_DUMP_LEN       64
+
+
 static s32
 brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
 {
@@ -64,7 +67,8 @@ brcmf_fil_cmd_data_set(struct brcmf_if *ifp, u32 cmd, void *data, u32 len)
        mutex_lock(&ifp->drvr->proto_block);
 
        brcmf_dbg(FIL, "cmd=%d, len=%d\n", cmd, len);
-       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data");
+       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
+                          min_t(uint, len, MAX_HEX_DUMP_LEN), "data");
 
        err = brcmf_fil_cmd_data(ifp, cmd, data, len, true);
        mutex_unlock(&ifp->drvr->proto_block);
@@ -81,7 +85,8 @@ brcmf_fil_cmd_data_get(struct brcmf_if *ifp, u32 cmd, void *data, u32 len)
        err = brcmf_fil_cmd_data(ifp, cmd, data, len, false);
 
        brcmf_dbg(FIL, "cmd=%d, len=%d\n", cmd, len);
-       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data");
+       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
+                          min_t(uint, len, MAX_HEX_DUMP_LEN), "data");
 
        mutex_unlock(&ifp->drvr->proto_block);
 
@@ -147,7 +152,8 @@ brcmf_fil_iovar_data_set(struct brcmf_if *ifp, char *name, void *data,
        mutex_lock(&drvr->proto_block);
 
        brcmf_dbg(FIL, "name=%s, len=%d\n", name, len);
-       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data");
+       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
+                          min_t(uint, len, MAX_HEX_DUMP_LEN), "data");
 
        buflen = brcmf_create_iovar(name, data, len, drvr->proto_buf,
                                    sizeof(drvr->proto_buf));
@@ -186,7 +192,8 @@ brcmf_fil_iovar_data_get(struct brcmf_if *ifp, char *name, void *data,
        }
 
        brcmf_dbg(FIL, "name=%s, len=%d\n", name, len);
-       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data");
+       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
+                          min_t(uint, len, MAX_HEX_DUMP_LEN), "data");
 
        mutex_unlock(&drvr->proto_block);
        return err;
@@ -268,7 +275,8 @@ brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name,
        mutex_lock(&drvr->proto_block);
 
        brcmf_dbg(FIL, "bssidx=%d, name=%s, len=%d\n", ifp->bssidx, name, len);
-       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data");
+       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
+                          min_t(uint, len, MAX_HEX_DUMP_LEN), "data");
 
        buflen = brcmf_create_bsscfg(ifp->bssidx, name, data, len,
                                     drvr->proto_buf, sizeof(drvr->proto_buf));
@@ -306,7 +314,8 @@ brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name,
                brcmf_dbg(ERROR, "Creating bsscfg failed\n");
        }
        brcmf_dbg(FIL, "bssidx=%d, name=%s, len=%d\n", ifp->bssidx, name, len);
-       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, len, "data");
+       brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
+                          min_t(uint, len, MAX_HEX_DUMP_LEN), "data");
 
        mutex_unlock(&drvr->proto_block);
        return err;