aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/chan_alloc.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-12-28 16:21:05 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-12-23 20:20:38 +0100
commitb348939d86bbadab2b162dda00246abdfd33055a (patch)
tree4989a09e50b3153cb844552c1ac28b46e977aeaf /openbsc/src/libbsc/chan_alloc.c
parent638da51a786c279cf7769afbb6fdb56cc4c6c867 (diff)
lchan: Introduce T3109 handling for the release procedure
T3109 is started when the SACCH is deactivated. It is stopped when the phones sends the DISC/UA/UM on LAPDm for the main signalling link. In case of timeout the abnormal release procedure will be initiated. Make sure to not issue the SACCH Deactivate twice to avoid confusing the equipment. This is still not fully spec compliant. In case of a timeout the abnormal release handling will be started which involves starting T3111+2. The error handling should be split out of the rf channel release method, e.g. lchan_release should be called and check if the channel release was already initiated.
Diffstat (limited to 'openbsc/src/libbsc/chan_alloc.c')
-rw-r--r--openbsc/src/libbsc/chan_alloc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c
index a8b15d177..9b59d5df0 100644
--- a/openbsc/src/libbsc/chan_alloc.c
+++ b/openbsc/src/libbsc/chan_alloc.c
@@ -362,6 +362,7 @@ void lchan_free(struct gsm_lchan *lchan)
void lchan_reset(struct gsm_lchan *lchan)
{
osmo_timer_del(&lchan->T3101);
+ osmo_timer_del(&lchan->T3109);
osmo_timer_del(&lchan->T3111);
osmo_timer_del(&lchan->error_timer);
@@ -376,7 +377,7 @@ void lchan_reset(struct gsm_lchan *lchan)
/* Drive the release process of the lchan */
static void _lchan_handle_release(struct gsm_lchan *lchan,
- int sach_deact, int mode)
+ int sacch_deact, int mode)
{
/* Release all SAPIs on the local end and continue */
rsl_release_sapis_from(lchan, 1, RSL_REL_LOCAL_END);
@@ -386,10 +387,15 @@ static void _lchan_handle_release(struct gsm_lchan *lchan,
* release indication from the BTS or just take it down (e.g.
* on assignment requests)
*/
- if (sach_deact)
+ if (sacch_deact) {
gsm48_send_rr_release(lchan);
- else
+
+ /* Deactivate the SACCH on the BTS side */
+ rsl_deact_sacch(lchan);
+ rsl_start_t3109(lchan);
+ } else {
rsl_release_request(lchan, 0, mode);
+ }
}
/* Consider releasing the channel now */