Change in osmo-bts[master]: Change gsm_bts_trx field to bool and rename it

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
Thu Nov 14 22:16:57 UTC 2019


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

Change subject: Change gsm_bts_trx field to bool and rename it
......................................................................

Change gsm_bts_trx field to bool and rename it

Thies field is used to store and retrieve whether MS power needs to be
calculated and updated by osmo-bts software or autonomously by lower
layers. Previous name was not clear
and may have been understood as indicating whether MS Power Control loop
is done or not in general, and the responsible for that is located under
lchan's ms_power_ctrl.fixed.

Related: OS#1851
Change-Id: Ic690ab69866a7377f1597e24aa7b0214831c1cbe
---
M include/osmo-bts/bts.h
M include/osmo-bts/gsm_data_shared.h
M src/common/bts.c
M src/common/vty.c
M tests/power/power_test.c
5 files changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index 5c719f9..63412f9 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -49,7 +49,7 @@
 uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg);
 void bts_update_status(enum bts_global_status which, int on);
 
-int trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx);
+bool trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx);
 
 struct gsm_time *get_time(struct gsm_bts *bts);
 
diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index 1445ed2..8678ea5 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -417,7 +417,7 @@
 
 
 	struct trx_power_params power_params;
-	int ms_power_control;
+	bool ms_pwr_ctl_soft; /* is power control loop done by osmocom software? */
 
 	struct {
 		void *l1h;
diff --git a/src/common/bts.c b/src/common/bts.c
index 60e27cc..3809eb3 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -778,9 +778,9 @@
 	return sup > 0;
 }
 
-int trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx)
+bool trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx)
 {
-	return trx->ms_power_control == 1;
+	return trx->ms_pwr_ctl_soft;
 }
 
 struct gsm_time *get_time(struct gsm_bts *bts)
diff --git a/src/common/vty.c b/src/common/vty.c
index e775d99..fd9be40 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -332,7 +332,7 @@
 		vty_out(vty, "  power-ramp step-interval %d%s",
 			tpp->ramp.step_interval_sec, VTY_NEWLINE);
 		vty_out(vty, "  ms-power-control %s%s",
-			trx->ms_power_control == 0 ? "dsp" : "osmo",
+			trx->ms_pwr_ctl_soft ? "osmo" : "dsp",
 			VTY_NEWLINE);
 		vty_out(vty, "  phy %u instance %u%s", pinst->phy_link->num,
 			pinst->num, VTY_NEWLINE);
@@ -790,7 +790,7 @@
 {
 	struct gsm_bts_trx *trx = vty->index;
 
-	trx->ms_power_control = argv[0][0] == 'd' ? 0 : 1;
+	trx->ms_pwr_ctl_soft = !strcmp(argv[0], "osmo");
 	return CMD_SUCCESS;
 }
 
diff --git a/tests/power/power_test.c b/tests/power/power_test.c
index a46a430..8df6d69 100644
--- a/tests/power/power_test.c
+++ b/tests/power/power_test.c
@@ -48,7 +48,7 @@
 	ts.trx = &trx;
 	trx.bts = &bts;
 	bts.band = GSM_BAND_1800;
-	trx.ms_power_control = 1;
+	trx.ms_pwr_ctl_soft = true;
 	bts.ul_power_target = -75;
 
 	lchan->state = LCHAN_S_NONE;

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ic690ab69866a7377f1597e24aa7b0214831c1cbe
Gerrit-Change-Number: 16059
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191114/9cd8c093/attachment.htm>


More information about the gerrit-log mailing list