From b7e8116bfa76016fd4e89b7d17bf2ea5e833870c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 10 Aug 2009 00:26:10 +0200 Subject: [PATCH] add T3101 to release lchan in case MS never responds to IMMEDIATE ASSIGN --- openbsc/include/openbsc/gsm_data.h | 2 ++ openbsc/src/abis_rsl.c | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 4f6240d3c..f90e60d46 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -147,6 +147,8 @@ struct gsm_lchan { /* Timer started to release the channel */ struct timer_list release_timer; + struct timer_list T3101; + /* * Operations that have a state and might be pending */ diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c index 50aebc3b9..f243c38f7 100644 --- a/openbsc/src/abis_rsl.c +++ b/openbsc/src/abis_rsl.c @@ -1017,6 +1017,14 @@ static int abis_rsl_rx_trx(struct msgb *msg) return rc; } +/* If T3101 expires, we never received a response to IMMEDIATE ASSIGN */ +static void t3101_expired(void *data) +{ + struct gsm_lchan *lchan = data; + + rsl_chan_release(lchan); +} + /* MS has requested a channel on the RACH */ static int rsl_rx_chan_rqd(struct msgb *msg) { @@ -1088,7 +1096,10 @@ static int rsl_rx_chan_rqd(struct msgb *msg) ia.chan_desc.chan_nr, gsm_chreq_name(chreq_reason), rqd_ref->ra); - /* FIXME: Start timer T3101 to wait for GSM48_MT_RR_PAG_RESP */ + /* Start timer T3101 to wait for GSM48_MT_RR_PAG_RESP */ + lchan->T3101.cb = t3101_expired; + lchan->T3101.data = lchan; + bsc_schedule_timer(&lchan->T3101, 10, 0); /* send IMMEDIATE ASSIGN CMD on RSL to BTS (to send on CCCH to MS) */ ret = rsl_imm_assign_cmd(bts, sizeof(ia), (u_int8_t *) &ia); @@ -1199,6 +1210,8 @@ static int abis_rsl_rx_rll(struct msgb *msg) break; case RSL_MT_EST_IND: DEBUGPC(DRLL, "ESTABLISH INDICATION\n"); + /* lchan is established, stop T3101 */ + bsc_del_timer(&msg->lchan->T3101); if (msgb_l2len(msg) > sizeof(struct abis_rsl_common_hdr) + sizeof(*rllh) && rllh->data[0] == RSL_IE_L3_INFO) {