From 0b02ea5e97f447a6a5d3a4a472fa1ea36174f161 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Tue, 5 Jan 2021 22:01:13 +0530 Subject: [PATCH] qcacld-3.0: Enable/disable roaming based on active NDP sessions Currently, active NDP sessions are tracked on the platforms where NAN concurrency handling is supported by host through policy mgr. Roaming is disabled when an active NDP session is present and re-enabled when the last NDP session is teardown. But this tracking is not supported on legacy platforms(which don't advertise either WMI_SERVICE_NDI_DBS_SUPPORT or WMI_SERVICE_NAN_DISABLE_SUPPORT) as policy mgr based tracking is not available. So, disable roaming when the first NDP connection happens and re-enable when the last peer is departed from HDD APIs in such legacy platforms. Change-Id: I6309af12eab9222dc34a79566f7830b7763826de CRs-Fixed: 2846541 --- core/hdd/src/wlan_hdd_main.c | 3 ++- core/hdd/src/wlan_hdd_nan_datapath.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a25bde20cd0e..5e13dd234e2c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1581,7 +1581,8 @@ void hdd_indicate_active_ndp_cnt(struct wlan_objmgr_psoc *psoc, adapter = wlan_hdd_get_adapter_from_vdev(psoc, vdev_id); if (adapter && cfg_nan_is_roam_config_disabled(psoc)) { - hdd_debug("vdev_id:%d ndp active sessions %d", vdev_id, cnt); + hdd_debug("vdev_id:%d%s active ndp sessions present", vdev_id, + cnt ? "" : " no more"); if (!cnt) wlan_hdd_enable_roaming(adapter, RSO_NDP_CON_ON_NDI); else diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index a6c6f65a6b80..94312b5d3975 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -965,6 +965,12 @@ int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id, adapter, WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); + /* + * This is called only for first peer. So, no.of NDP sessions + * are always 1 + */ + if (!NDI_CONCURRENCY_SUPPORTED(hdd_ctx->psoc)) + hdd_indicate_active_ndp_cnt(hdd_ctx->psoc, vdev_id, 1); } qdf_mem_free(roam_info); return 0; @@ -1039,5 +1045,11 @@ void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id, hdd_debug("No more ndp peers."); hdd_cleanup_ndi(hdd_ctx, adapter); qdf_event_set(&adapter->peer_cleanup_done); + /* + * This is called only for last peer. So, no.of NDP sessions + * are always 0 + */ + if (!NDI_CONCURRENCY_SUPPORTED(hdd_ctx->psoc)) + hdd_indicate_active_ndp_cnt(hdd_ctx->psoc, vdev_id, 0); } }