diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-01-14 15:55:42 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-02-11 16:26:31 +0100 |
commit | f338a03b0cc85ca20bfe8e1ebe3b98e86bcef3c1 (patch) | |
tree | 687ce70060164c999855bdf734a08c91a6c5b5f1 /openbsc/src/abis_nm.c | |
parent | f3956cbb20ce92c3df20169a8a3c625759290696 (diff) |
[BSC] Move the BTS-type specific code from bcs_init.c to bts_*.c
bsc_init.c was a big mess even only for two supported BTS models,
so before adding more BTS types, this needs a cleanup.
All the BTS specific code from bsc_init.c has now moved into
bts_{siemens_bs11,ipaccess_nanobts}.c
This has required that input_event() and nm_state_event() get both
converted to proper libosmocore signals instead of referencing external
symbols.
Diffstat (limited to 'openbsc/src/abis_nm.c')
-rw-r--r-- | openbsc/src/abis_nm.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c index c2541dfc5..686421625 100644 --- a/openbsc/src/abis_nm.c +++ b/openbsc/src/abis_nm.c @@ -683,11 +683,10 @@ static int update_admstate(struct gsm_bts *bts, u_int8_t obj_class, struct abis_om_obj_inst *obj_inst, u_int8_t adm_state) { struct gsm_nm_state *nm_state, new_state; - void *obj; - int rc; + struct nm_statechg_signal_data nsd; - obj = objclass2obj(bts, obj_class, obj_inst); - if (!obj) + nsd.obj = objclass2obj(bts, obj_class, obj_inst); + if (!nsd.obj) return -EINVAL; nm_state = objclass2nmstate(bts, obj_class, obj_inst); if (!nm_state) @@ -696,11 +695,15 @@ static int update_admstate(struct gsm_bts *bts, u_int8_t obj_class, new_state = *nm_state; new_state.administrative = adm_state; - rc = nm_state_event(EVT_STATECHG_ADM, obj_class, obj, nm_state, &new_state, obj_inst); + nsd.obj_class = obj_class; + nsd.old_state = nm_state; + nsd.new_state = &new_state; + nsd.obj_inst = obj_inst; + dispatch_signal(SS_NM, S_NM_STATECHG_ADM, &nsd); nm_state->administrative = adm_state; - return rc; + return 0; } static int abis_nm_rx_statechg_rep(struct msgb *mb) @@ -710,7 +713,6 @@ static int abis_nm_rx_statechg_rep(struct msgb *mb) struct gsm_bts *bts = mb->trx->bts; struct tlv_parsed tp; struct gsm_nm_state *nm_state, new_state; - int rc; DEBUGPC(DNM, "STATE CHG: "); @@ -749,8 +751,13 @@ static int abis_nm_rx_statechg_rep(struct msgb *mb) 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, &foh->obj_inst); + struct nm_statechg_signal_data nsd; + nsd.obj = objclass2obj(bts, foh->obj_class, &foh->obj_inst); + nsd.obj_class = foh->obj_class; + nsd.old_state = nm_state; + nsd.new_state = &new_state; + nsd.obj_inst = &foh->obj_inst; + dispatch_signal(SS_NM, S_NM_STATECHG_OPER, &nsd); nm_state->operational = new_state.operational; nm_state->availability = new_state.availability; if (nm_state->administrative == 0) |