diff --git a/init_deinit/dispatcher/src/dispatcher_init_deinit.c b/init_deinit/dispatcher/src/dispatcher_init_deinit.c index cc82036705..07b2cddfe1 100644 --- a/init_deinit/dispatcher/src/dispatcher_init_deinit.c +++ b/init_deinit/dispatcher/src/dispatcher_init_deinit.c @@ -492,6 +492,12 @@ static QDF_STATUS dispatcher_regulatory_pdev_close(struct wlan_objmgr_pdev return regulatory_pdev_close(pdev); } +static QDF_STATUS dispatcher_dfs_pdev_close(struct wlan_objmgr_pdev + *pdev) +{ + return dfs_pdev_close(pdev); +} + #ifdef WLAN_SA_API_ENABLE static QDF_STATUS dispatcher_init_sa_api(void) { @@ -1563,6 +1569,8 @@ QDF_STATUS dispatcher_pdev_close(struct wlan_objmgr_pdev *pdev) QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_pdev_close(pdev)); + QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_dfs_pdev_close(pdev)); + return QDF_STATUS_SUCCESS; } qdf_export_symbol(dispatcher_pdev_close); diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_init_deinit_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_init_deinit_api.h index 4da0c94b85..da867b2791 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_init_deinit_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_init_deinit_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. - * + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -49,6 +49,14 @@ QDF_STATUS dfs_init(void); */ QDF_STATUS dfs_deinit(void); +/** + * dfs_pdev_close() - Close dfs component + * @pdev: Pointer to pdev structure. + * + * Return: Success or Failure + */ +QDF_STATUS dfs_pdev_close(struct wlan_objmgr_pdev *pdev); + /** * wlan_dfs_pdev_obj_create_notification() - DFS pdev object create handler. * @pdev: Pointer to DFS pdev object. diff --git a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c index 30518fd52e..6e7e8ddaa2 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c @@ -406,6 +406,22 @@ QDF_STATUS dfs_deinit(void) return QDF_STATUS_SUCCESS; } +QDF_STATUS dfs_pdev_close(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_dfs *dfs = NULL; + + if (!pdev) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "PDEV is NULL"); + return QDF_STATUS_E_FAILURE; + } + + dfs = wlan_pdev_get_dfs_obj(pdev); + if (dfs) + dfs_detach(dfs); + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_dfs_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev, void *arg) { @@ -528,7 +544,6 @@ QDF_STATUS wlan_dfs_pdev_obj_destroy_notification(struct wlan_objmgr_pdev *pdev, /* DFS is NULL during unload. should we call this function before */ if (dfs) { - dfs_detach(dfs); global_dfs_to_mlme.pdev_component_obj_detach(pdev, WLAN_UMAC_COMP_DFS, (void *)dfs);