[PATCH] osmo-bts[master]: sysmo: use clock calibration source wrapper

Max gerrit-no-reply at lists.osmocom.org
Wed Oct 11 16:07:37 UTC 2017


Review at  https://gerrit.osmocom.org/4224

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
---
M src/osmo-bts-sysmo/l1_if.c
M src/osmo-bts-sysmo/l1_if.h
M src/osmo-bts-sysmo/sysmobts_ctrl.c
3 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/4224/1

diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 8f68210..3d28644 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -1238,7 +1238,7 @@
 	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 033e7f5..1b214be 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -146,6 +146,7 @@
 
 /* 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 8eee58c..21df88e 100644
--- a/src/osmo-bts-sysmo/sysmobts_ctrl.c
+++ b/src/osmo-bts-sysmo/sysmobts_ctrl.c
@@ -141,7 +141,7 @@
 
 	/* 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);

-- 
To view, visit https://gerrit.osmocom.org/4224
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>


More information about the gerrit-log mailing list