aboutsummaryrefslogtreecommitdiffstats
path: root/src/chan_alloc.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2008-12-27 21:34:06 +0000
committerHarald Welte <laforge@gnumonks.org>2008-12-27 21:34:06 +0000
commit75a983fab09567a59bcacf67416942f35cffe254 (patch)
tree9ffb01f8fc10efd001b6444d5574aeb8828dbf13 /src/chan_alloc.c
parent10b487b1c0c1a1cefa1d4114a166eca71f25bd38 (diff)
* add database handling
* fix IMSI handling
Diffstat (limited to 'src/chan_alloc.c')
-rw-r--r--src/chan_alloc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/chan_alloc.c b/src/chan_alloc.c
index 4ef5ff902..3ef8b4d24 100644
--- a/src/chan_alloc.c
+++ b/src/chan_alloc.c
@@ -63,7 +63,25 @@ struct gsm_bts_trx_ts *ts_alloc(struct gsm_bts *bts,
int i, j;
for (i = 0; i < bts->num_trx; i++) {
struct gsm_bts_trx *trx = &bts->trx[i];
- for (j = 0; j < 8; j++) {
+ int from, to;
+
+ /* 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;
+ }
+
+ for (j = from; j <= to; j++) {
struct gsm_bts_trx_ts *ts = &trx->ts[j];
if (ts->pchan == GSM_PCHAN_NONE) {
ts->pchan = pchan;