aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-01-08 15:44:56 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-12 03:28:50 +0100
commit4235aae29e7e8d6a2e90f3a5df4c15a75842d906 (patch)
tree97352e79738d58d546b73ee37756ac8fc5d5b77a
parent130d7137858153a50394faf92df0d8d8de31ed87 (diff)
HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic()
The name sounds like it is looking up neighbors, instead it simply traverses the global list of BTSes. Rename to reflect what it does. Move FIXME comment to its logical place: at the invocation of bts_by_arfcn_bsic(). Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd
-rw-r--r--src/libbsc/handover_decision.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c
index 1d3b0139b..8b9cd5b16 100644
--- a/src/libbsc/handover_decision.c
+++ b/src/libbsc/handover_decision.c
@@ -35,21 +35,16 @@
#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)
+/* Find BTS by ARFCN and BSIC */
+static struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net,
+ 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 */
+ struct gsm_bts *bts;
- 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;
+ llist_for_each_entry(bts, &net->bts_list, list) {
+ if (bts->c0->arfcn == arfcn &&
+ bts->bsic == bsic)
+ return bts;
}
return NULL;
@@ -63,7 +58,11 @@ static int handover_to_arfcn_bsic(struct gsm_lchan *lchan,
struct gsm_bts *new_bts;
/* resolve the gsm_bts structure for the best neighbor */
- new_bts = gsm_bts_neighbor(lchan->ts->trx->bts, arfcn, bsic);
+ /* 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 */
+ new_bts = bts_by_arfcn_bsic(lchan->ts->trx->bts->network, arfcn, bsic);
if (!new_bts) {
LOGP(DHODEC, LOGL_NOTICE, "unable to determine neighbor BTS "
"for ARFCN %u BSIC %u ?!?\n", arfcn, bsic);