summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-10-17 01:03:53 +0200
committerHarald Welte <laforge@gnumonks.org>2016-12-09 11:35:41 +0000
commitec16c161932c16280d7b4bdf8e72262e7f81c873 (patch)
tree9e567ec2b826fea9c8c72a200f9d425d8df5b80e
parentf788d933824cf9757d58a1e84843c7c33523e71c (diff)
lchan release in error state: SACCH deact only for SACCH pchans
This is useful particularly in case where we deactivate PDCHs which don't have a SACCH associated. The existin code would always attempt to deactivate a SACCH even in those cases, leading to the BTS responsding with related error messages. Change-Id: Iaf46782329b38ba8f3d438e6c75c2d467b852734
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h1
-rw-r--r--openbsc/src/libbsc/abis_rsl.c16
-rw-r--r--openbsc/src/libcommon/gsm_data_shared.c2
3 files changed, 17 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 4ec4f694e..9407b8262 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -891,6 +891,7 @@ static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts)
struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
int *rc);
+enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts);
uint8_t ts_subslots(struct gsm_bts_trx_ts *ts);
bool ts_is_tch(struct gsm_bts_trx_ts *ts);
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index b7f7a75ce..2c016a6e6 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -898,9 +898,23 @@ static int rsl_rf_chan_release(struct gsm_lchan *lchan, int error,
*/
static int rsl_rf_chan_release_err(struct gsm_lchan *lchan)
{
+ enum sacch_deact sacch_deact;
if (lchan->state != LCHAN_S_ACTIVE)
return 0;
- return rsl_rf_chan_release(lchan, 1, SACCH_DEACTIVATE);
+ switch (ts_pchan(lchan->ts)) {
+ case GSM_PCHAN_TCH_F:
+ case GSM_PCHAN_TCH_H:
+ case GSM_PCHAN_CCCH_SDCCH4:
+ case GSM_PCHAN_CCCH_SDCCH4_CBCH:
+ case GSM_PCHAN_SDCCH8_SACCH8C:
+ case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:
+ sacch_deact = SACCH_DEACTIVATE;
+ break;
+ default:
+ sacch_deact = SACCH_NONE;
+ break;
+ }
+ return rsl_rf_chan_release(lchan, 1, sacch_deact);
}
static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan)
diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c
index df204feab..387af7068 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -729,7 +729,7 @@ static const uint8_t subslots_per_pchan[] = {
};
/*! Return the actual pchan type, also heeding dynamic TS. */
-static enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts)
+enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts)
{
switch (ts->pchan) {
case GSM_PCHAN_TCH_F_TCH_H_PDCH: