diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-09-30 13:42:04 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-10-15 05:55:36 +0000 |
commit | 95486f248a37e66d6ae0baa1fd33e44317cce3ba (patch) | |
tree | 6761332de416b43b71cb1e05599646ea5bebfa78 /src/osmo-bsc/bts_trx.c | |
parent | 6adeb607d0a932fcbc07b1daada432e77490e7ce (diff) |
Introduce NM BaseBand Transceiver FSM
Change-Id: Ib4d35316c52eb4c71ea0d352a1e06fd5e600fe08
Diffstat (limited to 'src/osmo-bsc/bts_trx.c')
-rw-r--r-- | src/osmo-bsc/bts_trx.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/osmo-bsc/bts_trx.c b/src/osmo-bsc/bts_trx.c index 65ff7526e..c01444a0c 100644 --- a/src/osmo-bsc/bts_trx.c +++ b/src/osmo-bsc/bts_trx.c @@ -30,6 +30,16 @@ #include <osmocom/bsc/system_information.h> #include <osmocom/bsc/pcu_if.h> #include <osmocom/bsc/debug.h> +#include <osmocom/bsc/nm_common_fsm.h> + +static int gsm_bts_trx_talloc_destructor(struct gsm_bts_trx *trx) +{ + if (trx->bb_transc.mo.fi) { + osmo_fsm_inst_free(trx->bb_transc.mo.fi); + trx->bb_transc.mo.fi = NULL; + } + return 0; +} struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) { @@ -39,11 +49,17 @@ struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) if (!trx) return NULL; + talloc_set_destructor(trx, gsm_bts_trx_talloc_destructor); + trx->bts = bts; trx->nr = bts->num_trx++; gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, bts->nr, trx->nr, 0xff); + + trx->bb_transc.mo.fi = osmo_fsm_inst_alloc(&nm_bb_transc_fsm, trx, &trx->bb_transc, + LOGL_INFO, NULL); + osmo_fsm_inst_update_id_f(trx->bb_transc.mo.fi, "bts%d-trx%d", bts->nr, trx->nr); gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, bts->nr, trx->nr, 0xff); |