@@ -96,14 +96,16 @@
ts = &trx->ts[j];
if (!ts_is_usable(ts))
continue;
- /* ip.access dynamic TCH/F + PDCH combination */
- if (ts->pchan == GSM_PCHAN_TCH_F_PDCH &&
- pchan == GSM_PCHAN_TCH_F) {
- /* we can only consider such a dynamic channel
- * if the PDCH is currently inactive */
- if (ts->flags & TS_F_PDCH_MODE)
- continue;
- } else if (ts->pchan != pchan)
+ /*
+ * pchan must match; but when looking for TCH/F, allow a match
+ * with TCH/F_PDCH, to return dynamic TCH/F_PDCH slots to the
+ * channel allocator. Thus the channel allocator can pick a
+ * TCH/F_PDCH time slot and disable its PDCH later on (no need
+ * to check whether PDCH mode is currently active here).
+ */
+ if (!(ts->pchan == pchan
+ || (ts->pchan == GSM_PCHAN_TCH_F_PDCH
+ && pchan == GSM_PCHAN_TCH_F)))
continue;
/* check if all sub-slots are allocated yet */
for (ss = 0; ss < subslots_per_pchan[pchan]; ss++) {