aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/abis_nm.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-12-31 03:05:52 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-12-31 03:05:52 +0100
commitf31e4745bb32d120f55d8442669d666d88619fa0 (patch)
treec52cde3e079d50899f132f7954f455eca61a7f62 /openbsc/src/abis_nm.c
parentf7dbd589abdf321c9535d2bafa5b084474e83d4f (diff)
[misc] Utilize rf_locking by setting the nm_state.administrative
* On start the vty code will call the abis_nm method and this will set the administrative state to unlock/lock * During startup the BTS will report its state as well and would possible overwrite the set administrative. We are only going to update the administrative if it was 0 before. This appears to work on all of my tests. In case this will not be the case for others we will have to split the administrative into two sets one for the BTS and one for the BSC.
Diffstat (limited to 'openbsc/src/abis_nm.c')
-rw-r--r--openbsc/src/abis_nm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c
index f82dc6f39..38c8c2bf5 100644
--- a/openbsc/src/abis_nm.c
+++ b/openbsc/src/abis_nm.c
@@ -813,12 +813,17 @@ static int abis_nm_rx_statechg_rep(struct msgb *mb)
}
DEBUGPC(DNM, "\n");
- if (memcmp(&new_state, nm_state, sizeof(new_state))) {
+ if ((new_state.administrative != 0 && nm_state->administrative == 0) ||
+ new_state.operational != nm_state->operational ||
+ new_state.availability != nm_state->availability) {
/* Update the operational state of a given object in our in-memory data
* structures and send an event to the higher layer */
void *obj = objclass2obj(bts, foh->obj_class, &foh->obj_inst);
rc = nm_state_event(EVT_STATECHG_OPER, foh->obj_class, obj, nm_state, &new_state);
- *nm_state = new_state;
+ nm_state->operational = new_state.operational;
+ nm_state->availability = new_state.availability;
+ if (nm_state->administrative == 0)
+ nm_state->administrative = new_state.administrative;
}
#if 0
if (op_state == 1) {
@@ -2912,7 +2917,7 @@ void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked)
{
int new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED;
- trx->rf_locked = locked;
+ trx->nm_state.administrative = new_state;
if (!trx->bts || !trx->bts->oml_link)
return;