Ver código fonte

qcacld-3.0: Start BSS on operating band based on ACS hw mode

qcacld-2.0 to qcacld-3.0 propagation.

Currently, SAP start's on 2.4ghz channels on detecting unsafe
channels even though operating band ACS hw mode is configured
on 5ghz channels.

Fix is to start BSS on band based on ACS hw mode

Change-Id: I210937b4b464c408d5a22c348c028fa9a11b2142
CRs-Fixed: 1005327
Selvaraj, Sridhar 8 anos atrás
pai
commit
9a9266eac5

+ 6 - 9
core/sap/src/sap_api_link_cntl.c

@@ -325,14 +325,9 @@ wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext,
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			FL("CSR scan_status = eCSR_SCAN_ABORT/FAILURE (%d), choose default channel"),
 			scan_status);
-#ifdef SOFTAP_CHANNEL_RANGE
-		if (sap_ctx->acs_cfg->hw_mode == eCSR_DOT11_MODE_11a)
-			sap_ctx->channel = SAP_DEFAULT_5GHZ_CHANNEL;
-		else
-			sap_ctx->channel = SAP_DEFAULT_24GHZ_CHANNEL;
-#else
-		sap_ctx->channel = SAP_DEFAULT_24GHZ_CHANNEL;
-#endif
+		sap_ctx->channel =
+			sap_select_default_oper_chan(hal_handle,
+					sap_ctx->acs_cfg->hw_mode);
 		sap_ctx->sap_state = eSAP_ACS_CHANNEL_SELECTED;
 		sap_ctx->sap_status = eSAP_STATUS_SUCCESS;
 		goto close_session;
@@ -396,7 +391,9 @@ wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext,
 		goto close_session;
 	} else {
 #else
-		sap_ctx->channel = SAP_DEFAULT_24GHZ_CHANNEL;
+		sap_ctx->channel =
+			sap_select_default_oper_chan(hal_handle,
+				sap_ctx->acs_cfg->hw_mode);
 	} else {
 #endif
 		/* Valid Channel Found from scan results. */

+ 25 - 2
core/sap/src/sap_fsm.c

@@ -2089,6 +2089,28 @@ sap_dfs_is_channel_in_nol_list(ptSapContext sap_context,
 	return false;
 }
 
+/**
+ * sap_select_default_oper_chan() - Select operating channel based on acs hwmode
+ * @hal: pointer to HAL
+ * @acs_hwmode: HW mode of ACS
+ *
+ * Return: selected operating channel
+ */
+uint8_t sap_select_default_oper_chan(tHalHandle hal, uint32_t acs_hwmode)
+{
+	uint8_t channel;
+
+	if ((acs_hwmode == QCA_ACS_MODE_IEEE80211A) ||
+			(acs_hwmode == QCA_ACS_MODE_IEEE80211AD))
+		channel = SAP_DEFAULT_5GHZ_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_goto_channel_sel - Function for initiating scan request for SME
  * @sap_context: Sap Context value.
@@ -2297,8 +2319,9 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
 			QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
 				  FL("SAP Configuring default channel, Ch=%d"),
 				  sap_context->channel);
-			/* In case of error, switch to default channel */
-			sap_context->channel = SAP_DEFAULT_24GHZ_CHANNEL;
+			sap_context->channel =
+				sap_select_default_oper_chan(h_hal,
+					sap_context->acs_cfg->hw_mode);
 
 #ifdef SOFTAP_CHANNEL_RANGE
 			if (sap_context->channelList != NULL) {

+ 1 - 0
core/sap/src/sap_internal.h

@@ -434,4 +434,5 @@ QDF_STATUS sap_close_session(tHalHandle hHal,
 #ifdef __cplusplus
 }
 #endif
+uint8_t sap_select_default_oper_chan(tHalHandle hal, uint32_t acs_hwmode);
 #endif