aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/l1_if.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-10-08 18:30:43 +0200
committerpespin <pespin@sysmocom.de>2019-10-16 11:13:21 +0000
commit8ff35d3c9117b2abdbcca03d9400dde21157417b (patch)
tree35b5dd5b55aca461f9ef241e5b29379656ebd42c /src/osmo-bts-trx/l1_if.c
parent5fee4d1ff5fac53bc21ed19abf2f84456486fa44 (diff)
bts-trx: Time out if no clock ind recvd after RSP POWERON
Before this patch, if due to whatever reason the TRX started fine (RSP POWERON 0) and sockets were created but no CLOCK IND was ever received by the BTS, it wouldn't notice since the timerfd timeouts (bts_shutdown("no clock")) are only checked after the first CLOCK IND is sent by the TRX. As a result, the BTS would be kept on forever saying everything is fine but it would be sending no DL burst at all to the TRX (tested with a modfied osmo-trx dropping clock indication). With this patch, new APIs are added to indicate the scheduler_trx code the timeframes where clock ind are expected (between RSP POWERON 0 and RSP POWEROFF 0); if TRX sends clock indications out of that timeframe, BTs lower layers will drop them (controlled by "powered" bool). Hence, the scheduler_trx can now place a timeout (reusing same timerfd because its new use is exclusive in time with its other previous use) when it is told that CLOCK IND should start appearing, and if none arrives in considerable time, then the BTS can be shut down to notify the rest of the network. Related: OS#4215 Change-Id: Iba5dbe867aff10e70ec73dbf1f7aeeecb15c0a4d
Diffstat (limited to 'src/osmo-bts-trx/l1_if.c')
-rw-r--r--src/osmo-bts-trx/l1_if.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 10791284..38b43b9f 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -176,10 +176,13 @@ static void l1if_poweronoff_cb(struct trx_l1h *l1h, bool poweronoff, int rc)
plink->u.osmotrx.poweronoff_sent = false;
if (poweronoff) {
- if (rc == 0 && pinst->phy_link->state != PHY_LINK_CONNECTED)
+ if (rc == 0 && pinst->phy_link->state != PHY_LINK_CONNECTED) {
+ trx_sched_clock_started(pinst->trx->bts);
phy_link_state_set(pinst->phy_link, PHY_LINK_CONNECTED);
- else if (rc != 0 && pinst->phy_link->state != PHY_LINK_SHUTDOWN)
+ } else if (rc != 0 && pinst->phy_link->state != PHY_LINK_SHUTDOWN) {
+ trx_sched_clock_stopped(pinst->trx->bts);
phy_link_state_set(pinst->phy_link, PHY_LINK_SHUTDOWN);
+ }
}
}