aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-12 19:20:17 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-06 19:06:51 +0100
commitf2fbdcff6b49bab3f9f202d8f7212bfc63145ce7 (patch)
tree6d7c33d965f62c717704ea60e19d3da191835956
parent553db72509fb6936e782a75cd04d1ed91d00f12c (diff)
sysmobts: Copy more of l1if_rf_clock_info_reset into the CTRL code
The CTRL code should have used/extended the l1_if calibration code. The sysmobts-mgr code first needs to determine if the clock adjustment is necessary at all. This is done by first resetting the counters, then waiting, then asking for the diff and then applying the correction value. But the reference clock is only set by the application comand. Copy more code of l1if_rf_clock_info_reset to set the reference clock as value. This is leaving some todos inside the code that will be resolved as part of SYS#835. Related: SYS#835
-rw-r--r--src/osmo-bts-sysmo/sysmobts_ctrl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/sysmobts_ctrl.c b/src/osmo-bts-sysmo/sysmobts_ctrl.c
index df75c05..dabb010 100644
--- a/src/osmo-bts-sysmo/sysmobts_ctrl.c
+++ b/src/osmo-bts-sysmo/sysmobts_ctrl.c
@@ -121,6 +121,13 @@ static int ctrl_set_clkinfo_cb(struct gsm_bts_trx *trx, struct msgb *resp,
return 0;
}
+static int clock_setup_cb(struct gsm_bts_trx *trx, struct msgb *resp,
+ void *data)
+{
+ msgb_free(resp);
+ return 0;
+}
+
static int set_clock_info(struct ctrl_cmd *cmd, void *data)
{
struct gsm_bts_trx *trx = cmd->node;
@@ -132,6 +139,16 @@ static int set_clock_info(struct ctrl_cmd *cmd, void *data)
/* geneate a deferred control command */
cd = ctrl_cmd_def_make(fl1h, cmd, NULL, 10);
+ /* 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.clkSrc = fl1h->clk_src;
+ sysp->u.rfClockSetupReq.rfTrxClkCal.clkSrc = SuperFemto_ClkSrcId_GpsPps;
+ l1if_req_compl(fl1h, msg, clock_setup_cb, NULL);
+
+ /* Reset the error counters */
+ msg = sysp_msgb_alloc();
+ sysp = msgb_sysprim(msg);
sysp->id = SuperFemto_PrimId_RfClockInfoReq;
sysp->u.rfClockInfoReq.u8RstClkCal = 1;