qcacmn: Add ascii dump support to qdf hex dump API

The existing hex dump API dumps hex data only.
Add API so that the ascii data can also be
dumped along with hex dump

Change-Id: Icbe74b26f47601a249e3d7ac701f2a19d70fb83b
CRs-Fixed: 2464738
这个提交包含在:
Himanshu Batra
2019-06-17 18:19:18 +05:30
提交者 nshrivas
父节点 16d8432a3d
当前提交 bcb10e6676
修改 2 个文件,包含 49 行新增17 行删除

查看文件

@@ -1042,9 +1042,40 @@ qdf_tso_seg_dbg_zero(struct qdf_tso_seg_elem_t *tsoseg)
#endif /* TSOSEG_DEBUG */
/**
* qdf_trace_hex_dump() - externally called hex dump function
* @module: Module identifier a member of the QDF_MODULE_ID enumeration that
* identifies the module issuing the trace message.
* @level: Trace level a member of the QDF_TRACE_LEVEL enumeration indicating
* the severity of the condition causing the trace message to be
* issued. More severe conditions are more likely to be logged.
* @data: The base address of the buffer to be logged.
* @buf_len: The size of the buffer to be logged.
*
* Checks the level of severity and accordingly prints the trace messages
*
* Return: None
*/
void qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
void *data, int buf_len);
/**
* qdf_trace_hex_ascii_dump() - externally called hex and ascii dump function
* @module: Module identifier a member of the QDF_MODULE_ID enumeration that
* identifies the module issuing the trace message.
* @level: Trace level a member of the QDF_TRACE_LEVEL enumeration indicating
* the severity of the condition causing the trace message to be
* issued. More severe conditions are more likely to be logged.
* @data: The base address of the buffer to be logged.
* @buf_len: The size of the buffer to be logged.
*
* Checks the level of severity and accordingly prints the trace messages
*
* Return: None
*/
void qdf_trace_hex_ascii_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
void *data, int buf_len);
#define ERROR_CODE -1
#define QDF_MAX_NAME_SIZE 32
#define MAX_PRINT_CONFIG_SUPPORTED 32

查看文件

@@ -156,22 +156,8 @@ qdf_export_symbol(qdf_vtrace_msg);
/* Buffer size = data bytes(2 hex chars plus space) + NULL */
#define BUFFER_SIZE ((QDF_DP_TRACE_RECORD_SIZE * 3) + 1)
/**
* qdf_trace_hex_dump() - externally called hex dump function
* @module: Module identifier a member of the QDF_MODULE_ID enumeration that
* identifies the module issuing the trace message.
* @level: Trace level a member of the QDF_TRACE_LEVEL enumeration indicating
* the severity of the condition causing the trace message to be
* issued. More severe conditions are more likely to be logged.
* @data: The base address of the buffer to be logged.
* @buf_len: The size of the buffer to be logged.
*
* Checks the level of severity and accordingly prints the trace messages
*
* Return: None
*/
void qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
void *data, int buf_len)
static void __qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
void *data, int buf_len, bool print_ascii)
{
const u8 *ptr = data;
int i = 0;
@@ -186,15 +172,30 @@ void qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
buf_len -= ROW_SIZE;
hex_dump_to_buffer(ptr, linelen, ROW_SIZE, 1,
linebuf, sizeof(linebuf), false);
linebuf, sizeof(linebuf), print_ascii);
qdf_trace_msg(module, level, "%.8x: %s", i, linebuf);
ptr += ROW_SIZE;
i += ROW_SIZE;
}
}
void qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
void *data, int buf_len)
{
__qdf_trace_hex_dump(module, level, data, buf_len, false);
}
qdf_export_symbol(qdf_trace_hex_dump);
void qdf_trace_hex_ascii_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
void *data, int buf_len)
{
__qdf_trace_hex_dump(module, level, data, buf_len, true);
}
qdf_export_symbol(qdf_trace_hex_ascii_dump);
#endif
#ifdef TRACE_RECORD