diff options
-rw-r--r-- | src/common/phy_link.c | 2 | ||||
-rw-r--r-- | src/common/vty.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/common/phy_link.c b/src/common/phy_link.c index 7743c222..5ad72ac7 100644 --- a/src/common/phy_link.c +++ b/src/common/phy_link.c @@ -118,6 +118,8 @@ struct phy_instance *phy_instance_create(struct phy_link *plink, int num) void phy_instance_link_to_trx(struct phy_instance *pinst, struct gsm_bts_trx *trx) { + /* There might already be an associated TRX */ + OSMO_ASSERT(pinst->trx == NULL) trx->pinst = pinst; pinst->trx = trx; } diff --git a/src/common/vty.c b/src/common/vty.c index 8a1bafc4..e9a168f1 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -987,8 +987,13 @@ DEFUN(cfg_trx_phy, cfg_trx_phy_cmd, 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); + return CMD_WARNING; + } + + phy_instance_link_to_trx(pinst, trx); return CMD_SUCCESS; } |