diff options
-rw-r--r-- | openbsc/src/libbsc/chan_alloc.c | 40 | ||||
-rw-r--r-- | openbsc/src/libbsc/handover_decision_2.c | 5 |
2 files changed, 22 insertions, 23 deletions
diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index cd727fd86..12e179ef6 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -159,23 +159,31 @@ static struct gsm_lchan * _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan) { struct gsm_bts_trx_ts *ts; - int j, ss; + int j, start, stop, dir, ss; if (!trx_is_usable(trx)) return NULL; - for (j = 0; j < 8; j++) { + if (trx->bts->chan_alloc_reverse) { + /* check TS 7..0 */ + start = 7; + stop = -1; + dir = -1; + } else { + /* check TS 0..7 */ + start = 0; + stop = 8; + dir = 1; + } + + for (j = start; j != stop; j += dir) { 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. */ + 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++) { @@ -238,14 +246,10 @@ _lc_count_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan) 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. */ + 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++) { diff --git a/openbsc/src/libbsc/handover_decision_2.c b/openbsc/src/libbsc/handover_decision_2.c index 56ebd500c..e6fc852f1 100644 --- a/openbsc/src/libbsc/handover_decision_2.c +++ b/openbsc/src/libbsc/handover_decision_2.c @@ -1191,11 +1191,6 @@ static int congestion_check_bts(struct gsm_bts *bts, int tchf_congestion, continue; switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: - /* we can only consider such a dynamic channel - * if the PDCH is currently inactive */ - if (ts->flags & TS_F_PDCH_MODE) - break; - // fall through case GSM_PCHAN_TCH_F: lc = &ts->lchan[0]; /* omit if channel not active */ |