aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/abis_rsl.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-31 21:33:15 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-31 21:33:15 +0800
commitf30c0dca0d82ff738a0b4e228f055181416bd7c6 (patch)
tree8f844ef8c4d7d4caa3c461d0e0b17c5666b972fd /openbsc/src/abis_rsl.c
parentd7fd30617f110e07456c034bbcbebaab56c10031 (diff)
[rsl] Implement the T3111 timer to delay the RF Channel release
Diffstat (limited to 'openbsc/src/abis_rsl.c')
-rw-r--r--openbsc/src/abis_rsl.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c
index e3d778d9a..d170ff78f 100644
--- a/openbsc/src/abis_rsl.c
+++ b/openbsc/src/abis_rsl.c
@@ -987,6 +987,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);
rsl_lchan_set_state(msg->lchan, LCHAN_S_NONE);
lchan_free(msg->lchan);
break;
@@ -1082,6 +1083,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)
{
@@ -1260,16 +1269,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