From bc9576374d1716fb971746e21ae81690e352d9af Mon Sep 17 00:00:00 2001 From: Vinod Kumar Pirla Date: Fri, 24 Feb 2023 02:30:33 -0800 Subject: [PATCH] qcacld-3.0: Use link info pointer to cleanup VDEV ROC To obtain VDEV reference to cleanup the ROC, change the function argument of wlan_hdd_cleanup_remain_on_channel_ctx() API to take link info pointer instead of adapter. Existing references are changed to deflink. Change-Id: I032c04d18f6d3e962ee767e621d418ad71609139 CRs-Fixed: 3462405 --- core/hdd/inc/wlan_hdd_p2p.h | 13 +++++++++++-- core/hdd/src/wlan_hdd_hostapd.c | 2 +- core/hdd/src/wlan_hdd_main.c | 8 ++++---- core/hdd/src/wlan_hdd_p2p.c | 10 +++------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_p2p.h b/core/hdd/inc/wlan_hdd_p2p.h index 50f8c8c0e0..6dd6f122f5 100644 --- a/core/hdd/inc/wlan_hdd_p2p.h +++ b/core/hdd/inc/wlan_hdd_p2p.h @@ -127,8 +127,17 @@ void hdd_clean_up_interface(struct hdd_context *hdd_ctx, int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev); int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev); - -void wlan_hdd_cleanup_remain_on_channel_ctx(struct hdd_adapter *adapter); +/** + * wlan_hdd_cleanup_remain_on_channel_ctx - Cleanup ROC on VDEV + * @link_info: pointer to link_info struct in adapter + * + * This function is used to cleanup the ROC on the vdev + * pointed in the @link_info + * + * Return: void + */ +void +wlan_hdd_cleanup_remain_on_channel_ctx(struct wlan_hdd_link_info *link_info); /** * wlan_hdd_set_power_save() - hdd set power save diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 9db1f46054..43860bb58a 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7092,7 +7092,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, WLAN_CONTROL_PATH); wlan_hdd_cleanup_actionframe(adapter->deflink); - wlan_hdd_cleanup_remain_on_channel_ctx(adapter); + wlan_hdd_cleanup_remain_on_channel_ctx(adapter->deflink); mutex_lock(&hdd_ctx->sap_lock); if (test_bit(SOFTAP_BSS_STARTED, &adapter->deflink->link_flags)) { struct hdd_hostapd_state *hostapd_state = diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 3f820b28c8..05d94c8760 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8624,7 +8624,7 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx, wlan_hdd_scan_abort(adapter); wlan_hdd_cleanup_actionframe(adapter->deflink); - wlan_hdd_cleanup_remain_on_channel_ctx(adapter); + wlan_hdd_cleanup_remain_on_channel_ctx(adapter->deflink); status = wlan_hdd_flush_pmksa_cache(adapter->deflink); hdd_deregister_hl_netdev_fc_timer(adapter); @@ -8734,7 +8734,7 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx, } if (adapter->device_mode == QDF_P2P_GO_MODE) { - wlan_hdd_cleanup_remain_on_channel_ctx(adapter); + wlan_hdd_cleanup_remain_on_channel_ctx(adapter->deflink); hdd_abort_ongoing_sta_connection(hdd_ctx); } @@ -9000,7 +9000,7 @@ static void hdd_reset_scan_operation(struct hdd_context *hdd_ctx, case QDF_P2P_DEVICE_MODE: case QDF_NDI_MODE: wlan_hdd_scan_abort(adapter); - wlan_hdd_cleanup_remain_on_channel_ctx(adapter); + wlan_hdd_cleanup_remain_on_channel_ctx(adapter->deflink); if (adapter->device_mode == QDF_STA_MODE) { struct wlan_objmgr_vdev *vdev; @@ -9014,7 +9014,7 @@ static void hdd_reset_scan_operation(struct hdd_context *hdd_ctx, } break; case QDF_P2P_GO_MODE: - wlan_hdd_cleanup_remain_on_channel_ctx(adapter); + wlan_hdd_cleanup_remain_on_channel_ctx(adapter->deflink); break; case QDF_SAP_MODE: qdf_atomic_set(&adapter->deflink->session.ap.acs_in_progress, 0); diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index cbe132698d..7623994d73 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -88,16 +88,12 @@ int wlan_hdd_check_remain_on_channel(struct hdd_adapter *adapter) } /* Clean up RoC context at hdd_stop_adapter*/ -void wlan_hdd_cleanup_remain_on_channel_ctx(struct hdd_adapter *adapter) +void +wlan_hdd_cleanup_remain_on_channel_ctx(struct wlan_hdd_link_info *link_info) { struct wlan_objmgr_vdev *vdev; - if (!adapter) { - hdd_err("null adapter"); - return; - } - - vdev = hdd_objmgr_get_vdev_by_user(adapter->deflink, WLAN_OSIF_P2P_ID); + vdev = hdd_objmgr_get_vdev_by_user(link_info, WLAN_OSIF_P2P_ID); if (!vdev) return;