From bc82f92a8d8e214b42525f40c081d482a1a6a961 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 26 Jun 2011 14:41:58 +0200 Subject: move gsm 05.02 related calculations into libosmocore --- openbsc/include/openbsc/abis_rsl.h | 3 --- openbsc/src/libbsc/abis_rsl.c | 23 ----------------------- openbsc/src/libbsc/paging.c | 5 +++-- 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 #include +#include #include #include @@ -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; } -- cgit v1.2.3