diff --git a/global_lmac_if/src/wlan_global_lmac_if.c b/global_lmac_if/src/wlan_global_lmac_if.c index 032d26b8090f..6d3d963febdf 100644 --- a/global_lmac_if/src/wlan_global_lmac_if.c +++ b/global_lmac_if/src/wlan_global_lmac_if.c @@ -25,6 +25,7 @@ #ifdef WLAN_CONV_SPECTRAL_ENABLE #include #endif +#include /* Function pointer to call DA/OL specific tx_ops registration function */ QDF_STATUS (*wlan_global_lmac_if_tx_ops_register[MAX_DEV_TYPE]) @@ -193,6 +194,8 @@ QDF_STATUS wlan_global_lmac_if_open(struct wlan_objmgr_psoc *psoc) /* Function call to register rx-ops handlers */ wlan_global_lmac_if_rx_ops_register(rx_ops); + target_if_wake_lock_init(psoc); + return QDF_STATUS_SUCCESS; } qdf_export_symbol(wlan_global_lmac_if_open); @@ -215,6 +218,7 @@ QDF_STATUS wlan_global_lmac_if_close(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_INVAL; } + target_if_wake_lock_deinit(psoc); tx_ops = wlan_psoc_get_lmac_if_txops(psoc); rx_ops = wlan_psoc_get_lmac_if_rxops(psoc); diff --git a/target_if/mlme/psoc/inc/target_if_psoc_wake_lock.h b/target_if/mlme/psoc/inc/target_if_psoc_wake_lock.h index 21ef9603647d..7451dd5cb564 100644 --- a/target_if/mlme/psoc/inc/target_if_psoc_wake_lock.h +++ b/target_if/mlme/psoc/inc/target_if_psoc_wake_lock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2020 The Linux Foundation. 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 @@ -25,6 +25,9 @@ #ifndef __TARGET_IF_PSOC_WAKE_LOCK_H__ #define __TARGET_IF_PSOC_WAKE_LOCK_H__ +#include +#include + #ifdef FEATURE_VDEV_RSP_WAKELOCK /** * struct wlan_vdev_wakelock - vdev wake lock sub structure diff --git a/target_if/mlme/psoc/src/target_if_psoc_wake_lock.c b/target_if/mlme/psoc/src/target_if_psoc_wake_lock.c index 752ab0b4392d..1446318683f5 100644 --- a/target_if/mlme/psoc/src/target_if_psoc_wake_lock.c +++ b/target_if/mlme/psoc/src/target_if_psoc_wake_lock.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2020 The Linux Foundation. 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 @@ -28,6 +28,7 @@ #include #include #include +#include void target_if_wake_lock_init(struct wlan_objmgr_psoc *psoc) { @@ -35,10 +36,10 @@ void target_if_wake_lock_init(struct wlan_objmgr_psoc *psoc) struct wlan_lmac_if_mlme_rx_ops *rx_ops; rx_ops = target_if_vdev_mgr_get_rx_ops(psoc); - if (!rx_ops && !rx_ops->psoc_get_wakelock_info) { - mlme_err("vdev_id:%d psoc_id:%d No Rx Ops", vdev_id, + if (!rx_ops || !rx_ops->psoc_get_wakelock_info) { + mlme_err("psoc_id:%d No Rx Ops", wlan_psoc_get_id(psoc)); - return QDF_STATUS_E_INVAL; + return; } psoc_wakelock = rx_ops->psoc_get_wakelock_info(psoc); @@ -56,10 +57,10 @@ void target_if_wake_lock_deinit(struct wlan_objmgr_psoc *psoc) struct wlan_lmac_if_mlme_rx_ops *rx_ops; rx_ops = target_if_vdev_mgr_get_rx_ops(psoc); - if (!rx_ops && !rx_ops->psoc_get_wakelock_info) { - mlme_err("vdev_id:%d psoc_id:%d No Rx Ops", vdev_id, + if (!rx_ops || !rx_ops->psoc_get_wakelock_info) { + mlme_err("psoc_id:%d No Rx Ops", wlan_psoc_get_id(psoc)); - return QDF_STATUS_E_INVAL; + return; } psoc_wakelock = rx_ops->psoc_get_wakelock_info(psoc); @@ -68,7 +69,7 @@ void target_if_wake_lock_deinit(struct wlan_objmgr_psoc *psoc) qdf_wake_lock_destroy(&psoc_wakelock->stop_wakelock); qdf_wake_lock_destroy(&psoc_wakelock->delete_wakelock); - qdf_runtime_lock_deinit(&vdev_wakelock->wmi_cmd_rsp_runtime_lock); + qdf_runtime_lock_deinit(&psoc_wakelock->wmi_cmd_rsp_runtime_lock); } QDF_STATUS target_if_wake_lock_timeout_acquire( @@ -76,12 +77,11 @@ QDF_STATUS target_if_wake_lock_timeout_acquire( enum wakelock_mode mode) { struct psoc_mlme_wakelock *psoc_wakelock; - struct wlan_objmgr_psoc *psoc; struct wlan_lmac_if_mlme_rx_ops *rx_ops; rx_ops = target_if_vdev_mgr_get_rx_ops(psoc); if (!rx_ops && !rx_ops->psoc_get_wakelock_info) { - mlme_err("vdev_id:%d psoc_id:%d No Rx Ops", vdev_id, + mlme_err("psoc_id:%d No Rx Ops", wlan_psoc_get_id(psoc)); return QDF_STATUS_E_INVAL; } @@ -97,7 +97,7 @@ QDF_STATUS target_if_wake_lock_timeout_acquire( STOP_RESPONSE_TIMER); break; case DELETE_WAKELOCK: - qdf_wake_lock_timeout_acquire(&vdev_wakelock->delete_wakelock, + qdf_wake_lock_timeout_acquire(&psoc_wakelock->delete_wakelock, DELETE_RESPONSE_TIMER); break; default: @@ -119,9 +119,8 @@ QDF_STATUS target_if_wake_lock_timeout_release( struct wlan_lmac_if_mlme_rx_ops *rx_ops; rx_ops = target_if_vdev_mgr_get_rx_ops(psoc); - if (!rx_ops && !rx_ops->psoc_get_wakelock_info) { - mlme_err("vdev_id:%d psoc_id:%d No Rx Ops", vdev_id, - wlan_psoc_get_id(psoc)); + if (!rx_ops || !rx_ops->psoc_get_wakelock_info) { + mlme_err("psoc_id:%d No Rx Ops", wlan_psoc_get_id(psoc)); return QDF_STATUS_E_INVAL; } diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 744091a7c4a9..08f666722037 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -1761,7 +1761,7 @@ struct wlan_lmac_if_mlme_rx_ops { struct wlan_objmgr_psoc *psoc, struct multi_vdev_restart_resp *rsp); #ifdef FEATURE_VDEV_RSP_WAKELOCK - struct vdev_mlme_wakelock *(*psoc_get_wakelock_info)( + struct psoc_mlme_wakelock *(*psoc_get_wakelock_info)( struct wlan_objmgr_psoc *psoc); #endif struct vdev_response_timer *(*psoc_get_vdev_response_timer_info)( diff --git a/umac/mlme/include/wlan_psoc_mlme.h b/umac/mlme/include/wlan_psoc_mlme.h index 1c48c66c9dae..d0d31a49b271 100644 --- a/umac/mlme/include/wlan_psoc_mlme.h +++ b/umac/mlme/include/wlan_psoc_mlme.h @@ -24,7 +24,9 @@ #include #include #include - +#ifdef FEATURE_VDEV_RSP_WAKELOCK +#include +#endif /* Max RNR size given max vaps are 16 */ #define MAX_RNR_SIZE 256 diff --git a/umac/mlme/mlme_objmgr/dispatcher/src/wlan_psoc_mlme_main.c b/umac/mlme/mlme_objmgr/dispatcher/src/wlan_psoc_mlme_main.c index 3a75947e7bac..cf409c99e347 100644 --- a/umac/mlme/mlme_objmgr/dispatcher/src/wlan_psoc_mlme_main.c +++ b/umac/mlme/mlme_objmgr/dispatcher/src/wlan_psoc_mlme_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. 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 above @@ -26,7 +26,6 @@ #include #include #include -#include struct psoc_mlme_obj *mlme_psoc_get_priv(struct wlan_objmgr_psoc *psoc) { @@ -73,7 +72,6 @@ static QDF_STATUS mlme_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc, goto init_failed; } - target_if_wake_lock_init(psoc); return QDF_STATUS_SUCCESS; init_failed: qdf_mem_free(psoc_mlme); @@ -92,7 +90,6 @@ static QDF_STATUS mlme_psoc_obj_destroy_handler(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - target_if_wake_lock_deinit(psoc); wlan_objmgr_psoc_component_obj_detach(psoc, WLAN_UMAC_COMP_MLME, psoc_mlme); diff --git a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c index 5fd82e82e2dd..2979d716a30b 100644 --- a/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c +++ b/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c @@ -219,19 +219,18 @@ tgt_psoc_get_wakelock_info(struct wlan_objmgr_psoc *psoc) psoc_mlme = mlme_psoc_get_priv(psoc); if (!psoc_mlme) { - mlme_err("VDEV_%d: VDEV_MLME is NULL", wlan_vdev_get_id(psoc)); + mlme_err("PSOC_MLME is NULL"); return NULL; } - return &psoc_mlme->psoc_wakelock; + return &psoc_mlme->psoc_mlme_wakelock; } static inline void tgt_psoc_reg_wakelock_info_rx_op(struct wlan_lmac_if_mlme_rx_ops *mlme_rx_ops) { - mlme_rx_ops->psoc_get_wakelock_info = - tgt_psoc_get_wakelock_info; + mlme_rx_ops->psoc_get_wakelock_info = tgt_psoc_get_wakelock_info; } #else static inline void