Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/11666


Change subject: lchan: release in error: fix missing messages / events
......................................................................

lchan: release in error: fix missing messages / events

In the case where there is a release in error and we skip immediately to the RF
Release state, send all of Deact SACCH, RR Release messages and also signal the
lchan_rtp_fsm as appropriate.

Move that code to static lchan_do_release() and call from both
lchan_fsm_wait_rll_rtp_released_onenter() in the normal case, as well as
lchan_release() when skipping that.

When releasing in error, but we're already in LCHAN_ST_WAIT_RLL_RTP_RELEASED,
those messages have already been sent and we can skip them.

Change-Id: I648a9826ce56b611359f81462ca03e4ab4c736aa
---
M src/osmo-bsc/lchan_fsm.c
1 file changed, 18 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/11666/1

diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index e15adbe..2cb7c3e 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -927,6 +927,18 @@
        }
 }

+static void lchan_do_release(struct gsm_lchan *lchan)
+{
+       if (lchan->do_rr_release && lchan->sapis[0] != LCHAN_SAPI_UNUSED)
+               gsm48_send_rr_release(lchan);
+
+       if (lchan->fi_rtp)
+               osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_RELEASE, 0);
+
+       if (lchan->deact_sacch && should_sacch_deact(lchan))
+               rsl_deact_sacch(lchan);
+}
+
 static void lchan_fsm_wait_rll_rtp_released_onenter(struct osmo_fsm_inst *fi, 
uint32_t prev_state)
 {
        int sapis;
@@ -937,14 +949,7 @@
                if (lchan->sapis[sapi])
                        LOG_LCHAN(lchan, LOGL_DEBUG, "SAPI[%d] = %d\n", sapi, 
lchan->sapis[sapi]);

-       if (lchan->do_rr_release && lchan->sapis[0] != LCHAN_SAPI_UNUSED)
-               gsm48_send_rr_release(lchan);
-
-       if (lchan->fi_rtp)
-               osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_RELEASE, 0);
-
-       if (lchan->deact_sacch && should_sacch_deact(lchan))
-               rsl_deact_sacch(lchan);
+       lchan_do_release(lchan);

        sapis = 0;
        for_each_active_sapi(sapi, 1, lchan) {
@@ -1317,10 +1322,11 @@
        if (lchan->release_in_error) {
                switch (lchan->fi->state) {
                default:
-                       /* Normally we deact SACCH in 
lchan_fsm_wait_rll_rtp_released_onenter(). When
-                        * skipping that, but asked to SACCH deact, do it now. 
*/
-                       if (lchan->deact_sacch)
-                               rsl_deact_sacch(lchan);
+                       /* Normally we signal release in 
lchan_fsm_wait_rll_rtp_released_onenter(). When
+                        * skipping that, do it now. */
+                       lchan_do_release(lchan);
+                       /* fall thru */
+               case LCHAN_ST_WAIT_RLL_RTP_RELEASED:
                        lchan_fsm_state_chg(LCHAN_ST_WAIT_RF_RELEASE_ACK);
                        goto exit_release_handler;
                case LCHAN_ST_WAIT_TS_READY:

--
To view, visit https://gerrit.osmocom.org/11666
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I648a9826ce56b611359f81462ca03e4ab4c736aa
Gerrit-Change-Number: 11666
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <[email protected]>

Reply via email to