Kaynağa Gözat

qcacld-3.0: Fix Link tx power updation for RRM

Update Link tx power with TPC power calculated in lim_calculate_tpc
everytime a radio measurement request is received.

Change-Id: Ie564fd13b071f0265c2a5c80088d5550e07395b3
CRs-Fixed: 2938684
Gururaj Pandurangi 3 yıl önce
ebeveyn
işleme
32ae467386
1 değiştirilmiş dosya ile 13 ekleme ve 9 silme
  1. 13 9
      core/mac/src/pe/rrm/rrm_api.c

+ 13 - 9
core/mac/src/pe/rrm/rrm_api.c

@@ -250,6 +250,7 @@ rrm_process_link_measurement_request(struct mac_context *mac,
 	int8_t currentRSSI = 0;
 	struct vdev_mlme_obj *mlme_obj;
 	struct wlan_lmac_if_reg_tx_ops *tx_ops;
+	uint8_t ap_pwr_constraint = 0;
 
 	pe_debug("Received Link measurement request");
 
@@ -266,17 +267,20 @@ rrm_process_link_measurement_request(struct mac_context *mac,
 	}
 
 	if (wlan_reg_is_ext_tpc_supported(mac->psoc)) {
-		if (pLinkReq->MaxTxPower.maxTxPower !=
-				mlme_obj->reg_tpc_obj.ap_constraint_power) {
-
-			tx_ops = wlan_reg_get_tx_ops(mac->psoc);
-
-			mlme_obj->reg_tpc_obj.ap_constraint_power =
-					pLinkReq->MaxTxPower.maxTxPower;
-			lim_calculate_tpc(mac, pe_session, true);
+		ap_pwr_constraint = mlme_obj->reg_tpc_obj.ap_constraint_power;
+		mlme_obj->reg_tpc_obj.ap_constraint_power =
+				pLinkReq->MaxTxPower.maxTxPower;
+		lim_calculate_tpc(mac, pe_session, true);
 
-			LinkReport.txPower =
+		LinkReport.txPower =
 			mlme_obj->reg_tpc_obj.chan_power_info[0].tx_power;
+		if (LinkReport.txPower < MIN_TX_PWR_CAP)
+			LinkReport.txPower = MIN_TX_PWR_CAP;
+		else if (LinkReport.txPower > MAX_TX_PWR_CAP)
+			LinkReport.txPower = MAX_TX_PWR_CAP;
+
+		if (pLinkReq->MaxTxPower.maxTxPower != ap_pwr_constraint) {
+			tx_ops = wlan_reg_get_tx_ops(mac->psoc);
 
 			if (tx_ops->set_tpc_power)
 				tx_ops->set_tpc_power(mac->psoc,