diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-03-26 13:02:33 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-04-07 09:01:05 +0000 |
commit | 44311ea6e93f2832fe385cd97117ffcccee5ad3a (patch) | |
tree | f8481f9b5e1177cc52fdcb0dfee81401a3d9319f /src/libbsc | |
parent | 03ddccc13257dcf46392ff383d9b27fa32bcf60c (diff) |
Generate the S_L_INP_TEI_UP signal earlier.
The S_L_INP_TEI_UP signal was generated when the first message from a BTS
arrives on the OML/RSL link, rather than when the OML/RSL link comes up.
Instead, generate this signal when the link is brought up, so we
intitialize state regardless of how a particular BTS behaves.
Tested with osmo-bts-virtual and virtphy/mobile programs,
and with a sysmobts.
This was already committed in faf0982ae20001519cf20c5d6345dad490a135f2
but subsequently reverted in 383a059a123b1e0e5aab76423db47846e329f095
because it introduced a regression. The underlying problem causing this
regression has now been addressed by https://gerrit.osmocom.org/#/c/7462/
(libosmo-abis commit 49917c129b1456585258b0ebe89a513ecef823a8).
Change-Id: I78a152671a00b95c997830f7161fca92bb898fa3
Depends: I52f7c903212b38e9c87e4d45e52b231b6f1ae9f5
Related: OS#2719
Diffstat (limited to 'src/libbsc')
-rw-r--r-- | src/libbsc/bts_ipaccess_nanobts.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/libbsc/bts_ipaccess_nanobts.c b/src/libbsc/bts_ipaccess_nanobts.c index a3f7919e7..edfe41771 100644 --- a/src/libbsc/bts_ipaccess_nanobts.c +++ b/src/libbsc/bts_ipaccess_nanobts.c @@ -438,6 +438,11 @@ ipaccess_sign_link_up(void *unit_data, struct e1inp_line *line, bts->oml_tei, 0); rc = clock_gettime(CLOCK_MONOTONIC, &tp); bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */ + if (!(sign_link->trx->bts->ip_access.flags & OML_UP)) { + e1inp_event(sign_link->ts, S_L_INP_TEI_UP, + sign_link->tei, sign_link->sapi); + sign_link->trx->bts->ip_access.flags |= OML_UP; + } break; case E1INP_SIGN_RSL: { struct e1inp_ts *ts; @@ -458,6 +463,13 @@ ipaccess_sign_link_up(void *unit_data, struct e1inp_line *line, e1inp_sign_link_create(ts, E1INP_SIGN_RSL, trx, trx->rsl_tei, 0); trx->rsl_link->ts->sign.delay = 0; + if (!(sign_link->trx->bts->ip_access.flags & + (RSL_UP << sign_link->trx->nr))) { + e1inp_event(sign_link->ts, S_L_INP_TEI_UP, + sign_link->tei, sign_link->sapi); + sign_link->trx->bts->ip_access.flags |= + (RSL_UP << sign_link->trx->nr); + } break; } default: @@ -490,25 +502,12 @@ static int ipaccess_sign_link(struct msgb *msg) { int ret = 0; struct e1inp_sign_link *link = msg->dst; - struct e1inp_ts *e1i_ts = link->ts; switch (link->type) { case E1INP_SIGN_RSL: - if (!(link->trx->bts->ip_access.flags & - (RSL_UP << link->trx->nr))) { - e1inp_event(e1i_ts, S_L_INP_TEI_UP, - link->tei, link->sapi); - link->trx->bts->ip_access.flags |= - (RSL_UP << link->trx->nr); - } ret = abis_rsl_rcvmsg(msg); break; case E1INP_SIGN_OML: - if (!(link->trx->bts->ip_access.flags & OML_UP)) { - e1inp_event(e1i_ts, S_L_INP_TEI_UP, - link->tei, link->sapi); - link->trx->bts->ip_access.flags |= OML_UP; - } ret = abis_nm_rcvmsg(msg); break; default: |