aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_api.c
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2017-08-23 18:09:50 +0300
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-12 00:55:33 +0100
commitf7f4dc5e3b0dd61b8322946597147baef5d0464b (patch)
treef5346708f3d275c025de1d9f45eb757e0167db93 /openbsc/src/libbsc/bsc_api.c
parentf44fefe0ff3452f43a627e33e127d34a490d0d6d (diff)
handover: Implement proper handover procedure handling at any stage of the callneels/fairwaves_ho_orig
Enhancements for each stage of handover procedure should be implemented in order to support handover at any stage of the call. For these purposes new in_handover state and ho_queue for call control messages was introduced for gsm_subscriber_connection. Stage 1: HO-Command is sent to MS gsm_subscriber_connection state should be changed to in_handover=1. In this state all transmission of signalling layer messages (except RR messages needed for handover procedure) should be suspended until resuming is indicated. All call control messages for connection received from network side should be buffered in ho_queue. All call control messages for connection received from MS side should be ignored. Channel mode modification procedures should be also suspended. Stage 2: HO-Detect is received from MS Audio path should be switched on network side. Stage 3-1: HO-Complete is received from MS Resumption procedure after successful handover should be performed: - gsm_subscriber_connection state should be changed to normal (in_handover=0). - all buffered call control messages (ho_queue) should be sent to MS on new lchan. - suspended channel mode modification procedures should be performed on new lchan. Stage 3-2: HO-Fail is received from MS Resumption procedure after failed handover should be performed: - gsm_subscriber_connection state should be changed to normal (in_handover=0). - all buffered call control messages (ho_queue) should be sent to MS on old lchan. - suspended channel mode modification procedures should be performed on old lchan. Stage 3-3: T3103 expired: Handover has failed without HO-Complete or HO-Fail Resumption procedure should not be performed in case of T3103 expired: - gsm_subscriber_connection state should be changed to normal (in_handover=0). - all buffered call control messages (ho_queue) should be cleaned without sending them to MS. - suspended channel mode modification procedures should not be performed. Change-Id: Icb9b5c35ef0c894af2ea762e539f1a9216447fb7
Diffstat (limited to 'openbsc/src/libbsc/bsc_api.c')
-rw-r--r--openbsc/src/libbsc/bsc_api.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index 8a4c85ff3..71e82d033 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -253,11 +253,14 @@ struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lcha
conn->bts = lchan->ts->trx->bts;
lchan->conn = conn;
llist_add_tail(&conn->entry, &net->subscr_conns);
+ INIT_LLIST_HEAD(&conn->ho_queue);
return conn;
}
void bsc_subscr_con_free(struct gsm_subscriber_connection *conn)
{
+ struct msgb *msg;
+
if (!conn)
return;
@@ -283,6 +286,11 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn)
conn->secondary_lchan->conn = NULL;
}
+ while (!llist_empty(&conn->ho_queue)) {
+ msg = msgb_dequeue(&conn->ho_queue);
+ msgb_free(msg);
+ }
+
llist_del(&conn->entry);
talloc_free(conn);
}
@@ -747,6 +755,17 @@ int gsm0808_clear(struct gsm_subscriber_connection *conn)
return 0;
}
+/*
+ * Release handover RF Channel.
+ */
+int gsm0808_ho_clear(struct gsm_subscriber_connection *conn)
+{
+ if (conn->ho_lchan)
+ bsc_clear_handover(conn, 1);
+
+ return 0;
+}
+
static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id)
{
struct bsc_api *api;