aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/chan_alloc.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-06-14 13:12:00 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-06-16 04:29:40 +0200
commit832afa3f4b816797b6c9933187835a5c29cf5f1c (patch)
treea43ae6adbca6001e600f5c3cb6f7bfe5b7482e94 /openbsc/src/libbsc/chan_alloc.c
parent285df2ec624f5c51ca5621de0524fba64226d4ed (diff)
dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT
Do the PDCH DE/ACT before we set the lchan->state to De-/Activation Requested. It makes more sense semantically to change PDCH mode while the lchan is still in NONE status. Thus slightly move some invocations: PDCH ACT: Free the lchan before PDCH activation. Hence remove the lchan_free() call from the rsl_rx_pdch_act_ack() code path; it used to do the PDCH activation first and call lchan_free() in the callback. PDCH DEACT: Set the (TCH) Activation Requested state only within rsl_chan_activate_lchan(), after the PDCH deact is complete. Channel allocator: don't pick channels that have a PDCH PENDING flag set, to avoid using channels that are still in PDCH switchover (despite their state being NONE). The lchan_may_change_pdch() sanity checks are becoming a lot simpler. Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066
Diffstat (limited to 'openbsc/src/libbsc/chan_alloc.c')
-rw-r--r--openbsc/src/libbsc/chan_alloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c
index 471578025..f4ed53087 100644
--- a/openbsc/src/libbsc/chan_alloc.c
+++ b/openbsc/src/libbsc/chan_alloc.c
@@ -43,6 +43,13 @@ static int ts_is_usable(struct gsm_bts_trx_ts *ts)
return 0;
}
+ /* If a dyn PDCH channel is busy changing, it is already taken or not
+ * yet available. */
+ if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) {
+ if (ts->flags & TS_F_PDCH_PENDING_MASK)
+ return 0;
+ }
+
return 1;
}