Răsfoiți Sursa

qcacld-3.0: Check and override strict flag for SAP user CSA

If force SCC enabled, user trigger SAP CSA and target channel
doesn't cause MCC with existing STA/CLI. Then overide strict flag to
true, so that driver can skip the overlap interference check and
allow the CSA go through. This is to allow SAP/GO force SCC in
same band.

Change-Id: I7844f7329b922456594cad1402a0d2ac0d0927c5
CRs-Fixed: 3178725
Liangwei Dong 3 ani în urmă
părinte
comite
6977ac6da5
3 a modificat fișierele cu 62 adăugiri și 0 ștergeri
  1. 4 0
      core/hdd/src/wlan_hdd_hostapd.c
  2. 21 0
      core/sap/inc/sap_api.h
  3. 37 0
      core/sap/src/sap_module.c

+ 4 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -3189,6 +3189,10 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_chan_freq,
 	}
 	if (wlan_vdev_mlme_get_opmode(vdev) == QDF_P2P_GO_MODE)
 		is_p2p_go_session = true;
+	else
+		forced = wlansap_override_csa_strict_for_sap(
+					hdd_ctx->mac_handle, sap_ctx,
+					target_chan_freq, forced);
 	hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID);
 
 	strict = is_p2p_go_session;

+ 21 - 0
core/sap/inc/sap_api.h

@@ -1612,6 +1612,27 @@ uint32_t wlansap_get_safe_channel_from_pcl_for_sap(struct sap_context *sap_ctx);
 qdf_freq_t wlansap_get_chan_band_restrict(struct sap_context *sap_ctx,
 					  enum sap_csa_reason_code *csa_reason);
 
+/**
+ * wlansap_override_csa_strict_for_sap() - check user CSA strict or not
+ * @mac: mac ctx
+ * @sap_ctx: sap context
+ * @target_chan_freq: target channel frequency in MHz
+ * @strict: CSA strict flag
+ *
+ * If force SCC enabled, user trigger SAP CSA and target channel
+ * doesn't cause MCC with existing STA/CLI, then override strict flag to
+ * true, so that driver can skip the overlap interference check and
+ * allow the CSA go through. This is to allow SAP/GO force SCC in
+ * same band.
+ *
+ * Return: true if CSA is strict, otherwise false
+ */
+bool
+wlansap_override_csa_strict_for_sap(mac_handle_t mac_handle,
+				    struct sap_context *sap_ctx,
+				    uint32_t target_chan_freq,
+				    bool strict);
+
 #ifdef FEATURE_RADAR_HISTORY
 /**
  * wlansap_query_radar_history() -  get radar history info

+ 37 - 0
core/sap/src/sap_module.c

@@ -1393,6 +1393,43 @@ wlansap_set_chan_params_for_csa(struct mac_context *mac,
 	return QDF_STATUS_SUCCESS;
 }
 
+bool
+wlansap_override_csa_strict_for_sap(mac_handle_t mac_handle,
+				    struct sap_context *sap_ctx,
+				    uint32_t target_chan_freq,
+				    bool strict)
+{
+	uint8_t existing_vdev_id = WLAN_UMAC_VDEV_ID_MAX;
+	enum policy_mgr_con_mode existing_vdev_mode = PM_MAX_NUM_OF_MODE;
+	uint32_t con_freq;
+	enum phy_ch_width ch_width;
+	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
+
+	if (!mac_ctx || !sap_ctx->vdev ||
+	    wlan_vdev_mlme_get_opmode(sap_ctx->vdev) != QDF_SAP_MODE)
+		return strict;
+
+	if (sap_ctx->csa_reason != CSA_REASON_USER_INITIATED)
+		return strict;
+
+	if (!policy_mgr_is_force_scc(mac_ctx->psoc))
+		return strict;
+
+	existing_vdev_id =
+		policy_mgr_fetch_existing_con_info(
+				mac_ctx->psoc,
+				sap_ctx->sessionId,
+				target_chan_freq,
+				&existing_vdev_mode,
+				&con_freq, &ch_width);
+	if (existing_vdev_id < WLAN_UMAC_VDEV_ID_MAX &&
+	    (existing_vdev_mode == PM_STA_MODE ||
+	     existing_vdev_mode == PM_P2P_CLIENT_MODE))
+		return strict;
+
+	return true;
+}
+
 QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
 					       uint32_t target_chan_freq,
 					       enum phy_ch_width target_bw,