Change in osmo-bts[master]: rsl: Implement parsing of BS Power Control message

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri May 24 08:38:12 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/14156


Change subject: rsl: Implement parsing of BS Power Control message
......................................................................

rsl: Implement parsing of BS Power Control message

Change-Id: Id144a7e468f730e3cdaefa4cf2ad51c6106310a2
---
M doc/manuals/abis/rsl.adoc
M src/common/rsl.c
2 files changed, 33 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/14156/1

diff --git a/doc/manuals/abis/rsl.adoc b/doc/manuals/abis/rsl.adoc
index ec4da67..f66142d 100644
--- a/doc/manuals/abis/rsl.adoc
+++ b/doc/manuals/abis/rsl.adoc
@@ -39,6 +39,7 @@
 | 8.4.11 | - | MODE MODIFY NEGATIVE ACKNOWLEDGE | -> | Sent
 | 8.4.14 | - | RF CHANNEL RELEASE | <- | Received
 | 8.4.15 | <<MS_POWER_CONTROL>> | MS POWER CONTROL | <- | Received
+| 8.4.16 | - | BS POWER CONTROL | <- | Received
 | 8.4.19 | - | RF CHANNEL RELEASE ACKNOWLEDGE | -> | Sent
 | 8.4.20 | <<SACCH_INFO_MODIFY>> | SACCH INFO MODIFY | <- | Received
 5+<| *COMMON CHANNEL MANAGEMENT MESSAGES*
@@ -91,7 +92,6 @@
 2+<| *DEDICATED CHANNEL MANAGEMENT MESSAGES*
 | 8.4.12 | PHYSICAL CONTEXT REQUEST
 | 8.4.13 | PHYSICAL CONTEXT CONFIRM
-| 8.4.16 | BS POWER CONTROL
 | 8.4.17 | PREPROCESS CONFIGURE
 | 8.4.18 | PREPROCESSED MEASUREMENT RESULT
 | 8.4.21 | TALKER DETECTION
diff --git a/src/common/rsl.c b/src/common/rsl.c
index e6fd8b9..f59785b 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1585,6 +1585,35 @@
 	return 0;
 }
 
+/* 8.4.16 BS POWER CONTROL */
+static int rsl_rx_bs_pwr_ctrl(struct msgb *msg)
+{
+	struct abis_rsl_dchan_hdr *dch = msgb_l2(msg);
+	struct gsm_lchan *lchan = msg->lchan;
+	struct tlv_parsed tp;
+
+	rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg));
+
+	/* 9.3.4 BS Power (M) */
+	if (!TLVP_PRES_LEN(&tp, RSL_IE_BS_POWER, 1))
+		return rsl_tx_error_report(msg->trx, RSL_ERR_MAND_IE_ERROR, &dch->chan_nr, NULL, msg);
+
+	lchan->bs_power = *TLVP_VAL(&tp, RSL_IE_BS_POWER);
+
+	LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "BS POWER CONTROL to -%u dBm\n", (lchan->bs_power & 0xF)*2);
+
+	/* 9.3.31 MS Power Parameters (O) */
+	if (TLVP_PRESENT(&tp, RSL_IE_BS_POWER_PARAM)) {
+		/* Spec explicitly states BTS should perform autonomous
+		 * BS power control loop in BTS if 'BS Power Parameters'
+		 * IE is present!  WE don't support that. */
+		return rsl_tx_error_report(msg->trx, RSL_ERR_OPT_IE_ERROR, &dch->chan_nr, NULL, msg);
+	}
+
+	return 0;
+}
+
+
 /* 8.4.20 SACCH INFO MODify */
 static int rsl_rx_sacch_inf_mod(struct msgb *msg)
 {
@@ -2926,6 +2955,9 @@
 	case RSL_MT_MS_POWER_CONTROL:
 		ret = rsl_rx_ms_pwr_ctrl(msg);
 		break;
+	case RSL_MT_BS_POWER_CONTROL:
+		ret = rsl_rx_bs_pwr_ctrl(msg);
+		break;
 	case RSL_MT_IPAC_PDCH_ACT:
 	case RSL_MT_IPAC_PDCH_DEACT:
 		rsl_rx_dyn_pdch(msg, dch->c.msg_type == RSL_MT_IPAC_PDCH_ACT);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id144a7e468f730e3cdaefa4cf2ad51c6106310a2
Gerrit-Change-Number: 14156
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190524/e9bed3f9/attachment.htm>


More information about the gerrit-log mailing list