aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-12-20 23:53:24 +0100
committerlaforge <laforge@osmocom.org>2021-01-02 22:47:18 +0000
commitc77cea43ee237326114da5cbadd3780d70f17172 (patch)
tree286c3f051892008785ad7788b54a31b08c7a4b3d /include
parentcde3d1f29cd65211f58c683e4506944a5a807ce6 (diff)
abis_om2000: keep OM2K FSMs around, don't terminate
The existing code uses short-lived FSMs which are allocated straight before START, and which are free'd after DONE state is reached. While that works, it makes state introspection a bit hard, as one cannot show the FSM states, etc. Let's change to a different model where the per-OM2k-MO FSMs are always around (in state INIT after object creation). While at it, also introduce a RESET event that can reset each FSM instance back to INIT state, i.e. in case of OML link failure. Change-Id: Ia37cffff5c451e1d79a52ccae41ab5718b4661d4
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/abis_om2000.h19
-rw-r--r--include/osmocom/bsc/bts.h1
-rw-r--r--include/osmocom/bsc/bts_trx.h1
3 files changed, 20 insertions, 1 deletions
diff --git a/include/osmocom/bsc/abis_om2000.h b/include/osmocom/bsc/abis_om2000.h
index 58c07c4db..62aef9d51 100644
--- a/include/osmocom/bsc/abis_om2000.h
+++ b/include/osmocom/bsc/abis_om2000.h
@@ -121,9 +121,26 @@ int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx);
int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx);
int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts);
-struct osmo_fsm_inst *om2k_bts_fsm_start(struct gsm_bts *bts);
+enum om2k_bts_state {
+ OM2K_BTS_S_INIT,
+ OM2K_BTS_S_WAIT_CF,
+ OM2K_BTS_S_WAIT_IS,
+ OM2K_BTS_S_WAIT_CON,
+ OM2K_BTS_S_WAIT_TF,
+ OM2K_BTS_S_WAIT_MCTR,
+ OM2K_BTS_S_WAIT_TRX_LAPD,
+ OM2K_BTS_S_WAIT_TRX,
+ OM2K_BTS_S_DONE,
+ OM2K_BTS_S_ERROR,
+};
+
void abis_om2k_bts_init(struct gsm_bts *bts);
+void om2k_bts_fsm_start(struct gsm_bts *bts);
+void om2k_bts_fsm_reset(struct gsm_bts *bts);
+
void abis_om2k_trx_init(struct gsm_bts_trx *trx);
+void om2k_trx_fsm_start(struct gsm_bts_trx *trx);
+void om2k_trx_fsm_reset(struct gsm_bts_trx *trx);
int abis_om2k_vty_init(void);
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index aef0e0384..c79e7f7f4 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -316,6 +316,7 @@ struct gsm_bts {
struct gsm_envabtse envabtse[4];
} bs11;
struct {
+ struct osmo_fsm_inst *bts_fi;
struct {
struct om2k_mo om2k_mo;
struct gsm_abis_mo mo;
diff --git a/include/osmocom/bsc/bts_trx.h b/include/osmocom/bsc/bts_trx.h
index 5888c6318..85adc9bdd 100644
--- a/include/osmocom/bsc/bts_trx.h
+++ b/include/osmocom/bsc/bts_trx.h
@@ -66,6 +66,7 @@ struct gsm_bts_trx {
struct rxlev_stats rxlev_stat;
} ipaccess;
struct {
+ struct osmo_fsm_inst *trx_fi;
struct {
struct om2k_mo om2k_mo;
} trxc;