[MERGED] osmo-bsc[master]: HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Jan 19 22:09:28 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic()
......................................................................


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
---
M src/libbsc/handover_decision.c
1 file changed, 13 insertions(+), 14 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c
index 0693613..93ca28b 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 @@
 	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);

-- 
To view, visit https://gerrit.osmocom.org/5917
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd
Gerrit-PatchSet: 6
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list