aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy/l1_if.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-09-25 18:55:55 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-10-02 20:13:18 +0200
commit1290c52d2b1aa615597c833060a700e963aefca2 (patch)
tree89caba805ca6a3a4a94ea6bb8e43d8af76534ed7 /src/osmo-bts-octphy/l1_if.c
parent135068d5c8ddb5fcca3379b94eb3f777b3a14525 (diff)
Introduce NM Radio Carrier and Baseband Transceiver FSMs
All the Operative State logic to manage a RadioCarrier//BBTransc NM objects is centralized in these FSM, where other parts of the code simply send events to it. This allows keeping state consistent and offloading logic from each bts backend, since they are only required to submit events now. The idea in the long run is to also replace other NM objects with similar FSMs. This improved logic fixes bug where PHY + RSL link became available before OPSTART and hence op state changed to Enabled before receiving any OPSTART message. Change-Id: Ifb249a821c4270918699b6375a72b3a618e8cfbe
Diffstat (limited to 'src/osmo-bts-octphy/l1_if.c')
-rw-r--r--src/osmo-bts-octphy/l1_if.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index c03b4112..37a3e65c 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -36,6 +36,7 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/socket.h>
+#include <osmocom/core/fsm.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/bts_model.h>
@@ -44,6 +45,8 @@
#include <osmo-bts/l1sap.h>
#include <osmo-bts/handover.h>
#include <osmo-bts/bts.h>
+#include <osmo-bts/nm_radio_carrier_fsm.h>
+#include <osmo-bts/nm_bb_transc_fsm.h>
#include "l1_if.h"
#include "l1_oml.h"
@@ -311,19 +314,15 @@ int l1if_activate_rf(struct gsm_bts_trx *trx, int on)
int i;
if (on) {
/* signal availability */
- oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK);
- oml_mo_tx_sw_act_rep(&trx->mo);
- oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK);
- oml_mo_tx_sw_act_rep(&trx->bb_transc.mo);
+ osmo_fsm_inst_dispatch(trx->rc.fi, NM_RCARRIER_EV_SW_ACT, NULL);
+ osmo_fsm_inst_dispatch(trx->bb_transc.fi, NM_BBTRANSC_EV_SW_ACT, NULL);
for (i = 0; i < ARRAY_SIZE(trx->ts); i++)
oml_mo_state_chg(&trx->ts[i].mo, NM_OPSTATE_DISABLED,
NM_AVSTATE_DEPENDENCY);
} else {
- oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED,
- NM_AVSTATE_OFF_LINE);
- oml_mo_state_chg(&trx->bb_transc.mo, NM_OPSTATE_DISABLED,
- NM_AVSTATE_OFF_LINE);
+ osmo_fsm_inst_dispatch(trx->rc.fi, NM_RCARRIER_EV_DISABLE, NULL);
+ osmo_fsm_inst_dispatch(trx->bb_transc.fi, NM_BBTRANSC_EV_DISABLE, NULL);
}
return 0;