From e1777f8d8432f1bb08eef0b35738e7d4bd9ce3ed Mon Sep 17 00:00:00 2001 From: Nishank Aggarwal Date: Tue, 4 Apr 2017 14:17:13 +0530 Subject: [PATCH] qcacld-3.0: Fix kernel checkpatch warnings in sme_power_save.c Fix kernel checkpatch warnings in sme_power_save.c Change-Id: I3d4631c37815a54206f1f5bc5122d5d451a6944a CRs-Fixed: 2025503 --- core/sme/src/common/sme_power_save.c | 32 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/core/sme/src/common/sme_power_save.c b/core/sme/src/common/sme_power_save.c index 3d3d0ec59f7d..1a391400ee53 100644 --- a/core/sme/src/common/sme_power_save.c +++ b/core/sme/src/common/sme_power_save.c @@ -127,6 +127,7 @@ static void sme_set_ps_state(tpAniSirGlobal mac_ctx, { struct ps_global_info *ps_global_info = &mac_ctx->sme.ps_global_info; struct ps_params *ps_param = &ps_global_info->ps_params[session_id]; + ps_param->ps_state = ps_state; } @@ -405,6 +406,7 @@ static QDF_STATUS sme_ps_exit_wowl_req_params(tpAniSirGlobal mac_ctx, uint32_t session_id) { struct sSirHalWowlExitParams *hal_wowl_msg; + hal_wowl_msg = qdf_mem_malloc(sizeof(*hal_wowl_msg)); if (NULL == hal_wowl_msg) { sme_err("Fail to allocate memory for WoWLAN Add Bcast Pattern"); @@ -518,6 +520,7 @@ QDF_STATUS sme_ps_enable_disable(tHalHandle hal_ctx, uint32_t session_id, { QDF_STATUS status = QDF_STATUS_E_FAILURE; tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx); + status = sme_enable_sta_ps_check(mac_ctx, session_id); if (status != QDF_STATUS_SUCCESS) return status; @@ -537,6 +540,7 @@ QDF_STATUS sme_ps_uapsd_enable(tHalHandle hal_ctx, uint32_t session_id) QDF_STATUS status = QDF_STATUS_E_FAILURE; tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx); + status = sme_enable_sta_ps_check(mac_ctx, session_id); if (status != QDF_STATUS_SUCCESS) return status; @@ -560,6 +564,7 @@ QDF_STATUS sme_ps_uapsd_disable(tHalHandle hal_ctx, uint32_t session_id) QDF_STATUS status = QDF_STATUS_E_FAILURE; tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx); + status = sme_enable_sta_ps_check(mac_ctx, session_id); if (status != QDF_STATUS_SUCCESS) return status; @@ -653,7 +658,6 @@ void sme_set_tspec_uapsd_mask_per_session(tpAniSirGlobal mac_ctx, ps_param->uapsd_per_ac_delivery_enable_mask); sme_debug("New ps_param->ac_admit_mask[SIR_MAC_DIRECTION_UPLINK]: 0x%x", ps_param->ac_admit_mask[SIR_MAC_DIRECTION_UPLINK]); - return; } /** @@ -670,6 +674,7 @@ QDF_STATUS sme_ps_start_uapsd(tHalHandle hal_ctx, uint32_t session_id, void *callback_context) { QDF_STATUS status = QDF_STATUS_E_FAILURE; + status = sme_ps_uapsd_enable(hal_ctx, session_id); return status; } @@ -761,7 +766,7 @@ QDF_STATUS sme_set_ps_ns_offload(tHalHandle hal_ctx, request_buf = qdf_mem_malloc(sizeof(*request_buf)); if (NULL == request_buf) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - FL("Not able to allocate memory for NS offload request")); + "Not able to allocate memory for NS offload request"); return QDF_STATUS_E_NOMEM; } *request_buf = *request; @@ -774,7 +779,7 @@ QDF_STATUS sme_set_ps_ns_offload(tHalHandle hal_ctx, if (QDF_STATUS_SUCCESS != scheduler_post_msg(QDF_MODULE_ID_WMA, &msg)) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - FL("Not able to post SIR_HAL_SET_HOST_OFFLOAD message to HAL")); + "Not able to post SIR_HAL_SET_HOST_OFFLOAD message to HAL"); qdf_mem_free(request_buf); return QDF_STATUS_E_FAILURE; } @@ -783,7 +788,6 @@ QDF_STATUS sme_set_ps_ns_offload(tHalHandle hal_ctx, } #endif /* WLAN_NS_OFFLOAD */ -/* -------------------------------------------------------------------- */ /** * sme_post_pe_message * @@ -804,6 +808,7 @@ tSirRetStatus sme_post_pe_message(tpAniSirGlobal mac_ctx, struct scheduler_msg *msg) { QDF_STATUS qdf_status; + qdf_status = scheduler_post_msg(QDF_MODULE_ID_PE, msg); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { @@ -892,9 +897,9 @@ QDF_STATUS sme_ps_open_per_session(tHalHandle hal_ctx, uint32_t session_id) tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx); struct ps_global_info *ps_global_info = &mac_ctx->sme.ps_global_info; struct ps_params *ps_param = &ps_global_info->ps_params[session_id]; + ps_param->session_id = session_id; ps_param->mac_ctx = mac_ctx; - /* Allocate a timer to enable ps automatically */ if (!QDF_IS_STATUS_SUCCESS(qdf_mc_timer_init( &ps_param->auto_ps_enable_timer, @@ -914,19 +919,18 @@ void sme_auto_ps_entry_timer_expired(void *data) tpAniSirGlobal mac_ctx = (tpAniSirGlobal)ps_params->mac_ctx; uint32_t session_id = ps_params->session_id; QDF_STATUS status = QDF_STATUS_SUCCESS; - status = sme_enable_sta_ps_check(mac_ctx, session_id); - if (QDF_STATUS_SUCCESS == status) { + status = sme_enable_sta_ps_check(mac_ctx, session_id); + if (QDF_STATUS_SUCCESS == status) sme_ps_enable_disable((tHalHandle)mac_ctx, session_id, SME_PS_ENABLE); - } else { + else { status = qdf_mc_timer_start(&ps_params->auto_ps_enable_timer, AUTO_PS_ENTRY_TIMER_DEFAULT_VALUE); if (!QDF_IS_STATUS_SUCCESS(status) - && (QDF_STATUS_E_ALREADY != status)) { + && (QDF_STATUS_E_ALREADY != status)) sme_err("Cannot start traffic timer"); - } } } @@ -953,9 +957,9 @@ QDF_STATUS sme_ps_close_per_session(tHalHandle hal_ctx, uint32_t session_id) */ if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state( - &ps_param->auto_ps_enable_timer)) { + &ps_param->auto_ps_enable_timer)) qdf_mc_timer_stop(&ps_param->auto_ps_enable_timer); - } + qdf_status = qdf_mc_timer_destroy(&ps_param->auto_ps_enable_timer); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) @@ -975,9 +979,9 @@ bool sme_is_auto_ps_timer_running(tHalHandle hal_ctx, */ if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state( - &ps_param->auto_ps_enable_timer)) { + &ps_param->auto_ps_enable_timer)) status = true; - } + return status; }