<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/11314">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">handover_fsm: adjust inter-BSC HO failure handling to spec<br><br>Inter-BSC outgoing lacked the required BSSMAP HO Failure dispatch.<br><br>Not all cases should send BSSMAP HO Failure, name the relevant spec paragraphs<br>in comments and adjust handling.<br><br>Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154<br>Change-Id: I0980cacb9713e41a1eef3a0a7f6cc892e8a20da5<br>---<br>M src/osmo-bsc/handover_fsm.c<br>1 file changed, 33 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c</span><br><span>index 90d5f6c..4286084 100644</span><br><span>--- a/src/osmo-bsc/handover_fsm.c</span><br><span>+++ b/src/osmo-bsc/handover_fsm.c</span><br><span>@@ -40,6 +40,7 @@</span><br><span> #include <osmocom/bsc/osmo_bsc_lcls.h></span><br><span> #include <osmocom/bsc/mgw_endpoint_fsm.h></span><br><span> #include <osmocom/bsc/codec_pref.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/bsc/gsm_08_08.h></span><br><span> </span><br><span> #define LOG_FMT_BTS "bts %u lac-ci %u-%u arfcn-bsic %d-%d"</span><br><span> #define LOG_ARGS_BTS(bts) \</span><br><span>@@ -697,9 +698,39 @@</span><br><span>                            result = HO_RESULT_ERROR;</span><br><span>                    } else</span><br><span>                               result = bsc_tx_bssmap_ho_complete(conn, ho->new_lchan);</span><br><span style="color: hsl(0, 100%, 40%);">-             } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Not 'else': above checks may still result in HO_RESULT_ERROR. */</span><br><span style="color: hsl(120, 100%, 40%);">+           if (result == HO_RESULT_ERROR) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      /* Return a BSSMAP Handover Failure, as described in 3GPP TS 48.008 3.1.5.2.2</span><br><span style="color: hsl(120, 100%, 40%);">+                  * "Handover Resource Allocation Failure" */</span><br><span>                       bsc_tx_bssmap_ho_failure(conn);</span><br><span style="color: hsl(0, 100%, 40%);">-                 /* TODO: Also send BSSMAP Clear Request? */</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+     } else if (ho->scope & HO_INTER_BSC_OUT) {</span><br><span style="color: hsl(120, 100%, 40%);">+             switch (result) {</span><br><span style="color: hsl(120, 100%, 40%);">+             case HO_RESULT_OK:</span><br><span style="color: hsl(120, 100%, 40%);">+                    break;</span><br><span style="color: hsl(120, 100%, 40%);">+                case HO_RESULT_FAIL_RR_HO_FAIL:</span><br><span style="color: hsl(120, 100%, 40%);">+                       /* Return a BSSMAP Handover Failure, as described in 3GPP TS 48.008 3.1.5.3.2</span><br><span style="color: hsl(120, 100%, 40%);">+                  * "Handover Failure" */</span><br><span style="color: hsl(120, 100%, 40%);">+                    bsc_tx_bssmap_ho_failure(conn);</span><br><span style="color: hsl(120, 100%, 40%);">+                       break;</span><br><span style="color: hsl(120, 100%, 40%);">+                default:</span><br><span style="color: hsl(120, 100%, 40%);">+              case HO_RESULT_FAIL_TIMEOUT:</span><br><span style="color: hsl(120, 100%, 40%);">+                  switch (ho->fi->state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        case HO_OUT_ST_WAIT_HO_COMMAND:</span><br><span style="color: hsl(120, 100%, 40%);">+                               /* MSC never replied with a Handover Command. Fail and ignore the</span><br><span style="color: hsl(120, 100%, 40%);">+                              * handover, continue to use the lchan. */</span><br><span style="color: hsl(120, 100%, 40%);">+                            break;</span><br><span style="color: hsl(120, 100%, 40%);">+                        default:</span><br><span style="color: hsl(120, 100%, 40%);">+                      case HO_OUT_ST_WAIT_CLEAR:</span><br><span style="color: hsl(120, 100%, 40%);">+                            /* 3GPP TS 48.008 3.1.5.3.3 "Abnormal Conditions": if neither MS reports</span><br><span style="color: hsl(120, 100%, 40%);">+                             * HO Failure nor the MSC sends a Clear Command, we should release the</span><br><span style="color: hsl(120, 100%, 40%);">+                                 * dedicated radio resources and send a Clear Request to the MSC. */</span><br><span style="color: hsl(120, 100%, 40%);">+                          lchan_release(conn->lchan, false, true, GSM48_RR_CAUSE_ABNORMAL_TIMER);</span><br><span style="color: hsl(120, 100%, 40%);">+                            /* Once the channel release is through, the BSSMAP Clear will follow. */</span><br><span style="color: hsl(120, 100%, 40%);">+                              break;</span><br><span style="color: hsl(120, 100%, 40%);">+                        }</span><br><span style="color: hsl(120, 100%, 40%);">+                     break;</span><br><span>               }</span><br><span>    }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11314">change 11314</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11314"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I0980cacb9713e41a1eef3a0a7f6cc892e8a20da5 </div>
<div style="display:none"> Gerrit-Change-Number: 11314 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>