提交 45724a8a 编写于 作者: M Michal Kazior 提交者: Kalle Valo

ath10k: dump hex bytes with dev string prefix

This makes it easier to debug hex dumps on systems
with more than a single ath10k device.
Signed-off-by: NMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
上级 34b28b6e
...@@ -1264,11 +1264,26 @@ void ath10k_dbg_dump(struct ath10k *ar, ...@@ -1264,11 +1264,26 @@ void ath10k_dbg_dump(struct ath10k *ar,
const char *msg, const char *prefix, const char *msg, const char *prefix,
const void *buf, size_t len) const void *buf, size_t len)
{ {
char linebuf[256];
unsigned int linebuflen;
const void *ptr;
if (ath10k_debug_mask & mask) { if (ath10k_debug_mask & mask) {
if (msg) if (msg)
ath10k_dbg(ar, mask, "%s\n", msg); ath10k_dbg(ar, mask, "%s\n", msg);
print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len); for (ptr = buf; (ptr - buf) < len; ptr += 16) {
linebuflen = 0;
linebuflen += scnprintf(linebuf + linebuflen,
sizeof(linebuf) - linebuflen,
"%s%08x: ",
(prefix ? prefix : ""),
(unsigned int)(ptr - buf));
hex_dump_to_buffer(ptr, len - (ptr - buf), 16, 1,
linebuf + linebuflen,
sizeof(linebuf) - linebuflen, true);
dev_printk(KERN_DEBUG, ar->dev, "%s\n", linebuf);
}
} }
/* tracing code doesn't like null strings :/ */ /* tracing code doesn't like null strings :/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册