From d33659a2a567e02197aaad81c67a9150a9e82c32 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 13 Jun 2013 09:39:56 +0200 Subject: handover: Use enums to indicate the state instead of magic numbers Conflicts: src/common/l1sap.c src/common/rsl.c src/osmo-bts-trx/l1_if.c --- src/common/handover.c | 4 ++-- src/common/rsl.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/handover.c b/src/common/handover.c index e02c128f..6dedf9ea 100644 --- a/src/common/handover.c +++ b/src/common/handover.c @@ -111,7 +111,7 @@ void handover_rach(struct gsm_bts_trx *trx, uint8_t chan_nr, lchan->rqd_ta = acc_delay; /* Stop handover detection, wait for valid frame */ - lchan->ho.active = 2; + lchan->ho.active = HANDOVER_WAIT_FRAME; l1sap_chan_modify(trx, chan_nr); /* Send HANDover DETect to BSC */ @@ -140,6 +140,6 @@ void handover_frame(struct gsm_lchan *lchan) osmo_timer_del(&lchan->ho.t3105); /* Handover process is done */ - lchan->ho.active = 0; + lchan->ho.active = HANDOVER_NONE; } diff --git a/src/common/rsl.c b/src/common/rsl.c index 9597df62..f039f432 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -45,6 +45,7 @@ #include #include #include +#include //#define FAKE_CIPH_MODE_COMPL @@ -736,7 +737,7 @@ static int rsl_rx_chan_activ(struct msgb *msg) if ((type == RSL_ACT_INTER_ASYNC || type == RSL_ACT_INTER_SYNC) && TLVP_PRESENT(&tp, RSL_IE_HANDO_REF)) { - lchan->ho.active = 1; + lchan->ho.active = HANDOVER_ENABLED; lchan->ho.ref = *TLVP_VAL(&tp, RSL_IE_HANDO_REF); LOGP(DRSL, LOGL_INFO, "Channel activation due to handover (id %i)", lchan->ho.ref); } @@ -833,7 +834,7 @@ static int rsl_rx_rf_chan_rel(struct gsm_lchan *lchan) } /* deactivate handover RACH detection and timer */ - lchan->ho.active = 0; + lchan->ho.active = HANDOVER_NONE; osmo_timer_del(&lchan->ho.t3105); lchan->rel_act_kind = LCHAN_REL_ACT_RSL; -- cgit v1.2.3