Ver código fonte

qcacld-3.0: Start SAP on valid BW when no other interface is up

When SAP tries to come on 2.4 GHz channel with 40 MHz bandwidth
then it should start on same bandwidth if no other interface is
up. But currently SAP is getting switch from 40 MHz to 20 MHz
even in standalone case.

As a part of fix, check any other vdev is present on same mac or
not. If it's not present then start SAP on given bandwidth

Change-Id: Id9625a3dfaec34480f86b7ca1459ea33c32299fe
CRs-Fixed: 3226558
Jyoti Kumari 2 anos atrás
pai
commit
893081ff9e

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

@@ -4497,4 +4497,18 @@ bool policy_mgr_is_sta_chan_valid_for_connect_and_roam(
  */
 bool policy_mgr_is_ap_ap_mcc_allow(struct wlan_objmgr_psoc *psoc,
 				   struct wlan_objmgr_vdev *vdev);
+
+/**
+ * policy_mgr_any_other_vdev_on_same_mac_as_freq() - Function to check
+ * whether more than one vdev are present on same mac or not
+ * @psoc: PSOC object
+ * @freq: Channel frequency
+ * @vdev_id: Vdev id
+ *
+ * Return: True if more than one vdev are present on same mac
+ *
+ */
+bool policy_mgr_any_other_vdev_on_same_mac_as_freq(
+				struct wlan_objmgr_psoc *psoc,
+				uint32_t freq, uint8_t vdev_id);
 #endif /* __WLAN_POLICY_MGR_API_H */

+ 9 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -2524,10 +2524,17 @@ policy_mgr_valid_sap_conc_channel_check(struct wlan_objmgr_psoc *psoc,
 	/*
 	 * If interference is 0, it could be STA/SAP SCC,
 	 * check further if SAP can start on STA home channel or
-	 * select other band channel if not .
+	 * select other band channel if not.
 	 */
-	if (!ch_freq)
+	if (!ch_freq) {
+		if (!policy_mgr_any_other_vdev_on_same_mac_as_freq(psoc,
+								   sap_ch_freq,
+								   sap_vdev_id))
+			return QDF_STATUS_SUCCESS;
+
 		ch_freq = sap_ch_freq;
+	}
+
 	if (!ch_freq)
 		return QDF_STATUS_SUCCESS;
 

+ 36 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -8671,3 +8671,39 @@ bool policy_mgr_is_ap_ap_mcc_allow(struct wlan_objmgr_psoc *psoc,
 
 	return false;
 }
+
+bool policy_mgr_any_other_vdev_on_same_mac_as_freq(
+				struct wlan_objmgr_psoc *psoc,
+				uint32_t freq, uint8_t vdev_id)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	uint32_t conn_index = 0;
+	bool same_mac = false;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return false;
+	}
+
+	qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
+	for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
+	     conn_index++) {
+		if (!pm_conc_connection_list[conn_index].in_use)
+			continue;
+
+		if (pm_conc_connection_list[conn_index].vdev_id == vdev_id)
+			continue;
+
+		if (policy_mgr_are_2_freq_on_same_mac(
+				psoc,
+				pm_conc_connection_list[conn_index].freq,
+				freq)) {
+			same_mac = true;
+			break;
+		}
+	}
+	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
+
+	return same_mac;
+}