From 0a71d5a1f5f05a1af133d6eb0d9e6f708f42576e Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 28 Dec 2018 13:46:18 +0530 Subject: [PATCH] qcacmn: Remove serialization vdev destroy handler Each cmd in serialization list holds a vdev ref by I8d573ff5a25e6dff928b2708e51ad7b97e292277. When vdev is destroyed physically, it means vdev ref count is 0, all serialization cmds of this vdev are released, don't need purge in vdev destroy handler. Change-Id: Iea75707c88154e1e3e87369285b82d1288523e22 CRs-Fixed: 2367242 --- .../inc/wlan_serialization_legacy_api.h | 10 -- .../src/wlan_serialization_legacy_api.c | 8 -- .../src/wlan_serialization_main.c | 95 ------------------- 3 files changed, 113 deletions(-) diff --git a/umac/cmn_services/serialization/inc/wlan_serialization_legacy_api.h b/umac/cmn_services/serialization/inc/wlan_serialization_legacy_api.h index 959865f2be03..051f26053d8e 100644 --- a/umac/cmn_services/serialization/inc/wlan_serialization_legacy_api.h +++ b/umac/cmn_services/serialization/inc/wlan_serialization_legacy_api.h @@ -124,16 +124,6 @@ uint32_t wlan_serialization_get_pending_list_count( struct wlan_objmgr_psoc *psoc, uint8_t is_cmd_from_pending_scan_queue); -/** - * wlan_serialization_legacy_init_callback() - Initialize the legacy callbacks - * - * This API will be called only from legacy modules to initialize the - * purge command callbacks - * - * Return: none - */ -void wlan_serialization_legacy_init_callback(void); - /** * wlan_serialization_purge_cmd_list_by_vdev_id() - Purge given list * @psoc: pointer to soc diff --git a/umac/cmn_services/serialization/src/wlan_serialization_legacy_api.c b/umac/cmn_services/serialization/src/wlan_serialization_legacy_api.c index c4ff5d204f1e..7e2557f0b453 100644 --- a/umac/cmn_services/serialization/src/wlan_serialization_legacy_api.c +++ b/umac/cmn_services/serialization/src/wlan_serialization_legacy_api.c @@ -30,8 +30,6 @@ #include "wlan_serialization_scan_i.h" #include "wlan_serialization_non_scan_i.h" -extern struct serialization_legacy_callback ser_legacy_cb; - static struct wlan_objmgr_pdev *wlan_serialization_get_first_pdev( struct wlan_objmgr_psoc *psoc) { @@ -346,12 +344,6 @@ wlan_serialization_get_pending_list_next_node_using_psoc( ser_pdev_obj); } -void wlan_serialization_legacy_init_callback(void) -{ - ser_legacy_cb.serialization_purge_cmd_list = - wlan_serialization_purge_cmd_list; -} - void wlan_serialization_purge_cmd_list_by_vdev_id( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, bool purge_scan_active_queue, diff --git a/umac/cmn_services/serialization/src/wlan_serialization_main.c b/umac/cmn_services/serialization/src/wlan_serialization_main.c index 9b1b63fef2e5..c916420c6c65 100644 --- a/umac/cmn_services/serialization/src/wlan_serialization_main.c +++ b/umac/cmn_services/serialization/src/wlan_serialization_main.c @@ -32,8 +32,6 @@ #include "wlan_serialization_rules_i.h" #include "wlan_serialization_utils_i.h" -struct serialization_legacy_callback ser_legacy_cb; - QDF_STATUS wlan_serialization_psoc_close(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status; @@ -306,52 +304,6 @@ static QDF_STATUS wlan_serialization_pdev_obj_destroy_notification( return status; } -/** - * wlan_serialization_vdev_obj_create_notification() - VDEV obj create callback - * @vdev: VDEV object - * @arg_list: Variable argument list - * - * This callback is registered with object manager during initialization and - * when obj manager gets its turn to create the object, it would notify each - * component with the corresponding callback registered to inform the - * completion of the creation of the respective object. - * - * Return: QDF Status - */ -static QDF_STATUS wlan_serialization_vdev_obj_create_notification( - struct wlan_objmgr_vdev *vdev, void *arg_list) -{ - return QDF_STATUS_SUCCESS; -} - -/** - * wlan_serialization_vdev_obj_destroy_notification() - vdev obj delete callback - * @vdev: VDEV object - * @arg_list: Variable argument list - * - * This callback is registered with object manager during initialization and - * when obj manager gets its turn to delete the object, it would notify each - * component with the corresponding callback registered to inform the - * completion of the deletion of the respective object. - * - * Return: QDF Status - */ -static QDF_STATUS wlan_serialization_vdev_obj_destroy_notification( - struct wlan_objmgr_vdev *vdev, void *arg_list) -{ - uint8_t vdev_id = wlan_vdev_get_id(vdev); - - if (!ser_legacy_cb.serialization_purge_cmd_list) - return QDF_STATUS_SUCCESS; - - serialization_debug("for vdev_id[%d] vdev[%pK] flush all cmds", - vdev_id, vdev); - ser_legacy_cb.serialization_purge_cmd_list(wlan_vdev_get_psoc(vdev), - vdev, false, false, false, false, true); - - return QDF_STATUS_SUCCESS; -} - QDF_STATUS wlan_serialization_init(void) { QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -388,27 +340,7 @@ QDF_STATUS wlan_serialization_init(void) goto err_pdev_delete; } - status = wlan_objmgr_register_vdev_create_handler( - WLAN_UMAC_COMP_SERIALIZATION, - wlan_serialization_vdev_obj_create_notification, NULL); - if (status != QDF_STATUS_SUCCESS) { - serialization_err("Failed to reg vdev ser obj create handler"); - goto err_vdev_create; - } - - status = wlan_objmgr_register_vdev_destroy_handler( - WLAN_UMAC_COMP_SERIALIZATION, - wlan_serialization_vdev_obj_destroy_notification, NULL); - if (status != QDF_STATUS_SUCCESS) { - serialization_err("Failed to reg vdev ser obj delete handler"); - goto err_vdev_delete; - } serialization_debug("serialization handlers registered with obj mgr"); - /* - * Initialize the structure so all callbacks are registered - * initially as NULL. - */ - qdf_mem_zero(&ser_legacy_cb, sizeof(ser_legacy_cb)); return QDF_STATUS_SUCCESS; @@ -479,11 +411,6 @@ QDF_STATUS wlan_serialization_deinit(void) } serialization_alert("deregistered callbacks with obj mgr successfully"); - /* - * Initialize the structure so all callbacks are registered - * initially as NULL. - */ - qdf_mem_zero(&ser_legacy_cb, sizeof(ser_legacy_cb)); return ret_status; } @@ -497,8 +424,6 @@ QDF_STATUS wlan_serialization_deinit(void) #include "wlan_serialization_rules_i.h" #include "wlan_serialization_utils_i.h" -struct serialization_legacy_callback ser_legacy_cb; - QDF_STATUS wlan_serialization_psoc_close(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status = QDF_STATUS_E_FAILURE; @@ -920,7 +845,6 @@ static QDF_STATUS wlan_serialization_vdev_destroy_handler( struct wlan_serialization_vdev_queue *vdev_q; struct wlan_ser_vdev_obj *ser_vdev_obj = wlan_serialization_get_vdev_obj(vdev); - uint8_t vdev_id = wlan_vdev_get_id(vdev); uint8_t index; if (!ser_vdev_obj) { @@ -941,16 +865,7 @@ static QDF_STATUS wlan_serialization_vdev_destroy_handler( } qdf_mem_free(ser_vdev_obj); - if (!ser_legacy_cb.serialization_purge_cmd_list) - goto error; - ser_debug("for vdev_id[%d] vdev[%pK] flush all cmds", - vdev_id, vdev); - ser_legacy_cb.serialization_purge_cmd_list(wlan_vdev_get_psoc(vdev), - vdev, false, false, - false, false, true); - -error: return status; } @@ -1005,11 +920,6 @@ QDF_STATUS wlan_serialization_init(void) ser_err("Failed to reg vdev ser obj delete handler"); goto err_vdev_delete; } - /* - * Initialize the structure so all callbacks are registered - * initially as NULL. - */ - qdf_mem_zero(&ser_legacy_cb, sizeof(ser_legacy_cb)); status = QDF_STATUS_SUCCESS; goto exit; @@ -1088,11 +998,6 @@ QDF_STATUS wlan_serialization_deinit(void) } ser_alert("deregistered callbacks with obj mgr successfully"); - /* - * Initialize the structure so all callbacks are registered - * initially as NULL. - */ - qdf_mem_zero(&ser_legacy_cb, sizeof(ser_legacy_cb)); return ret_status; }