qcacld-3.0: Select default channel of SAP in case of failure

Currently the driver choses a default channel for SAP
in case of failures, logic of which is incorrect as
it does not take into account the hw mode, and all
other checks such as SRD, unsafe, DFS etc.
The channel chosen after this maybe not as per
expectation.

Fix is to chose a default channel from the acs channel
list itslef so that the checks of SRD etc. ae honored.

Change-Id: Ife8a6b88938fd566bed92a5bde1cb0fe34a45462
CRs-Fixed: 2476351
diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c
index 8a808c2..52194e3 100644
--- a/core/sap/src/sap_fsm.c
+++ b/core/sap/src/sap_fsm.c
@@ -703,34 +703,12 @@
 
 uint8_t sap_select_default_oper_chan(struct sap_acs_cfg *acs_cfg)
 {
-	uint8_t channel;
-
-	if (!acs_cfg) {
-		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
-			"ACS config invalid!");
-		QDF_BUG(0);
+	if (!acs_cfg || !acs_cfg->ch_list)
 		return 0;
-	}
 
-	if (acs_cfg->hw_mode == eCSR_DOT11_MODE_11a) {
-		channel = SAP_DEFAULT_5GHZ_CHANNEL;
-	} else if ((acs_cfg->hw_mode == eCSR_DOT11_MODE_11n) ||
-		   (acs_cfg->hw_mode == eCSR_DOT11_MODE_11n_ONLY) ||
-		   (acs_cfg->hw_mode == eCSR_DOT11_MODE_11ac) ||
-		   (acs_cfg->hw_mode == eCSR_DOT11_MODE_11ac_ONLY) ||
-		   (acs_cfg->hw_mode == eCSR_DOT11_MODE_11ax) ||
-		   (acs_cfg->hw_mode == eCSR_DOT11_MODE_11ax_ONLY)) {
-		if (WLAN_REG_IS_5GHZ_CH(acs_cfg->start_ch))
-			channel = SAP_DEFAULT_5GHZ_CHANNEL;
-		else
-			channel = SAP_DEFAULT_24GHZ_CHANNEL;
-	} else {
-		channel = SAP_DEFAULT_24GHZ_CHANNEL;
-	}
-
-	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
-			FL("channel selected to start bss %d"), channel);
-	return channel;
+	sap_debug("default channel chosen as %d", acs_cfg->ch_list[0]);
+	/* Return the default channel as first channel in list */
+	return acs_cfg->ch_list[0];
 }
 
 QDF_STATUS