aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/trx_vty.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-07-22 17:07:27 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-07-23 17:21:40 +0200
commite6372cff1bb044faf992976f6e1096a14a8f0295 (patch)
tree3559cbaf3175362ca25e4cf1758883959962d300 /src/osmo-bts-trx/trx_vty.c
parentaa54224e563bcde01bcd1dfc21c59552b421a815 (diff)
bts-trx: Introduce VTY command osmotrx trxd-max-version
This command allows setting a maximum TRXD format version to negotiate with TRX. osmo-bts-trx will hence end up using that version if supported by TRX, or a lower one otherwise (or fail if TRX doesn't support any of them). Since now the maximum version can be 0, avoid going through SETFORMAT negotiation in that case, since 0 is the default version. This way we keep backward compatibility with TRX implementations that exit upon receival of unknown commands (such as SC5 current one). The VTY command is located in the "phy" node instead of the "phy instance" node because instances of same phy are expected to use same host with same implementation, so TRXD version to use should be the same for both. Related: OS#4006 Change-Id: I5eb1fdc002f9d7f4acf475356d8fc998dc8f6326
Diffstat (limited to 'src/osmo-bts-trx/trx_vty.c')
-rw-r--r--src/osmo-bts-trx/trx_vty.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index b9af445b..c52908e0 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -496,6 +496,29 @@ DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_phy_trxd_max_version, cfg_phy_trxd_max_version_cmd,
+ "osmotrx trxd-max-version (latest|<0-15>)", OSMOTRX_STR
+ "Set maximum TRXD format version to negotiate with TRX\n"
+ "Use latest supported TRXD format version (default)\n"
+ "Maximum TRXD format version number\n")
+{
+ struct phy_link *plink = vty->index;
+
+ int max_ver;
+ if (strcmp(argv[0], "latest") == 0)
+ max_ver = TRX_DATA_FORMAT_VER;
+ else
+ max_ver = atoi(argv[0]);
+ if (max_ver > TRX_DATA_FORMAT_VER) {
+ vty_out(vty, "%% Format version %d is not supported, maximum supported is %d%s",
+ max_ver, TRX_DATA_FORMAT_VER, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ plink->u.osmotrx.trxd_hdr_ver_max = max_ver;
+
+ return CMD_SUCCESS;
+}
+
void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
{
if (plink->u.osmotrx.local_ip)
@@ -525,6 +548,9 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
if (plink->u.osmotrx.use_legacy_setbsic)
vty_out(vty, " osmotrx legacy-setbsic%s", VTY_NEWLINE);
+
+ if (plink->u.osmotrx.trxd_hdr_ver_max != TRX_DATA_FORMAT_VER)
+ vty_out(vty, " osmotrx trxd-max-version %d%s", plink->u.osmotrx.trxd_hdr_ver_max, VTY_NEWLINE);
}
void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst)
@@ -584,6 +610,7 @@ int bts_model_vty_init(struct gsm_bts *bts)
install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd);
install_element(PHY_NODE, &cfg_phy_setbsic_cmd);
install_element(PHY_NODE, &cfg_phy_no_setbsic_cmd);
+ install_element(PHY_NODE, &cfg_phy_trxd_max_version_cmd);
install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd);
install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd);