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-09 21:57:13 +0100
commitfd425b1484ceac900c02f7d8fcb5fb199ef2bbf6 (patch)
treee9d45b1468c6fa51823a15150720e5945b379fab
parent50131c125e2298cc4f71fa2b69881f6a40a7000a (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 df75c05a..dabb0106 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;