libosmogsm  0.9.6.315-40e62
Osmocom GSM library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gsm0502.h
Go to the documentation of this file.
1 
3 #pragma once
4 
5 #include <stdint.h>
6 
7 #include <osmocom/gsm/protocol/gsm_04_08.h>
8 #include <osmocom/gsm/protocol/gsm_08_58.h>
9 
10 /* Table 5 Clause 7 TS 05.02 */
11 static inline unsigned int
12 gsm0502_get_n_pag_blocks(struct gsm48_control_channel_descr *chan_desc)
13 {
14  if (chan_desc->ccch_conf == RSL_BCCH_CCCH_CONF_1_C)
15  return 3 - chan_desc->bs_ag_blks_res;
16  else
17  return 9 - chan_desc->bs_ag_blks_res;
18 }
19 
20 /* Chapter 6.5.2 of TS 05.02 */
21 static inline unsigned int
22 gsm0502_get_ccch_group(uint64_t imsi, unsigned int bs_cc_chans,
23  unsigned int n_pag_blocks)
24 {
25  return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) / n_pag_blocks;
26 }
27 
28 /* Chapter 6.5.2 of TS 05.02 */
29 static inline unsigned int
30 gsm0502_get_paging_group(uint64_t imsi, unsigned int bs_cc_chans,
31  int n_pag_blocks)
32 {
33  return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) % n_pag_blocks;
34 }
35 
36 unsigned int
37 gsm0502_calc_paging_group(struct gsm48_control_channel_descr *chan_desc, uint64_t imsi);
static unsigned int gsm0502_get_n_pag_blocks(struct gsm48_control_channel_descr *chan_desc)
Definition: gsm0502.h:12
unsigned int gsm0502_calc_paging_group(struct gsm48_control_channel_descr *chan_desc, uint64_t imsi)
Definition: gsm0502.c:30
static unsigned int gsm0502_get_ccch_group(uint64_t imsi, unsigned int bs_cc_chans, unsigned int n_pag_blocks)
Definition: gsm0502.h:22
static unsigned int gsm0502_get_paging_group(uint64_t imsi, unsigned int bs_cc_chans, int n_pag_blocks)
Definition: gsm0502.h:30