aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-26 14:41:58 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-26 14:41:58 +0200
commitbc82f92a8d8e214b42525f40c081d482a1a6a961 (patch)
tree79aa5a2af5f35a9001421ecfd2dfc655c4c07267 /openbsc
parent457a0813794f04670a4b2d952ba7256a9b900b12 (diff)
move gsm 05.02 related calculations into libosmocore
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/abis_rsl.h3
-rw-r--r--openbsc/src/libbsc/abis_rsl.c23
-rw-r--r--openbsc/src/libbsc/paging.c5
3 files changed, 3 insertions, 28 deletions
diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index 7a7624a7e..3b4df90c0 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -66,9 +66,6 @@ int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
int abis_rsl_rcvmsg(struct msgb *msg);
-unsigned int get_paging_group(uint64_t imsi, unsigned int bs_cc_chans,
- int n_pag_blocks);
-unsigned int n_pag_blocks(int bs_ccch_sdcch_comb, unsigned int bs_ag_blks_res);
uint64_t str_to_imsi(const char *imsi_str);
int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, uint8_t reason);
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index d186008d4..8356bd9a5 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -144,29 +144,6 @@ uint64_t str_to_imsi(const char *imsi_str)
return ret;
}
-/* Table 5 Clause 7 TS 05.02 */
-unsigned int n_pag_blocks(int bs_ccch_sdcch_comb, unsigned int bs_ag_blks_res)
-{
- if (!bs_ccch_sdcch_comb)
- return 9 - bs_ag_blks_res;
- else
- return 3 - bs_ag_blks_res;
-}
-
-/* Chapter 6.5.2 of TS 05.02 */
-unsigned int get_ccch_group(uint64_t imsi, unsigned int bs_cc_chans,
- unsigned int n_pag_blocks)
-{
- return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) / n_pag_blocks;
-}
-
-/* Chapter 6.5.2 of TS 05.02 */
-unsigned int get_paging_group(uint64_t imsi, unsigned int bs_cc_chans,
- int n_pag_blocks)
-{
- return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) % n_pag_blocks;
-}
-
static struct msgb *rsl_msgb_alloc(void)
{
return msgb_alloc_headroom(RSL_ALLOC_SIZE, RSL_ALLOC_HEADROOM,
diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c
index 04f14c6d2..371a7a673 100644
--- a/openbsc/src/libbsc/paging.c
+++ b/openbsc/src/libbsc/paging.c
@@ -40,6 +40,7 @@
#include <osmocom/core/talloc.h>
#include <osmocom/gsm/gsm48.h>
+#include <osmocom/gsm/gsm0502.h>
#include <openbsc/paging.h>
#include <openbsc/debug.h>
@@ -64,8 +65,8 @@ static unsigned int calculate_group(struct gsm_bts *bts, struct gsm_subscriber *
bs_cc_chans = rsl_ccch_conf_to_bs_cc_chans(ccch_conf);
/* code word + 2, as 2 channels equals 0x0 */
blocks = gsm48_number_of_paging_subchannels(&bts->si_common.chan_desc);
- group = get_paging_group(str_to_imsi(subscr->imsi),
- bs_cc_chans, blocks);
+ group = gsm0502_get_paging_group(str_to_imsi(subscr->imsi),
+ bs_cc_chans, blocks);
return group;
}