diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-02-22 07:52:51 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2015-09-22 16:41:27 +0200 |
commit | 889890da4312916bd617b3c95326a89237078a3b (patch) | |
tree | a767ad6e8d80629f415e74f1ce000dec7956e655 /src/osmo-bts-trx/scheduler.c | |
parent | 23a5183767d96a723190634f4a26d018492880bf (diff) |
TRX: Improved handling of clock indications.
If no clock is received, a POWEROFF is sent until clock is detected.
Diffstat (limited to 'src/osmo-bts-trx/scheduler.c')
-rw-r--r-- | src/osmo-bts-trx/scheduler.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/osmo-bts-trx/scheduler.c b/src/osmo-bts-trx/scheduler.c index b5fe08f2..057d5c2e 100644 --- a/src/osmo-bts-trx/scheduler.c +++ b/src/osmo-bts-trx/scheduler.c @@ -2252,6 +2252,8 @@ no_clock: llist_for_each_entry(trx, &bts->trx_list, list) { trx_if_flush(trx_l1h_hdl(trx)); trx_sched_reset(trx_l1h_hdl(trx)); + if (trx->nr == 0) + trx_if_cmd_poweroff(trx_l1h_hdl(trx)); } /* tell BSC */ @@ -2295,6 +2297,9 @@ int trx_sched_clock(uint32_t fn) int32_t elapsed; int32_t elapsed_fn; + if (quit) + return 0; + /* reset lost counter */ tranceiver_lost = 0; @@ -2304,13 +2309,21 @@ int trx_sched_clock(uint32_t fn) if (!tranceiver_available) { LOGP(DL1C, LOGL_NOTICE, "initial GSM clock received: fn=%u\n", fn); + + tranceiver_available = 1; + + /* start provisioning tranceiver */ + l1if_provision_tranceiver(bts); + + /* tell BSC */ + check_tranceiver_availability(bts, 1); + new_clock: tranceiver_last_fn = fn; trx_sched_fn(tranceiver_last_fn); /* schedule first FN clock */ memcpy(tv_clock, &tv_now, sizeof(struct timeval)); - tranceiver_available = 1; memset(&tranceiver_clock_timer, 0, sizeof(tranceiver_clock_timer)); tranceiver_clock_timer.cb = trx_ctrl_timer_cb; @@ -2318,12 +2331,6 @@ new_clock: osmo_timer_schedule(&tranceiver_clock_timer, 0, FRAME_DURATION_uS); - /* start provisioning tranceiver */ - l1if_provision_tranceiver(bts); - - /* tell BSC */ - check_tranceiver_availability(bts, 1); - return 0; } |