From bc48e26fc91e0a24ec571904d1fab6dd351a5d48 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 19 Jan 2014 15:10:06 +0100 Subject: common/rsl.c: Allow bts_model_rsl_chan_act() to return negative cause If the channel couldn't be activated, the function can simply return a negated RSL_ERR_* constant which will then be propagated towards the BSC in an CHAN_ACT_NACK RSL message. --- src/common/rsl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/rsl.c b/src/common/rsl.c index b8e4c23c..8b7702b3 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -675,6 +675,7 @@ static int rsl_rx_chan_activ(struct msgb *msg) struct rsl_ie_chan_mode *cm; struct tlv_parsed tp; uint8_t type; + int rc; if (lchan->state != LCHAN_S_NONE) { LOGP(DRSL, LOGL_ERROR, @@ -788,7 +789,11 @@ static int rsl_rx_chan_activ(struct msgb *msg) /* actually activate the channel in the BTS */ lchan->rel_act_kind = LCHAN_REL_ACT_RSL; - return bts_model_rsl_chan_act(msg->lchan, &tp); + rc = bts_model_rsl_chan_act(msg->lchan, &tp); + if (rc < 0) + return rsl_tx_chan_act_nack(lchan, -rc); + + return 0; } /* 8.4.14 RF CHANnel RELease is received */ -- cgit v1.2.3