summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-05-30 14:12:48 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2013-07-29 12:44:05 +0200
commit587eaf10edadef1356e0fa3be4ba82f2ddf128ac (patch)
treed77abe75499c0767e59c68c9e367622bf41a571f
parent5d7e1190af142026a216b093c0a4915f002fc2c3 (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--openbsc/include/openbsc/gsm_data.h10
-rw-r--r--openbsc/src/libbsc/bsc_api.c11
2 files changed, 21 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 8ec08ecb0..8822b9b3e 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/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/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index 045068f24..8ac822e93 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/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);
}