diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2018-05-04 23:01:01 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-05-05 01:50:49 +0200
commit968c14232785d5aff13eb5591ebb712f7ee59730 (patch)
parenta82c0b1c42796368355e3596a3347b2cf356ba70 (diff)
dyn TS, assignment: allow switch from PDCH with associated conn
Typically, an lchan that is released should no longer be associated with subscriber connection. If that is the case, an S_LCHAN_UNEXPECTED_RELEASE is triggered, which aborts, e.g., an ongoing assignment. However, with dynamic timeslots, we may set lchan->conn and then start to switch over from PDCH to a TCH mode, in which case it is perfectly fine to release an lchan that is associated to a conn. In lchan_free(), do not fire S_LCHAN_UNEXPECTED_RELEASE for a dyn TS that is currently in switchover. This is the second and last part to fix dynamic timeslots handling of the gscon. Related: OS#3211 Change-Id: Id7d9dd06451722eb328db77bb586826c954bd85c
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c
index e72ab3ca2..966896878 100644
--- a/src/libbsc/chan_alloc.c
+++ b/src/libbsc/chan_alloc.c
@@ -448,7 +448,9 @@ void lchan_free(struct gsm_lchan *lchan)
lchan->type = GSM_LCHAN_NONE;
- if (lchan->conn) {
+ if (lchan->conn
+ && !(lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH
+ && lchan->ts->dyn.pchan_is != lchan->ts->dyn.pchan_want)) {
struct lchan_signal_data sig;
/* We might kill an active channel... */
@@ -479,7 +481,9 @@ void lchan_free(struct gsm_lchan *lchan)
sig.bts = lchan->ts->trx->bts;
osmo_signal_dispatch(SS_CHALLOC, S_CHALLOC_FREED, &sig);
- if (lchan->conn) {
+ if (lchan->conn
+ && !(lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH
+ && lchan->ts->dyn.pchan_is != lchan->ts->dyn.pchan_want)) {
LOGP(DRLL, LOGL_ERROR, "the subscriber connection should be gone.\n");
lchan->conn = NULL;