Browse Source

qcacld-3.0: Start the SAP if force SAP ini is set

Currently, the driver trims the channel list with
the PCL if external acs policy ini is set, and
if the channels are unsafe then that can lead
to 0 channels and the SAP can fail.

Fix is to check whether the force SAP start ini
is set and override the channel.

Change-Id: If245bf27deda0f6022343d7a175520fdd92d106b
CRs-Fixed: 2667742
gaurank kathpalia 5 years ago
parent
commit
3935335687

+ 12 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -1904,6 +1904,18 @@ QDF_STATUS wlan_mlme_get_vht_tx_mcs_2x2(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS
 wlan_mlme_get_vht20_mcs9(struct wlan_objmgr_psoc *psoc, bool *value);
 
+/**
+ * wlan_mlme_get_force_sap_enabled() - Get the value of force SAP enabled
+ * @psoc: psoc context
+ * @value: data to get
+ *
+ * Get the value of force SAP enabled
+ *
+ * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE
+ */
+QDF_STATUS
+wlan_mlme_get_force_sap_enabled(struct wlan_objmgr_psoc *psoc, bool *value);
+
 /**
  * wlan_mlme_get_vht_enable2x2() - Enables/disables VHT Tx/Rx MCS values for 2x2
  * @psoc: psoc context

+ 15 - 0
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -2500,6 +2500,21 @@ ucfg_mlme_get_vht_enable2x2(struct wlan_objmgr_psoc *psoc, bool *value)
 	return wlan_mlme_get_vht_enable2x2(psoc, value);
 }
 
+/**
+ * ucfg_mlme_get_force_sap_enabled() - Get the value of force SAP enabled
+ * @psoc: psoc context
+ * @value: data to get
+ *
+ * Get the value of force SAP enabled
+ *
+ * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE
+ */
+static inline QDF_STATUS
+ucfg_mlme_get_force_sap_enabled(struct wlan_objmgr_psoc *psoc, bool *value)
+{
+	return wlan_mlme_get_force_sap_enabled(psoc, value);
+}
+
 /**
  * ucfg_mlme_set_vht_enable2x2() - Enables/disables VHT Tx/Rx MCS values for 2x2
  * @psoc: psoc context

+ 14 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -2991,6 +2991,20 @@ wlan_mlme_get_vht_enable2x2(struct wlan_objmgr_psoc *psoc, bool *value)
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS
+wlan_mlme_get_force_sap_enabled(struct wlan_objmgr_psoc *psoc, bool *value)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_FAILURE;
+
+	*value = mlme_obj->cfg.acs.force_sap_start;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS
 wlan_mlme_set_vht_enable2x2(struct wlan_objmgr_psoc *psoc, bool value)
 {

+ 4 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -2922,6 +2922,7 @@ static void wlan_hdd_handle_zero_acs_list(struct hdd_context *hdd_ctx,
 {
 	uint16_t i, sta_count;
 	uint32_t acs_chan_default = 0;
+	bool force_sap_allowed = false;
 
 	if (!acs_ch_list_count || *acs_ch_list_count > 0 ||
 	    !acs_freq_list) {
@@ -2936,7 +2937,9 @@ static void wlan_hdd_handle_zero_acs_list(struct hdd_context *hdd_ctx,
 			(hdd_ctx->psoc, PM_STA_MODE, NULL);
 	sta_count += policy_mgr_mode_specific_connection_count
 			(hdd_ctx->psoc, PM_P2P_CLIENT_MODE, NULL);
-	if (!sta_count)
+
+	ucfg_mlme_get_force_sap_enabled(hdd_ctx->psoc, &force_sap_allowed);
+	if (!sta_count && !force_sap_allowed)
 		return;
 
 	for (i = 0; i < org_ch_list_count; i++) {