From 6321c72522897b2e8df787a73441f699b5af28d9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 25 Oct 2013 18:32:16 +0200 Subject: rsl/pcu: Do not send a CHAN ACT to the BSC on PCU usage The PCU is forcing the activation of a PDCH. Currently the BSC will receive a channel act ack for a channel that was not activated at all. Use the "release_reason" flag of the lchan to see if we have requested a normal activation or a silent one. It feels a bit odd to do it in the TX function but it is the most easy solution right now. I have added logging so it will not be totally silent. --- include/osmo-bts/rsl.h | 9 +++++++++ src/common/pcu_sock.c | 1 + src/common/rsl.c | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index 251cd23d..ede9edc8 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -1,6 +1,15 @@ #ifndef _RSL_H #define _RSL_H +/** + * What kind of release/activation is done? A silent one for + * the PDCH or one triggered through RSL? + */ +enum { + LCHAN_REL_ACT_RSL, + LCHAN_REL_ACT_PCU, +}; + int down_rsl(struct gsm_bts_trx *trx, struct msgb *msg); int rsl_tx_rf_res(struct gsm_bts_trx *trx); int rsl_tx_chan_rqd(struct gsm_bts_trx *trx, struct gsm_time *gtime, diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index a90caacf..3fef9b12 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -538,6 +538,7 @@ static int pcu_rx_act_req(struct gsm_bts *bts, return -EINVAL; lchan = trx->ts[act_req->ts_nr].lchan; + lchan->rel_act_kind = LCHAN_REL_ACT_PCU; if (lchan->type != GSM_LCHAN_PDTCH) { LOGP(DPCU, LOGL_ERROR, "Lchan is not of type PDCH, but %d.\n", lchan->type); diff --git a/src/common/rsl.c b/src/common/rsl.c index 0bcb6202..ad3150cf 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -489,6 +489,12 @@ int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan) struct msgb *msg; uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + if (lchan->rel_act_kind != LCHAN_REL_ACT_RSL) { + LOGP(DRSL, LOGL_NOTICE, "%s not sending REL ACK\n", + gsm_lchan_name(lchan)); + return 0; + } + LOGP(DRSL, LOGL_NOTICE, "%s Tx RF CHAN REL ACK\n", gsm_lchan_name(lchan)); msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); @@ -508,6 +514,12 @@ int rsl_tx_chan_act_ack(struct gsm_lchan *lchan, struct gsm_time *gtime) uint8_t chan_nr = gsm_lchan2chan_nr(lchan); uint8_t ie[2]; + if (lchan->rel_act_kind != LCHAN_REL_ACT_RSL) { + LOGP(DRSL, LOGL_NOTICE, "%s not sending CHAN ACT ACK\n", + gsm_lchan_name(lchan)); + return 0; + } + LOGP(DRSL, LOGL_NOTICE, "%s Tx CHAN ACT ACK\n", gsm_lchan_name(lchan)); msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); @@ -531,6 +543,12 @@ int rsl_tx_chan_act_nack(struct gsm_lchan *lchan, uint8_t cause) struct msgb *msg; uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + if (lchan->rel_act_kind != LCHAN_REL_ACT_RSL) { + LOGP(DRSL, LOGL_DEBUG, "%s not sending CHAN ACT NACK.\n", + gsm_lchan_name(lchan)); + return 0; + } + LOGP(DRSL, LOGL_NOTICE, "%s Sending Channel Activated NACK: cause = 0x%02x\n", gsm_lchan_name(lchan), cause); @@ -763,6 +781,7 @@ static int rsl_rx_chan_activ(struct msgb *msg) dch->chan_nr, type, lchan->tch_mode); /* actually activate the channel in the BTS */ + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; return bts_model_rsl_chan_act(msg->lchan, &tp); } @@ -778,6 +797,7 @@ static int rsl_rx_rf_chan_rel(struct gsm_lchan *lchan) msgb_queue_flush(&lchan->dl_tch_queue); } + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; rc = bts_model_rsl_chan_rel(lchan); lapdm_channel_exit(&lchan->lapdm_ch); -- cgit v1.2.3