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
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 3a72a69..18c05fd 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 @@
 		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 934531e..70ceb3d 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 @@
 
 	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 f0f660f..7e06f75 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 @@
 	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 f11b387..f494074 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -7158,3 +7158,40 @@
 
 	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";
+	}
+}