aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-07 14:37:21 +0100
committerIvan Kluchnikov <kluchnikovi@gmail.com>2017-02-10 07:27:51 +0000
commit7a18906cfafc4d73b1c9eb9e527139af6ad938dd (patch)
tree9a2126dc4440936942e6beb947b6392ec3c1df90
parentd15dc832c9da401d35300bf4c6d59235ee770bc5 (diff)
all models: fix vty write: bts_model_config_write_phy
The vty write for phy/inst is broken, leading to a written-out config being unparsable; fix all of these: - in common/vty.c, actually call bts_model_config_write_phy_inst(). - in sysmo and lc15 write the phy instance elements in bts_model_config_write_phy_inst() and not in bts_model_config_write_phy(), which lead to writing the members above their parent 'instance'. - sysmo, lc15 and oct omit the bts_model_config_write_phy_inst() implementation. This did not cause a compilation problem because it was in fact never called. - sysmo writes 'clock-source None' when clk_src is zero, leading to unparsable config (related: OS#1944). Instead omit the 'clock-source' when zero. - osmo-bts-trx seems to be the only part that lacks nothing, yet it also didn't work properly because bts_model_config_write_phy_inst() was never called. This problem existed since commit d784e50747b8cf0ce505489e1451f75be5ccbd4b "Introduce new phy_link and phy_instance abstraction" Change-Id: Icc54fa70045c8fa58e78cf9f788c21a437edfbd4
-rw-r--r--src/common/vty.c1
-rw-r--r--src/osmo-bts-litecell15/lc15bts_vty.c14
-rw-r--r--src/osmo-bts-octphy/octphy_vty.c4
-rw-r--r--src/osmo-bts-sysmo/sysmobts_vty.c21
4 files changed, 19 insertions, 21 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
index b48afa43..646ac87f 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -358,6 +358,7 @@ static void config_write_phy_single(struct vty *vty, struct phy_link *plink)
if (!pinst)
break;
vty_out(vty, " instance %u%s", pinst->num, VTY_NEWLINE);
+ bts_model_config_write_phy_inst(vty, pinst);
}
}
diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c
index 0ffe6634..46f73abd 100644
--- a/src/osmo-bts-litecell15/lc15bts_vty.c
+++ b/src/osmo-bts-litecell15/lc15bts_vty.c
@@ -329,7 +329,11 @@ void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
vty_out(vty, " nominal-tx-power %d%s", trx->nominal_power,VTY_NEWLINE);
}
-static void write_phy_inst(struct vty *vty, struct phy_instance *pinst)
+void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
+{
+}
+
+void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst)
{
int i;
@@ -346,14 +350,6 @@ static void write_phy_inst(struct vty *vty, struct phy_instance *pinst)
pinst->u.lc15.calib_path, VTY_NEWLINE);
}
-void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
-{
- struct phy_instance *pinst;
-
- llist_for_each_entry(pinst, &plink->instances, list)
- write_phy_inst(vty, pinst);
-}
-
int bts_model_vty_init(struct gsm_bts *bts)
{
vty_bts = bts;
diff --git a/src/osmo-bts-octphy/octphy_vty.c b/src/osmo-bts-octphy/octphy_vty.c
index c2d1fbb8..abfac1ed 100644
--- a/src/osmo-bts-octphy/octphy_vty.c
+++ b/src/osmo-bts-octphy/octphy_vty.c
@@ -219,6 +219,10 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
VTY_NEWLINE);
}
+void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst)
+{
+}
+
void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts)
{
}
diff --git a/src/osmo-bts-sysmo/sysmobts_vty.c b/src/osmo-bts-sysmo/sysmobts_vty.c
index e67d8be0..330c9ce8 100644
--- a/src/osmo-bts-sysmo/sysmobts_vty.c
+++ b/src/osmo-bts-sysmo/sysmobts_vty.c
@@ -443,7 +443,11 @@ void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
VTY_NEWLINE);
}
-static void write_phy_inst(struct vty *vty, struct phy_instance *pinst)
+void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
+{
+}
+
+void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst)
{
int i;
@@ -464,17 +468,10 @@ static void write_phy_inst(struct vty *vty, struct phy_instance *pinst)
if (pinst->u.sysmobts.calib_path)
vty_out(vty, " trx-calibration-path %s%s",
pinst->u.sysmobts.calib_path, VTY_NEWLINE);
- vty_out(vty, " clock-source %s%s",
- get_value_string(femtobts_clksrc_names,
- pinst->u.sysmobts.clk_src), VTY_NEWLINE);
-}
-
-void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
-{
- struct phy_instance *pinst;
-
- llist_for_each_entry(pinst, &plink->instances, list)
- write_phy_inst(vty, pinst);
+ if (pinst->u.sysmobts.clk_src)
+ vty_out(vty, " clock-source %s%s",
+ get_value_string(femtobts_clksrc_names,
+ pinst->u.sysmobts.clk_src), VTY_NEWLINE);
}
int bts_model_vty_init(struct gsm_bts *bts)