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 Jun 12 09:59:57 UTC 2020


pespin has submitted this change. ( 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, 10 insertions(+), 3 deletions(-)

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



diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index d0eba2b..97f87a1 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -138,6 +138,13 @@
 	return trx_sched_set_lchan(&l1h->l1s, gsm_lchan2chan_nr(lchan), LID_SACCH, false);
 }
 
+/* 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 46f2c18..5f51acb 100644
--- a/src/osmo-bts-trx/l1_if.h
+++ b/src/osmo-bts-trx/l1_if.h
@@ -114,6 +114,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 8fb67d2..fbe4c2f 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -129,7 +129,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 b920c57..b3214ee 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -169,8 +169,7 @@
 	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
 	int val = atoi(argv[0]);
 
-	trx->nominal_power = val;
-	trx->power_params.trx_p_max_out_mdBm = to_mdB(trx->nominal_power);
+	l1if_trx_set_nominal_power(trx, val);
 	l1h->config.nominal_power_set_by_vty = true;
 
 	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: 6
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/20200612/2007f39f/attachment.htm>


More information about the gerrit-log mailing list