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
This commit is contained in:
parent
6b9f15fa84
commit
4dfe66100e
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user