Commit 09c7dfa0 authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcm80211: util: remove function brcmu_format_hex() from brcmutil

The function brcmu_format_hex() filled a string buffer with byte
values from a data buffer. The calling function used this string
buffer in a printk. Now the calling function uses the kernel
function print_hex_dump_bytes().
Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Reviewed-by: default avatarAlwin Beukers <alwin@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 20e5ca16
...@@ -6044,7 +6044,6 @@ void brcms_c_print_txdesc(struct d11txh *txh) ...@@ -6044,7 +6044,6 @@ void brcms_c_print_txdesc(struct d11txh *txh)
u8 *rtsph = txh->RTSPhyHeader; u8 *rtsph = txh->RTSPhyHeader;
struct ieee80211_rts rts = txh->rts_frame; struct ieee80211_rts rts = txh->rts_frame;
char hexbuf[256];
/* add plcp header along with txh descriptor */ /* add plcp header along with txh descriptor */
printk(KERN_DEBUG "Raw TxDesc + plcp header:\n"); printk(KERN_DEBUG "Raw TxDesc + plcp header:\n");
...@@ -6065,17 +6064,16 @@ void brcms_c_print_txdesc(struct d11txh *txh) ...@@ -6065,17 +6064,16 @@ void brcms_c_print_txdesc(struct d11txh *txh)
printk(KERN_DEBUG "XtraFrameTypes: %04x ", xtraft); printk(KERN_DEBUG "XtraFrameTypes: %04x ", xtraft);
printk(KERN_DEBUG "\n"); printk(KERN_DEBUG "\n");
brcmu_format_hex(hexbuf, iv, sizeof(txh->IV)); print_hex_dump_bytes("SecIV:", DUMP_PREFIX_OFFSET, iv, sizeof(txh->IV));
printk(KERN_DEBUG "SecIV: %s\n", hexbuf); print_hex_dump_bytes("RA:", DUMP_PREFIX_OFFSET,
brcmu_format_hex(hexbuf, ra, sizeof(txh->TxFrameRA)); ra, sizeof(txh->TxFrameRA));
printk(KERN_DEBUG "RA: %s\n", hexbuf);
printk(KERN_DEBUG "Fb FES Time: %04x ", tfestfb); printk(KERN_DEBUG "Fb FES Time: %04x ", tfestfb);
brcmu_format_hex(hexbuf, rtspfb, sizeof(txh->RTSPLCPFallback)); print_hex_dump_bytes("Fb RTS PLCP:", DUMP_PREFIX_OFFSET,
printk(KERN_DEBUG "RTS PLCP: %s ", hexbuf); rtspfb, sizeof(txh->RTSPLCPFallback));
printk(KERN_DEBUG "RTS DUR: %04x ", rtsdfb); printk(KERN_DEBUG "RTS DUR: %04x ", rtsdfb);
brcmu_format_hex(hexbuf, fragpfb, sizeof(txh->FragPLCPFallback)); print_hex_dump_bytes("PLCP:", DUMP_PREFIX_OFFSET,
printk(KERN_DEBUG "PLCP: %s ", hexbuf); fragpfb, sizeof(txh->FragPLCPFallback));
printk(KERN_DEBUG "DUR: %04x", fragdfb); printk(KERN_DEBUG "DUR: %04x", fragdfb);
printk(KERN_DEBUG "\n"); printk(KERN_DEBUG "\n");
...@@ -6090,10 +6088,10 @@ void brcms_c_print_txdesc(struct d11txh *txh) ...@@ -6090,10 +6088,10 @@ void brcms_c_print_txdesc(struct d11txh *txh)
printk(KERN_DEBUG "MaxAggbyte_fb: %04x\n", mabyte_f); printk(KERN_DEBUG "MaxAggbyte_fb: %04x\n", mabyte_f);
printk(KERN_DEBUG "MinByte: %04x\n", mmbyte); printk(KERN_DEBUG "MinByte: %04x\n", mmbyte);
brcmu_format_hex(hexbuf, rtsph, sizeof(txh->RTSPhyHeader)); print_hex_dump_bytes("RTS PLCP:", DUMP_PREFIX_OFFSET,
printk(KERN_DEBUG "RTS PLCP: %s ", hexbuf); rtsph, sizeof(txh->RTSPhyHeader));
brcmu_format_hex(hexbuf, (u8 *) &rts, sizeof(txh->rts_frame)); print_hex_dump_bytes("RTS Frame:", DUMP_PREFIX_OFFSET,
printk(KERN_DEBUG "RTS Frame: %s", hexbuf); (u8 *)&rts, sizeof(txh->rts_frame));
printk(KERN_DEBUG "\n"); printk(KERN_DEBUG "\n");
} }
#endif /* defined(BCMDBG) */ #endif /* defined(BCMDBG) */
......
...@@ -335,23 +335,3 @@ void brcmu_prpkt(const char *msg, struct sk_buff *p0) ...@@ -335,23 +335,3 @@ void brcmu_prpkt(const char *msg, struct sk_buff *p0)
} }
EXPORT_SYMBOL(brcmu_prpkt); EXPORT_SYMBOL(brcmu_prpkt);
#endif /* defined(BCMDBG) */ #endif /* defined(BCMDBG) */
#if defined(BCMDBG)
/*
* print bytes formatted as hex to a string. return the resulting
* string length
*/
int brcmu_format_hex(char *str, const void *bytes, int len)
{
int i;
char *p = str;
const u8 *src = (const u8 *)bytes;
for (i = 0; i < len; i++) {
p += snprintf(p, 3, "%02X", *src);
src++;
}
return (int)(p - str);
}
EXPORT_SYMBOL(brcmu_format_hex);
#endif /* defined(BCMDBG) */
...@@ -178,16 +178,13 @@ extern uint brcmu_pkttotlen(struct sk_buff *p); ...@@ -178,16 +178,13 @@ extern uint brcmu_pkttotlen(struct sk_buff *p);
/* ip address */ /* ip address */
struct ipv4_addr; struct ipv4_addr;
/* externs */
/* format/print */
#ifdef BCMDBG #ifdef BCMDBG
extern void brcmu_prpkt(const char *msg, struct sk_buff *p0); extern void brcmu_prpkt(const char *msg, struct sk_buff *p0);
#else #else
#define brcmu_prpkt(a, b) #define brcmu_prpkt(a, b)
#endif /* BCMDBG */ #endif /* BCMDBG */
/* externs */
/* format/print */
#if defined(BCMDBG)
extern int brcmu_format_hex(char *str, const void *bytes, int len);
#endif
#endif /* _BRCMU_UTILS_H_ */ #endif /* _BRCMU_UTILS_H_ */
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