From 4dfe66100eacfbac7ab613f0b1d49977781be462 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sat, 5 Jan 2019 23:23:08 -0800 Subject: [PATCH] qcacld-3.0: Consolidate mac_trace() APIs There are currently two separate MAC Trace APIs, mac_trace() and mac_trace_new(). Since these ultimately result in a call to qdf_trace(), and since only mac_trace() is widely called, consolidate these two APIs into a single mac_trace() API. In addition, make this a static inline to eliminate an unnecessary function call at every call site and to fully take advantage of the conditional expansion of qdf_trace(). Change-Id: I71101cc076a19ae8dad26c743f726c94571ae8a1 CRs-Fixed: 2380107 --- core/mac/inc/mac_trace.h | 22 +++++++++--- .../src/sys/legacy/src/utils/src/mac_trace.c | 34 ------------------- 2 files changed, 17 insertions(+), 39 deletions(-) diff --git a/core/mac/inc/mac_trace.h b/core/mac/inc/mac_trace.h index e5d09e9015331..e3941d7365504 100644 --- a/core/mac/inc/mac_trace.h +++ b/core/mac/inc/mac_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016, 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2016, 2018-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -30,19 +30,31 @@ #define __MAC_TRACE_H #include "ani_global.h" +#include "qdf_trace.h" #define MAC_TRACE_GET_MODULE_ID(data) ((data >> 8) & 0xff) #define MAC_TRACE_GET_MSG_ID(data) (data & 0xffff) +/** + * mac_trace() - Main function used for MAC Trace + * @mac_ctx: Global MAC context + * @code: trace code + * @session: session id + * @data: data to be traced. + * + * Return: None + */ +static inline void mac_trace(struct mac_context *mac_ctx, uint8_t code, + uint16_t session, uint32_t data) +{ + qdf_trace(QDF_MODULE_ID_PE, code, session, data); +} + #ifdef TRACE_RECORD #define eLOG_NODROP_MISSED_BEACON_SCENARIO 0 #define eLOG_PROC_DEAUTH_FRAME_SCENARIO 1 -void mac_trace(struct mac_context *mac, uint8_t code, uint16_t session, - uint32_t data); -void mac_trace_new(struct mac_context *mac, uint8_t module, uint8_t code, - uint16_t session, uint32_t data); uint8_t *mac_trace_get_cfg_msg_string(uint16_t cfgMsg); uint8_t *mac_trace_get_lim_msg_string(uint16_t limMsg); uint8_t *mac_trace_get_sme_msg_string(uint16_t smeMsg); diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c index a6ec97633b58a..8b43b18a9169b 100644 --- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c +++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c @@ -768,38 +768,4 @@ uint8_t *mac_trace_get_info_log_string(uint16_t info_log) } } -/** - * mac_trace() - Main function used for MAC Trace - * @mac_ctx: Global MAC context - * @code: code - * @session: session id - * @data: data to be traced. - * - * Return: None - **/ -void mac_trace(struct mac_context *mac_ctx, uint8_t code, - uint16_t session, uint32_t data) -{ - /* - * Today mac_trace is being invoked by PE only, need to remove this - * function once PE is migrated to using new trace API. - */ - mac_trace_new(mac_ctx, QDF_MODULE_ID_PE, code, session, data); -} - -/** - * mac_trace_new() - New function used for MAC Trace - * @mac_ctx: Global MAC context - * @code: code - * @session: session id - * @data: data to be traced. - * - * Return: None - **/ -void mac_trace_new(struct mac_context *mac_ctx, uint8_t module, uint8_t code, - uint16_t session, uint32_t data) -{ - qdf_trace(module, code, session, data); -} - #endif