Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 2 | * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /**========================================================================= |
| 29 | |
| 30 | \file lim_trace.c |
| 31 | |
| 32 | \brief implementation for trace related APIs |
| 33 | |
| 34 | \author Sunit Bhatia |
| 35 | |
| 36 | ========================================================================*/ |
| 37 | |
| 38 | /*-------------------------------------------------------------------------- |
| 39 | Include Files |
| 40 | ------------------------------------------------------------------------*/ |
| 41 | |
| 42 | #include "ani_global.h" /* for tpAniSirGlobal */ |
| 43 | |
| 44 | #include "lim_trace.h" |
| 45 | #include "lim_timer_utils.h" |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 46 | #include "qdf_trace.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 47 | |
| 48 | #ifdef LIM_TRACE_RECORD |
| 49 | uint32_t g_mgmt_frame_stats[14]; |
| 50 | |
| 51 | #define LIM_TRACE_MAX_SUBTYPES 14 |
| 52 | |
| 53 | static uint8_t *__lim_trace_get_timer_string(uint16_t timerId) |
| 54 | { |
| 55 | switch (timerId) { |
| 56 | CASE_RETURN_STRING(eLIM_MIN_CHANNEL_TIMER); |
| 57 | CASE_RETURN_STRING(eLIM_MAX_CHANNEL_TIMER); |
| 58 | CASE_RETURN_STRING(eLIM_JOIN_FAIL_TIMER); |
| 59 | CASE_RETURN_STRING(eLIM_AUTH_FAIL_TIMER); |
| 60 | CASE_RETURN_STRING(eLIM_AUTH_RESP_TIMER); |
| 61 | CASE_RETURN_STRING(eLIM_ASSOC_FAIL_TIMER); |
| 62 | CASE_RETURN_STRING(eLIM_REASSOC_FAIL_TIMER); |
| 63 | CASE_RETURN_STRING(eLIM_PRE_AUTH_CLEANUP_TIMER); |
| 64 | CASE_RETURN_STRING(eLIM_CNF_WAIT_TIMER); |
| 65 | CASE_RETURN_STRING(eLIM_AUTH_RSP_TIMER); |
| 66 | CASE_RETURN_STRING(eLIM_UPDATE_OLBC_CACHE_TIMER); |
| 67 | CASE_RETURN_STRING(eLIM_PROBE_AFTER_HB_TIMER); |
| 68 | CASE_RETURN_STRING(eLIM_ADDTS_RSP_TIMER); |
| 69 | CASE_RETURN_STRING(eLIM_CHANNEL_SWITCH_TIMER); |
| 70 | CASE_RETURN_STRING(eLIM_LEARN_DURATION_TIMER); |
| 71 | CASE_RETURN_STRING(eLIM_QUIET_TIMER); |
| 72 | CASE_RETURN_STRING(eLIM_QUIET_BSS_TIMER); |
| 73 | CASE_RETURN_STRING(eLIM_WPS_OVERLAP_TIMER); |
| 74 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 75 | CASE_RETURN_STRING(eLIM_FT_PREAUTH_RSP_TIMER); |
| 76 | #endif |
| 77 | CASE_RETURN_STRING(eLIM_REMAIN_CHN_TIMER); |
| 78 | CASE_RETURN_STRING(eLIM_PERIODIC_PROBE_REQ_TIMER); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 79 | CASE_RETURN_STRING(eLIM_DISASSOC_ACK_TIMER); |
| 80 | CASE_RETURN_STRING(eLIM_DEAUTH_ACK_TIMER); |
| 81 | CASE_RETURN_STRING(eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER); |
| 82 | CASE_RETURN_STRING(eLIM_INSERT_SINGLESHOT_NOA_TIMER); |
| 83 | CASE_RETURN_STRING(eLIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE); |
| 84 | default: |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 85 | return "UNKNOWN"; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 86 | break; |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | static uint8_t *__lim_trace_get_mgmt_drop_reason_string(uint16_t dropReason) |
| 91 | { |
| 92 | |
| 93 | switch (dropReason) { |
| 94 | CASE_RETURN_STRING(eMGMT_DROP_INFRA_BCN_IN_IBSS); |
| 95 | CASE_RETURN_STRING(eMGMT_DROP_INVALID_SIZE); |
| 96 | CASE_RETURN_STRING(eMGMT_DROP_NON_SCAN_MODE_FRAME); |
| 97 | CASE_RETURN_STRING(eMGMT_DROP_NOT_LAST_IBSS_BCN); |
| 98 | CASE_RETURN_STRING(eMGMT_DROP_NO_DROP); |
| 99 | CASE_RETURN_STRING(eMGMT_DROP_SCAN_MODE_FRAME); |
| 100 | |
| 101 | default: |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 102 | return "UNKNOWN"; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 103 | break; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void lim_trace_init(tpAniSirGlobal pMac) |
| 108 | { |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 109 | qdf_trace_register(QDF_MODULE_ID_PE, (tp_qdf_trace_cb) &lim_trace_dump); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 110 | } |
| 111 | |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 112 | void lim_trace_dump(tpAniSirGlobal pMac, tp_qdf_trace_record pRecord, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 113 | uint16_t recIndex) |
| 114 | { |
| 115 | |
| 116 | static char *frameSubtypeStr[LIM_TRACE_MAX_SUBTYPES] = { |
| 117 | "Association request", |
| 118 | "Association response", |
| 119 | "Reassociation request", |
| 120 | "Reassociation response", |
| 121 | "Probe request", |
| 122 | "Probe response", |
| 123 | NULL, |
| 124 | NULL, |
| 125 | "Beacon", |
| 126 | "ATIM", |
| 127 | "Disassociation", |
| 128 | "Authentication", |
| 129 | "Deauthentication", |
| 130 | "Action" |
| 131 | }; |
| 132 | |
| 133 | switch (pRecord->code) { |
| 134 | case TRACE_CODE_MLM_STATE: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 135 | lim_log(pMac, LOG1, |
| 136 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 137 | pRecord->time, pRecord->session, "MLM State:", |
| 138 | lim_trace_get_mlm_state_string((uint16_t) pRecord->data), |
| 139 | pRecord->data); |
| 140 | break; |
| 141 | case TRACE_CODE_SME_STATE: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 142 | lim_log(pMac, LOG1, |
| 143 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 144 | pRecord->time, pRecord->session, "SME State:", |
| 145 | lim_trace_get_sme_state_string((uint16_t) pRecord->data), |
| 146 | pRecord->data); |
| 147 | break; |
| 148 | case TRACE_CODE_TX_MGMT: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 149 | lim_log(pMac, LOG1, |
| 150 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 151 | pRecord->time, pRecord->session, "TX Mgmt:", |
| 152 | frameSubtypeStr[pRecord->data], pRecord->data); |
| 153 | break; |
| 154 | |
| 155 | case TRACE_CODE_RX_MGMT: |
| 156 | if (LIM_TRACE_MAX_SUBTYPES <= |
| 157 | LIM_TRACE_GET_SUBTYPE(pRecord->data)) { |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 158 | lim_log(pMac, LOG1, "Wrong Subtype - %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 159 | LIM_TRACE_GET_SUBTYPE(pRecord->data)); |
| 160 | } else { |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 161 | lim_log(pMac, LOG1, |
| 162 | "%04d %012llu S%d %-14s %-30s(%d) SN: %d", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 163 | recIndex, pRecord->time, pRecord->session, |
| 164 | "RX Mgmt:", |
| 165 | frameSubtypeStr[LIM_TRACE_GET_SUBTYPE |
| 166 | (pRecord->data)], |
| 167 | LIM_TRACE_GET_SUBTYPE(pRecord->data), |
| 168 | LIM_TRACE_GET_SSN(pRecord->data)); |
| 169 | } |
| 170 | break; |
| 171 | case TRACE_CODE_RX_MGMT_DROP: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 172 | lim_log(pMac, LOG1, "%04d %012llu S%d %-14s %-30s(%d)", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 173 | recIndex, pRecord->time, pRecord->session, |
| 174 | "Drop RX Mgmt:", |
| 175 | __lim_trace_get_mgmt_drop_reason_string((uint16_t) pRecord-> |
| 176 | data), pRecord->data); |
| 177 | break; |
| 178 | |
| 179 | case TRACE_CODE_RX_MGMT_TSF: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 180 | lim_log(pMac, LOG1, |
| 181 | "%04d %012llu S%d %-14s %-30s0x%x(%d)", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 182 | recIndex, pRecord->time, pRecord->session, |
| 183 | "RX Mgmt TSF:", " ", pRecord->data, pRecord->data); |
| 184 | break; |
| 185 | |
| 186 | case TRACE_CODE_TX_COMPLETE: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 187 | lim_log(pMac, LOG1, "%04d %012llu S%d %-14s %d", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 188 | pRecord->time, pRecord->session, "TX Complete", |
| 189 | pRecord->data); |
| 190 | break; |
| 191 | |
| 192 | case TRACE_CODE_TX_SME_MSG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 193 | lim_log(pMac, LOG1, |
| 194 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 195 | pRecord->time, pRecord->session, "TX SME Msg:", |
| 196 | mac_trace_get_sme_msg_string((uint16_t) pRecord->data), |
| 197 | pRecord->data); |
| 198 | break; |
| 199 | case TRACE_CODE_RX_SME_MSG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 200 | lim_log(pMac, LOG1, |
| 201 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 202 | pRecord->time, pRecord->session, |
| 203 | LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord-> |
| 204 | data) ? "Def/Drp LIM Msg:" |
| 205 | : "RX Sme Msg:", |
| 206 | mac_trace_get_sme_msg_string((uint16_t) pRecord->data), |
| 207 | pRecord->data); |
| 208 | break; |
| 209 | |
| 210 | case TRACE_CODE_TX_WMA_MSG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 211 | lim_log(pMac, LOG1, |
| 212 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 213 | pRecord->time, pRecord->session, "TX WMA Msg:", |
| 214 | mac_trace_get_wma_msg_string((uint16_t) pRecord->data), |
| 215 | pRecord->data); |
| 216 | break; |
| 217 | |
| 218 | case TRACE_CODE_RX_WMA_MSG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 219 | lim_log(pMac, LOG1, |
| 220 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 221 | pRecord->time, pRecord->session, |
| 222 | LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord-> |
| 223 | data) ? "Def/Drp LIM Msg:" |
| 224 | : "RX WMA Msg:", |
| 225 | mac_trace_get_wma_msg_string((uint16_t) pRecord->data), |
| 226 | pRecord->data); |
| 227 | break; |
| 228 | |
| 229 | case TRACE_CODE_TX_LIM_MSG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 230 | lim_log(pMac, LOG1, |
| 231 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 232 | pRecord->time, pRecord->session, "TX LIM Msg:", |
| 233 | mac_trace_get_lim_msg_string((uint16_t) pRecord->data), |
| 234 | pRecord->data); |
| 235 | break; |
| 236 | case TRACE_CODE_RX_LIM_MSG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 237 | lim_log(pMac, LOG1, |
| 238 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 239 | pRecord->time, pRecord->session, |
| 240 | LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord-> |
| 241 | data) ? "Def/Drp LIM Msg:" |
| 242 | : "RX LIM Msg", |
| 243 | mac_trace_get_lim_msg_string((uint16_t) pRecord->data), |
| 244 | pRecord->data); |
| 245 | break; |
| 246 | case TRACE_CODE_TX_CFG_MSG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 247 | lim_log(pMac, LOG1, |
| 248 | "%04d %012llu S%d %-14s %-30s(0x%x) ", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 249 | pRecord->time, pRecord->session, "TX CFG Msg:", |
| 250 | mac_trace_get_cfg_msg_string((uint16_t) pRecord->data), |
| 251 | pRecord->data); |
| 252 | break; |
| 253 | case TRACE_CODE_RX_CFG_MSG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 254 | lim_log(pMac, LOG1, |
| 255 | "%04d %012llu S%d %-14s %-30s(0x%x) ", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 256 | pRecord->time, pRecord->session, |
| 257 | LIM_TRACE_GET_DEFRD_OR_DROPPED(pRecord-> |
| 258 | data) ? "Def/Drp LIM Msg:" |
| 259 | : "RX CFG Msg:", |
| 260 | mac_trace_get_cfg_msg_string((uint16_t) |
| 261 | MAC_TRACE_GET_MSG_ID(pRecord-> |
| 262 | data)), |
| 263 | pRecord->data); |
| 264 | break; |
| 265 | |
| 266 | case TRACE_CODE_TIMER_ACTIVATE: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 267 | lim_log(pMac, LOG1, |
| 268 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 269 | pRecord->time, pRecord->session, "Timer Actvtd", |
| 270 | __lim_trace_get_timer_string((uint16_t) pRecord->data), |
| 271 | pRecord->data); |
| 272 | break; |
| 273 | case TRACE_CODE_TIMER_DEACTIVATE: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 274 | lim_log(pMac, LOG1, |
| 275 | "%04d %012llu S%d %-14s %-30s(0x%x)", recIndex, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 276 | pRecord->time, pRecord->session, "Timer DeActvtd", |
| 277 | __lim_trace_get_timer_string((uint16_t) pRecord->data), |
| 278 | pRecord->data); |
| 279 | break; |
| 280 | |
| 281 | case TRACE_CODE_INFO_LOG: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 282 | lim_log(pMac, LOG1, |
| 283 | "%04d %012llu S%d %-14s %-30s(0x%x)", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 284 | recIndex, pRecord->time, pRecord->session, |
| 285 | "INFORMATION_LOG", |
| 286 | mac_trace_get_info_log_string((uint16_t) pRecord->data), |
| 287 | pRecord->data); |
| 288 | break; |
| 289 | default: |
Abhishek Singh | 37595be | 2015-12-01 15:25:20 +0530 | [diff] [blame] | 290 | lim_log(pMac, LOG1, "%04d %012llu S%d %-14s(%d) (0x%x)", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 291 | recIndex, pRecord->time, pRecord->session, |
| 292 | "Unknown Code", pRecord->code, pRecord->data); |
| 293 | break; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | void mac_trace_msg_tx(tpAniSirGlobal pMac, uint8_t session, uint32_t data) |
| 298 | { |
| 299 | |
| 300 | uint16_t msgId = (uint16_t) MAC_TRACE_GET_MSG_ID(data); |
| 301 | uint8_t moduleId = (uint8_t) MAC_TRACE_GET_MODULE_ID(data); |
| 302 | |
| 303 | switch (moduleId) { |
| 304 | case SIR_LIM_MODULE_ID: |
| 305 | if (msgId >= SIR_LIM_ITC_MSG_TYPES_BEGIN) |
| 306 | mac_trace(pMac, TRACE_CODE_TX_LIM_MSG, session, data); |
| 307 | else |
| 308 | mac_trace(pMac, TRACE_CODE_TX_SME_MSG, session, data); |
| 309 | break; |
| 310 | case SIR_WMA_MODULE_ID: |
| 311 | mac_trace(pMac, TRACE_CODE_TX_WMA_MSG, session, data); |
| 312 | break; |
| 313 | case SIR_CFG_MODULE_ID: |
| 314 | mac_trace(pMac, TRACE_CODE_TX_CFG_MSG, session, data); |
| 315 | break; |
| 316 | default: |
| 317 | mac_trace(pMac, moduleId, session, data); |
| 318 | break; |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | void mac_trace_msg_tx_new(tpAniSirGlobal pMac, uint8_t module, uint8_t session, |
| 323 | uint32_t data) |
| 324 | { |
| 325 | uint16_t msgId = (uint16_t) MAC_TRACE_GET_MSG_ID(data); |
| 326 | uint8_t moduleId = (uint8_t) MAC_TRACE_GET_MODULE_ID(data); |
| 327 | |
| 328 | switch (moduleId) { |
| 329 | case SIR_LIM_MODULE_ID: |
| 330 | if (msgId >= SIR_LIM_ITC_MSG_TYPES_BEGIN) |
| 331 | mac_trace_new(pMac, module, TRACE_CODE_TX_LIM_MSG, |
| 332 | session, data); |
| 333 | else |
| 334 | mac_trace_new(pMac, module, TRACE_CODE_TX_SME_MSG, |
| 335 | session, data); |
| 336 | break; |
| 337 | case SIR_WMA_MODULE_ID: |
| 338 | mac_trace_new(pMac, module, TRACE_CODE_TX_WMA_MSG, session, data); |
| 339 | break; |
| 340 | case SIR_CFG_MODULE_ID: |
| 341 | mac_trace_new(pMac, module, TRACE_CODE_TX_CFG_MSG, session, data); |
| 342 | break; |
| 343 | default: |
| 344 | mac_trace(pMac, moduleId, session, data); |
| 345 | break; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | /* |
| 350 | * bit31: Rx message defferred or not |
| 351 | * bit 0-15: message ID: |
| 352 | */ |
| 353 | void mac_trace_msg_rx(tpAniSirGlobal pMac, uint8_t session, uint32_t data) |
| 354 | { |
| 355 | uint16_t msgId = (uint16_t) MAC_TRACE_GET_MSG_ID(data); |
| 356 | uint8_t moduleId = (uint8_t) MAC_TRACE_GET_MODULE_ID(data); |
| 357 | |
| 358 | switch (moduleId) { |
| 359 | case SIR_LIM_MODULE_ID: |
| 360 | if (msgId >= SIR_LIM_ITC_MSG_TYPES_BEGIN) |
| 361 | mac_trace(pMac, TRACE_CODE_RX_LIM_MSG, session, data); |
| 362 | else |
| 363 | mac_trace(pMac, TRACE_CODE_RX_SME_MSG, session, data); |
| 364 | break; |
| 365 | case SIR_WMA_MODULE_ID: |
| 366 | mac_trace(pMac, TRACE_CODE_RX_WMA_MSG, session, data); |
| 367 | break; |
| 368 | case SIR_CFG_MODULE_ID: |
| 369 | mac_trace(pMac, TRACE_CODE_RX_CFG_MSG, session, data); |
| 370 | break; |
| 371 | default: |
| 372 | mac_trace(pMac, moduleId, session, data); |
| 373 | break; |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | /* |
| 378 | * bit31: Rx message defferred or not |
| 379 | * bit 0-15: message ID: |
| 380 | */ |
| 381 | void mac_trace_msg_rx_new(tpAniSirGlobal pMac, uint8_t module, uint8_t session, |
| 382 | uint32_t data) |
| 383 | { |
| 384 | uint16_t msgId = (uint16_t) MAC_TRACE_GET_MSG_ID(data); |
| 385 | uint8_t moduleId = (uint8_t) MAC_TRACE_GET_MODULE_ID(data); |
| 386 | |
| 387 | switch (moduleId) { |
| 388 | case SIR_LIM_MODULE_ID: |
| 389 | if (msgId >= SIR_LIM_ITC_MSG_TYPES_BEGIN) |
| 390 | mac_trace_new(pMac, module, TRACE_CODE_RX_LIM_MSG, |
| 391 | session, data); |
| 392 | else |
| 393 | mac_trace_new(pMac, module, TRACE_CODE_RX_SME_MSG, |
| 394 | session, data); |
| 395 | break; |
| 396 | case SIR_WMA_MODULE_ID: |
| 397 | mac_trace_new(pMac, module, TRACE_CODE_RX_WMA_MSG, session, data); |
| 398 | break; |
| 399 | case SIR_CFG_MODULE_ID: |
| 400 | mac_trace_new(pMac, module, TRACE_CODE_RX_CFG_MSG, session, data); |
| 401 | break; |
| 402 | default: |
| 403 | mac_trace(pMac, moduleId, session, data); |
| 404 | break; |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | uint8_t *lim_trace_get_mlm_state_string(uint32_t mlmState) |
| 409 | { |
| 410 | switch (mlmState) { |
| 411 | CASE_RETURN_STRING(eLIM_MLM_OFFLINE_STATE); |
| 412 | CASE_RETURN_STRING(eLIM_MLM_IDLE_STATE); |
| 413 | CASE_RETURN_STRING(eLIM_MLM_WT_PROBE_RESP_STATE); |
| 414 | CASE_RETURN_STRING(eLIM_MLM_PASSIVE_SCAN_STATE); |
| 415 | CASE_RETURN_STRING(eLIM_MLM_WT_JOIN_BEACON_STATE); |
| 416 | CASE_RETURN_STRING(eLIM_MLM_JOINED_STATE); |
| 417 | CASE_RETURN_STRING(eLIM_MLM_BSS_STARTED_STATE); |
| 418 | CASE_RETURN_STRING(eLIM_MLM_WT_AUTH_FRAME2_STATE); |
| 419 | CASE_RETURN_STRING(eLIM_MLM_WT_AUTH_FRAME3_STATE); |
| 420 | CASE_RETURN_STRING(eLIM_MLM_WT_AUTH_FRAME4_STATE); |
| 421 | CASE_RETURN_STRING(eLIM_MLM_AUTH_RSP_TIMEOUT_STATE); |
| 422 | CASE_RETURN_STRING(eLIM_MLM_AUTHENTICATED_STATE); |
| 423 | CASE_RETURN_STRING(eLIM_MLM_WT_ASSOC_RSP_STATE); |
| 424 | CASE_RETURN_STRING(eLIM_MLM_WT_REASSOC_RSP_STATE); |
| 425 | CASE_RETURN_STRING(eLIM_MLM_ASSOCIATED_STATE); |
| 426 | CASE_RETURN_STRING(eLIM_MLM_REASSOCIATED_STATE); |
| 427 | CASE_RETURN_STRING(eLIM_MLM_LINK_ESTABLISHED_STATE); |
| 428 | CASE_RETURN_STRING(eLIM_MLM_WT_ASSOC_CNF_STATE); |
| 429 | CASE_RETURN_STRING(eLIM_MLM_LEARN_STATE); |
| 430 | CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_STATE); |
| 431 | CASE_RETURN_STRING(eLIM_MLM_WT_DEL_BSS_RSP_STATE); |
| 432 | CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE); |
| 433 | CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_PREASSOC_STATE); |
| 434 | CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE); |
| 435 | CASE_RETURN_STRING(eLIM_MLM_WT_ADD_STA_RSP_STATE); |
| 436 | CASE_RETURN_STRING(eLIM_MLM_WT_DEL_STA_RSP_STATE); |
| 437 | CASE_RETURN_STRING(eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE); |
| 438 | CASE_RETURN_STRING(eLIM_MLM_WT_SET_BSS_KEY_STATE); |
| 439 | CASE_RETURN_STRING(eLIM_MLM_WT_SET_STA_KEY_STATE); |
| 440 | CASE_RETURN_STRING(eLIM_MLM_WT_SET_STA_BCASTKEY_STATE); |
| 441 | CASE_RETURN_STRING(eLIM_MLM_WT_SET_MIMOPS_STATE); |
| 442 | default: |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 443 | return "UNKNOWN"; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 444 | break; |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | uint8_t *lim_trace_get_sme_state_string(uint32_t smeState) |
| 449 | { |
| 450 | switch (smeState) { |
| 451 | |
| 452 | CASE_RETURN_STRING(eLIM_SME_OFFLINE_STATE); |
| 453 | CASE_RETURN_STRING(eLIM_SME_IDLE_STATE); |
| 454 | CASE_RETURN_STRING(eLIM_SME_SUSPEND_STATE); |
| 455 | CASE_RETURN_STRING(eLIM_SME_WT_SCAN_STATE); |
| 456 | CASE_RETURN_STRING(eLIM_SME_WT_JOIN_STATE); |
| 457 | CASE_RETURN_STRING(eLIM_SME_WT_AUTH_STATE); |
| 458 | CASE_RETURN_STRING(eLIM_SME_WT_ASSOC_STATE); |
| 459 | CASE_RETURN_STRING(eLIM_SME_WT_REASSOC_STATE); |
| 460 | CASE_RETURN_STRING(eLIM_SME_WT_REASSOC_LINK_FAIL_STATE); |
| 461 | CASE_RETURN_STRING(eLIM_SME_JOIN_FAILURE_STATE); |
| 462 | CASE_RETURN_STRING(eLIM_SME_ASSOCIATED_STATE); |
| 463 | CASE_RETURN_STRING(eLIM_SME_REASSOCIATED_STATE); |
| 464 | CASE_RETURN_STRING(eLIM_SME_LINK_EST_STATE); |
| 465 | CASE_RETURN_STRING(eLIM_SME_LINK_EST_WT_SCAN_STATE); |
| 466 | CASE_RETURN_STRING(eLIM_SME_WT_PRE_AUTH_STATE); |
| 467 | CASE_RETURN_STRING(eLIM_SME_WT_DISASSOC_STATE); |
| 468 | CASE_RETURN_STRING(eLIM_SME_WT_DEAUTH_STATE); |
| 469 | CASE_RETURN_STRING(eLIM_SME_WT_START_BSS_STATE); |
| 470 | CASE_RETURN_STRING(eLIM_SME_WT_STOP_BSS_STATE); |
| 471 | CASE_RETURN_STRING(eLIM_SME_NORMAL_STATE); |
| 472 | CASE_RETURN_STRING(eLIM_SME_CHANNEL_SCAN_STATE); |
| 473 | CASE_RETURN_STRING(eLIM_SME_NORMAL_CHANNEL_SCAN_STATE); |
| 474 | default: |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 475 | return "UNKNOWN"; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 476 | break; |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | #endif |