Change in osmo-bts[master]: Unify common and bts-trx power control loop VTY command

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

pespin gerrit-no-reply at lists.osmocom.org
Wed Nov 13 12:27:36 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/16058 )


Change subject: Unify common and bts-trx power control loop VTY command
......................................................................

Unify common and bts-trx power control loop VTY command

osmotrx specific commands are marked as deprecated and their
implementation changed to set the common code variables. osmo-bts-trx
specific power control loop code is also changed to use the common
variables.

Related: OS#1851
Change-Id: I8fb310b2aee7780982bd9394bc5e758dfd66be25
---
M doc/examples/trx/osmo-bts-trx-calypso.cfg
M include/osmo-bts/phy_link.h
M src/osmo-bts-trx/loops.c
M src/osmo-bts-trx/main.c
M src/osmo-bts-trx/trx_vty.c
5 files changed, 17 insertions(+), 22 deletions(-)



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

diff --git a/doc/examples/trx/osmo-bts-trx-calypso.cfg b/doc/examples/trx/osmo-bts-trx-calypso.cfg
index 6b52fd2..d8cddbd 100644
--- a/doc/examples/trx/osmo-bts-trx-calypso.cfg
+++ b/doc/examples/trx/osmo-bts-trx-calypso.cfg
@@ -26,7 +26,6 @@
  osmotrx ip local 127.0.0.1
  osmotrx ip remote 127.0.0.1
  osmotrx timing-advance-loop
- osmotrx ms-power-loop -65
  osmotrx legacy-setbsic
 bts 0
  oml remote-ip 127.0.0.1
@@ -36,3 +35,4 @@
  band 900
  trx 0
   phy 0 instance 0
+  uplink-power-target -65
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index 316a1ba..b2e7c0e 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -45,8 +45,6 @@
 			uint16_t base_port_remote;
 			struct osmo_fd trx_ofd_clk;
 			bool trx_ta_loop;
-			bool trx_ms_power_loop;
-			int8_t trx_target_rssi;
 			uint32_t clock_advance;
 			uint32_t rts_advance;
 			bool use_legacy_setbsic;
diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c
index b2b163a..70e566d 100644
--- a/src/osmo-bts-trx/loops.c
+++ b/src/osmo-bts-trx/loops.c
@@ -28,6 +28,7 @@
 #include <osmo-bts/gsm_data.h>
 #include <osmo-bts/logging.h>
 #include <osmo-bts/l1sap.h>
+#include <osmo-bts/bts.h>
 #include <osmocom/core/bits.h>
 #include <osmocom/gsm/gsm_utils.h>
 
@@ -147,7 +148,6 @@
 static void ms_power_clock(struct gsm_lchan *lchan, struct l1sched_chan_state *chan_state)
 {
 	struct gsm_bts_trx *trx = lchan->ts->trx;
-	struct phy_instance *pinst = trx_phy_instance(trx);
 	int rssi;
 	int i;
 
@@ -188,9 +188,9 @@
 	/* change RSSI */
 	LOGPLCHAN(lchan, DLOOP, LOGL_DEBUG, "Lowest RSSI: %d Target RSSI: %d Current "
 		"MS power: %d (%d dBm)\n", rssi,
-		pinst->phy_link->u.osmotrx.trx_target_rssi, lchan->ms_power_ctrl.current,
+		trx->bts->ul_power_target, lchan->ms_power_ctrl.current,
 		ms_pwr_dbm(trx->bts->band, lchan->ms_power_ctrl.current));
-	ms_power_diff(lchan, pinst->phy_link->u.osmotrx.trx_target_rssi - rssi);
+	ms_power_diff(lchan, trx->bts->ul_power_target - rssi);
 }
 
 
@@ -247,7 +247,7 @@
 	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 (trx_ms_pwr_ctrl_is_osmo(l1t->trx))
 		ms_power_val(lchan, chan_state, rssi);
 
 	/* if TA loop is enabled, handle it */
