aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/abis_rsl.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-01-14 14:16:16 +0100
committerHarald Welte <laforge@gnumonks.org>2011-01-14 14:25:57 +0100
commit64bb754b404cadab4453f222d9a15534d1fabd1d (patch)
treec43c2cf0cf1431152d22bd2338ee40946d65be8c /openbsc/src/abis_rsl.c
parentda0a99ab0d3e133c1d03ee0557be25f2a8c0770a (diff)
[RSL] Move RF CHAN REL ACK into its own function
... rather than handling it in the main switch() statement
Diffstat (limited to 'openbsc/src/abis_rsl.c')
-rw-r--r--openbsc/src/abis_rsl.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c
index e1f6abc1..07a7dc68 100644
--- a/openbsc/src/abis_rsl.c
+++ b/openbsc/src/abis_rsl.c
@@ -675,6 +675,24 @@ static int rsl_rf_chan_release(struct gsm_lchan *lchan, int error)
return abis_rsl_sendmsg(msg);
}
+static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan)
+{
+
+ DEBUGP(DRSL, "%s RF CHANNEL RELEASE ACK\n", gsm_lchan_name(lchan));
+
+ if (lchan->state != LCHAN_S_REL_REQ && lchan->state != LCHAN_S_REL_ERR)
+ LOGP(DRSL, LOGL_NOTICE, "%s CHAN REL ACK but state %s\n",
+ gsm_lchan_name(lchan),
+ gsm_lchans_name(lchan->state));
+ bsc_del_timer(&lchan->T3111);
+ /* we have an error timer pending to release that */
+ if (lchan->state != LCHAN_S_REL_ERR)
+ rsl_lchan_set_state(lchan, LCHAN_S_NONE);
+ lchan_free(lchan);
+
+ return 0;
+}
+
int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
u_int8_t *ms_ident, u_int8_t chan_needed)
{
@@ -1066,16 +1084,7 @@ static int abis_rsl_rx_dchan(struct msgb *msg)
rc = rsl_rx_hando_det(msg);
break;
case RSL_MT_RF_CHAN_REL_ACK:
- DEBUGP(DRSL, "%s RF CHANNEL RELEASE ACK\n", ts_name);
- if (msg->lchan->state != LCHAN_S_REL_REQ && msg->lchan->state != LCHAN_S_REL_ERR)
- 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);
- /* we have an error timer pending to release that */
- if (msg->lchan->state != LCHAN_S_REL_ERR)
- rsl_lchan_set_state(msg->lchan, LCHAN_S_NONE);
- lchan_free(msg->lchan);
+ rc = rsl_rx_rf_chan_rel_ack(msg->lchan);
break;
case RSL_MT_MODE_MODIFY_ACK:
DEBUGP(DRSL, "%s CHANNEL MODE MODIFY ACK\n", ts_name);