1 /*
2 * Copyright (c) 2013-2016, 2018-2021 The Linux Foundation. All rights reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 /**=========================================================================
20
21 * \file mac_trace.h
22
23 * \brief definition for trace related APIs
24
25 \author Sunit Bhatia
26
27 ========================================================================*/
28
29 #ifndef __MAC_TRACE_H
30 #define __MAC_TRACE_H
31
32 #include "ani_global.h"
33 #include "qdf_trace.h"
34
35 #define MAC_TRACE_GET_MODULE_ID(data) ((data >> 8) & 0xff)
36 #define MAC_TRACE_GET_MSG_ID(data) (data & 0xffff)
37
38 /**
39 * mac_trace() - Main function used for MAC Trace
40 * @mac_ctx: Global MAC context
41 * @code: trace code
42 * @session: session id
43 * @data: data to be traced.
44 *
45 * Return: None
46 */
mac_trace(struct mac_context * mac_ctx,uint16_t code,uint16_t session,uint32_t data)47 static inline void mac_trace(struct mac_context *mac_ctx, uint16_t code,
48 uint16_t session, uint32_t data)
49 {
50 qdf_trace(QDF_MODULE_ID_PE, code, session, data);
51 }
52
53 #ifdef TRACE_RECORD
54
55 #define eLOG_NODROP_MISSED_BEACON_SCENARIO 0
56 #define eLOG_PROC_DEAUTH_FRAME_SCENARIO 1
57
58 uint8_t *mac_trace_get_lim_msg_string(uint16_t limMsg);
59 uint8_t *mac_trace_get_sme_msg_string(uint16_t smeMsg);
60 uint8_t *mac_trace_get_info_log_string(uint16_t infoLog);
61
62 #endif
63 uint8_t *mac_trace_get_wma_msg_string(uint16_t wmaMsg);
64 uint8_t *mac_trace_getcsr_roam_state(uint16_t csr_roamState);
65 uint8_t *mac_trace_getcsr_roam_sub_state(uint16_t csr_roamSubState);
66 uint8_t *mac_trace_get_lim_sme_state(uint16_t limState);
67 uint8_t *mac_trace_get_lim_mlm_state(uint16_t mlmState);
68
69 #endif
70