@@ -261,12 +261,11 @@
 {
 	struct gsm_lchan *lchan = &l1t->trx->ts[L1SAP_CHAN2TS(chan_nr)]
 					.lchan[l1sap_chan2ss(chan_nr)];
-	struct phy_instance *pinst = trx_phy_instance(l1t->trx);
 
 	if (lchan->ms_power_ctrl.fixed)
 	        return;
 
-	if (pinst->phy_link->u.osmotrx.trx_ms_power_loop)
+	if (trx_ms_pwr_ctrl_is_osmo(l1t->trx))
 		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..b5841b0 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -124,6 +124,8 @@
 
 int bts_model_trx_init(struct gsm_bts_trx *trx)
 {
+	/* Enable software based algo for MS Power Control Loop: */
+	trx->ms_power_control = true;
 	return 0;
 }
 
@@ -136,8 +138,6 @@
 	plink->u.osmotrx.clock_advance = 20;
 	plink->u.osmotrx.rts_advance = 5;
 	plink->u.osmotrx.trx_ta_loop = true;
-	plink->u.osmotrx.trx_ms_power_loop = false;
-	plink->u.osmotrx.trx_target_rssi = -10;
 	/* attempt use newest TRXD version by default: */
 	plink->u.osmotrx.trxd_hdr_ver_max = TRX_DATA_FORMAT_VER;
 }
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 86f5712..5c6aea3 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -160,26 +160,28 @@
 	return CMD_SUCCESS;
 }
 
-DEFUN(cfg_phy_ms_power_loop, cfg_phy_ms_power_loop_cmd,
+DEFUN_DEPRECATED(cfg_phy_ms_power_loop, cfg_phy_ms_power_loop_cmd,
 	"osmotrx ms-power-loop <-127-127>", OSMOTRX_STR
 	"Enable MS power control loop\nTarget RSSI value (transceiver specific, "
 	"should be 6dB or more above noise floor)\n")
 {
-	struct phy_link *plink = vty->index;
+	vty_out (vty, "'osmotrx ms-power-loop' is deprecated, use 'uplink-power-target' instead%s", VTY_NEWLINE);
 
-	plink->u.osmotrx.trx_target_rssi = atoi(argv[0]);
-	plink->u.osmotrx.trx_ms_power_loop = true;
+	vty_bts->ul_power_target = atoi(argv[0]);
+	/* Remark: workaround after deprecation only works for 1st TRX */
+	vty_bts->c0->ms_power_control = true;
 
 	return CMD_SUCCESS;
 }
 
-DEFUN(cfg_phy_no_ms_power_loop, cfg_phy_no_ms_power_loop_cmd,
+DEFUN_DEPRECATED(cfg_phy_no_ms_power_loop, cfg_phy_no_ms_power_loop_cmd,
 	"no osmotrx ms-power-loop",
 	NO_STR OSMOTRX_STR "Disable MS power control loop\n")
 {
-	struct phy_link *plink = vty->index;
+	vty_out (vty, "'no osmotrx ms-power-loop' is deprecated, use 'ms-power-control dsp' instead%s", VTY_NEWLINE);
 
-	plink->u.osmotrx.trx_ms_power_loop = false;
+	/* Remark: workaround after deprecation only works for 1st TRX */
+	vty_bts->c0->ms_power_control = false;
 
 	return CMD_SUCCESS;
 }
@@ -525,10 +527,6 @@
 		vty_out(vty, " osmotrx ip remote %s%s",
 			plink->u.osmotrx.remote_ip, VTY_NEWLINE);
 
-	if (plink->u.osmotrx.trx_ms_power_loop)
-		vty_out(vty, " osmotrx ms-power-loop %d%s", plink->u.osmotrx.trx_target_rssi, VTY_NEWLINE);
-	else
-		vty_out(vty, " no osmotrx ms-power-loop%s", VTY_NEWLINE);
 	vty_out(vty, " %sosmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no ", VTY_NEWLINE);
 
 	if (plink->u.osmotrx.base_port_local)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I8fb310b2aee7780982bd9394bc5e758dfd66be25
Gerrit-Change-Number: 16058
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191113/9c6b4855/attachment.htm>


More information about the gerrit-log mailing list