Change in osmo-bts[master]: RSL: Fix logic about fixed/dynamic MS power control in MS POWER COMMAND

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri May 24 16:03:05 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14155 )

Change subject: RSL: Fix logic about fixed/dynamic MS power control in MS POWER COMMAND
......................................................................

RSL: Fix logic about fixed/dynamic MS power control in MS POWER COMMAND

The spec is quite clear: If the MS Power Parameters IE is present, then
the BTS shall perform autonomous MS power control.  If it's absent,
then the MS power shall be fied.  Let's adjust our code accordingly.

Change-Id: Ie43a1fc9cc658677c8c945ae82d03b7bffbe52d5
Related: OS#1622
---
M src/common/rsl.c
1 file changed, 21 insertions(+), 6 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/common/rsl.c b/src/common/rsl.c
index e6fbe6f..e6fd8b9 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1554,19 +1554,34 @@
 /* 8.4.15 MS POWER CONTROL */
 static int rsl_rx_ms_pwr_ctrl(struct msgb *msg)
 {
+	struct abis_rsl_dchan_hdr *dch = msgb_l2(msg);
 	struct gsm_lchan *lchan = msg->lchan;
 	struct tlv_parsed tp;
+	uint8_t pwr;
 
 	rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg));
-	if (TLVP_PRES_LEN(&tp, RSL_IE_MS_POWER, 1)) {
-		uint8_t pwr = *TLVP_VAL(&tp, RSL_IE_MS_POWER) & 0x1F;
-		lchan->ms_power_ctrl.fixed = 1;
-		lchan->ms_power_ctrl.current = pwr;
 
-		LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "forcing power to %d\n", lchan->ms_power_ctrl.current);
-		bts_model_adjst_ms_pwr(lchan);
+	/* 9.3.13 MS Power (M) */
+	if (!TLVP_PRES_LEN(&tp, RSL_IE_MS_POWER, 1))
+		return rsl_tx_error_report(msg->trx, RSL_ERR_MAND_IE_ERROR, &dch->chan_nr, NULL, msg);
+
+	pwr = *TLVP_VAL(&tp, RSL_IE_MS_POWER) & 0x1F;
+	lchan->ms_power_ctrl.current = pwr;
+
+	LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "forcing power to %d\n", lchan->ms_power_ctrl.current);
+
+	/* 9.3.31 MS Power Parameters (O) */
+	if (TLVP_PRESENT(&tp, RSL_IE_MS_POWER_PARAM))
+		lchan->ms_power_ctrl.fixed = 0;
+	else {
+		/* Spec explicitly states BTS should only perform
+		* autonomous MS power control loop in BTS if 'MS Power
+		* Parameters' IE is present! */
+		lchan->ms_power_ctrl.fixed = 1;
 	}
 
+	bts_model_adjst_ms_pwr(lchan);
+
 	return 0;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/14155
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie43a1fc9cc658677c8c945ae82d03b7bffbe52d5
Gerrit-Change-Number: 14155
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190524/f2be903a/attachment.html>


More information about the gerrit-log mailing list