diff options
author | Holger Freyther <zecke@selfish.org> | 2009-02-04 02:14:45 +0000 |
---|---|---|
committer | Holger Freyther <zecke@selfish.org> | 2009-02-04 02:14:45 +0000 |
commit | 3aa8d6c46d63869f0d7f24c0135db201ec311d33 (patch) | |
tree | 32323cf8abd91830dffca76f4a85f1ffe2802cb2 | |
parent | 2976c40cd17c44b9f5d1f69a9d77d62decd85ff1 (diff) |
[paging] This is paging my phone but it looks completely wrong...
- The paging block calculation is wrong but I have a hard time finding
the right information. The table of 05.02 (Table 5 of 9) looks good
but my phone is not happy with that group...
-rw-r--r-- | include/openbsc/abis_rsl.h | 1 | ||||
-rw-r--r-- | src/abis_rsl.c | 4 | ||||
-rw-r--r-- | src/paging.c | 21 |
3 files changed, 23 insertions, 3 deletions
diff --git a/include/openbsc/abis_rsl.h b/include/openbsc/abis_rsl.h index 420f3f4b2..196867157 100644 --- a/include/openbsc/abis_rsl.h +++ b/include/openbsc/abis_rsl.h @@ -376,6 +376,7 @@ int abis_rsl_rcvmsg(struct msgb *msg); unsigned int get_paging_group(u_int64_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); +u_int64_t str_to_imsi(const char *imsi_str); /* to be provided by external code */ int abis_rsl_sendmsg(struct msgb *msg); diff --git a/src/abis_rsl.c b/src/abis_rsl.c index 2e1224d99..0fa32eddc 100644 --- a/src/abis_rsl.c +++ b/src/abis_rsl.c @@ -852,9 +852,9 @@ int rsl_number_of_paging_subchannels(struct gsm_bts *bts) { if (bts->chan_desc.ccch_conf == RSL_BCCH_CCCH_CONF_1_C) { return MAX(1, (3 - bts->chan_desc.bs_ag_blks_res)) - * bts->chan_desc.bs_pa_mfrms; + * (bts->chan_desc.bs_pa_mfrms + 2); } else { return (9 - bts->chan_desc.bs_ag_blks_res) - * bts->chan_desc.bs_pa_mfrms; + * (bts->chan_desc.bs_pa_mfrms + 2); } } diff --git a/src/paging.c b/src/paging.c index e580ac72f..0461572d1 100644 --- a/src/paging.c +++ b/src/paging.c @@ -48,6 +48,22 @@ static LLIST_HEAD(managed_bts); +static unsigned int calculate_group(struct gsm_bts *bts, struct gsm_subscriber *subscr) +{ + int ccch_conf; + int bs_cc_chans; + int blocks; + unsigned int group; + + ccch_conf = bts->chan_desc.ccch_conf; + bs_cc_chans = rsl_ccch_conf_to_bs_cc_chans(ccch_conf); + /* code word + 2, as 2 channels equals 0x0 */ + blocks = bts->chan_desc.bs_pa_mfrms + 2; + group = get_paging_group(str_to_imsi(subscr->imsi), + bs_cc_chans, blocks); + return group; +} + /* * Kill one paging request update the internal list... */ @@ -66,6 +82,7 @@ static void page_handle_pending_requests(void *data) { u_int8_t mi[128]; unsigned long int tmsi; unsigned int mi_len; + unsigned int pag_group; struct paging_bts *paging_bts = (struct paging_bts *)data; struct paging_request *request = NULL; @@ -82,9 +99,11 @@ static void page_handle_pending_requests(void *data) { DEBUGP(DPAG, "Going to send paging commands: '%s'\n", request->subscr->imsi); ++request->requests; + + pag_group = calculate_group(paging_bts->bts, request->subscr); tmsi = strtoul(request->subscr->tmsi, NULL, 10); mi_len = generate_mid_from_tmsi(mi, tmsi); - rsl_paging_cmd(paging_bts->bts, 1, mi_len, mi, + rsl_paging_cmd(paging_bts->bts, pag_group, mi_len, mi, request->chan_type); if (request->requests > MAX_PAGING_REQUEST) { |