aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-10-11 17:46:10 +0200
committerMax <msuraev@sysmocom.de>2017-10-11 17:53:46 +0200
commit3552247ae8d86bddc4e76529eeb8406c5cb470d6 (patch)
tree12c928a8bc68aac09f5d5469906acd214172c3a2
parent2d3aa02ba3f7276fbab7f1e2744b5eb880a36fd9 (diff)
sysmo: use clock calibration source wrapper
Make get_clk_cal() public and use it for ctrl commands handling. This ensures that the calibration is properly selected depending on the clock source. Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9 Related: OS#1944
-rw-r--r--src/osmo-bts-sysmo/l1_if.c2
-rw-r--r--src/osmo-bts-sysmo/l1_if.h1
-rw-r--r--src/osmo-bts-sysmo/sysmobts_ctrl.c2
3 files changed, 3 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 8f68210e..3d286443 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -1238,7 +1238,7 @@ static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp,
return 0;
}
-static int get_clk_cal(struct femtol1_hdl *hdl)
+int get_clk_cal(struct femtol1_hdl *hdl)
{
#ifdef FEMTOBTS_API_VERSION
return hdl->clk_cal;
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index 033e7f58..1b214be7 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -146,6 +146,7 @@ int l1if_rsl_mode_modify(struct gsm_lchan *lchan);
/* calibration loading */
int calib_load(struct femtol1_hdl *fl1h);
+int get_clk_cal(struct femtol1_hdl *hdl);
/* on-line re-calibration */
int l1if_rf_clock_info_reset(struct femtol1_hdl *fl1h);
diff --git a/src/osmo-bts-sysmo/sysmobts_ctrl.c b/src/osmo-bts-sysmo/sysmobts_ctrl.c
index 8eee58c5..21df88e5 100644
--- a/src/osmo-bts-sysmo/sysmobts_ctrl.c
+++ b/src/osmo-bts-sysmo/sysmobts_ctrl.c
@@ -141,7 +141,7 @@ static int set_clock_info(struct ctrl_cmd *cmd, void *data)
/* Set GPS/PPS as reference */
sysp->id = SuperFemto_PrimId_RfClockSetupReq;
- sysp->u.rfClockSetupReq.rfTrx.iClkCor = fl1h->clk_cal; /* !!! use get_clk_cal */
+ sysp->u.rfClockSetupReq.rfTrx.iClkCor = get_clk_cal(fl1h);
sysp->u.rfClockSetupReq.rfTrx.clkSrc = fl1h->clk_src;
sysp->u.rfClockSetupReq.rfTrxClkCal.clkSrc = SuperFemto_ClkSrcId_GpsPps;
l1if_req_compl(fl1h, msg, clock_setup_cb, NULL);