path: root/src
diff options
authorPau Espin Pedrol <pespin@sysmocom.de>2018-11-28 16:55:47 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-12-05 16:06:47 +0000
commit3df635655517a98b488c7a4d7f02c25e4338f128 (patch)
treea79c2fb9d954aff674db9e48abaff0c343362c6c /src
parent0502a0ee1b06556b412f3d9796dcae22fb38da6b (diff)
bsc: timeslot_fsm: Fix ts_is_lchan_waiting_for_pchan
If ts_is_lchan_waiting_for_pchan() wasn't accounting for TCH lchans waiting for TS to deactive PDCH in order to setup the TS as TCH. Since now TCH lchan is catched by ts_is_lchan_waiting_for_pchan() when TS state is TS_ST_WAIT_PDCH_DEACT, there's no need to check for that case in caller ts_is_pchan_switching(), since it will never hit because the callee returns true in that case now. See osmo-bsc I9cedb77d6578597f1febab36c54b2ee427c7a4a2 for similar extensive explanation. Change-Id: Ib03e5a91438a5b74a04e69f81fab565842b02b66
Diffstat (limited to 'src')
1 files changed, 5 insertions, 3 deletions
diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index 145049154..269fcd526 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -857,7 +857,7 @@ static struct osmo_fsm ts_fsm = {
bool ts_is_lchan_waiting_for_pchan(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config *target_pchan)
struct gsm_lchan *lchan;
- ts_for_each_lchan(lchan, ts) {
+ ts_for_each_potential_lchan(lchan, ts) {
if (lchan->fi->state == LCHAN_ST_WAIT_TS_READY) {
if (target_pchan)
*target_pchan = gsm_pchan_by_lchan_type(lchan->type);
@@ -887,13 +887,15 @@ bool ts_is_pchan_switching(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config
switch (ts->fi->state) {
+ /* When switching to PDCH, there are no lchans and we are
+ * telling the PCU to take over the timeslot. */
if (target_pchan)
*target_pchan = GSM_PCHAN_PDCH;
return true;
- /* If we were switching to a specific pchan kind, an lchan would be waiting. So this must
- * be NONE then. */
+ /* If lchan started a PDCH deact but got somehow released while
+ * waiting for PDCH DEACT (N)ACK */
if (target_pchan)
*target_pchan = GSM_PCHAN_NONE;
return true;