From 294fd1b650e4482775fdd604288fc928e66ef81c Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Tue, 5 Feb 2013 09:06:49 +0100 Subject: Added radio link timeout procedure according to TS 05.08 Chapter 5.2 Chapter 5.2 applies to MS procedure, but 5.3 (BSS procedure) defines no exact criterion, so I decided to use the procedure equivalent to MS. The criterion is based on a counter S, which is initialized to a preset RADIO_LINK_TIMEOUT, which can be configured via VTY. Whenever a received SACCH block is bad, S is counted down by one. If SACCH block is successfully decoded, S is counted up by two, but never above initial RADIO_LINK_TIMEOUT value. If S reaches 0, an RSL Connection Failure Indication with cause RF Radio Link Failure is sent to BSC, which then aborts channel. Use link timeout value from BSC via OML attribute. How to test: - Set "debug" for "meas" logging. - Start silent call to an attached mobile. - Remove battery from mobile or shield mobile. - Watch S count down. --- src/common/rsl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/common/rsl.c') diff --git a/src/common/rsl.c b/src/common/rsl.c index 5f2dd901..2aec0cee 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -541,6 +541,26 @@ int rsl_tx_chan_act_nack(struct gsm_lchan *lchan, uint8_t cause) return abis_rsl_sendmsg(msg); } +/* 8.4.4 sending CONNection FAILure */ +int rsl_tx_conn_fail(struct gsm_lchan *lchan, uint8_t cause) +{ + struct msgb *msg; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + + LOGP(DRSL, LOGL_NOTICE, "Sending Connection Failure: cause = 0x%02x\n", cause); + + msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); + if (!msg) + return -ENOMEM; + + /* 9.3.26 Cause */ + msgb_tlv_put(msg, RSL_IE_CAUSE, 1, &cause); + rsl_dch_push_hdr(msg, RSL_MT_CONN_FAIL, chan_nr); + msg->trx = lchan->ts->trx; + + return abis_rsl_sendmsg(msg); +} + /* 8.5.3 sending CHANnel ReQuireD */ int rsl_tx_chan_rqd(struct gsm_bts_trx *trx, struct gsm_time *gtime, uint8_t ra, uint8_t acc_delay) -- cgit v1.2.3