Эх сурвалжийг харах

qcacld-3.0: Store and delete other SAP connection information if SCC

Currently only store and delete self SAP connection information when
get PCL for mode SAP, if there is other SAP doing SCC with it, the PCL
list may only have SCC channels, but if the SCC channel has unsafe
channel within bandwidth, it cannot move to other safe channel which
has bigger bandwidth.

For example, AP1+AP2 on channel 5240(BW 80 MHz) and AP3 is on channel
2462, COEX AVOID event come and both 5180 and 2462 become unsafe, when
AP1 is going to switch channel it will get PCL list only have 5240, so
it cannot move home channel but just shrink bandwidth to avoid unsafe
channels.

Fix it by also store and delete other SAP connection information SCC
with current SAP if get PCL from get safe SAP channel path:
wlansap_get_safe_channel_from_pcl_and_acs_range().

Change-Id: Ia52c6ac221293036f65173f38cf4b8436629492a
CRs-Fixed: 3534131
Will Huang 1 жил өмнө
parent
commit
57604f153e

+ 24 - 0
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -2912,6 +2912,30 @@ QDF_STATUS policy_mgr_get_pcl_for_vdev_id(struct wlan_objmgr_psoc *psoc,
 					  uint32_t weight_len,
 					  uint8_t vdev_id);
 
+/**
+ * policy_mgr_get_pcl_for_scc_in_same_mode() - Get PCL for vdev and other
+ * connection in same mode and same frequency
+ * @psoc: PSOC object information
+ * @mode: Connection mode of type 'policy_mgr_con_mode'
+ * @pcl_ch: Pointer to the PCL
+ * @len: Pointer to the length of the PCL
+ * @pcl_weight: Pointer to the weights of the PCL
+ * @weight_len: Max length of the weights list
+ * @vdev_id: vdev id to get PCL
+ *
+ * If need move connections in same mode and same frequency, need get PCL
+ * after remove them from connection list.
+ *
+ * Return: QDF STATUS
+ */
+QDF_STATUS
+policy_mgr_get_pcl_for_scc_in_same_mode(struct wlan_objmgr_psoc *psoc,
+					enum policy_mgr_con_mode mode,
+					uint32_t *pcl_ch, uint32_t *len,
+					uint8_t *pcl_weight,
+					uint32_t weight_len,
+					uint8_t vdev_id);
+
 /**
  * policy_mgr_get_valid_chan_weights() - Get the weightage for
  * all valid channels

+ 45 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -324,6 +324,51 @@ out:
 	return status;
 }
 
+QDF_STATUS
+policy_mgr_get_pcl_for_scc_in_same_mode(struct wlan_objmgr_psoc *psoc,
+					enum policy_mgr_con_mode mode,
+					uint32_t *pcl_ch, uint32_t *len,
+					uint8_t *pcl_weight,
+					uint32_t weight_len,
+					uint8_t vdev_id)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	struct policy_mgr_conc_connection_info
+			info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} };
+	qdf_freq_t vdev_freq;
+	QDF_STATUS status;
+	uint8_t num_del = 0;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	status = policy_mgr_get_chan_by_session_id(psoc, vdev_id, &vdev_freq);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		policy_mgr_err("Fail to get channel by vdev id %d", vdev_id);
+		return status;
+	}
+
+	policy_mgr_debug("get pcl for existing conn:%d vdev id %d",
+			 mode, vdev_id);
+
+	qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
+	policy_mgr_store_and_del_conn_info_by_chan_and_mode(psoc,
+							    vdev_freq,
+							    mode,
+							    info,
+							    &num_del);
+	status = policy_mgr_get_pcl(psoc, mode, pcl_ch, len,
+				    pcl_weight, weight_len, vdev_id);
+	if (num_del > 0)
+		policy_mgr_restore_deleted_conn_info(psoc, info, num_del);
+	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
+
+	return status;
+}
+
 void
 polic_mgr_send_pcl_to_fw(struct wlan_objmgr_psoc *psoc,
 			 enum QDF_OPMODE mode)

+ 5 - 5
core/sap/src/sap_module.c

@@ -3593,11 +3593,11 @@ wlansap_get_safe_channel_from_pcl_and_acs_range(struct sap_context *sap_ctx,
 	}
 
 	status =
-		policy_mgr_get_pcl_for_vdev_id(mac->psoc, PM_SAP_MODE,
-					       pcl_freqs, &pcl_len,
-					       pcl.weight_list,
-					       QDF_ARRAY_SIZE(pcl.weight_list),
-					       sap_ctx->sessionId);
+		policy_mgr_get_pcl_for_scc_in_same_mode(mac->psoc, PM_SAP_MODE,
+							pcl_freqs, &pcl_len,
+							pcl.weight_list,
+							QDF_ARRAY_SIZE(pcl.weight_list),
+							sap_ctx->sessionId);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
 		sap_err("Get PCL failed");