From b0479496e371e2f26f611e6e81015bdcb59515bf Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 10 Oct 2018 01:50:31 +0200 Subject: handover_fsm: adjust inter-BSC HO failure handling to spec Inter-BSC outgoing lacked the required BSSMAP HO Failure dispatch. Not all cases should send BSSMAP HO Failure, name the relevant spec paragraphs in comments and adjust handling. Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154 Change-Id: I0980cacb9713e41a1eef3a0a7f6cc892e8a20da5 --- src/osmo-bsc/handover_fsm.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 90d5f6c24..428608491 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -40,6 +40,7 @@ #include #include #include +#include #define LOG_FMT_BTS "bts %u lac-ci %u-%u arfcn-bsic %d-%d" #define LOG_ARGS_BTS(bts) \ @@ -697,9 +698,39 @@ void handover_end(struct gsm_subscriber_connection *conn, enum handover_result r result = HO_RESULT_ERROR; } else result = bsc_tx_bssmap_ho_complete(conn, ho->new_lchan); - } else { + } + /* Not 'else': above checks may still result in HO_RESULT_ERROR. */ + if (result == HO_RESULT_ERROR) { + /* Return a BSSMAP Handover Failure, as described in 3GPP TS 48.008 3.1.5.2.2 + * "Handover Resource Allocation Failure" */ + bsc_tx_bssmap_ho_failure(conn); + } + } else if (ho->scope & HO_INTER_BSC_OUT) { + switch (result) { + case HO_RESULT_OK: + break; + case HO_RESULT_FAIL_RR_HO_FAIL: + /* Return a BSSMAP Handover Failure, as described in 3GPP TS 48.008 3.1.5.3.2 + * "Handover Failure" */ bsc_tx_bssmap_ho_failure(conn); - /* TODO: Also send BSSMAP Clear Request? */ + break; + default: + case HO_RESULT_FAIL_TIMEOUT: + switch (ho->fi->state) { + case HO_OUT_ST_WAIT_HO_COMMAND: + /* MSC never replied with a Handover Command. Fail and ignore the + * handover, continue to use the lchan. */ + break; + default: + case HO_OUT_ST_WAIT_CLEAR: + /* 3GPP TS 48.008 3.1.5.3.3 "Abnormal Conditions": if neither MS reports + * HO Failure nor the MSC sends a Clear Command, we should release the + * dedicated radio resources and send a Clear Request to the MSC. */ + lchan_release(conn->lchan, false, true, GSM48_RR_CAUSE_ABNORMAL_TIMER); + /* Once the channel release is through, the BSSMAP Clear will follow. */ + break; + } + break; } } -- cgit v1.2.3