aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-05-30 14:12:48 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-12-01 03:37:43 +0100
commit3d2d487410377532030e328adeff1a224a884fb8 (patch)
tree98f2098ebe85cedd37c24f0b127f5469776aa4e6
parent6321015c6cd78a2e63f2c9246df98f43a734ee54 (diff)
HO: Add a penalty timer list to the subscriber connection entity
This penalty timer is used to temporarily block cells where handover or assignment failed or where handover is not allowed. This is usefull to prevent repeated handover attempts to broken cells or cells that have limited allowed distance.
-rw-r--r--include/osmocom/bsc/gsm_data.h10
-rw-r--r--src/libbsc/bsc_api.c11
2 files changed, 21 insertions, 0 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 8ec08ecb0..8822b9b3e 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -97,6 +97,13 @@ struct neigh_meas_proc {
uint8_t last_seen_nr;
};
+/* penalty timers for handover */
+struct ho_penalty_timer {
+ struct llist_head entry;
+ uint8_t bts;
+ time_t timeout;
+};
+
/* the per subscriber data for lchan */
struct gsm_subscriber_connection {
struct llist_head entry;
@@ -130,6 +137,9 @@ struct gsm_subscriber_connection {
/* for assignment handling */
struct osmo_timer_list T10;
struct gsm_lchan *secondary_lchan;
+
+ /* penalty timers for handover */
+ struct llist_head ho_penalty_timers;
};
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 045068f24..8ac822e93 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -249,6 +249,7 @@ struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan)
conn->lchan = lchan;
conn->bts = lchan->ts->trx->bts;
lchan->conn = conn;
+ INIT_LLIST_HEAD(&conn->ho_penalty_timers);
llist_add_tail(&conn->entry, &sub_connections);
return conn;
}
@@ -256,6 +257,8 @@ struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan)
/* TODO: move subscriber put here... */
void subscr_con_free(struct gsm_subscriber_connection *conn)
{
+ struct ho_penalty_timer *penalty;
+
if (!conn)
return;
@@ -281,6 +284,14 @@ void subscr_con_free(struct gsm_subscriber_connection *conn)
conn->secondary_lchan->conn = NULL;
}
+ /* flush handover penalty timers */
+ while (!llist_empty(&conn->ho_penalty_timers)) {
+ penalty = llist_entry(conn->ho_penalty_timers.next,
+ struct ho_penalty_timer, entry);
+ llist_del(&penalty->entry);
+ talloc_free(penalty);
+ }
+
llist_del(&conn->entry);
talloc_free(conn);
}