aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-26 10:32:34 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-26 10:32:34 +0800
commitb051b3b161e4f11ea4be77f87b94c8a52daf81a3 (patch)
treef956443af1b6dd36d3b47ff82920549a7ffca0f4
parent479a3aa707326007d66876a31d07bfab1eecdd8b (diff)
bsc_init: Do not use magic numbers for GSM 12.21 states.
-rw-r--r--openbsc/src/bsc_init.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/openbsc/src/bsc_init.c b/openbsc/src/bsc_init.c
index bdbff7b8..e2069081 100644
--- a/openbsc/src/bsc_init.c
+++ b/openbsc/src/bsc_init.c
@@ -418,9 +418,9 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
switch (obj_class) {
case NM_OC_SITE_MANAGER:
bts = container_of(obj, struct gsm_bts, site_mgr);
- if ((new_state->operational == 2 &&
+ if ((new_state->operational == NM_OPSTATE_ENABLED &&
new_state->availability == NM_AVSTATE_OK) ||
- (new_state->operational == 1 &&
+ (new_state->operational == NM_OPSTATE_DISABLED &&
new_state->availability == NM_AVSTATE_OFF_LINE))
abis_nm_opstart(bts, obj_class, 0xff, 0xff, 0xff);
break;
@@ -440,7 +440,7 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
case NM_OC_CHANNEL:
ts = obj;
trx = ts->trx;
- if (new_state->operational == 1 &&
+ if (new_state->operational == NM_OPSTATE_DISABLED &&
new_state->availability == NM_AVSTATE_DEPENDENCY) {
patch_nm_tables(trx->bts);
enum abis_nm_chan_comb ccomb =
@@ -455,7 +455,7 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
break;
case NM_OC_RADIO_CARRIER:
trx = obj;
- if (new_state->operational == 1 &&
+ if (new_state->operational == NM_OPSTATE_DISABLED &&
new_state->availability == NM_AVSTATE_OK)
abis_nm_opstart(trx->bts, obj_class, trx->bts->bts_nr,
trx->nr, 0xff);
@@ -464,7 +464,7 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
bts = container_of(obj, struct gsm_bts, gprs.nse);
if (bts->gprs.mode == BTS_GPRS_NONE)
break;
- if (new_state->availability == 5) {
+ if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
abis_nm_ipaccess_set_attr(bts, obj_class, bts->bts_nr,
0xff, 0xff, nanobts_attr_nse,
sizeof(nanobts_attr_nse));
@@ -478,7 +478,7 @@ int nm_state_event(enum nm_evt evt, u_int8_t obj_class, void *obj,
bts = container_of(obj, struct gsm_bts, gprs.cell);
if (bts->gprs.mode == BTS_GPRS_NONE)
break;
- if (new_state->availability == 5) {
+ if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
abis_nm_ipaccess_set_attr(bts, obj_class, bts->bts_nr,
0, 0xff, nanobts_attr_cell,
sizeof(nanobts_attr_cell));