|
@@ -671,6 +671,31 @@ sch_bcn_process_sta_ibss(tpAniSirGlobal mac_ctx,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * get_local_power_constraint_beacon() - extracts local constraint
|
|
|
+ * from beacon
|
|
|
+ * @bcn: beacon structure
|
|
|
+ * @local_constraint: local constraint pointer
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+#ifdef FEATURE_WLAN_ESE
|
|
|
+static void get_local_power_constraint_beacon(
|
|
|
+ tpSchBeaconStruct bcn,
|
|
|
+ int8_t *local_constraint)
|
|
|
+{
|
|
|
+ if (bcn->eseTxPwr.present)
|
|
|
+ *local_constraint = bcn->eseTxPwr.power_limit;
|
|
|
+}
|
|
|
+#else
|
|
|
+static void get_local_power_constraint_beacon(
|
|
|
+ tpSchBeaconStruct bcn,
|
|
|
+ int8_t *local_constraint)
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
/*
|
|
|
* __sch_beacon_process_for_session() - Process the received beacon frame when
|
|
|
* station is not scanning and corresponding session is found
|
|
@@ -715,12 +740,11 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx,
|
|
|
uint8_t *rx_pkt_info,
|
|
|
tpPESession session)
|
|
|
{
|
|
|
- int8_t localRRMConstraint = 0;
|
|
|
uint8_t bssIdx = 0;
|
|
|
tUpdateBeaconParams beaconParams;
|
|
|
uint8_t sendProbeReq = false;
|
|
|
tpSirMacMgmtHdr pMh = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
|
|
|
- int8_t regMax = 0, maxTxPower = 0;
|
|
|
+ int8_t regMax = 0, maxTxPower = 0, local_constraint;
|
|
|
qdf_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams));
|
|
|
beaconParams.paramChangeBitmap = 0;
|
|
|
|
|
@@ -765,35 +789,35 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx,
|
|
|
regMax = cfg_get_regulatory_max_transmit_power(mac_ctx,
|
|
|
session->currentOperChannel);
|
|
|
|
|
|
- if (mac_ctx->rrm.rrmPEContext.rrmEnable
|
|
|
- && bcn->powerConstraintPresent)
|
|
|
- localRRMConstraint =
|
|
|
- bcn->localPowerConstraint.localPowerConstraints;
|
|
|
- else
|
|
|
- localRRMConstraint = 0;
|
|
|
- maxTxPower = lim_get_max_tx_power(regMax, regMax - localRRMConstraint,
|
|
|
- mac_ctx->roam.configParam.nTxPowerCap);
|
|
|
+ local_constraint = regMax;
|
|
|
|
|
|
-#if defined FEATURE_WLAN_ESE
|
|
|
- if (session->isESEconnection) {
|
|
|
- int8_t localESEConstraint = 0;
|
|
|
- if (bcn->eseTxPwr.present) {
|
|
|
- localESEConstraint = bcn->eseTxPwr.power_limit;
|
|
|
- maxTxPower = lim_get_max_tx_power(maxTxPower,
|
|
|
- localESEConstraint,
|
|
|
- mac_ctx->roam.configParam.nTxPowerCap);
|
|
|
- }
|
|
|
- sch_log(mac_ctx, LOG1,
|
|
|
- FL("RegMax = %d, localEseCons = %d, MaxTx = %d"),
|
|
|
- regMax, localESEConstraint, maxTxPower);
|
|
|
+ if (mac_ctx->roam.configParam.allow_tpc_from_ap) {
|
|
|
+ get_local_power_constraint_beacon(bcn, &local_constraint);
|
|
|
+ sch_log(mac_ctx, LOG1, "ESE localPowerConstraint = %d,",
|
|
|
+ local_constraint);
|
|
|
+
|
|
|
+ if (mac_ctx->rrm.rrmPEContext.rrmEnable &&
|
|
|
+ bcn->powerConstraintPresent) {
|
|
|
+ local_constraint = regMax;
|
|
|
+ local_constraint -=
|
|
|
+ bcn->localPowerConstraint.localPowerConstraints;
|
|
|
+ sch_log(mac_ctx, LOG1, "localPowerConstraint = %d,",
|
|
|
+ local_constraint);
|
|
|
+ }
|
|
|
}
|
|
|
-#endif
|
|
|
+
|
|
|
+ maxTxPower = lim_get_max_tx_power(regMax, local_constraint,
|
|
|
+ mac_ctx->roam.configParam.nTxPowerCap);
|
|
|
+
|
|
|
+ sch_log(mac_ctx, LOG1, "RegMax = %d, MaxTx pwr = %d",
|
|
|
+ regMax, maxTxPower);
|
|
|
+
|
|
|
|
|
|
/* If maxTxPower is increased or decreased */
|
|
|
if (maxTxPower != session->maxTxPower) {
|
|
|
sch_log(mac_ctx, LOG1,
|
|
|
- FL("Local power constraint change..updating new maxTx power %d to HAL"),
|
|
|
- maxTxPower);
|
|
|
+ FL("Local power constraint change, Updating new maxTx power %d from old pwr %d"),
|
|
|
+ maxTxPower, session->maxTxPower);
|
|
|
if (lim_send_set_max_tx_power_req(mac_ctx, maxTxPower, session)
|
|
|
== eSIR_SUCCESS)
|
|
|
session->maxTxPower = maxTxPower;
|