aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/timeslot_fsm.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-07-26 20:33:15 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-07-28 12:18:23 +0200
commitbcdbfb740610bea2f1b51c5c331af5386a841393 (patch)
treefdba1310ddda4254aa665cdd6cfd0e7b40db9767 /src/osmo-bsc/timeslot_fsm.c
parent31f525e7560ad13e32cfc5e0b5f1862c0efcb991 (diff)
fix nanobts: timeslot FSM: use flags to remember OML,RSL status
Before this patch, the timeslot FSM receives OML and RSL ready events. Afterwards, it relies on examining the RSL and OML status to match the received events. This doesn't work for the ip.access nanobts, which fails to change the CHANNEL OM's operational status even though it has sent an Opstart ACK. We receive OML CHANNEL Opstart ACK, but the mo's state left at OP_STATE=Disabled. We apparently cannot rely on the gsm_abis_mo state as assumed before this patch, since changing the state depends on each BTS vendor's OML implementation. Also, implementation wise, it is better to not include assumptions on RSL and OML implementations in the timeslot FSM. Simply receive the OML and RSL ready events and remember that they arrived in dedicated flags. Remove the no longer needed oml_is_ts_ready() callback from struct gsm_bts_model added in: commit 91aa68f762218906e45be4817c6ea54b480da5e1 "dyn TS: init only when both RSL and the Channel OM are established" I99f29d2ba079f6f4b77f0af12d9784588d2f56b3 This keeps osmo-bts operational while fixing ip.access nanobts, where the CHANNEL OM's state prevented the timeslot FSM from entering operation. Change-Id: I4843d03b3237cdcca0ad2041ef6895ff253d8419
Diffstat (limited to 'src/osmo-bsc/timeslot_fsm.c')
-rw-r--r--src/osmo-bsc/timeslot_fsm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index 84d80f8f8..245ce76f7 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -220,13 +220,13 @@ static void ts_setup_lchans(struct gsm_bts_trx_ts *ts)
static void ts_fsm_not_initialized(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct gsm_bts_trx_ts *ts = ts_fi_ts(fi);
- struct gsm_bts *bts = ts->trx->bts;
switch (event) {
case TS_EV_OML_READY:
ts->pdch_act_allowed = true;
+ ts->is_oml_ready = true;
ts_setup_lchans(ts);
- if (!ts->trx->rsl_link) {
+ if (!ts->is_rsl_ready) {
LOG_TS(ts, LOGL_DEBUG, "No RSL link yet\n");
return;
}
@@ -235,8 +235,8 @@ static void ts_fsm_not_initialized(struct osmo_fsm_inst *fi, uint32_t event, voi
case TS_EV_RSL_READY:
ts->pdch_act_allowed = true;
- if (bts->model->oml_is_ts_ready
- && !bts->model->oml_is_ts_ready(ts)) {
+ ts->is_rsl_ready = true;
+ if (!ts->is_oml_ready) {
LOG_TS(ts, LOGL_DEBUG, "OML not ready yet\n");
return;
}
@@ -680,6 +680,7 @@ static void ts_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data
struct gsm_bts_trx_ts *ts = ts_fi_ts(fi);
switch (event) {
case TS_EV_OML_DOWN:
+ ts->is_oml_ready = false;
if (fi->state != TS_ST_NOT_INITIALIZED)
osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0);
OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED);
@@ -689,6 +690,7 @@ static void ts_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data
break;
case TS_EV_RSL_DOWN:
+ ts->is_rsl_ready = false;
if (fi->state != TS_ST_NOT_INITIALIZED)
osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0);
OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED);