aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_l1_if.cpp
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-02-14 19:46:33 +0100
committerStefan Sperling <ssperling@sysmocom.de>2018-02-14 19:55:05 +0100
commit5b22fb7953c39edaaf672384a48bee33970f49f6 (patch)
tree456ba22798f4a5dd2b95606b6f4d09b16d8e7d6c /src/pcu_l1_if.cpp
parentc907b88ecde0adab34bc7a03fa0db121a59db53a (diff)
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
Diffstat (limited to 'src/pcu_l1_if.cpp')
-rw-r--r--src/pcu_l1_if.cpp4
1 files changed, 4 insertions, 0 deletions
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;
}