aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-05-30 11:14:31 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-12 03:28:14 +0100
commit91398f763e303c8202d858368bf11539904ee042 (patch)
tree422301950a4f78681cf3f81389def17edc128af0
parentd5161dd04fcaf764ff583fddb5cb3c23aa5cb02b (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
-rw-r--r--include/osmocom/bsc/handover.h2
-rw-r--r--src/libbsc/handover_logic.c18
2 files changed, 20 insertions, 0 deletions
diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h
index 9e2ba1a59..a9349eeda 100644
--- a/include/osmocom/bsc/handover.h
+++ b/include/osmocom/bsc/handover.h
@@ -7,3 +7,5 @@ struct gsm_subscriber_connection;
int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts);
void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan);
struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan);
+
+int bsc_ho_count(struct gsm_bts *bts, bool inter_cell);
diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index 4c741073b..684f5b04f 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -398,3 +398,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;
+}