aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-20 17:15:21 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-06 10:13:23 +0800
commit2e4447baa55a711d0c9bcc9879baea8e47507ba6 (patch)
treeb652e690408b442970b2d33784a0f408e3f61243
parente66bf1fd465cc5d364d36ee1ea78419e29b2c4f7 (diff)
[paging] Implement the counting for TCH/H and TCH/F
Add some code to count TCH/H and TCH/F and also handle the neci bit of the network. Our channel allocator will allocate a TCH/F if we request a TCH/H but can not allocate it.
-rw-r--r--openbsc/src/paging.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index bca97cf87..18d41aa56 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -128,10 +128,8 @@ static int can_send_pag_req(struct gsm_bts *bts, int rsl_type)
switch (rsl_type) {
case RSL_CHANNEED_TCH_F:
- LOGP(DPAG, LOGL_ERROR, "Not implemented.\n");
- break;
case RSL_CHANNEED_TCH_ForH:
- LOGP(DPAG, LOGL_ERROR, "Not implemented.\n");
+ goto count_tch;
break;
case RSL_CHANNEED_SDCCH:
goto count_sdcch;
@@ -139,7 +137,7 @@ static int can_send_pag_req(struct gsm_bts *bts, int rsl_type)
case RSL_CHANNEED_ANY:
default:
if (bts->network->pag_any_tch)
- LOGP(DPAG, LOGL_ERROR, "Not implemented.\n");
+ goto count_tch;
else
goto count_sdcch;
break;
@@ -155,6 +153,15 @@ count_sdcch:
count += pl.pchan[GSM_PCHAN_CCCH_SDCCH4].total
- pl.pchan[GSM_PCHAN_CCCH_SDCCH4].used;
return bts->paging.free_chans_need > count;
+
+count_tch:
+ count = 0;
+ count += pl.pchan[GSM_PCHAN_TCH_F].total
+ - pl.pchan[GSM_PCHAN_TCH_F].used;
+ if (bts->network->neci)
+ count += pl.pchan[GSM_PCHAN_TCH_H].total
+ - pl.pchan[GSM_PCHAN_TCH_H].used;
+ return bts->paging.free_chans_need > count;
}
/*