From d9ae25c1bfa15a29d3fba5fc20bb96757e31a0fb Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 8 Apr 2010 23:05:22 +0200 Subject: [rsl] Implement the T3111 timer to delay the RF Channel release --- openbsc/include/openbsc/gsm_data.h | 1 + openbsc/src/abis_rsl.c | 19 +++++++++++++++---- openbsc/src/vty_interface.c | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 303663f41..eed29b1da 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -246,6 +246,7 @@ struct gsm_lchan { } encr; struct timer_list T3101; + struct timer_list T3111; /* AMR bits */ struct gsm48_multi_rate_conf mr_conf; diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c index d313d054a..e73a1db4d 100644 --- a/openbsc/src/abis_rsl.c +++ b/openbsc/src/abis_rsl.c @@ -982,6 +982,7 @@ static int abis_rsl_rx_dchan(struct msgb *msg) LOGP(DRSL, LOGL_NOTICE, "%s CHAN REL ACK but state %s\n", gsm_lchan_name(msg->lchan), gsm_lchans_name(msg->lchan->state)); + bsc_del_timer(&msg->lchan->T3111); msg->lchan->state = LCHAN_S_NONE; lchan_free(msg->lchan); break; @@ -1077,6 +1078,14 @@ static void t3101_expired(void *data) rsl_rf_chan_release(lchan); } +/* If T3111 expires, we will send the RF Channel Request */ +static void t3111_expired(void *data) +{ + struct gsm_lchan *lchan = data; + + rsl_rf_chan_release(lchan); +} + /* MS has requested a channel on the RACH */ static int rsl_rx_chan_rqd(struct msgb *msg) { @@ -1249,16 +1258,18 @@ static int rsl_rx_rll_err_ind(struct msgb *msg) static void rsl_handle_release(struct gsm_lchan *lchan) { + struct gsm_bts *bts; if (lchan->state != LCHAN_S_REL_REQ) LOGP(DRSL, LOGL_ERROR, "RF release on %s but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); - /* we can now releae the channel on the BTS/Abis side */ - /* FIXME: officially we need to start T3111 and wait for - * some grace period */ - rsl_rf_chan_release(lchan); + /* wait a bit to send the RF Channel Release */ + lchan->T3111.cb = t3111_expired; + lchan->T3111.data = lchan; + bts = lchan->ts->trx->bts; + bsc_schedule_timer(&lchan->T3111, bts->network->T3111, 0); } /* ESTABLISH INDICATION, LOCATION AREA UPDATE REQUEST diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c index e0548df62..d64d49505 100644 --- a/openbsc/src/vty_interface.c +++ b/openbsc/src/vty_interface.c @@ -1331,7 +1331,7 @@ DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.") DECLARE_TIMER(3105, "Currently not used.") DECLARE_TIMER(3107, "Currently not used.") DECLARE_TIMER(3109, "Currently not used.") -DECLARE_TIMER(3111, "Currently not used.") +DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel.") DECLARE_TIMER(3113, "Set the time to try paging a subscriber.") DECLARE_TIMER(3115, "Currently not used.") DECLARE_TIMER(3117, "Currently not used.") -- cgit v1.2.3