diff --git a/qdf/Kbuild b/qdf/Kbuild index 2d5281ae5db4..ee89dd5c46aa 100644 --- a/qdf/Kbuild +++ b/qdf/Kbuild @@ -35,7 +35,8 @@ linux/src/qdf_mem.o \ linux/src/qdf_module.o \ linux/src/qdf_nbuf.o \ linux/src/qdf_perf.o \ -linux/src/qdf_threads.o +linux/src/qdf_threads.o \ +linux/src/qdf_trace.o #linux/src/qdf_net.o \ #linux/src/qdf_net_event.o \ #linux/src/qdf_net_ioctl.o diff --git a/qdf/inc/qdf_trace.h b/qdf/inc/qdf_trace.h index 9543b2e2661f..aa1df566eeda 100644 --- a/qdf/inc/qdf_trace.h +++ b/qdf/inc/qdf_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -85,6 +85,34 @@ typedef enum { #define QDF_DEBUG_ERROR 0x20 #define QDF_DEBUG_CFG 0x40 +/* + * Shared print control index + * for converged debug framework + */ +#define QDF_PRINT_IDX_SHARED -1 + +/** + * QDF_PRINT_INFO() - Generic wrapper API for logging + * @idx: Index of print control object + * @module: Module identifier. A member of QDF_MODULE_ID enumeration that + * identifies the module issuing the trace message + * @level: Trace level. A member of QDF_TRACE_LEVEL enumeration indicating + * the severity of the condition causing the trace message to be + * issued. + * @str_format: Format string that contains the message to be logged. + * @...:. + * + * + * This wrapper will be used for any generic logging messages. Wrapper will + * compile a call to converged QDF trace message API. + * + * Return: Nothing + * + */ +void QDF_PRINT_INFO(unsigned int idx, QDF_MODULE_ID module, + QDF_TRACE_LEVEL level, + char *str_format, ...); + #ifdef CONFIG_MCL /* By default Data Path module will have all log levels enabled, except debug * log level. Debug level will be left up to the framework or user space modules @@ -103,8 +131,6 @@ typedef enum { #define INVALID_QDF_TRACE_ADDR 0xffffffff #define DEFAULT_QDF_TRACE_DUMP_COUNT 0 -#include - #define DUMP_DP_TRACE 0 #define ENABLE_DP_TRACE_LIVE_MODE 1 #define CLEAR_DP_TRACE_BUFFER 2 diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h index 77b11f18cfe2..c588f529642b 100644 --- a/qdf/inc/qdf_types.h +++ b/qdf/inc/qdf_types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -245,12 +245,12 @@ typedef void (*qdf_timer_func_t)(void *); * @QDF_MODULE_ID_TARGET_IF: Scheduler target interface queue module ID * @QDF_MODULE_ID_SCHEDULER: Scheduler's module ID * @QDF_MODULE_ID_MGMT_TXRX: MGMT_TXRX module ID + * @QDF_MODULE_ID_ANY: Generic module ID * @QDF_MODULE_ID_MAX: Max place holder module ID * * These are generic IDs that identify the various modules in the software * system - * 0 is unused for historical purposes - * 3 & 4 are unused for historical purposes + * 0 & 4 are unused for historical purposes */ typedef enum { QDF_MODULE_ID_TLSHIM = 1, @@ -281,6 +281,7 @@ typedef enum { QDF_MODULE_ID_TARGET_IF = 27, QDF_MODULE_ID_SCHEDULER = 28, QDF_MODULE_ID_MGMT_TXRX = 29, + QDF_MODULE_ID_ANY = 30, QDF_MODULE_ID_MAX } QDF_MODULE_ID; diff --git a/qdf/linux/src/i_qdf_trace.h b/qdf/linux/src/i_qdf_trace.h index 124ebfb2c64b..fdc11be67f69 100644 --- a/qdf/linux/src/i_qdf_trace.h +++ b/qdf/linux/src/i_qdf_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * diff --git a/qdf/linux/src/qdf_trace.c b/qdf/linux/src/qdf_trace.c index 79604f5925ae..48963157b20a 100644 --- a/qdf/linux/src/qdf_trace.c +++ b/qdf/linux/src/qdf_trace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,6 +33,10 @@ /* Include Files */ #include +#include + +#ifdef CONFIG_MCL + #include #include "qdf_time.h" #include "qdf_mc_timer.h" @@ -1718,3 +1722,22 @@ void qdf_dp_trace_dump_all(uint32_t count) } EXPORT_SYMBOL(qdf_dp_trace_dump_all); #endif + +#endif /* CONFIG_MCL */ + +void QDF_PRINT_INFO(unsigned int idx, QDF_MODULE_ID module, + QDF_TRACE_LEVEL level, + char *str_format, ...) +{ + va_list args; + + /* Generic wrapper API will compile qdf_vprint in order to + * log the message. Once QDF converged debug framework is in + * place, this will be changed to adapt to the framework, compiling + * call to converged tracing API + */ + va_start(args, str_format); + qdf_vprint(str_format, args); + va_end(args); +} +EXPORT_SYMBOL(QDF_PRINT_INFO);