Change in osmo-bts[master]: bts-trx: Introduce helper func l1if_trx_set_nominal_power

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
Fri May 29 16:05:43 UTC 2020


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


Change subject: bts-trx: Introduce helper func l1if_trx_set_nominal_power
......................................................................

bts-trx: Introduce helper func l1if_trx_set_nominal_power

This way we wrap same logic in one place, which will be used more in
next commit.

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



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

diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index f3be413..3f61564 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -140,6 +140,13 @@
 				   LID_SACCH, 0);
 }
 
+/* Sets the nominal power, in dB */
+void l1if_trx_set_nominal_power(struct gsm_bts_trx *trx, unsigned int nominal_power)
+{
+	trx->nominal_power = nominal_power;
+	trx->power_params.trx_p_max_out_mdBm = to_mdB(nominal_power);
+}
+
 static void l1if_setslot_cb(struct trx_l1h *l1h, uint8_t tn, uint8_t type, int rc)
 {
 	struct phy_instance *pinst = l1h->phy_inst;
diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h
index 22052ff..b5262a8 100644
--- a/src/osmo-bts-trx/l1_if.h
+++ b/src/osmo-bts-trx/l1_if.h
@@ -112,6 +112,7 @@
 int l1if_provision_transceiver_trx(struct trx_l1h *l1h);
 int l1if_provision_transceiver(struct gsm_bts *bts);
 int l1if_mph_time_ind(struct gsm_bts *bts, uint32_t fn);
+void l1if_trx_set_nominal_power(struct gsm_bts_trx *trx, unsigned int nominal_power);
 
 static inline struct l1sched_trx *trx_l1sched_hdl(struct gsm_bts_trx *trx)
 {
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 60688bc..33577d5 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -127,7 +127,7 @@
 
 int bts_model_trx_init(struct gsm_bts_trx *trx)
 {
-	trx->power_params.trx_p_max_out_mdBm = to_mdB(trx->bts->c0->nominal_power);
+	l1if_trx_set_nominal_power(trx, trx->bts->c0->nominal_power);
 	return 0;
 }
 
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 5e67cb5..06591a1 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -165,9 +165,11 @@
 	"Nominal transmit output power level in dBm\n")
 {
 	struct gsm_bts_trx *trx = vty->index;
+	int val = atoi(argv[0]);
 
-	trx->nominal_power = atoi(argv[0]);
-	trx->power_params.trx_p_max_out_mdBm = to_mdB(trx->nominal_power);
+	l1if_trx_set_nominal_power(trx, val);
+
+
 
 	return CMD_SUCCESS;
 }

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I929fc50d544a88900d2e22317ec5ced10f15e51c
Gerrit-Change-Number: 18588
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/20200529/75c37200/attachment.htm>


More information about the gerrit-log mailing list