qcacld-3.0: Set SMM if all new/existing conns are in same band

When the device is in DBS mode, and STA session gets
disconnected, then the dbs_opportunistic_timer is started
to wait for 10s and then sets back to SMM (Single MAC
mode) after timeout if DBS mode is not required.

The enhancement is to check the if the device is in DBS mode
and the STA session disconnects and new STA session starts in
the band in which existing connection are there, then stop the
dbs_opportunistic_timer and set hw_mode to SMM.

Change-Id: I16bfbb5135e36f2ab87bd09244d5eb6932846c72
CRs-Fixed: 1077488
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 36a8a46..926d4f0 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -11166,6 +11166,8 @@
 	tCsrRoamProfile *pRoamProfile;
 	eCsrAuthType RSNAuthType;
 	tSmeConfigParams *sme_config;
+	uint8_t channel = 0;
+	struct sir_hw_mode_params hw_mode;
 
 	ENTER();
 
@@ -11458,6 +11460,21 @@
 		pRoamProfile->ChannelInfo.ChannelList = NULL;
 		pRoamProfile->ChannelInfo.numOfChannels = 0;
 
+		if (!QDF_IS_STATUS_SUCCESS(
+				wma_get_current_hw_mode(&hw_mode))) {
+			hdd_err("wma_get_current_hw_mode failed");
+			return status;
+		}
+
+		if ((QDF_STA_MODE == pAdapter->device_mode)
+		    && hw_mode.dbs_cap) {
+			cds_get_channel_from_scan_result(pAdapter,
+					pRoamProfile, &channel);
+			if (channel)
+				cds_checkn_update_hw_mode_single_mac_mode
+					(channel);
+		}
+
 	} else {
 		hdd_err("No valid Roam profile");
 		return -EINVAL;