1 /*
2 * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for
6 * any purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
8 * copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 */
19
20 /**=========================================================================
21
22 \file mac_trace.c
23
24 \brief implementation for trace related APIs
25
26 \author Sunit Bhatia
27
28 ========================================================================*/
29
30 /*--------------------------------------------------------------------------
31 Include Files
32 ------------------------------------------------------------------------*/
33
34 #include "mac_trace.h"
35 #include "wma_types.h"
36 #include "csr_internal.h"
37 #include "lim_global.h"
38 #include "lim_types.h"
39 #include "qdf_mem.h"
40 #include "qdf_trace.h"
41 #include "wma_if.h"
42 #include "wma.h"
43
44 /**
45 * mac_trace_getcsr_roam_state() - Get the csr roam state
46 * @csr_roam_state: State in numeric form
47 *
48 * This function will return a string equivalent of the state.
49 *
50 * Return: String equivalent of the state.
51 **/
mac_trace_getcsr_roam_state(uint16_t csr_roam_state)52 uint8_t *mac_trace_getcsr_roam_state(uint16_t csr_roam_state)
53 {
54 switch (csr_roam_state) {
55 CASE_RETURN_STRING(eCSR_ROAMING_STATE_STOP);
56 CASE_RETURN_STRING(eCSR_ROAMING_STATE_IDLE);
57 CASE_RETURN_STRING(eCSR_ROAMING_STATE_JOINING);
58 CASE_RETURN_STRING(eCSR_ROAMING_STATE_JOINED);
59
60 default:
61 return (uint8_t *) "UNKNOWN";
62 break;
63 }
64 }
65
66 /**
67 * mac_trace_getcsr_roam_sub_state() - Get the csr roam sub state
68 * @csr_roam_sub_state: State in numeric form
69 *
70 * This function will return a string equivalent of the state.
71 *
72 * Return: String equivalent of the state.
73 **/
mac_trace_getcsr_roam_sub_state(uint16_t csr_roam_sub_state)74 uint8_t *mac_trace_getcsr_roam_sub_state(uint16_t csr_roam_sub_state)
75 {
76 switch (csr_roam_sub_state) {
77 CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_NONE);
78 CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_START_BSS_REQ);
79 CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DISASSOC_REQ);
80 CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_STOP_BSS_REQ);
81 CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_DEAUTH_REQ);
82 CASE_RETURN_STRING(eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY);
83 default:
84 return (uint8_t *) "UNKNOWN";
85 break;
86 }
87 }
88
89 /**
90 * mac_trace_get_lim_sme_state() - Get the lim sme state
91 * @lim_state: State in numeric form
92 *
93 * This function will return a string equivalent of the state.
94 *
95 * Return: String equivalent of the state.
96 **/
mac_trace_get_lim_sme_state(uint16_t lim_state)97 uint8_t *mac_trace_get_lim_sme_state(uint16_t lim_state)
98 {
99 switch (lim_state) {
100 CASE_RETURN_STRING(eLIM_SME_OFFLINE_STATE);
101 CASE_RETURN_STRING(eLIM_SME_IDLE_STATE);
102 CASE_RETURN_STRING(eLIM_SME_SUSPEND_STATE);
103 CASE_RETURN_STRING(eLIM_SME_WT_JOIN_STATE);
104 CASE_RETURN_STRING(eLIM_SME_WT_AUTH_STATE);
105 CASE_RETURN_STRING(eLIM_SME_WT_ASSOC_STATE);
106 CASE_RETURN_STRING(eLIM_SME_WT_REASSOC_STATE);
107 CASE_RETURN_STRING(eLIM_SME_JOIN_FAILURE_STATE);
108 CASE_RETURN_STRING(eLIM_SME_ASSOCIATED_STATE);
109 CASE_RETURN_STRING(eLIM_SME_REASSOCIATED_STATE);
110 CASE_RETURN_STRING(eLIM_SME_LINK_EST_STATE);
111 CASE_RETURN_STRING(eLIM_SME_WT_PRE_AUTH_STATE);
112 CASE_RETURN_STRING(eLIM_SME_WT_DISASSOC_STATE);
113 CASE_RETURN_STRING(eLIM_SME_WT_DEAUTH_STATE);
114 CASE_RETURN_STRING(eLIM_SME_WT_START_BSS_STATE);
115 CASE_RETURN_STRING(eLIM_SME_WT_STOP_BSS_STATE);
116 CASE_RETURN_STRING(eLIM_SME_NORMAL_STATE);
117
118 default:
119 return (uint8_t *) "UNKNOWN";
120 break;
121 }
122 }
123
124 /**
125 * mac_trace_get_lim_mlm_state() - Get the lim mlm state
126 * @mlm_state: State in numeric form
127 *
128 * This function will return a string equivalent of the state.
129 *
130 * Return: String equivalent of the state.
131 **/
mac_trace_get_lim_mlm_state(uint16_t mlm_state)132 uint8_t *mac_trace_get_lim_mlm_state(uint16_t mlm_state)
133 {
134 switch (mlm_state) {
135 CASE_RETURN_STRING(eLIM_MLM_OFFLINE_STATE);
136 CASE_RETURN_STRING(eLIM_MLM_IDLE_STATE);
137 CASE_RETURN_STRING(eLIM_MLM_WT_JOIN_BEACON_STATE);
138 CASE_RETURN_STRING(eLIM_MLM_JOINED_STATE);
139 CASE_RETURN_STRING(eLIM_MLM_BSS_STARTED_STATE);
140 CASE_RETURN_STRING(eLIM_MLM_WT_AUTH_FRAME2_STATE);
141 CASE_RETURN_STRING(eLIM_MLM_WT_AUTH_FRAME3_STATE);
142 CASE_RETURN_STRING(eLIM_MLM_WT_AUTH_FRAME4_STATE);
143 CASE_RETURN_STRING(eLIM_MLM_AUTH_RSP_TIMEOUT_STATE);
144 CASE_RETURN_STRING(eLIM_MLM_AUTHENTICATED_STATE);
145 CASE_RETURN_STRING(eLIM_MLM_WT_ASSOC_RSP_STATE);
146 CASE_RETURN_STRING(eLIM_MLM_WT_REASSOC_RSP_STATE);
147 CASE_RETURN_STRING(eLIM_MLM_ASSOCIATED_STATE);
148 CASE_RETURN_STRING(eLIM_MLM_REASSOCIATED_STATE);
149 CASE_RETURN_STRING(eLIM_MLM_LINK_ESTABLISHED_STATE);
150 CASE_RETURN_STRING(eLIM_MLM_WT_ASSOC_CNF_STATE);
151 CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_STATE);
152 CASE_RETURN_STRING(eLIM_MLM_WT_DEL_BSS_RSP_STATE);
153 CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE);
154 CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE);
155 CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_PREASSOC_STATE);
156 CASE_RETURN_STRING(eLIM_MLM_WT_ADD_STA_RSP_STATE);
157 CASE_RETURN_STRING(eLIM_MLM_WT_DEL_STA_RSP_STATE);
158
159 default:
160 return (uint8_t *) "UNKNOWN";
161 break;
162 }
163 }
164
165 #ifdef TRACE_RECORD
166 /**
167 * mac_trace_get_sme_msg_string() - Get the msg
168 * @sme_msg: message type in numeric form
169 *
170 * This function will return a string equivalent of the message.
171 *
172 * Return: String equivalent of the message type.
173 **/
mac_trace_get_sme_msg_string(uint16_t sme_msg)174 uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg)
175 {
176 switch (sme_msg) {
177 CASE_RETURN_STRING(eWNI_SME_SYS_READY_IND);
178 CASE_RETURN_STRING(eWNI_SME_JOIN_REQ);
179 CASE_RETURN_STRING(eWNI_SME_JOIN_RSP);
180 CASE_RETURN_STRING(eWNI_SME_SETCONTEXT_RSP);
181 CASE_RETURN_STRING(eWNI_SME_REASSOC_REQ);
182 CASE_RETURN_STRING(eWNI_SME_REASSOC_RSP);
183 CASE_RETURN_STRING(eWNI_SME_DISASSOC_REQ);
184 CASE_RETURN_STRING(eWNI_SME_DISASSOC_RSP);
185 CASE_RETURN_STRING(eWNI_SME_DISASSOC_IND);
186 CASE_RETURN_STRING(eWNI_SME_DISASSOC_CNF);
187 CASE_RETURN_STRING(eWNI_SME_DEAUTH_REQ);
188 CASE_RETURN_STRING(eWNI_SME_DEAUTH_RSP);
189 CASE_RETURN_STRING(eWNI_SME_DEAUTH_IND);
190 CASE_RETURN_STRING(eWNI_SME_DISCONNECT_DONE_IND);
191 CASE_RETURN_STRING(eWNI_SME_START_BSS_REQ);
192 CASE_RETURN_STRING(eWNI_SME_START_BSS_RSP);
193 CASE_RETURN_STRING(eWNI_SME_ASSOC_IND);
194 CASE_RETURN_STRING(eWNI_SME_ASSOC_CNF);
195 CASE_RETURN_STRING(eWNI_SME_SWITCH_CHL_IND);
196 CASE_RETURN_STRING(eWNI_SME_STOP_BSS_REQ);
197 CASE_RETURN_STRING(eWNI_SME_STOP_BSS_RSP);
198 CASE_RETURN_STRING(eWNI_SME_DEAUTH_CNF);
199 CASE_RETURN_STRING(eWNI_SME_MIC_FAILURE_IND);
200 CASE_RETURN_STRING(eWNI_SME_ADDTS_REQ);
201 CASE_RETURN_STRING(eWNI_SME_MSCS_REQ);
202 CASE_RETURN_STRING(eWNI_SME_ADDTS_RSP);
203 CASE_RETURN_STRING(eWNI_SME_DELTS_REQ);
204 CASE_RETURN_STRING(eWNI_SME_DELTS_RSP);
205 CASE_RETURN_STRING(eWNI_SME_DELTS_IND);
206 CASE_RETURN_STRING(eWNI_SME_ASSOC_IND_UPPER_LAYER);
207 CASE_RETURN_STRING(eWNI_SME_WPS_PBC_PROBE_REQ_IND);
208 CASE_RETURN_STRING(eWNI_SME_UPPER_LAYER_ASSOC_CNF);
209 CASE_RETURN_STRING(eWNI_SME_SESSION_UPDATE_PARAM);
210 CASE_RETURN_STRING(eWNI_SME_CHNG_MCC_BEACON_INTERVAL);
211 CASE_RETURN_STRING(eWNI_SME_GET_SNR_REQ);
212 CASE_RETURN_STRING(eWNI_SME_LINK_STATUS_IND);
213 CASE_RETURN_STRING(eWNI_SME_RRM_MSG_TYPE_BEGIN);
214 CASE_RETURN_STRING(eWNI_SME_NEIGHBOR_REPORT_REQ_IND);
215 CASE_RETURN_STRING(eWNI_SME_NEIGHBOR_REPORT_IND);
216 CASE_RETURN_STRING(eWNI_SME_BEACON_REPORT_REQ_IND);
217 CASE_RETURN_STRING(eWNI_SME_BEACON_REPORT_RESP_XMIT_IND);
218 CASE_RETURN_STRING(eWNI_SME_CHAN_LOAD_REPORT_RESP_XMIT_IND);
219 CASE_RETURN_STRING(eWNI_SME_CHAN_LOAD_REQ_IND);
220 CASE_RETURN_STRING(eWNI_SME_FT_AGGR_QOS_REQ);
221 CASE_RETURN_STRING(eWNI_SME_FT_AGGR_QOS_RSP);
222 #if defined FEATURE_WLAN_ESE
223 CASE_RETURN_STRING(eWNI_SME_ESE_ADJACENT_AP_REPORT);
224 #endif
225 CASE_RETURN_STRING(eWNI_SME_REGISTER_MGMT_FRAME_REQ);
226 CASE_RETURN_STRING(eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE);
227 CASE_RETURN_STRING(eWNI_SME_MAX_ASSOC_EXCEEDED);
228 #ifdef WLAN_FEATURE_GTK_OFFLOAD
229 CASE_RETURN_STRING(eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP);
230 #endif /* WLAN_FEATURE_GTK_OFFLOAD */
231 CASE_RETURN_STRING(eWNI_SME_DFS_RADAR_FOUND);
232 CASE_RETURN_STRING(eWNI_SME_CHANNEL_CHANGE_REQ);
233 CASE_RETURN_STRING(eWNI_SME_CHANNEL_CHANGE_RSP);
234 CASE_RETURN_STRING(eWNI_SME_START_BEACON_REQ);
235 CASE_RETURN_STRING(eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ);
236 CASE_RETURN_STRING(eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND);
237 CASE_RETURN_STRING(eWNI_SME_STATS_EXT_EVENT);
238 CASE_RETURN_STRING(eWNI_SME_UPDATE_ADDITIONAL_IES);
239 CASE_RETURN_STRING(eWNI_SME_MODIFY_ADDITIONAL_IES);
240 #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
241 CASE_RETURN_STRING(eWNI_SME_AUTO_SHUTDOWN_IND);
242 #endif
243 CASE_RETURN_STRING(eWNI_SME_SET_HT_2040_MODE);
244 #ifdef FEATURE_WLAN_TDLS
245 CASE_RETURN_STRING(eWNI_SME_TDLS_SEND_MGMT_REQ);
246 CASE_RETURN_STRING(eWNI_SME_TDLS_SEND_MGMT_RSP);
247 CASE_RETURN_STRING(eWNI_SME_TDLS_ADD_STA_REQ);
248 CASE_RETURN_STRING(eWNI_SME_TDLS_ADD_STA_RSP);
249 CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_REQ);
250 CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_RSP);
251 CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_IND);
252 CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_ALL_PEER_IND);
253 CASE_RETURN_STRING(eWNI_SME_MGMT_FRM_TX_COMPLETION_IND);
254 CASE_RETURN_STRING(eWNI_SME_TDLS_LINK_ESTABLISH_REQ);
255 CASE_RETURN_STRING(eWNI_SME_TDLS_LINK_ESTABLISH_RSP);
256 CASE_RETURN_STRING(eWNI_SME_TDLS_SHOULD_DISCOVER);
257 CASE_RETURN_STRING(eWNI_SME_TDLS_SHOULD_TEARDOWN);
258 CASE_RETURN_STRING(eWNI_SME_TDLS_PEER_DISCONNECTED);
259 #endif
260 CASE_RETURN_STRING(eWNI_SME_UNPROT_MGMT_FRM_IND);
261 CASE_RETURN_STRING(eWNI_SME_GET_TSM_STATS_REQ);
262 CASE_RETURN_STRING(eWNI_SME_GET_TSM_STATS_RSP);
263 CASE_RETURN_STRING(eWNI_SME_TSM_IE_IND);
264 CASE_RETURN_STRING(eWNI_SME_SET_HW_MODE_REQ);
265 CASE_RETURN_STRING(eWNI_SME_SET_HW_MODE_RESP);
266 CASE_RETURN_STRING(eWNI_SME_HW_MODE_TRANS_IND);
267 CASE_RETURN_STRING(eWNI_SME_NSS_UPDATE_REQ);
268 CASE_RETURN_STRING(eWNI_SME_NSS_UPDATE_RSP);
269 CASE_RETURN_STRING(eWNI_SME_REGISTER_MGMT_FRAME_CB);
270 CASE_RETURN_STRING(eWNI_SME_HT40_OBSS_SCAN_IND);
271 #ifdef WLAN_FEATURE_NAN
272 CASE_RETURN_STRING(eWNI_SME_NAN_EVENT);
273 #endif
274 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
275 CASE_RETURN_STRING(eWNI_SME_READY_TO_EXTWOW_IND);
276 #endif
277 CASE_RETURN_STRING(eWNI_SME_MSG_GET_TEMPERATURE_IND);
278 CASE_RETURN_STRING(eWNI_SME_SNR_IND);
279 #ifdef FEATURE_WLAN_EXTSCAN
280 CASE_RETURN_STRING(eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND);
281 CASE_RETURN_STRING(eWNI_SME_EPNO_NETWORK_FOUND_IND);
282 #endif
283 CASE_RETURN_STRING(eWNI_SME_SET_THERMAL_LEVEL_IND);
284 CASE_RETURN_STRING(eWNI_SME_OCB_SET_CONFIG_RSP);
285 CASE_RETURN_STRING(eWNI_SME_OCB_GET_TSF_TIMER_RSP);
286 CASE_RETURN_STRING(eWNI_SME_DCC_GET_STATS_RSP);
287 CASE_RETURN_STRING(eWNI_SME_DCC_UPDATE_NDL_RSP);
288 CASE_RETURN_STRING(eWNI_SME_DCC_STATS_EVENT);
289 CASE_RETURN_STRING(eWNI_SME_SET_DUAL_MAC_CFG_REQ);
290 CASE_RETURN_STRING(eWNI_SME_SET_DUAL_MAC_CFG_RESP);
291 CASE_RETURN_STRING(eWNI_SME_SET_IE_REQ);
292 CASE_RETURN_STRING(eWNI_SME_EXT_CHANGE_CHANNEL);
293 CASE_RETURN_STRING(eWNI_SME_EXT_CHANGE_CHANNEL_IND);
294 CASE_RETURN_STRING(eWNI_SME_SET_ANTENNA_MODE_REQ);
295 CASE_RETURN_STRING(eWNI_SME_SET_ANTENNA_MODE_RESP);
296 CASE_RETURN_STRING(eWNI_SME_TSF_EVENT);
297 CASE_RETURN_STRING(eWNI_SME_MON_INIT_SESSION);
298 CASE_RETURN_STRING(eWNI_SME_MON_DEINIT_SESSION);
299 CASE_RETURN_STRING(eWNI_SME_PDEV_SET_HT_VHT_IE);
300 CASE_RETURN_STRING(eWNI_SME_SET_VDEV_IES_PER_BAND);
301 CASE_RETURN_STRING(eWNI_SME_SEND_DISASSOC_FRAME);
302 CASE_RETURN_STRING(eWNI_SME_UPDATE_ACCESS_POLICY_VENDOR_IE);
303 CASE_RETURN_STRING(eWNI_SME_DEFAULT_SCAN_IE);
304 CASE_RETURN_STRING(eWNI_SME_LOST_LINK_INFO_IND);
305 CASE_RETURN_STRING(eWNI_SME_GET_PEER_INFO_EXT_IND);
306 CASE_RETURN_STRING(eWNI_SME_RSO_CMD_STATUS_IND);
307 CASE_RETURN_STRING(eWNI_SME_TRIGGER_SAE);
308 CASE_RETURN_STRING(eWNI_SME_SEND_MGMT_FRAME_TX);
309 CASE_RETURN_STRING(eWNI_SME_SEND_SAE_MSG);
310 CASE_RETURN_STRING(eWNI_SME_CSA_RESTART_REQ);
311 CASE_RETURN_STRING(eWNI_SME_CSA_RESTART_RSP);
312 CASE_RETURN_STRING(eWNI_SME_MSG_TYPES_END);
313 CASE_RETURN_STRING(eWNI_SME_HIDDEN_SSID_RESTART_RSP);
314 CASE_RETURN_STRING(eWNI_SME_STA_CSA_CONTINUE_REQ);
315 CASE_RETURN_STRING(eWNI_SME_ANTENNA_ISOLATION_RSP);
316 default:
317 return (uint8_t *) "UNKNOWN";
318 break;
319 }
320 }
321 #endif
322
323 /**
324 * mac_trace_get_wma_msg_string() - Get the msg
325 * @wma_msg: message type in numeric form
326 *
327 * This function will return a string equivalent of the message.
328 *
329 * Return: String equivalent of the message type.
330 **/
mac_trace_get_wma_msg_string(uint16_t wma_msg)331 uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
332 {
333 switch (wma_msg) {
334 CASE_RETURN_STRING(WMA_ADD_STA_REQ);
335 CASE_RETURN_STRING(WMA_ADD_STA_RSP);
336 CASE_RETURN_STRING(WMA_DELETE_STA_REQ);
337 CASE_RETURN_STRING(WMA_DELETE_STA_RSP);
338 CASE_RETURN_STRING(WMA_ADD_BSS_REQ);
339 CASE_RETURN_STRING(WMA_DELETE_BSS_REQ);
340 CASE_RETURN_STRING(WMA_DELETE_BSS_HO_FAIL_REQ);
341 CASE_RETURN_STRING(WMA_DELETE_BSS_RSP);
342 CASE_RETURN_STRING(WMA_DELETE_BSS_HO_FAIL_RSP);
343 CASE_RETURN_STRING(WMA_SEND_BEACON_REQ);
344 CASE_RETURN_STRING(WMA_SET_BSSKEY_RSP);
345 CASE_RETURN_STRING(WMA_SET_STAKEY_RSP);
346 CASE_RETURN_STRING(WMA_UPDATE_EDCA_PROFILE_IND);
347
348 CASE_RETURN_STRING(WMA_UPDATE_BEACON_IND);
349 CASE_RETURN_STRING(WMA_CHNL_SWITCH_REQ);
350 CASE_RETURN_STRING(WMA_ADD_TS_REQ);
351 CASE_RETURN_STRING(WMA_DEL_TS_REQ);
352 CASE_RETURN_STRING(WMA_MISSED_BEACON_IND);
353
354 CASE_RETURN_STRING(WMA_SWITCH_CHANNEL_RSP);
355 CASE_RETURN_STRING(WMA_P2P_NOA_ATTR_IND);
356 CASE_RETURN_STRING(WMA_PWR_SAVE_CFG);
357
358 CASE_RETURN_STRING(WMA_TIMER_ADJUST_ADAPTIVE_THRESHOLD_IND);
359 CASE_RETURN_STRING(WMA_SET_STA_BCASTKEY_RSP);
360 CASE_RETURN_STRING(WMA_ADD_TS_RSP);
361 CASE_RETURN_STRING(WMA_DPU_MIC_ERROR);
362
363 CASE_RETURN_STRING(WMA_TIMER_CHIP_MONITOR_TIMEOUT);
364 CASE_RETURN_STRING(WMA_TIMER_TRAFFIC_ACTIVITY_REQ);
365 CASE_RETURN_STRING(WMA_TIMER_ADC_RSSI_STATS);
366 #ifdef FEATURE_WLAN_ESE
367 CASE_RETURN_STRING(WMA_TSM_STATS_REQ);
368 CASE_RETURN_STRING(WMA_TSM_STATS_RSP);
369 #endif
370 CASE_RETURN_STRING(WMA_HT40_OBSS_SCAN_IND);
371 CASE_RETURN_STRING(WMA_SET_MIMOPS_REQ);
372 CASE_RETURN_STRING(WMA_SET_MIMOPS_RSP);
373 CASE_RETURN_STRING(WMA_SYS_READY_IND);
374 CASE_RETURN_STRING(WMA_SET_TX_POWER_REQ);
375 CASE_RETURN_STRING(WMA_SET_TX_POWER_RSP);
376 CASE_RETURN_STRING(WMA_GET_TX_POWER_REQ);
377
378 CASE_RETURN_STRING(WMA_ENABLE_UAPSD_REQ);
379 CASE_RETURN_STRING(WMA_DISABLE_UAPSD_REQ);
380 CASE_RETURN_STRING(WMA_SET_KEY_DONE);
381
382 CASE_RETURN_STRING(WMA_BTC_SET_CFG);
383 CASE_RETURN_STRING(WMA_HANDLE_FW_MBOX_RSP);
384 CASE_RETURN_STRING(WMA_SEND_PROBE_RSP_TMPL);
385 CASE_RETURN_STRING(WMA_SET_MAX_TX_POWER_REQ);
386 CASE_RETURN_STRING(WMA_SET_HOST_OFFLOAD);
387 CASE_RETURN_STRING(WMA_SET_KEEP_ALIVE);
388 #ifdef WLAN_NS_OFFLOAD
389 CASE_RETURN_STRING(WMA_SET_NS_OFFLOAD);
390 #endif /* WLAN_NS_OFFLOAD */
391 CASE_RETURN_STRING(WMA_WLAN_SUSPEND_IND);
392 CASE_RETURN_STRING(WMA_WLAN_RESUME_REQ);
393 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
394 CASE_RETURN_STRING(WMA_WLAN_EXT_WOW);
395 CASE_RETURN_STRING(WMA_WLAN_SET_APP_TYPE1_PARAMS);
396 CASE_RETURN_STRING(WMA_WLAN_SET_APP_TYPE2_PARAMS);
397 #endif
398 CASE_RETURN_STRING(WMA_MSG_TYPES_END);
399 CASE_RETURN_STRING(WMA_AGGR_QOS_REQ);
400 CASE_RETURN_STRING(WMA_AGGR_QOS_RSP);
401 CASE_RETURN_STRING(WMA_ROAM_PRE_AUTH_STATUS);
402 #ifdef WLAN_FEATURE_PACKET_FILTERING
403 CASE_RETURN_STRING(WMA_8023_MULTICAST_LIST_REQ);
404 CASE_RETURN_STRING(WMA_RECEIVE_FILTER_SET_FILTER_REQ);
405 CASE_RETURN_STRING
406 (WMA_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ);
407 CASE_RETURN_STRING
408 (WMA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP);
409 CASE_RETURN_STRING(WMA_RECEIVE_FILTER_CLEAR_FILTER_REQ);
410 #endif /* WLAN_FEATURE_PACKET_FILTERING */
411 #ifdef WLAN_FEATURE_GTK_OFFLOAD
412 CASE_RETURN_STRING(WMA_GTK_OFFLOAD_REQ);
413 CASE_RETURN_STRING(WMA_GTK_OFFLOAD_GETINFO_REQ);
414 CASE_RETURN_STRING(WMA_GTK_OFFLOAD_GETINFO_RSP);
415 #endif /* WLAN_FEATURE_GTK_OFFLOAD */
416 CASE_RETURN_STRING(WMA_SET_TM_LEVEL_REQ);
417 CASE_RETURN_STRING(WMA_UPDATE_OP_MODE);
418 CASE_RETURN_STRING(WMA_UPDATE_MEMBERSHIP);
419 CASE_RETURN_STRING(WMA_UPDATE_USERPOS);
420 CASE_RETURN_STRING(WMA_UPDATE_CHAN_LIST_REQ);
421 CASE_RETURN_STRING(WMA_CLI_SET_CMD);
422 #ifndef REMOVE_PKT_LOG
423 CASE_RETURN_STRING(WMA_PKTLOG_ENABLE_REQ);
424 #endif
425 #ifdef FEATURE_WLAN_ESE
426 CASE_RETURN_STRING(WMA_SET_PLM_REQ);
427 #endif
428 CASE_RETURN_STRING(WMA_RATE_UPDATE_IND);
429 CASE_RETURN_STRING(WMA_INIT_BAD_PEER_TX_CTL_INFO_CMD);
430 #ifdef FEATURE_WLAN_TDLS
431 CASE_RETURN_STRING(WMA_UPDATE_TDLS_PEER_STATE);
432 #endif
433 CASE_RETURN_STRING(WMA_ADD_PERIODIC_TX_PTRN_IND);
434 CASE_RETURN_STRING(WMA_TX_POWER_LIMIT);
435 CASE_RETURN_STRING(WMA_DHCP_START_IND);
436 CASE_RETURN_STRING(WMA_DHCP_STOP_IND);
437 #ifdef FEATURE_WLAN_CH_AVOID
438 CASE_RETURN_STRING(WMA_CH_AVOID_UPDATE_REQ);
439 #endif
440 #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
441 CASE_RETURN_STRING(WMA_SET_AUTO_SHUTDOWN_TIMER_REQ);
442 #endif
443 CASE_RETURN_STRING(WMA_INIT_THERMAL_INFO_CMD);
444 CASE_RETURN_STRING(WMA_SET_THERMAL_LEVEL);
445 CASE_RETURN_STRING(WMA_SET_SAP_INTRABSS_DIS);
446 CASE_RETURN_STRING(SIR_HAL_SET_BASE_MACADDR_IND);
447 CASE_RETURN_STRING(WMA_LINK_STATUS_GET_REQ);
448 #ifdef DHCP_SERVER_OFFLOAD
449 CASE_RETURN_STRING(WMA_SET_DHCP_SERVER_OFFLOAD_CMD);
450 #endif
451 CASE_RETURN_STRING(WMA_OCB_SET_CONFIG_CMD);
452 CASE_RETURN_STRING(WMA_OCB_SET_UTC_TIME_CMD);
453 CASE_RETURN_STRING(WMA_OCB_START_TIMING_ADVERT_CMD);
454 CASE_RETURN_STRING(WMA_OCB_STOP_TIMING_ADVERT_CMD);
455 CASE_RETURN_STRING(WMA_OCB_GET_TSF_TIMER_CMD);
456 CASE_RETURN_STRING(WMA_DCC_GET_STATS_CMD);
457 CASE_RETURN_STRING(WMA_DCC_CLEAR_STATS_CMD);
458 CASE_RETURN_STRING(WMA_DCC_UPDATE_NDL_CMD);
459 CASE_RETURN_STRING(WMA_SET_IE_INFO);
460 CASE_RETURN_STRING(WMA_GW_PARAM_UPDATE_REQ);
461 CASE_RETURN_STRING(WMA_ADD_BCN_FILTER_CMDID);
462 CASE_RETURN_STRING(WMA_REMOVE_BCN_FILTER_CMDID);
463 CASE_RETURN_STRING(WMA_SET_ADAPT_DWELLTIME_CONF_PARAMS);
464 CASE_RETURN_STRING(WDA_APF_GET_CAPABILITIES_REQ);
465 CASE_RETURN_STRING(WMA_ROAM_SYNC_TIMEOUT);
466 CASE_RETURN_STRING(WMA_SET_PDEV_IE_REQ);
467 CASE_RETURN_STRING(WMA_SEND_FREQ_RANGE_CONTROL_IND);
468 CASE_RETURN_STRING(WMA_POWER_DEBUG_STATS_REQ);
469 CASE_RETURN_STRING(SIR_HAL_SET_MAS);
470 CASE_RETURN_STRING(SIR_HAL_SET_MIRACAST);
471 CASE_RETURN_STRING(SIR_HAL_CONFIG_STATS_FACTOR);
472 CASE_RETURN_STRING(SIR_HAL_CONFIG_GUARD_TIME);
473 CASE_RETURN_STRING(SIR_HAL_START_STOP_LOGGING);
474 CASE_RETURN_STRING(SIR_HAL_FLUSH_LOG_TO_FW);
475 CASE_RETURN_STRING(SIR_HAL_SET_PCL_TO_FW);
476 CASE_RETURN_STRING(SIR_HAL_PDEV_SET_HW_MODE);
477 CASE_RETURN_STRING(SIR_HAL_PDEV_DUAL_MAC_CFG_REQ);
478 CASE_RETURN_STRING(WMA_RADAR_DETECTED_IND);
479 CASE_RETURN_STRING(WMA_TIMER_TRAFFIC_STATS_IND);
480 CASE_RETURN_STRING(WMA_EXCLUDE_UNENCRYPTED_IND);
481 CASE_RETURN_STRING(WMA_SET_MAX_TX_POWER_RSP);
482 CASE_RETURN_STRING(WMA_SET_DTIM_PERIOD);
483 CASE_RETURN_STRING(WMA_SET_MAX_TX_POWER_PER_BAND_REQ);
484 #ifdef FEATURE_WLAN_TDLS
485 CASE_RETURN_STRING(WMA_SET_TDLS_LINK_ESTABLISH_REQ);
486 CASE_RETURN_STRING(WMA_SET_TDLS_LINK_ESTABLISH_REQ_RSP);
487 #endif
488 CASE_RETURN_STRING(WMA_CSA_OFFLOAD_EVENT);
489 CASE_RETURN_STRING(WMA_UPDATE_RX_NSS);
490 #ifdef WLAN_FEATURE_NAN
491 CASE_RETURN_STRING(WMA_NAN_REQUEST);
492 #endif
493 #ifdef WLAN_SUPPORT_TWT
494 CASE_RETURN_STRING(WMA_TWT_ADD_DIALOG_REQUEST);
495 CASE_RETURN_STRING(WMA_TWT_DEL_DIALOG_REQUEST);
496 CASE_RETURN_STRING(WMA_TWT_PAUSE_DIALOG_REQUEST);
497 CASE_RETURN_STRING(WMA_TWT_RESUME_DIALOG_REQUEST);
498 CASE_RETURN_STRING(WMA_TWT_NUDGE_DIALOG_REQUEST);
499 #endif
500 CASE_RETURN_STRING(WMA_RX_SCAN_EVENT);
501 CASE_RETURN_STRING(WMA_DEL_PERIODIC_TX_PTRN_IND);
502 #ifdef FEATURE_WLAN_TDLS
503 CASE_RETURN_STRING(WMA_TDLS_SHOULD_DISCOVER_CMD);
504 CASE_RETURN_STRING(WMA_TDLS_SHOULD_TEARDOWN_CMD);
505 CASE_RETURN_STRING(WMA_TDLS_PEER_DISCONNECTED_CMD);
506 #endif
507 CASE_RETURN_STRING(WMA_DFS_BEACON_TX_SUCCESS_IND);
508 CASE_RETURN_STRING(WMA_DISASSOC_TX_COMP);
509 CASE_RETURN_STRING(WMA_DEAUTH_TX_COMP);
510 CASE_RETURN_STRING(WMA_MODEM_POWER_STATE_IND);
511 #ifdef WLAN_FEATURE_STATS_EXT
512 CASE_RETURN_STRING(WMA_STATS_EXT_REQUEST);
513 #endif
514 CASE_RETURN_STRING(WMA_GET_TEMPERATURE_REQ);
515 #ifdef FEATURE_WLAN_EXTSCAN
516 CASE_RETURN_STRING(WMA_EXTSCAN_GET_CAPABILITIES_REQ);
517 CASE_RETURN_STRING(WMA_EXTSCAN_START_REQ);
518 CASE_RETURN_STRING(WMA_EXTSCAN_STOP_REQ);
519 CASE_RETURN_STRING(WMA_EXTSCAN_SET_BSSID_HOTLIST_REQ);
520 CASE_RETURN_STRING(WMA_EXTSCAN_RESET_BSSID_HOTLIST_REQ);
521 CASE_RETURN_STRING(WMA_EXTSCAN_SET_SIGNF_CHANGE_REQ);
522 CASE_RETURN_STRING(WMA_EXTSCAN_RESET_SIGNF_CHANGE_REQ);
523 CASE_RETURN_STRING(WMA_EXTSCAN_GET_CACHED_RESULTS_REQ);
524 CASE_RETURN_STRING(WMA_SET_EPNO_LIST_REQ);
525 CASE_RETURN_STRING(WMA_SET_PASSPOINT_LIST_REQ);
526 CASE_RETURN_STRING(WMA_RESET_PASSPOINT_LIST_REQ);
527 #endif /* FEATURE_WLAN_EXTSCAN */
528 #ifdef WLAN_FEATURE_LINK_LAYER_STATS
529 CASE_RETURN_STRING(WMA_LINK_LAYER_STATS_CLEAR_REQ);
530 CASE_RETURN_STRING(WMA_LINK_LAYER_STATS_SET_REQ);
531 CASE_RETURN_STRING(WMA_LINK_LAYER_STATS_GET_REQ);
532 CASE_RETURN_STRING(WMA_LINK_LAYER_STATS_RESULTS_RSP);
533 #endif /* WLAN_FEATURE_LINK_LAYER_STATS */
534 CASE_RETURN_STRING(WMA_SET_SCAN_MAC_OUI_REQ);
535 CASE_RETURN_STRING(WMA_TSF_GPIO_PIN);
536 #ifdef WLAN_FEATURE_GPIO_LED_FLASHING
537 CASE_RETURN_STRING(WMA_LED_FLASHING_REQ);
538 #endif
539 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
540 CASE_RETURN_STRING(WMA_UPDATE_Q2Q_IE_IND);
541 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
542 CASE_RETURN_STRING(WMA_SET_RSSI_MONITOR_REQ);
543 CASE_RETURN_STRING(WMA_SET_WISA_PARAMS);
544 CASE_RETURN_STRING(WMA_SET_WOW_PULSE_CMD);
545 CASE_RETURN_STRING(WMA_GET_RCPI_REQ);
546 CASE_RETURN_STRING(WMA_SET_DBS_SCAN_SEL_CONF_PARAMS);
547 CASE_RETURN_STRING(WMA_GET_ROAM_SCAN_STATS);
548 CASE_RETURN_STRING(WMA_PEER_CREATE_RESPONSE);
549 #ifdef FW_THERMAL_THROTTLE_SUPPORT
550 CASE_RETURN_STRING(WMA_SET_THERMAL_THROTTLE_CFG);
551 CASE_RETURN_STRING(WMA_SET_THERMAL_MGMT);
552 #endif /* FW_THERMAL_THROTTLE_SUPPORT */
553 CASE_RETURN_STRING(WMA_UPDATE_EDCA_PIFS_PARAM_IND);
554 default:
555 return (uint8_t *) "UNKNOWN";
556 break;
557 }
558 }
559
560 #ifdef TRACE_RECORD
561 /**
562 * mac_trace_get_lim_msg_string() - Get the msg
563 * @lim_msg: message type in numeric form
564 *
565 * This function will return a string equivalent of the message.
566 *
567 * Return: String equivalent of the message type.
568 **/
mac_trace_get_lim_msg_string(uint16_t lim_msg)569 uint8_t *mac_trace_get_lim_msg_string(uint16_t lim_msg)
570 {
571 switch (lim_msg) {
572 CASE_RETURN_STRING(SIR_BB_XPORT_MGMT_MSG);
573 CASE_RETURN_STRING(SIR_LIM_DELETE_STA_CONTEXT_IND);
574 CASE_RETURN_STRING(SIR_LIM_UPDATE_BEACON);
575 CASE_RETURN_STRING(SIR_LIM_JOIN_FAIL_TIMEOUT);
576 CASE_RETURN_STRING(SIR_LIM_AUTH_FAIL_TIMEOUT);
577 CASE_RETURN_STRING(SIR_LIM_AUTH_RSP_TIMEOUT);
578 CASE_RETURN_STRING(SIR_LIM_ASSOC_FAIL_TIMEOUT);
579 CASE_RETURN_STRING(SIR_LIM_REASSOC_FAIL_TIMEOUT);
580 CASE_RETURN_STRING(SIR_LIM_HEART_BEAT_TIMEOUT);
581 CASE_RETURN_STRING(SIR_LIM_ADDTS_RSP_TIMEOUT);
582 CASE_RETURN_STRING(SIR_LIM_LINK_TEST_DURATION_TIMEOUT);
583 CASE_RETURN_STRING(SIR_LIM_CNF_WAIT_TIMEOUT);
584 CASE_RETURN_STRING(SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT);
585 CASE_RETURN_STRING(SIR_LIM_WPS_OVERLAP_TIMEOUT);
586 CASE_RETURN_STRING(SIR_LIM_FT_PREAUTH_RSP_TIMEOUT);
587 CASE_RETURN_STRING(SIR_LIM_DISASSOC_ACK_TIMEOUT);
588 CASE_RETURN_STRING(SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT);
589 CASE_RETURN_STRING(SIR_LIM_AUTH_RETRY_TIMEOUT);
590 CASE_RETURN_STRING(SIR_LIM_AUTH_SAE_TIMEOUT);
591 CASE_RETURN_STRING(SIR_LIM_RRM_STA_STATS_RSP_TIMEOUT);
592 CASE_RETURN_STRING(SIR_LIM_MSG_TYPES_END);
593 CASE_RETURN_STRING(LIM_MLM_SCAN_REQ);
594 CASE_RETURN_STRING(LIM_MLM_SCAN_CNF);
595 CASE_RETURN_STRING(LIM_MLM_START_CNF);
596 CASE_RETURN_STRING(LIM_MLM_JOIN_REQ);
597 CASE_RETURN_STRING(LIM_MLM_JOIN_CNF);
598 CASE_RETURN_STRING(LIM_MLM_AUTH_REQ);
599 CASE_RETURN_STRING(LIM_MLM_AUTH_CNF);
600 CASE_RETURN_STRING(LIM_MLM_AUTH_IND);
601 CASE_RETURN_STRING(LIM_MLM_ASSOC_REQ);
602 CASE_RETURN_STRING(LIM_MLM_ASSOC_CNF);
603 CASE_RETURN_STRING(LIM_MLM_ASSOC_IND);
604 CASE_RETURN_STRING(LIM_MLM_DISASSOC_REQ);
605 CASE_RETURN_STRING(LIM_MLM_DISASSOC_CNF);
606 CASE_RETURN_STRING(LIM_MLM_DISASSOC_IND);
607 CASE_RETURN_STRING(LIM_MLM_REASSOC_CNF);
608 CASE_RETURN_STRING(LIM_MLM_REASSOC_IND);
609 CASE_RETURN_STRING(LIM_MLM_DEAUTH_REQ);
610 CASE_RETURN_STRING(LIM_MLM_DEAUTH_CNF);
611 CASE_RETURN_STRING(LIM_MLM_DEAUTH_IND);
612 CASE_RETURN_STRING(LIM_MLM_TSPEC_REQ);
613 CASE_RETURN_STRING(LIM_MLM_TSPEC_CNF);
614 CASE_RETURN_STRING(LIM_MLM_SETKEYS_CNF);
615 CASE_RETURN_STRING(LIM_MLM_LINK_TEST_STOP_REQ);
616 CASE_RETURN_STRING(LIM_MLM_PURGE_STA_IND);
617 default:
618 return (uint8_t *) "UNKNOWN";
619 break;
620 }
621 }
622
623 /**
624 * mac_trace_get_info_log_string() - Get the log info
625 * @info_log: message type in numeric form
626 *
627 * This function will return a string equivalent of the message.
628 *
629 * Return: String equivalent of the message type.
630 **/
mac_trace_get_info_log_string(uint16_t info_log)631 uint8_t *mac_trace_get_info_log_string(uint16_t info_log)
632 {
633 switch (info_log) {
634 CASE_RETURN_STRING(eLOG_NODROP_MISSED_BEACON_SCENARIO);
635 CASE_RETURN_STRING(eLOG_PROC_DEAUTH_FRAME_SCENARIO);
636 default:
637 return (uint8_t *) "UNKNOWN";
638 break;
639 }
640 }
641
642 #endif
643