diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-10 13:59:16 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-03-16 15:32:31 +0100 |
commit | c8feeeb7b77ffe2c0b0d5b13f49561dfcfb431b7 (patch) | |
tree | 2d554e792dc0008708b25346e7c05f0d9778eea4 /openbsc/src/libbsc | |
parent | 4400dbdce728878de273406e786d3780a160755d (diff) |
move to libbsc: gsm_bts_neighbor() -- TODO really?
Change-Id: I63d4835dc7aabdf176e0ca634a6a4ca527612693
Diffstat (limited to 'openbsc/src/libbsc')
-rw-r--r-- | openbsc/src/libbsc/handover_decision.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/handover_decision.c b/openbsc/src/libbsc/handover_decision.c index 0f07bcac6..8d7e047b7 100644 --- a/openbsc/src/libbsc/handover_decision.c +++ b/openbsc/src/libbsc/handover_decision.c @@ -33,6 +33,27 @@ #include <openbsc/handover.h> #include <osmocom/gsm/gsm_utils.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) +{ + struct gsm_bts *neigh; + /* FIXME: use some better heuristics here to determine which cell + * using this ARFCN really is closest to the target cell. For + * now we simply assume that each ARFCN will only be used by one + * cell */ + + llist_for_each_entry(neigh, &bts->network->bts_list, list) { + /* FIXME: this is probably returning the same bts again!? */ + if (neigh->c0->arfcn == arfcn && + neigh->bsic == bsic) + return neigh; + } + + return NULL; +} + + /* issue handover to a cell identified by ARFCN and BSIC */ static int handover_to_arfcn_bsic(struct gsm_lchan *lchan, uint16_t arfcn, uint8_t bsic) |