From 5b22fb7953c39edaaf672384a48bee33970f49f6 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Wed, 14 Feb 2018 19:46:33 +0100 Subject: Make osmo-pcu wait for BTS to become available at start-up time. After the PCU socket becomes available, the BTS might send an INFO_IND message with the 'ACTIVE' flag cleared. If this happens, do not exit immediately, but keep retrying until an INFO_IND message with the 'ACTIVE' flag arrives. Note that this change only affects behaviour at process start-up time. If the BTS switches from active to inactive state then osmo-pcu will still exit. If this behaviour should be changed as well it could be done in a follow-up patch. Tested against osom-bsc + osmo-bts-virtual. Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309 Related: OS#2689 --- src/pcu_l1_if.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pcu_l1_if.cpp') diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 7112b044..0a9803b1 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -414,7 +414,10 @@ static int pcu_rx_info_ind(struct gsm_pcu_if_info_ind *info_ind) if (!(info_ind->flags & PCU_IF_FLAG_ACTIVE)) { LOGP(DL1IF, LOGL_NOTICE, "BTS not available\n"); + if (!bts->active) + return -EAGAIN; bssgp_failed: + bts->active = false; /* free all TBF */ for (trx = 0; trx < ARRAY_SIZE(bts->trx); trx++) { bts->trx[trx].arfcn = info_ind->trx[trx].arfcn; @@ -562,6 +565,7 @@ bssgp_failed: } } + bts->active = true; return rc; } -- cgit v1.2.3