[2/3] don't touch OML MO when PHY link is established
diff mbox

Message ID 1454672483-15150-2-git-send-email-laforge@gnumonks.org
State Accepted
Headers show

Commit Message

Harald Welte Feb. 5, 2016, 11:41 a.m. UTC
It seems the right thing to do: Once we know a PHY link is established,
the associated OML managed objects should change their state
accordingly.  However, given all the hackery we do with MO states, this
actually breaks things, rather than helping.  So I'm disabling that part
for now, but this needs to be re-visited at some point.
---
 src/common/bts.c      | 16 ++++++++--------
 src/common/phy_link.c |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

Patch
diff mbox

diff --git a/src/common/bts.c b/src/common/bts.c
index 2d0ad8e..222a82c 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -266,19 +266,19 @@  int trx_set_available(struct gsm_bts_trx *trx, int avail)
 	LOGP(DSUM, LOGL_INFO, "TRX(%d): Setting available = %d\n",
 		trx->nr, avail);
 	if (avail) {
-		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);
-
+		/* FIXME: This needs to be sorted out */
+#if 0
+		oml_mo_state_chg(&trx->mo,  NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE);
+		oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OFF_LINE);
 		for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++)
 			oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY);
+#endif
 	} else {
-		oml_mo_state_chg(&trx->mo,  NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE);
-		oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OFF_LINE);
+		oml_mo_state_chg(&trx->mo,  NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
+		oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_NOT_INSTALLED);
 
 		for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++)
-			oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE);
+			oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
 	}
 	return 0;
 }
diff --git a/src/common/phy_link.c b/src/common/phy_link.c
index 4103ede..0a77fec 100644
--- a/src/common/phy_link.c
+++ b/src/common/phy_link.c
@@ -67,7 +67,7 @@  void phy_link_state_set(struct phy_link *plink, enum phy_link_state state)
 			LOGP(DL1C, LOGL_INFO, "trx_set_avail(1)\n");
 			trx_set_available(trx, 1);
 			break;
-		default:
+		case PHY_LINK_SHUTDOWN:
 			LOGP(DL1C, LOGL_INFO, "trx_set_avail(0)\n");
 			trx_set_available(trx, 0);
 			break;