aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/osmo-bts-sysmo/l1_if.h2
-rw-r--r--src/osmo-bts-sysmo/sysmobts_vty.c19
2 files changed, 17 insertions, 4 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index e47edb44..ed86400a 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -30,7 +30,7 @@ struct femtol1_hdl {
struct gsm_time gsm_time;
uint32_t hLayer1; /* handle to the L1 instance in the DSP */
uint32_t dsp_trace_f;
- uint16_t clk_cal;
+ int clk_cal;
uint8_t clk_src;
struct llist_head wlc_list;
diff --git a/src/osmo-bts-sysmo/sysmobts_vty.c b/src/osmo-bts-sysmo/sysmobts_vty.c
index 99c81637..9d1c1e76 100644
--- a/src/osmo-bts-sysmo/sysmobts_vty.c
+++ b/src/osmo-bts-sysmo/sysmobts_vty.c
@@ -144,6 +144,7 @@ DEFUN(cfg_trx_clkcal_def, cfg_trx_clkcal_def_cmd,
return CMD_SUCCESS;
}
+#ifdef HW_SYSMOBTS_V1
DEFUN(cfg_trx_clkcal, cfg_trx_clkcal_cmd,
"clock-calibration <0-4095>",
"Set the clock calibration value\n" "Clock DAC value\n")
@@ -156,6 +157,20 @@ DEFUN(cfg_trx_clkcal, cfg_trx_clkcal_cmd,
return CMD_SUCCESS;
}
+#else
+DEFUN(cfg_trx_clkcal, cfg_trx_clkcal_cmd,
+ "clock-calibration <-4095-4095>",
+ "Set the clock calibration value\n" "Offset in PPB\n")
+{
+ int clkcal = atoi(argv[0]);
+ struct gsm_bts_trx *trx = vty->index;
+ struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx);
+
+ fl1h->clk_cal = clkcal;
+
+ return CMD_SUCCESS;
+}
+#endif
DEFUN(cfg_trx_clksrc, cfg_trx_clksrc_cmd,
"clock-source (tcxo|ocxo|ext|gps)",
@@ -396,10 +411,8 @@ void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
{
struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx);
- if (fl1h->clk_cal != 0xffff) {
- vty_out(vty, " clock-calibration %u%s", fl1h->clk_cal,
+ vty_out(vty, " clock-calibration %d%s", fl1h->clk_cal,
VTY_NEWLINE);
- }
vty_out(vty, " clock-source %s%s",
get_value_string(femtobts_clksrc_names, fl1h->clk_src),
VTY_NEWLINE);