qcacld-3.0: Dont send power disable cmd to FW in disconnected state

Do not send power save disable command to FW in disconnected state
as the power save is already disabled when STA is disconnected and
FW does not expect powersave commands after VDEV is down

Change-Id: Iea5a564f1a57f7fa4b8d9c96296d2c2e82c92775
CRs-Fixed: 2171113
This commit is contained in:
Kiran Kumar Lokere
2018-01-10 20:20:14 -08:00
committed by snandini
parent 1756f39b41
commit 7d9439c858
2 changed files with 10 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -42,8 +42,7 @@ QDF_STATUS sme_ps_uapsd_enable(tHalHandle hal_ctx, uint32_t session_id);
QDF_STATUS sme_ps_uapsd_disable(tHalHandle hal_ctx, uint32_t session_id); QDF_STATUS sme_ps_uapsd_disable(tHalHandle hal_ctx, uint32_t session_id);
/* Condition check if driver is ready to enter in PS */ /* Condition check if driver is ready to enter in PS */
QDF_STATUS sme_enable_sta_ps_check(tpAniSirGlobal mac_ctx, uint32_t session_id, QDF_STATUS sme_enable_sta_ps_check(tpAniSirGlobal mac_ctx, uint32_t session_id);
enum sme_ps_cmd command);
QDF_STATUS sme_ps_process_command(tpAniSirGlobal mac_ctx, QDF_STATUS sme_ps_process_command(tpAniSirGlobal mac_ctx,
uint32_t session_id, uint32_t session_id,

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -489,8 +489,7 @@ QDF_STATUS sme_ps_process_command(tpAniSirGlobal mac_ctx, uint32_t session_id,
* *
* Return: QDF_STATUS * Return: QDF_STATUS
*/ */
QDF_STATUS sme_enable_sta_ps_check(tpAniSirGlobal mac_ctx, uint32_t session_id, QDF_STATUS sme_enable_sta_ps_check(tpAniSirGlobal mac_ctx, uint32_t session_id)
enum sme_ps_cmd command)
{ {
struct ps_global_info *ps_global_info = &mac_ctx->sme.ps_global_info; struct ps_global_info *ps_global_info = &mac_ctx->sme.ps_global_info;
@@ -504,8 +503,7 @@ QDF_STATUS sme_enable_sta_ps_check(tpAniSirGlobal mac_ctx, uint32_t session_id,
* also if command is power save disable there is not need to check * also if command is power save disable there is not need to check
* for connected state as firmware can handle this * for connected state as firmware can handle this
*/ */
if ((command != SME_PS_DISABLE) && if (!csr_is_conn_state_connected_infra(mac_ctx, session_id)) {
!csr_is_conn_state_connected_infra(mac_ctx, session_id)) {
sme_debug("STA not infra/connected state Session_id: %d", sme_debug("STA not infra/connected state Session_id: %d",
session_id); session_id);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
@@ -528,7 +526,7 @@ QDF_STATUS sme_ps_enable_disable(tHalHandle hal_ctx, uint32_t session_id,
QDF_STATUS status = QDF_STATUS_E_FAILURE; QDF_STATUS status = QDF_STATUS_E_FAILURE;
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx); tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx);
status = sme_enable_sta_ps_check(mac_ctx, session_id, command); status = sme_enable_sta_ps_check(mac_ctx, session_id);
if (status != QDF_STATUS_SUCCESS) if (status != QDF_STATUS_SUCCESS)
return status; return status;
status = sme_ps_process_command(mac_ctx, session_id, command); status = sme_ps_process_command(mac_ctx, session_id, command);
@@ -545,7 +543,7 @@ QDF_STATUS sme_ps_timer_flush_sync(tHalHandle hal, uint8_t session_id)
struct sEnablePsParams *req; struct sEnablePsParams *req;
t_wma_handle *wma; t_wma_handle *wma;
status = sme_enable_sta_ps_check(mac_ctx, session_id, SME_PS_ENABLE); status = sme_enable_sta_ps_check(mac_ctx, session_id);
if (QDF_IS_STATUS_ERROR(status)) { if (QDF_IS_STATUS_ERROR(status)) {
sme_debug("Power save not allowed for vdev id %d", session_id); sme_debug("Power save not allowed for vdev id %d", session_id);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -605,8 +603,7 @@ QDF_STATUS sme_ps_uapsd_enable(tHalHandle hal_ctx, uint32_t session_id)
QDF_STATUS status = QDF_STATUS_E_FAILURE; QDF_STATUS status = QDF_STATUS_E_FAILURE;
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx); tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx);
status = sme_enable_sta_ps_check(mac_ctx, session_id, status = sme_enable_sta_ps_check(mac_ctx, session_id);
SME_PS_UAPSD_ENABLE);
if (status != QDF_STATUS_SUCCESS) if (status != QDF_STATUS_SUCCESS)
return status; return status;
status = sme_ps_process_command(mac_ctx, session_id, status = sme_ps_process_command(mac_ctx, session_id,
@@ -630,8 +627,7 @@ QDF_STATUS sme_ps_uapsd_disable(tHalHandle hal_ctx, uint32_t session_id)
QDF_STATUS status = QDF_STATUS_E_FAILURE; QDF_STATUS status = QDF_STATUS_E_FAILURE;
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx); tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx);
status = sme_enable_sta_ps_check(mac_ctx, session_id, status = sme_enable_sta_ps_check(mac_ctx, session_id);
SME_PS_UAPSD_DISABLE);
if (status != QDF_STATUS_SUCCESS) if (status != QDF_STATUS_SUCCESS)
return status; return status;
status = sme_ps_process_command(mac_ctx, session_id, status = sme_ps_process_command(mac_ctx, session_id,
@@ -990,7 +986,7 @@ void sme_auto_ps_entry_timer_expired(void *data)
session_id = ps_params->session_id; session_id = ps_params->session_id;
sme_debug("auto_ps_timer expired, enabling powersave"); sme_debug("auto_ps_timer expired, enabling powersave");
status = sme_enable_sta_ps_check(mac_ctx, session_id, SME_PS_ENABLE); status = sme_enable_sta_ps_check(mac_ctx, session_id);
if (QDF_STATUS_SUCCESS == status) if (QDF_STATUS_SUCCESS == status)
sme_ps_enable_disable((tHalHandle)mac_ctx, session_id, sme_ps_enable_disable((tHalHandle)mac_ctx, session_id,
SME_PS_ENABLE); SME_PS_ENABLE);