qcacld-3.0: UMAC: Add support for 2.4Ghz HT40 STA

- Add support for 2.4Ghz HT40 STA.
- Add HT40 OBSS scan start and stop operation.
- Add support for extraction of OBSS scan paramters from beacon
  and probe response.

Change-Id: I58e8d72b8ee922f710af0474ed3efd0438fff3a7
CRs-Fixed: 947086
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index 4064a07..6866468 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -1147,6 +1147,38 @@
 
 #endif
 
+static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx,
+							struct sSirMsgQ *msg)
+{
+	struct sPESession *session;
+	uint8_t session_id;
+	struct sme_obss_ht40_scanind_msg *ht40_scanind;
+
+	ht40_scanind = (struct sme_obss_ht40_scanind_msg *)msg->bodyptr;
+	session = pe_find_session_by_bssid(mac_ctx,
+			ht40_scanind->mac_addr.bytes, &session_id);
+	if (session == NULL) {
+		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
+			"OBSS Scan not started: session id is NULL");
+		return;
+	}
+	if (session->htSupportedChannelWidthSet ==
+			WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) {
+		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
+			"OBSS Scan Start Req: session id %d"
+			"htSupportedChannelWidthSet %d",
+			session->peSessionId,
+			session->htSupportedChannelWidthSet);
+		lim_send_ht40_obss_scanind(mac_ctx, session);
+	} else {
+		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
+			"OBSS Scan not started: channel width - %d session %d",
+			session->htSupportedChannelWidthSet,
+			session->peSessionId);
+	}
+	return;
+}
+
 /**
  * lim_handle_hw_mode_change_on_csa() - Do HW mode change on CSA for STA mode
  * @mac_ctx: Global MAC context
@@ -1973,6 +2005,11 @@
 		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
+	case eWNI_SME_HT40_OBSS_SCAN_IND:
+		lim_process_sme_obss_scan_ind(mac_ctx, msg);
+		qdf_mem_free(msg->bodyptr);
+		msg->bodyptr = NULL;
+		break;
 	default:
 		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
@@ -2208,6 +2245,7 @@
 			IS_DOT11_MODE_HT(psessionEntry->dot11mode);
 		psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport =
 			(uint8_t) macHTInfoField3.lsigTXOPProtectionFullSupport;
+		lim_init_obss_params(pMac, psessionEntry);
 	}
 }