aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-06-16 12:36:20 +0200
committerMax <msuraev@sysmocom.de>2016-06-16 12:43:44 +0200
commit7cc3c3156ef23500612724f8a38c3db95c05702b (patch)
treee992b0514dccbb8bd84c9b6913e7e1bec38ded22
parent58e4e18206501c3bffa65f0b876bbc5ebe175d6e (diff)
Fix OML activation
Previously software activation could have been reported multiple times which broke proper BTS init. Introduce guard variable to ensure reporting happens only once. Note: this is just minimal workaround - ideally proper OML state machine should be implemented. Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af Related: OS#1648
-rw-r--r--include/osmo-bts/phy_link.h2
-rw-r--r--src/osmo-bts-trx/l1_if.c12
-rw-r--r--src/osmo-bts-trx/trx_if.c4
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: