aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/abis_rsl.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-09 14:30:52 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-09 14:30:52 +0200
commitf0fbae94ea7e22e18a732eb5907137f8033bdf1d (patch)
treede318137388e044e51ee37a4867f13002cd832a0 /openbsc/src/abis_rsl.c
parent8fe4df503c92f1d2e990bce3f37a61610e5664c2 (diff)
[rsl] Rework the lchan channel release procedure
1.) free every SAPI from 1-7 and wait for the confirmation and then continue until all of them are freed. If the SAPI is not torn down we will receive a timeout and then we force the RF Channel Release... 2.) once SAPI is down we send the RR Release, SACCH Deact 3.) the abis_rsl will see that all SAPIs are down and then will release channel...
Diffstat (limited to 'openbsc/src/abis_rsl.c')
-rw-r--r--openbsc/src/abis_rsl.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c
index 03626e7e3..ccd272f17 100644
--- a/openbsc/src/abis_rsl.c
+++ b/openbsc/src/abis_rsl.c
@@ -1299,11 +1299,21 @@ static int rsl_rx_rll_err_ind(struct msgb *msg)
static void rsl_handle_release(struct gsm_lchan *lchan)
{
+ int sapi;
struct gsm_bts *bts;
+
+ /* maybe we have only brought down one RLL */
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));
+ return;
+
+ for (sapi = 0; sapi < ARRAY_SIZE(lchan->sapis); ++sapi) {
+ if (lchan->sapis[sapi] == LCHAN_SAPI_UNUSED)
+ continue;
+ LOGP(DRSL, LOGL_NOTICE, "%s waiting for SAPI=%d to be released.\n",
+ gsm_lchan_name(lchan), sapi);
+ return;
+ }
+
/* wait a bit to send the RF Channel Release */
@@ -1365,6 +1375,7 @@ static int abis_rsl_rx_rll(struct msgb *msg)
rll_indication(msg->lchan, rllh->link_id,
BSC_RLLR_IND_REL_IND);
rsl_handle_release(msg->lchan);
+ rsl_lchan_rll_release(msg->lchan, rllh->link_id);
break;
case RSL_MT_REL_CONF:
/* BTS informs us of having received UA from MS,
@@ -1372,6 +1383,7 @@ static int abis_rsl_rx_rll(struct msgb *msg)
DEBUGPC(DRLL, "RELEASE CONFIRMATION\n");
msg->lchan->sapis[rllh->link_id & 0x7] = LCHAN_SAPI_UNUSED;
rsl_handle_release(msg->lchan);
+ rsl_lchan_rll_release(msg->lchan, rllh->link_id);
break;
case RSL_MT_ERROR_IND:
rc = rsl_rx_rll_err_ind(msg);