qcacmn: Add wmi wrapper function for mtrace logging

For qdf_mtrace 15 bits are reserved for message id and currently
WMI message IDs are getting used as 32 bit IDs.

Write a wrapper function which accepts 32 bit message IDs and
converts this 32 bit message id to 15 bit by extracting
WMI_GRP_ID and WMI_MESSAGE_ID in that group. New 15 bit
message ID for qdf_mtrace will be constucted as 8 bits
(From LSB) specifies the WMI_GRP_ID and remaining 7 bits
specifies the actual WMI command. With this notation there
can be maximum 256 groups and each group can have max 128
commands which can be supported.

Change-Id: Ia5adfc079b63c2311bdc8ae4c73488d89afd462f
CRs-Fixed: 2298877
This commit is contained in:
Ashish Kumar Dhanotiya
2018-08-02 14:26:53 +05:30
committed by nshrivas
vanhempi 89921da033
commit 308f575884
2 muutettua tiedostoa jossa 41 lisäystä ja 0 poistoa

Näytä tiedosto

@@ -40,6 +40,20 @@
#define QDF_TRACE_BUFFER_SIZE (512)
/*
* Extracts the 8-bit group id from the wmi command id by performing the
* reverse operation of WMI_CMD_GRP_START_ID
*/
#define QDF_WMI_MTRACE_GRP_ID(message_id) (((message_id) >> 12) & 0xFF)
/*
* Number of bits reserved for WMI mtrace command id
*/
#define QDF_WMI_MTRACE_CMD_NUM_BITS 7
/*
* Extracts the 7-bit group specific command id from the wmi command id
*/
#define QDF_WMI_MTRACE_CMD_ID(message_id) ((message_id) & 0x7F)
#ifdef CONFIG_MCL
#define QDF_DEFAULT_TRACE_LEVEL \
((1 << QDF_TRACE_LEVEL_FATAL) | (1 << QDF_TRACE_LEVEL_ERROR))