Change in osmo-bts[master]: common/vty: facilitate finding duplicate PHY/TRX associations

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

fixeria gerrit-no-reply at lists.osmocom.org
Wed May 19 15:29:59 UTC 2021


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


Change subject: common/vty: facilitate finding duplicate PHY/TRX associations
......................................................................

common/vty: facilitate finding duplicate PHY/TRX associations

In phy_instance_link_to_trx(), if the given PHY instance is already
associated with a TRX instance, unbind the later from it.

In cfg_trx_phy_cmd(), use phy_instance_link_to_trx().  Tolerate
duplicate entries (just print a warning) in the interactive VTY
mode, abort if we're reading from the configuration file.

Change-Id: I132e08fc496abef278b94254cebfac7a4285a7c2
---
M src/common/phy_link.c
M src/common/vty.c
2 files changed, 12 insertions(+), 2 deletions(-)



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

diff --git a/src/common/phy_link.c b/src/common/phy_link.c
index 7743c22..b22d877 100644
--- a/src/common/phy_link.c
+++ b/src/common/phy_link.c
@@ -118,6 +118,9 @@
 
 void phy_instance_link_to_trx(struct phy_instance *pinst, struct gsm_bts_trx *trx)
 {
+	/* There might already be an associated TRX */
+	if (pinst->trx != NULL)
+		pinst->trx->pinst = NULL;
 	trx->pinst = pinst;
 	pinst->trx = trx;
 }
diff --git a/src/common/vty.c b/src/common/vty.c
index d4e2902..4bf9761 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -987,8 +987,15 @@
 		return CMD_WARNING;
 	}
 
-	trx->pinst = pinst;
-	pinst->trx = trx;
+	if (pinst->trx != NULL) {
+		vty_out(vty, "phy%s instance %s is already bound to %s%s",
+			argv[0], argv[1], gsm_trx_name(pinst->trx), VTY_NEWLINE);
+		/* Be tolerant in the interactive VTY mode */
+		if (vty->type == VTY_FILE)
+			return CMD_WARNING;
+	}
+
+	phy_instance_link_to_trx(pinst, trx);
 
 	return CMD_SUCCESS;
 }

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I132e08fc496abef278b94254cebfac7a4285a7c2
Gerrit-Change-Number: 24289
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210519/d5ccf558/attachment.htm>


More information about the gerrit-log mailing list