aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-05-31 15:05:52 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2013-07-29 12:44:11 +0200
commitbec07b0c3f74a5e593dc3d9c44ec583b5ac72a29 (patch)
tree15ca4c97a83c82ac01805752d7f5b61e2849ea3b
parentedb02c611709c0252aa6535df3e3b10bf6829ce8 (diff)
HO: Assign SDCCH on channel request
This is needed, so channel can be negotiated before the actual channel type is assigned. In case there is no SDCCH available, try to assign what ever the MS requested. If this is not possible try to assign TCH/F. If this is still not possible, reject channel request.
-rw-r--r--openbsc/src/libbsc/abis_rsl.c48
1 files changed, 37 insertions, 11 deletions
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index de8207687..23836c73f 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -1383,21 +1383,47 @@ static int rsl_rx_chan_rqd(struct msgb *msg)
*/
is_lu = !!(chreq_reason == GSM_CHREQ_REASON_LOCATION_UPD);
- /* check availability / allocate channel */
- lchan = lchan_alloc(bts, lctype, is_lu);
- if (!lchan && (rqd_ref->ra & 0xf0) == 0x30) {
- LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x, retrying with %s\n",
- msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra, gsm_lchant_name(GSM_LCHAN_TCH_F));
- lctype = GSM_LCHAN_TCH_F;
- lchan = lchan_alloc(bts, lctype, is_lu);
+ /* check availability / allocate channel
+ *
+ * First try to allocate SDCCH.
+ *
+ * If SDCCH is not available, try whatever MS requested, if not SDCCH.
+ *
+ * If there is still no channel available, and MS requested not TCH/F,
+ * try to allocate TCH/F.
+ *
+ * If there is still no channel available, reject channel request.
+ *
+ * Note: If the MS requests not TCH/H, we don't know if the phone
+ * supports TCH/H, so we must assign TCH/F or SDCCH.
+ */
+ lchan = lchan_alloc(bts, GSM_LCHAN_SDCCH, 0);
+ if (!lchan && lctype != GSM_LCHAN_SDCCH) {
+ LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s "
+ "0x%x, retrying with %s\n",
+ msg->lchan->ts->trx->bts->nr,
+ gsm_lchant_name(GSM_LCHAN_SDCCH), rqd_ref->ra,
+ gsm_lchant_name(lctype));
+ lchan = lchan_alloc(bts, lctype, 0);
+ }
+ if (!lchan && lctype != GSM_LCHAN_TCH_F) {
+ LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s "
+ "0x%x, retrying with %s\n",
+ msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype),
+ rqd_ref->ra, gsm_lchant_name(GSM_LCHAN_TCH_F));
+ lchan = lchan_alloc(bts, GSM_LCHAN_TCH_F, 0);
}
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);
+ LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s "
+ "0x%x, rejecting channel request\n",
+ msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype),
+ rqd_ref->ra);
osmo_counter_inc(bts->network->stats.chreq.no_channel);
/* FIXME gather multiple CHAN RQD and reject up to 4 at the same time */
- if (bts->network->T3122)
- rsl_send_imm_ass_rej(bts, 1, rqd_ref, bts->network->T3122 & 0xff);
+ if (bts->network->T3122) {
+ rsl_send_imm_ass_rej(bts, 1, rqd_ref,
+ bts->network->T3122 & 0xff);
+ }
return -ENOMEM;
}