aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc/handover_logic.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-05-30 11:14:31 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-19 16:03:16 +0100
commita91800034e56cfa5a50764067569ec21bcb37415 (patch)
treeb54defa443257a90b8946c98ef54b2f832024885 /src/libbsc/handover_logic.c
parent5eaa4fb821751b70ad2b864d8765ff96bd301996 (diff)
HO: Add function to count currently ongoing handovers to a given BTS
In order to keep processing power at BTS at a defined level, the handover decision might want to limit maximum number of slots that require RACH detection. Change-Id: I8908e37fe0d8d2eda906cc6301ba0969b25a5575
Diffstat (limited to 'src/libbsc/handover_logic.c')
-rw-r--r--src/libbsc/handover_logic.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index f525b21d5..ee7b6833e 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -389,3 +389,21 @@ static __attribute__((constructor)) void on_dso_load_ho_logic(void)
{
osmo_signal_register_handler(SS_LCHAN, ho_logic_sig_cb, NULL);
}
+
+/* Count number of currently ongoing handovers
+ * inter_cell: if true, count only handovers between two cells. If false, count only handovers within one
+ * cell. */
+int bsc_ho_count(struct gsm_bts *bts, bool inter_cell)
+{
+ struct bsc_handover *ho;
+ int count = 0;
+
+ llist_for_each_entry(ho, &bsc_handovers, list) {
+ if (ho->inter_cell != inter_cell)
+ continue;
+ if (ho->new_lchan->ts->trx->bts == bts)
+ count++;
+ }
+
+ return count;
+}