Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f049006 authored by Srinivas Dasari's avatar Srinivas Dasari
Browse files

qcacld-3.0: Handle NAN+STA reconnect concurrency

Currently, STA reconnect (e.g. reconnect to same BSSID) is handled
as STA+STA as part of NAN concurrency checks. This results in NAN
disable when reconnect is issued.
Check if the current incoming connection is on same vdev as
previous sta connection instance and disable NAN only if it's
different.
Handle NAN+SAP reenable in similar way.
Also, remove the redundant usage of NDI cleanup API
ucfg_nan_check_and_disable_unsupported_ndi in
if_mgr_connect_start.

Change-Id: Ia063a69bb2efdf1d51c6988b8905ceac0f454dab
CRs-Fixed: 2821352
parent 205ef8b2
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2091,7 +2091,7 @@ uint32_t policy_mgr_get_mode_specific_conn_info(
		policy_mgr_err("Invalid Context");
		return count;
	}
	if (!ch_freq_list || !vdev_id) {
	if (!vdev_id) {
		policy_mgr_err("Null pointer error");
		return count;
	}
@@ -2100,13 +2100,16 @@ uint32_t policy_mgr_get_mode_specific_conn_info(
				psoc, mode, list);
	qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
	if (count == 1) {
		*ch_freq_list = pm_conc_connection_list[list[index]].freq;
		if (ch_freq_list)
			*ch_freq_list =
				pm_conc_connection_list[list[index]].freq;
		*vdev_id =
			pm_conc_connection_list[list[index]].vdev_id;
	} else {
		for (index = 0; index < count; index++) {
			ch_freq_list[index] = pm_conc_connection_list[
						      list[index]].freq;
			if (ch_freq_list)
				ch_freq_list[index] =
				pm_conc_connection_list[list[index]].freq;

			vdev_id[index] =
			pm_conc_connection_list[list[index]].vdev_id;
+17 −8
Original line number Diff line number Diff line
@@ -21133,6 +21133,8 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
#endif
	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(ndev);
	struct hdd_context *hdd_ctx;
	uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS], i;
	bool disable_nan = true;
	hdd_enter();
@@ -21184,17 +21186,24 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
	 * connection already exists and if this is a case of STA+STA
	 * or SAP+STA concurrency
	 */
	sta_cnt = policy_mgr_mode_specific_connection_count(hdd_ctx->psoc,
							    PM_STA_MODE, NULL);
	sap_cnt = policy_mgr_mode_specific_connection_count(hdd_ctx->psoc,
							    PM_SAP_MODE, NULL);
	sta_cnt = policy_mgr_get_mode_specific_conn_info(hdd_ctx->psoc, NULL,
							 vdev_id_list,
							 PM_STA_MODE);
	sap_cnt = policy_mgr_get_mode_specific_conn_info(hdd_ctx->psoc, NULL,
							 &vdev_id_list[sta_cnt],
							 PM_SAP_MODE);
	if (adapter->device_mode == QDF_P2P_CLIENT_MODE || sap_cnt || sta_cnt) {
		for (i = 0; i < sta_cnt + sap_cnt; i++)
			if (vdev_id_list[i] == adapter->vdev_id)
				disable_nan = false;
		if (disable_nan) {
			hdd_debug("Invalid NAN concurrency. SAP: %d STA: %d P2P: %d",
				  sap_cnt, sta_cnt,
				  (adapter->device_mode == QDF_P2P_CLIENT_MODE));
			ucfg_nan_disable_concurrency(hdd_ctx->psoc);
		}
	}
	/*
	 * STA+NDI concurrency gets preference over NDI+NDI. Disable
	 * first NDI in case an NDI+NDI concurrency exists if FW does
+17 −9
Original line number Diff line number Diff line
@@ -6356,8 +6356,9 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
	struct cfg80211_chan_def new_chandef;
	struct cfg80211_chan_def *chandef;
	uint16_t sap_ch;
	bool srd_channel_allowed;
	bool srd_channel_allowed, disable_nan = true;
	enum QDF_OPMODE vdev_opmode;
	uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS], i;

	hdd_enter();

@@ -6444,10 +6445,12 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
	sta_sap_scc_on_dfs_chan =
		policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(
							hdd_ctx->psoc);
	sta_cnt = policy_mgr_mode_specific_connection_count(hdd_ctx->psoc,
							    PM_STA_MODE, NULL);
	sap_cnt = policy_mgr_mode_specific_connection_count(hdd_ctx->psoc,
							    PM_SAP_MODE, NULL);
	sta_cnt = policy_mgr_get_mode_specific_conn_info(hdd_ctx->psoc, NULL,
							 vdev_id_list,
							 PM_STA_MODE);
	sap_cnt = policy_mgr_get_mode_specific_conn_info(hdd_ctx->psoc, NULL,
							 &vdev_id_list[sta_cnt],
							 PM_SAP_MODE);

	hdd_debug("sta_sap_scc_on_dfs_chan %u, sta_cnt %u",
		  sta_sap_scc_on_dfs_chan, sta_cnt);
@@ -6510,11 +6513,16 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
	/* Disable NAN Disc before starting P2P GO or STA+SAP or SAP+SAP */
	if (adapter->device_mode == QDF_P2P_GO_MODE || sta_cnt ||
	    (sap_cnt > (MAX_SAP_NUM_CONCURRENCY_WITH_NAN - 1))) {
		for (i = 0; i < sta_cnt + sap_cnt; i++)
			if (vdev_id_list[i] == adapter->vdev_id)
				disable_nan = false;
		if (disable_nan) {
			hdd_debug("Invalid NAN concurrency. SAP: %d STA: %d P2P_GO: %d",
				  sap_cnt, sta_cnt,
				  (adapter->device_mode == QDF_P2P_GO_MODE));
			ucfg_nan_disable_concurrency(hdd_ctx->psoc);
		}
	}

	/* NDI + SAP conditional supported */
	hdd_sap_nan_check_and_disable_unsupported_ndi(hdd_ctx->psoc, true);