From 39acb13377f905b32fbe5d29d29408e9f2622429 Mon Sep 17 00:00:00 2001 From: Sreelakshmi Konamki Date: Wed, 16 Dec 2015 13:06:22 +0530 Subject: [PATCH] qcacld-3.0: Changes in Protocol Stack logs from numerical values to string qcacld-2.0 to qcacld-3.0 propagation As a part of logging enhancement,to make logs more interactive, changed pmcstate,scanType etc from numerical values to human readable string in Protocol stack. Change-Id: I589088c2c5fd0afa106a1d0773a2ff525b0dd083 CRs-Fixed: 638916 --- core/mac/inc/sir_api.h | 3 ++ .../mac/src/pe/lim/lim_process_beacon_frame.c | 4 +- .../src/pe/lim/lim_process_sme_req_messages.c | 3 +- core/mac/src/pe/lim/lim_sme_req_utils.c | 3 +- core/mac/src/pe/lim/lim_utils.c | 37 +++++++++++++++++++ core/sme/inc/sme_api.h | 1 + core/sme/src/csr/csr_api_roam.c | 6 ++- core/sme/src/csr/csr_api_scan.c | 24 ++++++++---- core/sme/src/csr/csr_util.c | 21 +++++++++++ 9 files changed, 88 insertions(+), 14 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index d73049243280..001844f6067e 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -309,6 +309,9 @@ typedef enum eStaRateMode { #define IERATE_RATE_MASK 0x7f #define IERATE_IS_BASICRATE(x) ((x) & IERATE_BASICRATE_MASK) +const char *lim_bss_type_to_string(const uint16_t bss_type); +const char *lim_scan_type_to_string(const uint8_t scan_type); + typedef struct sSirSupportedRates { /* * For Self STA Entry: this represents Self Mode. diff --git a/core/mac/src/pe/lim/lim_process_beacon_frame.c b/core/mac/src/pe/lim/lim_process_beacon_frame.c index 3a72a69ba418..18c05fd653f4 100644 --- a/core/mac/src/pe/lim/lim_process_beacon_frame.c +++ b/core/mac/src/pe/lim/lim_process_beacon_frame.c @@ -238,9 +238,9 @@ lim_process_beacon_frame_no_session(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo) cdf_mem_free(pBeacon); } /* end of (eLIM_MLM_WT_PROBE_RESP_STATE) || (eLIM_MLM_PASSIVE_SCAN_STATE) */ else { - lim_log(pMac, LOG1, FL("Rcvd Beacon in unexpected MLM state %d"), + lim_log(pMac, LOG1, FL("Rcvd Beacon in unexpected MLM state %s (%d)"), + lim_mlm_state_str(pMac->lim.gLimMlmState), pMac->lim.gLimMlmState); - lim_print_mlm_state(pMac, LOG1, pMac->lim.gLimMlmState); #ifdef WLAN_DEBUG pMac->lim.gLimUnexpBcnCnt++; #endif diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 934531e06572..70ceb3dfba6b 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -1396,11 +1396,12 @@ static void __lim_process_sme_scan_req(tpAniSirGlobal mac_ctx, scan_req = (tpSirSmeScanReq) msg_buf; lim_log(mac_ctx, LOG1, - FL("SME SCAN REQ id %d numChan %d min %d max %d IELen %d first %d fresh %d unique %d type %d rsp %d"), + FL("SME SCAN REQ id %d numChan %d min %d max %d IELen %d first %d fresh %d unique %d type %s (%d) rsp %d"), scan_req->scan_id, scan_req->channelList.numChannels, scan_req->minChannelTime, scan_req->maxChannelTime, scan_req->uIEFieldLen, scan_req->returnAfterFirstMatch, scan_req->returnFreshResults, scan_req->returnUniqueResults, + lim_scan_type_to_string(scan_req->scanType), scan_req->scanType, mac_ctx->lim.gLimRspReqd ? 1 : 0); /* * Since scan req always requires a response, we will overwrite response diff --git a/core/mac/src/pe/lim/lim_sme_req_utils.c b/core/mac/src/pe/lim/lim_sme_req_utils.c index f0f660fdfd11..7e06f75d72cf 100644 --- a/core/mac/src/pe/lim/lim_sme_req_utils.c +++ b/core/mac/src/pe/lim/lim_sme_req_utils.c @@ -388,7 +388,8 @@ lim_is_sme_start_bss_req_valid(tpAniSirGlobal mac_ctx, tSirMacRateSet *opr_rates = &start_bss_req->operationalRateSet; PELOG1(lim_log(mac_ctx, LOG1, - FL("Parsed START_BSS_REQ fields are bssType=%d, channelId=%d, SSID len=%d, rsnIE len=%d, nwType=%d, rateset len=%d"), + FL("Parsed START_BSS_REQ fields are bssType=%s (%d), channelId=%d, SSID len=%d, rsnIE len=%d, nwType=%d, rateset len=%d"), + lim_bss_type_to_string(start_bss_req->bssType), start_bss_req->bssType, start_bss_req->channelId, start_bss_req->ssId.length, start_bss_req->rsnIE.length, start_bss_req->nwType, opr_rates->numRates);) diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index f11b3873c2a9..f49407430ec7 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -7158,3 +7158,40 @@ lim_get_80Mhz_center_channel(uint8_t primary_channel) return INVALID_CHANNEL_ID; } + +/** + * lim_scan_type_to_string(): converts scan type enum to string. + * @scan_type: enum value of scan_type. + * + * Return: Printable string for scan_type + */ +const char *lim_scan_type_to_string(const uint8_t scan_type) +{ + switch (scan_type) { + CASE_RETURN_STRING(eSIR_PASSIVE_SCAN); + CASE_RETURN_STRING(eSIR_ACTIVE_SCAN); + CASE_RETURN_STRING(eSIR_BEACON_TABLE); + default: + return "Unknown scan_type"; + } +} + +/** + * lim_bss_type_to_string(): converts bss type enum to string. + * @bss_type: enum value of bss_type. + * + * Return: Printable string for bss_type + */ +const char *lim_bss_type_to_string(const uint16_t bss_type) +{ + switch (bss_type) { + CASE_RETURN_STRING(eSIR_INFRASTRUCTURE_MODE); + CASE_RETURN_STRING(eSIR_INFRA_AP_MODE); + CASE_RETURN_STRING(eSIR_IBSS_MODE); + CASE_RETURN_STRING(eSIR_BTAMP_STA_MODE); + CASE_RETURN_STRING(eSIR_BTAMP_AP_MODE); + CASE_RETURN_STRING(eSIR_AUTO_MODE); + default: + return "Unknown bss_type"; + } +} diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 7882951a772c..748652169697 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -819,6 +819,7 @@ CDF_STATUS sme_modify_add_ie(tHalHandle hHal, CDF_STATUS sme_update_add_ie(tHalHandle hHal, tSirUpdateIE *pUpdateIE, eUpdateIEsType updateType); CDF_STATUS sme_update_connect_debug(tHalHandle hHal, uint32_t set_value); +const char *sme_request_type_to_string(const uint8_t request_type); CDF_STATUS sme_ap_disable_intra_bss_fwd(tHalHandle hHal, uint8_t sessionId, bool disablefwd); uint32_t sme_get_channel_bonding_mode5_g(tHalHandle hHal); diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 7c1c12de50b4..aa08d033a091 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -7143,7 +7143,8 @@ CDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId, /* Initialize the count before proceeding with the Join requests */ pSession->join_bssid_count = 0; sms_log(pMac, LOG1, - FL("called BSSType = %d authtype = %d encryType = %d"), + FL("called BSSType = %s (%d) authtype = %d encryType = %d"), + lim_bss_type_to_string(pProfile->BSSType), pProfile->BSSType, pProfile->AuthType.authType[0], pProfile->EncryptionType.encryptionType[0]); csr_roam_cancel_roaming(pMac, sessionId); @@ -7325,7 +7326,8 @@ csr_roam_reassoc(tpAniSirGlobal mac_ctx, uint32_t session_id, return CDF_STATUS_E_FAILURE; } sms_log(mac_ctx, LOG1, - FL("called BSSType = %d authtype = %d encryType = %d"), + FL("called BSSType = %s (%d) authtype = %d encryType = %d"), + lim_bss_type_to_string(profile->BSSType), profile->BSSType, profile->AuthType.authType[0], profile->EncryptionType.encryptionType[0]); csr_roam_cancel_roaming(mac_ctx, session_id); diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 921288b9604b..16ebbc7227ac 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -4861,11 +4861,15 @@ CDF_STATUS csr_send_mb_scan_req(tpAniSirGlobal pMac, uint16_t sessionId, pScanReqParam->fUniqueResult, pScanReqParam->freshScan, pScanReqParam->hiddenSsid); sms_log(pMac, LOG1, - FL("scanType = %u BSSType = %u numOfSSIDs = %d" - " numOfChannels = %d requestType = %d p2pSearch = %d\n"), - pScanReq->scanType, pScanReq->BSSType, + FL("scanType = %s (%u) BSSType = %s (%u) numOfSSIDs = %d" + " numOfChannels = %d requestType = %s (%d) p2pSearch = %d\n"), + lim_scan_type_to_string(pScanReq->scanType), + pScanReq->scanType, + lim_bss_type_to_string(pScanReq->BSSType), + pScanReq->BSSType, pScanReq->SSIDs.numOfSSIDs, pScanReq->ChannelInfo.numOfChannels, + sme_request_type_to_string(pScanReq->requestType), pScanReq->requestType, pScanReq->p2pSearch); return CDF_STATUS_E_NOMEM; } @@ -5006,10 +5010,12 @@ CDF_STATUS csr_send_mb_scan_req(tpAniSirGlobal pMac, uint16_t sessionId, send_scan_req: sms_log(pMac, LOG1, - FL("scanId %d domainIdCurrent %d scanType %d bssType %d requestType %d numChannels %d"), - pMsg->scan_id, pMac->scan.domainIdCurrent, pMsg->scanType, - pMsg->bssType, pScanReq->requestType, - pMsg->channelList.numChannels); + FL("scanId %d domainIdCurrent %d scanType %s (%d) bssType %s (%d) requestType %s (%d) numChannels %d"), + pMsg->scan_id, pMac->scan.domainIdCurrent, + lim_scan_type_to_string(pMsg->scanType), pMsg->scanType, + lim_bss_type_to_string(pMsg->bssType), pMsg->bssType, + sme_request_type_to_string(pScanReq->requestType), + pScanReq->requestType, pMsg->channelList.numChannels); for (i = 0; i < pMsg->channelList.numChannels; i++) { sms_log(pMac, LOG1, FL("channelNumber[%d]= %d"), i, @@ -5256,7 +5262,9 @@ static void csr_scan_copy_request_valid_channels_only(tpAniSirGlobal mac_ctx, ) { #ifdef FEATURE_WLAN_LFR sms_log(mac_ctx, LOG2, - FL(" reqType=%d, numOfChannels=%d, ignoring DFS channel %d"), + FL(" reqType= %s (%d), numOfChannels=%d, ignoring DFS channel %d"), + sme_request_type_to_string( + src_req->requestType), src_req->requestType, src_req->ChannelInfo.numOfChannels, src_req->ChannelInfo.ChannelList diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 8c9c1d869cec..189e3b27705b 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -5561,6 +5561,27 @@ bool csr_is_channel_present_in_list(uint8_t *pChannelList, return false; } +/** + * sme_request_type_to_string(): converts scan request enum to string. + * @request_type: scan request type enum. + * + * Return: Printable string for request_type + */ +const char *sme_request_type_to_string(const uint8_t request_type) +{ + switch (request_type) { + CASE_RETURN_STRING(eCSR_SCAN_REQUEST_11D_SCAN); + CASE_RETURN_STRING(eCSR_SCAN_REQUEST_FULL_SCAN); + CASE_RETURN_STRING(eCSR_SCAN_IDLE_MODE_SCAN); + CASE_RETURN_STRING(eCSR_SCAN_HO_PROBE_SCAN); + CASE_RETURN_STRING(eCSR_SCAN_P2P_DISCOVERY); + CASE_RETURN_STRING(eCSR_SCAN_SOFTAP_CHANNEL_RANGE); + CASE_RETURN_STRING(eCSR_SCAN_P2P_FIND_PEER); + default: + return "Unknown Scan Request Type"; + } +} + CDF_STATUS csr_add_to_channel_list_front(uint8_t *pChannelList, int numChannels, uint8_t channel) {