diff options
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/abis_rsl.c | 9 | ||||
-rw-r--r-- | openbsc/src/bssap.c | 2 | ||||
-rw-r--r-- | openbsc/src/chan_alloc.c | 16 | ||||
-rw-r--r-- | openbsc/src/handover_logic.c | 2 |
4 files changed, 25 insertions, 4 deletions
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c index efafed86a..268c2d7b2 100644 --- a/openbsc/src/abis_rsl.c +++ b/openbsc/src/abis_rsl.c @@ -1140,6 +1140,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg) struct gsm_lchan *lchan; u_int8_t rqd_ta; int ret; + int is_lu; u_int16_t arfcn; u_int8_t ts_number, subch; @@ -1162,8 +1163,14 @@ static int rsl_rx_chan_rqd(struct msgb *msg) counter_inc(bts->network->stats.chreq.total); + /* + * We want LOCATION UPDATES to succeed and will assign a TCH + * if we have no SDCCH available. + */ + is_lu = !!(chreq_reason == GSM_CHREQ_REASON_LOCATION_UPD); + /* check availability / allocate channel */ - lchan = lchan_alloc(bts, lctype); + lchan = lchan_alloc(bts, lctype, is_lu); if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); diff --git a/openbsc/src/bssap.c b/openbsc/src/bssap.c index 8cafde5b6..1c84073da 100644 --- a/openbsc/src/bssap.c +++ b/openbsc/src/bssap.c @@ -403,7 +403,7 @@ static int handle_new_assignment(struct msgb *msg, int full_rate, int chan_mode) bts = msg->lchan->ts->trx->bts; chan_type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H; - new_lchan = lchan_alloc(bts, chan_type); + new_lchan = lchan_alloc(bts, chan_type, 0); if (!new_lchan) { LOGP(DMSC, LOGL_NOTICE, "No free channel.\n"); diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c index 1fb0a4f1e..06c75102a 100644 --- a/openbsc/src/chan_alloc.c +++ b/openbsc/src/chan_alloc.c @@ -223,7 +223,8 @@ _lc_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan) } /* Allocate a logical channel */ -struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type) +struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, + int allow_bigger) { struct gsm_lchan *lchan = NULL; enum gsm_phys_chan_config first, second; @@ -241,6 +242,19 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type) lchan = _lc_find_bts(bts, first); if (lchan == NULL) lchan = _lc_find_bts(bts, second); + + /* allow to assign bigger channels */ + if (allow_bigger) { + if (lchan == NULL) { + lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H); + type = GSM_LCHAN_TCH_H; + } + + if (lchan == NULL) { + lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); + type = GSM_LCHAN_TCH_F; + } + } break; case GSM_LCHAN_TCH_F: lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); diff --git a/openbsc/src/handover_logic.c b/openbsc/src/handover_logic.c index dc00b0d09..8981e8dc2 100644 --- a/openbsc/src/handover_logic.c +++ b/openbsc/src/handover_logic.c @@ -99,7 +99,7 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) counter_inc(bts->network->stats.handover.attempted); - new_lchan = lchan_alloc(bts, old_lchan->type); + new_lchan = lchan_alloc(bts, old_lchan->type, 0); if (!new_lchan) { LOGP(DHO, LOGL_NOTICE, "No free channel\n"); counter_inc(bts->network->stats.handover.no_channel); |