From d46299da00f923b24043aa37fa2bae17ffcc1ff7 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 29 Jul 2009 16:46:37 +0200 Subject: make channel allocator policy multi-TRX aware For now, we assume that TRX1 (and higher) all have a TCH/F configuration on all of their timeslots --- openbsc/src/chan_alloc.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'openbsc/src/chan_alloc.c') diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c index fe16815c6..e3d6ae67e 100644 --- a/openbsc/src/chan_alloc.c +++ b/openbsc/src/chan_alloc.c @@ -73,20 +73,34 @@ struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts, /* the following constraints are pure policy, * no requirement to put this restriction in place */ - switch (pchan) { - case GSM_PCHAN_CCCH: - case GSM_PCHAN_CCCH_SDCCH4: - from = 0; to = 0; - break; - case GSM_PCHAN_SDCCH8_SACCH8C: - from = 1; to = 1; - break; - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_H: - from = 2; to = 7; - break; - default: - return NULL; + if (trx == bts->c0) { + /* On the first TRX we run one CCCH and one SDCCH8 */ + switch (pchan) { + case GSM_PCHAN_CCCH: + case GSM_PCHAN_CCCH_SDCCH4: + from = 0; to = 0; + break; + case GSM_PCHAN_SDCCH8_SACCH8C: + from = 1; to = 1; + break; + case GSM_PCHAN_TCH_F: + case GSM_PCHAN_TCH_H: + from = 2; to = 7; + break; + default: + return NULL; + } + } else { + /* Every secondary TRX is configured for TCH/F + * and TCH/H only */ + switch (pchan) { + case GSM_PCHAN_TCH_F: + case GSM_PCHAN_TCH_H: + from = 0; to = 7; + break; + default: + return NULL; + } } for (j = from; j <= to; j++) { -- cgit v1.2.3