aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-06-05 09:22:11 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-06-05 09:34:33 +0200
commitad3e31dc4b9ee1063d9e633ca884315b5a5c9710 (patch)
tree7f0079002ff481db60eb54c5ea1b733ca8e11f22 /src/osmo-bts-sysmo
parent1c069cd0a0316567e56549c45db549383deadf57 (diff)
sysmobts: The meaning of the clock value changed from v1 to v2
In v2 the calibration value is the clock error in ppb that needs to be compensated. Create a V2 specific implementation. Write the clock value unconditionally as it is initialized to 0 by default and not 0xffff.
Diffstat (limited to 'src/osmo-bts-sysmo')
-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);