Change in osmo-bts[master]: Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSP

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/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Nov 18 18:29:32 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/16071 )

Change subject: Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSP
......................................................................

Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSP

It indicates whether BTS model supports managing an MS Power Control
Loop over HW/DSP instead of using the software based osmocom algorithm
present in osmo-bts.
osmo-bts-trx own loop implementation is considered to be a "DSP/HW" one
since it acts on lower layers and interferes with osmocom algorithm
since it controls the same end variable "lchan->ms_power_ctrl.current",
this way we make sure both aren't enabled at the same time.
Old behavior in kept: if common upper-layer algo is not enabled
explicitly in VTY (ms-power-control osmo) and bts-trx specific lower
layer algo is neither enabled (osmotrx ms-power-loop <xyz>), then no
power control is done at all.

Related: OS#1851
Change-Id: I49706926b1e962b18791174627bc3cc0cd0cd9d5
---
M include/osmo-bts/gsm_data_shared.h
M src/common/bts.c
M src/common/gsm_data_shared.c
M src/common/vty.c
M src/osmo-bts-litecell15/main.c
M src/osmo-bts-oc2g/main.c
M src/osmo-bts-sysmo/main.c
M src/osmo-bts-trx/loops.c
M src/osmo-bts-trx/main.c
9 files changed, 23 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index bd10056..c19bb21 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -479,6 +479,7 @@
 	BTS_FEAT_SPEECH_F_AMR,
 	BTS_FEAT_SPEECH_H_AMR,
 	BTS_FEAT_ETWS_PN,
+	BTS_FEAT_MS_PWR_CTRL_DSP,
 	_NUM_BTS_FEAT
 };
 
diff --git a/src/common/bts.c b/src/common/bts.c
index 3809eb3..da41176 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -256,6 +256,10 @@
 	tpp->ramp.step_size_mdB = to_mdB(2);
 	tpp->ramp.step_interval_sec = 1;
 
+	/* IF BTS model doesn't DSP/HW support MS Power Control Loop, enable osmo algo by default: */
+	if (!gsm_bts_has_feature(trx->bts, BTS_FEAT_MS_PWR_CTRL_DSP))
+		trx->ms_pwr_ctl_soft = true;
+
 	rc = bts_model_trx_init(trx);
 	if (rc < 0) {
 		llist_del(&trx->list);
diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c
index 80acabc..b31d458 100644
--- a/src/common/gsm_data_shared.c
+++ b/src/common/gsm_data_shared.c
@@ -108,6 +108,7 @@
 	{ BTS_FEAT_SPEECH_F_AMR,	"Fullrate speech AMR" },
 	{ BTS_FEAT_SPEECH_H_AMR,	"Halfrate speech AMR" },
 	{ BTS_FEAT_ETWS_PN,		"ETWS Primary Notification on PCH" },
+	{ BTS_FEAT_MS_PWR_CTRL_DSP,	"DSP/HW based MS Power Control Loop" },
 	{ 0, NULL }
 };
 
diff --git a/src/common/vty.c b/src/common/vty.c
index 514d120..2558ba8 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -789,8 +789,14 @@
 	"Handled by DSP\n" "Handled by OsmoBTS\n")
 {
 	struct gsm_bts_trx *trx = vty->index;
+	bool soft = !strcmp(argv[0], "osmo");
 
-	trx->ms_pwr_ctl_soft = !strcmp(argv[0], "osmo");
+	if (!soft && !gsm_bts_has_feature(trx->bts, BTS_FEAT_MS_PWR_CTRL_DSP)) {
+		vty_out(vty, "This BTS model has no DSP/HW MS Power Control support%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	trx->ms_pwr_ctl_soft = soft;
 	return CMD_SUCCESS;
 }
 
diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c
index b0d725b..6f3fc00 100644
--- a/src/osmo-bts-litecell15/main.c
+++ b/src/osmo-bts-litecell15/main.c
@@ -112,6 +112,7 @@
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_EFR);
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_AMR);
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_AMR);
+	gsm_bts_set_feature(bts, BTS_FEAT_MS_PWR_CTRL_DSP);
 
 	bts_model_vty_init(bts);
 
diff --git a/src/osmo-bts-oc2g/main.c b/src/osmo-bts-oc2g/main.c
index cbf5c42..f9bb0cb 100644
--- a/src/osmo-bts-oc2g/main.c
+++ b/src/osmo-bts-oc2g/main.c
@@ -120,6 +120,7 @@
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_EFR);
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_AMR);
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_AMR);
+	gsm_bts_set_feature(bts, BTS_FEAT_MS_PWR_CTRL_DSP);
 
 	bts_model_vty_init(bts);
 
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index ad7118a..bb2c436 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -86,6 +86,7 @@
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_EFR);
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_AMR);
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_AMR);
+	gsm_bts_set_feature(bts, BTS_FEAT_MS_PWR_CTRL_DSP);
 
 	bts_model_vty_init(bts);
 
diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c
index 1f54fee..e73d842 100644
--- a/src/osmo-bts-trx/loops.c
+++ b/src/osmo-bts-trx/loops.c
@@ -237,8 +237,9 @@
 					.lchan[l1sap_chan2ss(chan_nr)];
 	struct phy_instance *pinst = trx_phy_instance(l1t->trx);
 
-	/* if MS power control loop is enabled, handle it */
-	if (pinst->phy_link->u.osmotrx.trx_ms_power_loop)
+	/* if common upper layer MS power control loop is disabled
+	   and lower layer MS power control loop is enabled, handle it */
+	if (!l1t->trx->ms_pwr_ctl_soft && pinst->phy_link->u.osmotrx.trx_ms_power_loop)
 		ms_power_val(lchan, chan_state, rssi);
 
 	/* if TA loop is enabled, handle it */
@@ -257,7 +258,9 @@
 	if (lchan->ms_power_ctrl.fixed)
 	        return;
 
-	if (pinst->phy_link->u.osmotrx.trx_ms_power_loop)
+	/* if common upper layer MS power control loop is disabled
+	   and lower layer MS power control loop is enabled, handle it */
+	if (!l1t->trx->ms_pwr_ctl_soft && pinst->phy_link->u.osmotrx.trx_ms_power_loop)
 		ms_power_clock(lchan, chan_state);
 
 	/* count the number of SACCH clocks */
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index cf40ea3..9a29b3b 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -116,6 +116,7 @@
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_AMR);
 	gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_AMR);
 	gsm_bts_set_feature(bts, BTS_FEAT_CBCH);
+	gsm_bts_set_feature(bts, BTS_FEAT_MS_PWR_CTRL_DSP);
 
 	bts_model_vty_init(bts);
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/16071
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I49706926b1e962b18791174627bc3cc0cd0cd9d5
Gerrit-Change-Number: 16071
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191118/2d0626fb/attachment.htm>


More information about the gerrit-log mailing list