aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-11-28 14:21:29 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-11-28 14:26:10 +0100
commit3b62449ab9d9bf9028827cb9171cdbcf55dc3aa3 (patch)
tree6e55d0bfcadfc3bc0a43078b5cc28823ae79fe7a
parent746df53ad2dde43d6d3230cfffbe0763405d4770 (diff)
UNTESTED: fix count of waiting lchans on dyn TSneels/pdch_deact_nack
-rw-r--r--src/osmo-bsc/timeslot_fsm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index a3374c3..41de24f 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -147,7 +147,9 @@ static int ts_lchans_waiting(struct gsm_bts_trx_ts *ts)
{
struct gsm_lchan *lchan;
int count = 0;
- ts_for_each_lchan(lchan, ts)
+ /* Make sure we count lchans waiting for a dyn TS that is still in pchan_is == PDCH:
+ * ts_subslots(PDCH) == 0, so rather use pchan_on_init's subslot count. */
+ ts_as_pchan_for_each_lchan(lchan, ts, ts->pchan_on_init)
if (lchan->fi->state == LCHAN_ST_WAIT_TS_READY)
count++;
return count;
@@ -860,7 +862,9 @@ 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) {
+ /* Make sure we count lchans waiting for a dyn TS that is still in pchan_is == PDCH:
+ * ts_subslots(PDCH) == 0, so rather use pchan_on_init's subslot count. */
+ ts_as_pchan_for_each_lchan(lchan, ts, ts->pchan_on_init) {
if (lchan->fi->state == LCHAN_ST_WAIT_TS_READY) {
if (target_pchan)
*target_pchan = gsm_pchan_by_lchan_type(lchan->type);