diff options
-rw-r--r-- | include/osmo-bts/phy_link.h | 2 | ||||
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 12 | ||||
-rw-r--r-- | src/osmo-bts-trx/trx_if.c | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index b3db4ce5..82e73c8c 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -1,6 +1,7 @@ #pragma once #include <stdint.h> +#include <stdbool.h> #include <osmocom/core/linuxlist.h> #include <osmo-bts/scheduler.h> @@ -94,6 +95,7 @@ struct phy_instance { } sysmobts; struct { struct trx_l1h *hdl; + bool sw_act_reported; } osmotrx; struct { /* logical transceiver number within one PHY */ diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index befaffd2..8ccba90e 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -23,10 +23,12 @@ #include <stdint.h> #include <unistd.h> #include <stdlib.h> +#include <stdbool.h> #include <errno.h> #include <osmocom/core/talloc.h> #include <osmocom/core/bits.h> +#include <osmocom/gsm/abis_nm.h> #include <osmo-bts/logging.h> #include <osmo-bts/bts.h> @@ -106,9 +108,12 @@ static void check_transceiver_availability_trx(struct trx_l1h *l1h, int avail) if (avail) { /* 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); + if (!pinst->u.osmotrx.sw_act_reported) { + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + pinst->u.osmotrx.sw_act_reported = true; + } for (tn = 0; tn < TRX_NR_TS; tn++) oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, @@ -685,7 +690,8 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) { int rc; - + LOGP(DOML, LOGL_DEBUG, "bts_model_opstart: %s received\n", + get_value_string(abis_nm_obj_class_names, mo->obj_class)); switch (mo->obj_class) { case NM_OC_RADIO_CARRIER: /* activate transceiver */ diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index a4c16dc3..c448006e 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -518,7 +518,9 @@ int bts_model_phy_link_open(struct phy_link *plink) if (!pinst->u.osmotrx.hdl) goto cleanup; } - + /* FIXME: is there better way to check/report TRX availability? */ + transceiver_available = 1; + phy_link_state_set(plink, PHY_LINK_CONNECTED); return 0; cleanup: |