On 07/18/2011 11:00 AM, Holger Hans Peter Freyther wrote:
> On 07/16/2011 09:08 PM, Holger Hans Peter Freyther wrote:
>> On 07/16/2011 05:19 PM, Harald Welte wrote:
>>
> 
> 
> I am debugging this now, what also jumped into my eye is that the
> administrative is set. This will e.g. change the setting of the TRX lock.

Hi Harald,
and actually the above was the problem. In bts_ipaccess_nanobts:sw_activ_rep
we will use the administrative state of the TRX (rc_state variable) and issue
a change_adm_state, with NM_OPSTATE_NULL as rc_state we will get a NACK.

Now my understanding might be wrong but I think the administrative state is
something we want to 'maintain' from the BSC. So I think the administrative
state should survive a BTS disconnect.

In theory there is one way this could still fail, in the administrative ACK
code path we will set the administrative state to the one returned by the BTS,
we probably want to compare the result and then send a signal if setting the
admin state didn't result in what we asked for.

My proposed patch will call gsm_bts_mo_reset from within bts_bootstrap and
removes setting the administrative state.

what do you think?
        holger
>From fe1ca353bb7285f71ba1d22675c6c840770706ce Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther <[email protected]>
Date: Mon, 18 Jul 2011 11:26:07 +0200
Subject: [PATCH] bts-init: Initialize the BTS like it will look after a reset

Reset the BTS MO State on BTS bootstrap. This way we will always
test the BTS disconnect/reconnect case of the BTS.

Do not reset the administrative state of objects. The BSC might
have set these and wants to maintain them across disconnect/
reconnect. Right now this is true for the TRX state.
---
 openbsc/src/libbsc/bsc_init.c           |    3 +++
 openbsc/src/libcommon/gsm_data_shared.c |    1 -
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 1be8cb7..02a3adf 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -406,6 +406,9 @@ static int bootstrap_bts(struct gsm_bts *bts)
 
 	bts->si_common.ncc_permitted = 0xff;
 
+	/* Initialize the BTS state */
+	gsm_bts_mo_reset(bts);
+
 	return 0;
 }
 
diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c
index 58e3bed..b52d58a 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -36,7 +36,6 @@
 
 void gsm_abis_mo_reset(struct gsm_abis_mo *mo)
 {
-	mo->nm_state.administrative = NM_STATE_NULL;
 	mo->nm_state.operational = NM_OPSTATE_NULL;
 	mo->nm_state.availability = NM_AVSTATE_POWER_OFF;
 }
-- 
1.7.4.1

Reply via email to