summaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-07-29 16:46:37 +0200
committerHarald Welte <laforge@gnumonks.org>2009-07-29 16:46:37 +0200
commitd46299da00f923b24043aa37fa2bae17ffcc1ff7 (patch)
tree4ee64293a26502ab37bf1f1874e5258848977336 /openbsc/src
parent67b4c30a9de972d199830bba5535e934bd47ac0f (diff)
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
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/chan_alloc.c42
1 files changed, 28 insertions, 14 deletions
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++) {