aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc/handover_decision.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libbsc/handover_decision.c')
-rw-r--r--src/libbsc/handover_decision.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c
index 2506946ca..15463b0f5 100644
--- a/src/libbsc/handover_decision.c
+++ b/src/libbsc/handover_decision.c
@@ -30,9 +30,11 @@
#include <osmocom/bsc/meas_rep.h>
#include <osmocom/bsc/signal.h>
#include <osmocom/core/talloc.h>
-#include <osmocom/bsc/handover.h>
#include <osmocom/gsm/gsm_utils.h>
+#include <osmocom/bsc/handover.h>
+#include <osmocom/bsc/handover_cfg.h>
+
/* Get reference to a neighbor cell on a given BCCH ARFCN */
static struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts,
uint16_t arfcn, uint8_t bsic)
@@ -187,7 +189,7 @@ static void process_meas_neigh(struct gsm_meas_rep *mr)
/* attempt to do a handover */
static int attempt_handover(struct gsm_meas_rep *mr)
{
- struct gsm_network *net = mr->lchan->ts->trx->bts->network;
+ struct gsm_bts *bts = mr->lchan->ts->trx->bts;
struct neigh_meas_proc *best_cell = NULL;
unsigned int best_better_db = 0;
int i, rc;
@@ -204,10 +206,10 @@ static int attempt_handover(struct gsm_meas_rep *mr)
continue;
/* caculate average rxlev for this cell over the window */
- avg = neigh_meas_avg(nmp, net->handover.win_rxlev_avg_neigh);
+ avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho));
/* check if hysteresis is fulfilled */
- if (avg < mr->dl.full.rx_lev + net->handover.pwr_hysteresis)
+ if (avg < mr->dl.full.rx_lev + ho_get_pwr_hysteresis(bts->ho))
continue;
better = avg - mr->dl.full.rx_lev;
@@ -222,7 +224,7 @@ static int attempt_handover(struct gsm_meas_rep *mr)
LOGP(DHO, LOGL_INFO, "%s: Cell on ARFCN %u is better: ",
gsm_ts_name(mr->lchan->ts), best_cell->arfcn);
- if (!net->handover.active) {
+ if (!ho_get_ho_active(bts->ho)) {
LOGPC(DHO, LOGL_INFO, "Skipping, Handover disabled\n");
return 0;
}
@@ -248,7 +250,7 @@ static int attempt_handover(struct gsm_meas_rep *mr)
* attempt a handover */
static int process_meas_rep(struct gsm_meas_rep *mr)
{
- struct gsm_network *net = mr->lchan->ts->trx->bts->network;
+ struct gsm_bts *bts = mr->lchan->ts->trx->bts;
enum meas_rep_field dlev, dqual;
int av_rxlev;
@@ -274,7 +276,7 @@ static int process_meas_rep(struct gsm_meas_rep *mr)
process_meas_neigh(mr);
av_rxlev = get_meas_rep_avg(mr->lchan, dlev,
- net->handover.win_rxlev_avg);
+ ho_get_rxlev_avg_win(bts->ho));
/* Interference HO */
if (rxlev2dbm(av_rxlev) > -85 &&
@@ -299,14 +301,14 @@ static int process_meas_rep(struct gsm_meas_rep *mr)
}
/* Distance */
- if (mr->ms_l1.ta > net->handover.max_distance) {
+ if (mr->ms_l1.ta > ho_get_max_distance(bts->ho))
LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dbm ta=%d \n",
rxlev2dbm(av_rxlev), mr->ms_l1.ta);
return attempt_handover(mr);
}
/* Power Budget AKA Better Cell */
- if ((mr->nr % net->handover.pwr_interval) == 0)
+ if ((mr->nr % ho_get_pwr_interval(bts->ho)) == 0)
return attempt_handover(mr);
return 0;