Change in osmo-bts[master]: bts-trx: vty: Add 'nominal-tx-power' cmd

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
Wed Jun 3 17:33:14 UTC 2020


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

Change subject: bts-trx: vty: Add 'nominal-tx-power' cmd
......................................................................

bts-trx: vty: Add 'nominal-tx-power' cmd

This value will be soon acquired automatically by osmo-bts-trx by asking
over TRXC to new versions of osmo-trx which is the nominal tx power for a given trx.
However, to still be able to work correctly against older versions of
osmo-trx or other TRX implementation (older or current) not supporting
this new TRX comamnd, let's allow the user to force a given value
through VTY for Tx power to work correctly.

Change-Id: Ib1b6f80d3b54afc42db9d358a79582cc619c6ce4
---
M src/osmo-bts-trx/l1_if.h
M src/osmo-bts-trx/main.c
M src/osmo-bts-trx/trx_vty.c
3 files changed, 45 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h
index 7370999..42452d2 100644
--- a/src/osmo-bts-trx/l1_if.h
+++ b/src/osmo-bts-trx/l1_if.h
@@ -78,6 +78,8 @@
 	int			power_oml;
 	int			power_sent;
 
+	bool			nominal_power_set_by_vty; /* whether nominal trx power was enforced/retreived from VTY config "nominal-tx-power" */
+
 	int			maxdly_valid;
 	int			maxdly;
 	int			maxdly_sent;
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index ab0472e..3c1c892 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -104,8 +104,10 @@
 	bts->variant = BTS_OSMO_TRX;
 	bts->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3);
 
-	/* FIXME: this needs to be overridden with the real hardrware
-	 * value */
+	/* The nominal value is later  overwritten through VTY cmd
+	 * 'nominal-tx-power' if present.
+	 * FIXME: In the future, we want osmo-trx to provide us with this info
+	 * through TRXC. */
 	bts->c0->nominal_power = 23;
 
 	gsm_bts_set_feature(bts, BTS_FEAT_GPRS);
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 9c67a7f..6dddfe2 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -160,6 +160,36 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd,
+	"nominal-tx-power <-10-100>",
+	"Manually set (force) the nominal transmit output power in dBm\n"
+	"Nominal transmit output power level in dBm\n")
+{
+	struct gsm_bts_trx *trx = vty->index;
+	struct phy_instance *pinst = trx_phy_instance(trx);
+	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+	int val = atoi(argv[0]);
+
+	trx->nominal_power = val;
+	l1h->config.nominal_power_set_by_vty = true;
+
+	return CMD_SUCCESS;
+}
+
+DEFUN(cfg_trx_no_nominal_power, cfg_trx_no_nominal_power_cmd,
+	"no nominal-tx-power",
+	NO_STR
+	"Manually set (force) the nominal transmit output power; ask the TRX instead (default)\n")
+{
+	struct gsm_bts_trx *trx = vty->index;
+	struct phy_instance *pinst = trx_phy_instance(trx);
+	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+
+	l1h->config.nominal_power_set_by_vty = false;
+
+	return CMD_SUCCESS;
+}
+
 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, "
@@ -574,6 +604,12 @@
 
 void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
 {
+	struct phy_instance *pinst = trx_phy_instance(trx);
+	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
+
+	if (l1h->config.nominal_power_set_by_vty)
+		vty_out(vty, "  nominal-tx-power %d%s", trx->nominal_power,
+			VTY_NEWLINE);
 }
 
 int bts_model_vty_init(struct gsm_bts *bts)
@@ -583,6 +619,9 @@
 	install_element_ve(&show_transceiver_cmd);
 	install_element_ve(&show_phy_cmd);
 
+	install_element(TRX_NODE, &cfg_trx_nominal_power_cmd);
+	install_element(TRX_NODE, &cfg_trx_no_nominal_power_cmd);
+
 	install_element(PHY_NODE, &cfg_phy_ms_power_loop_cmd);
 	install_element(PHY_NODE, &cfg_phy_no_ms_power_loop_cmd);
 	install_element(PHY_NODE, &cfg_phy_timing_advance_loop_cmd);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib1b6f80d3b54afc42db9d358a79582cc619c6ce4
Gerrit-Change-Number: 18579
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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/20200603/722df393/attachment.htm>


More information about the gerrit-log mailing list