summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-19 06:19:10 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-19 06:19:10 -0800
commitb86cddd1841fea9262aff09666485cf0b5194201 (patch)
tree7eb8572352585c84bc95ed9e95002e744213ac3d
parenta59b279953132fe0b7b82be0f4ccb245d37f5e72 (diff)
parent97fa4f692b7dab4791e2226064b46298f898a196 (diff)
Merge "qcacld-2.0: Do not queue multiple setMaxTxPower cmd in SME pending queue" into wlan-cld2.driver.lnx.1.0-dev
-rw-r--r--CORE/MAC/inc/aniGlobal.h3
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c20
2 files changed, 21 insertions, 2 deletions
diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h
index e6069b00d761..e838794259ec 100644
--- a/CORE/MAC/inc/aniGlobal.h
+++ b/CORE/MAC/inc/aniGlobal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -1291,6 +1291,7 @@ typedef struct sAniSirGlobal
uint8_t sub20_config_info;
uint8_t sub20_channelwidth;
uint8_t sub20_dynamic_channelwidth;
+ bool max_power_cmd_pending;
} tAniSirGlobal;
typedef enum
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 789b441bb0ab..0d8e5e4759b2 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -1080,6 +1080,7 @@ sme_process_cmd:
&pCommand->Link, LL_ACCESS_LOCK)) {
csrReleaseCommand(pMac, pCommand);
}
+ pMac->max_power_cmd_pending = false;
break;
case eSmeCommandSetMaxTxPowerPerBand:
csrLLUnlock(&pMac->sme.smeCmdActiveList);
@@ -1092,6 +1093,7 @@ sme_process_cmd:
&pCommand->Link, LL_ACCESS_LOCK)) {
csrReleaseCommand(pMac, pCommand);
}
+ pMac->max_power_cmd_pending = false;
break;
#ifdef FEATURE_OEM_DATA_SUPPORT
@@ -9766,6 +9768,12 @@ eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB,
tSmeCmd *set_max_tx_pwr_per_band;
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+ if (mac_ctx->max_power_cmd_pending) {
+ smsLog(mac_ctx, LOG1,
+ FL("set max tx power already in progress"));
+ return eHAL_STATUS_RESOURCES;
+ }
+
smsLog(mac_ctx, LOG1,
FL("band : %d power %d dB"),
band, dB);
@@ -9783,6 +9791,7 @@ eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB,
set_tx_max_pwr_per_band.band = band;
set_max_tx_pwr_per_band->u.
set_tx_max_pwr_per_band.power = dB;
+ mac_ctx->max_power_cmd_pending = true;
status = csrQueueSmeCommand(mac_ctx,
set_max_tx_pwr_per_band,
eANI_BOOLEAN_TRUE);
@@ -9792,6 +9801,7 @@ eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB,
status);
csrReleaseCommand(mac_ctx,
set_max_tx_pwr_per_band);
+ mac_ctx->max_power_cmd_pending = false;
}
} else {
smsLog(mac_ctx, LOGE,
@@ -9823,6 +9833,12 @@ eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr bssid,
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *set_max_tx_pwr;
+ if (mac_ptr->max_power_cmd_pending) {
+ smsLog(mac_ptr, LOG1,
+ FL("set max tx power already in progress"));
+ return eHAL_STATUS_RESOURCES;
+ }
+
MTRACE(vos_trace(VOS_MODULE_ID_SME,
TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0));
smsLog(mac_ptr, LOG1,
@@ -9839,6 +9855,7 @@ eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr bssid,
vos_mem_copy(set_max_tx_pwr->u.set_tx_max_pwr.self_sta_mac_addr,
self_mac_addr, SIR_MAC_ADDR_LENGTH);
set_max_tx_pwr->u.set_tx_max_pwr.power = db;
+ mac_ptr->max_power_cmd_pending = true;
status = csrQueueSmeCommand(mac_ptr, set_max_tx_pwr,
eANI_BOOLEAN_TRUE);
if (!HAL_STATUS_SUCCESS(status)) {
@@ -9846,6 +9863,7 @@ eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr bssid,
FL("fail to send msg status = %d"),
status);
csrReleaseCommandScan(mac_ptr, set_max_tx_pwr);
+ mac_ptr->max_power_cmd_pending = false;
}
}
else