From 9ddd8e6267a744caa0f206eeccb28b413fc987d5 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 6 Jul 2016 14:39:04 +0200 Subject: dyn pdch: don't PDCH ACT if gprs mode is none Skip PDCH activation if the GPRS mode is 'none' at: * TCH/F_PDCH init after OML Enable (dyn_pdch_init()) * after TCH/F_PDCH is released, in TCH/F mode * in the T3111 error timer callback after a TCH/F_PDCH was released in error state Assert the GPRS mode in rsl_ipacc_pdch_activate() to make sure all callers check the GPRS mode. Closes: OS#1765 Change-Id: I970e5f9dbcb1c625209e914a4c7696294ed34e62 --- openbsc/src/libbsc/abis_rsl.c | 11 +++++++++-- openbsc/src/libbsc/bsc_dyn_pdch.c | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'openbsc') diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 9f7628090..013daec1c 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -645,8 +645,9 @@ static void error_timeout_cb(void *data) LOGP(DRSL, LOGL_INFO, "%s is back in operation.\n", gsm_lchan_name(lchan)); rsl_lchan_set_state(lchan, LCHAN_S_NONE); - /* Put PDCH channel back into PDCH mode */ - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) + /* Put PDCH channel back into PDCH mode, if GPRS is enabled */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH + && lchan->ts->trx->bts->gprs.mode != BTS_GPRS_NONE) rsl_ipacc_pdch_activate(lchan->ts, 1); } @@ -772,9 +773,13 @@ static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan) * Any state other than LCHAN_S_REL_ERR became LCHAN_S_NONE after above * do_lchan_free(). Assert this, because that's what ensures a PDCH ACT * on a dynamic channel in all cases. + * + * If GPRS is disabled, always skip the PDCH ACT. */ OSMO_ASSERT(lchan->state == LCHAN_S_NONE || lchan->state == LCHAN_S_REL_ERR); + if (lchan->ts->trx->bts->gprs.mode == BTS_GPRS_NONE) + return 0; if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH && lchan->state == LCHAN_S_NONE) return rsl_ipacc_pdch_activate(lchan->ts, 1); @@ -2042,6 +2047,8 @@ int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act) } if (act){ + /* Callers should heed the GPRS mode. */ + OSMO_ASSERT(ts->trx->bts->gprs.mode != BTS_GPRS_NONE); msg_type = RSL_MT_IPAC_PDCH_ACT; ts->flags |= TS_F_PDCH_ACT_PENDING; } else { diff --git a/openbsc/src/libbsc/bsc_dyn_pdch.c b/openbsc/src/libbsc/bsc_dyn_pdch.c index e0d1a6349..26409a747 100644 --- a/openbsc/src/libbsc/bsc_dyn_pdch.c +++ b/openbsc/src/libbsc/bsc_dyn_pdch.c @@ -34,6 +34,13 @@ void dyn_pdch_init(struct gsm_bts_trx_ts *ts) if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) return; + if (ts->trx->bts->gprs.mode == BTS_GPRS_NONE) { + LOGP(DRSL, LOGL_NOTICE, "%s %s: GPRS mode is 'none':" + " not activating PDCH.\n", + gsm_ts_name(ts), gsm_pchan_name(ts->pchan)); + return; + } + LOGP(DRSL, LOGL_DEBUG, "%s %s: trying to PDCH ACT\n", gsm_ts_name(ts), gsm_pchan_name(ts->pchan)); -- cgit v1.2.3