aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-09-03 19:11:36 +0700
committerfixeria <vyanitskiy@sysmocom.de>2020-09-09 11:29:06 +0000
commit0098b5ce7459aaf3380e7dd7c2c3d883da800e4b (patch)
tree55400f34f26269c22abc9306621ccf0c91f6efb7
parentf087c1ebd44f10d41a8f2b55d648ae34f6d92cd5 (diff)
abis_om2000: check result of gsm_bts_trx_set_system_infos()
Ensure that osmo-bsc would not continue to work as usual, if for some reason we cannot encode or send System Information messages. Introduce transitional state OM2K_TRX_S_SEND_SI, from where we can generate and send System Information messages. Otherwise it's confusing if we fail to do something when we're already in state OM2K_TRX_S_DONE. Change-Id: Ia6df539d0914c57ea80fdb29882832678b47f267
-rw-r--r--src/osmo-bsc/abis_om2000.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c
index 5c8b378ec..a3f689add 100644
--- a/src/osmo-bsc/abis_om2000.c
+++ b/src/osmo-bsc/abis_om2000.c
@@ -2122,6 +2122,7 @@ enum om2k_trx_state {
OM2K_TRX_S_WAIT_TX,
OM2K_TRX_S_WAIT_RX,
OM2K_TRX_S_WAIT_TS,
+ OM2K_TRX_S_SEND_SI,
OM2K_TRX_S_DONE,
OM2K_TRX_S_ERROR
};
@@ -2195,14 +2196,22 @@ static void om2k_trx_s_wait_ts(struct osmo_fsm_inst *fi, uint32_t event, void *d
&ts->rbs2000.om2k_mo);
} else {
/* only after all 8 TS */
- osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_DONE, 0, 0);
+ osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_SEND_SI, 0, 0);
}
}
-static void om2k_trx_s_done_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+static void om2k_trx_s_send_si(struct osmo_fsm_inst *fi, uint32_t prev_state)
{
struct om2k_trx_fsm_priv *otfp = fi->priv;
- gsm_bts_trx_set_system_infos(otfp->trx);
+
+ if (gsm_bts_trx_set_system_infos(otfp->trx) == 0)
+ osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_DONE, 0, 0);
+ else
+ osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_ERROR, 0, 0);
+}
+
+static void om2k_trx_s_done_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL);
}
@@ -2237,10 +2246,16 @@ static const struct osmo_fsm_state om2k_trx_states[] = {
[OM2K_TRX_S_WAIT_TS] = {
.in_event_mask = S(OM2K_TRX_EVT_TS_DONE),
.out_state_mask = S(OM2K_TRX_S_ERROR) |
- S(OM2K_TRX_S_DONE),
+ S(OM2K_TRX_S_SEND_SI),
.name = "WAIT-TS",
.action = om2k_trx_s_wait_ts,
},
+ [OM2K_TRX_S_SEND_SI] = {
+ .out_state_mask = S(OM2K_TRX_S_ERROR) |
+ S(OM2K_TRX_S_DONE),
+ .name = "SEND-SI",
+ .onenter = om2k_trx_s_send_si,
+ },
[OM2K_TRX_S_DONE] = {
.name = "DONE",
.onenter = om2k_trx_s_done_onenter,