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
This commit is contained in:
Himanshu Batra
2019-06-17 18:19:18 +05:30
committed by nshrivas
parent 16d8432a3d
commit bcb10e6676
2 changed files with 49 additions and 17 deletions

View File

@@ -1042,9 +1042,40 @@ qdf_tso_seg_dbg_zero(struct qdf_tso_seg_elem_t *tsoseg)
#endif /* TSOSEG_DEBUG */ #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 qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
void *data, int buf_len); 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 ERROR_CODE -1
#define QDF_MAX_NAME_SIZE 32 #define QDF_MAX_NAME_SIZE 32
#define MAX_PRINT_CONFIG_SUPPORTED 32 #define MAX_PRINT_CONFIG_SUPPORTED 32

View File

@@ -156,22 +156,8 @@ qdf_export_symbol(qdf_vtrace_msg);
/* Buffer size = data bytes(2 hex chars plus space) + NULL */ /* Buffer size = data bytes(2 hex chars plus space) + NULL */
#define BUFFER_SIZE ((QDF_DP_TRACE_RECORD_SIZE * 3) + 1) #define BUFFER_SIZE ((QDF_DP_TRACE_RECORD_SIZE * 3) + 1)
/** static void __qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
* qdf_trace_hex_dump() - externally called hex dump function void *data, int buf_len, bool print_ascii)
* @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)
{ {
const u8 *ptr = data; const u8 *ptr = data;
int i = 0; int i = 0;
@@ -186,15 +172,30 @@ void qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
buf_len -= ROW_SIZE; buf_len -= ROW_SIZE;
hex_dump_to_buffer(ptr, linelen, ROW_SIZE, 1, 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); qdf_trace_msg(module, level, "%.8x: %s", i, linebuf);
ptr += ROW_SIZE; ptr += ROW_SIZE;
i += 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); 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 #endif
#ifdef TRACE_RECORD #ifdef TRACE_RECORD