libosmogsm  0.9.6-15.20170220git32ee5af8.fc34
Osmocom GSM library
gsm0502.h
1 #pragma once
2 
3 #include <stdint.h>
4 
5 #include <osmocom/gsm/protocol/gsm_04_08.h>
7 
8 /* Table 5 Clause 7 TS 05.02 */
9 static inline unsigned int
10 gsm0502_get_n_pag_blocks(struct gsm48_control_channel_descr *chan_desc)
11 {
12  if (chan_desc->ccch_conf == RSL_BCCH_CCCH_CONF_1_C)
13  return 3 - chan_desc->bs_ag_blks_res;
14  else
15  return 9 - chan_desc->bs_ag_blks_res;
16 }
17 
18 /* Chapter 6.5.2 of TS 05.02 */
19 static inline unsigned int
20 gsm0502_get_ccch_group(uint64_t imsi, unsigned int bs_cc_chans,
21  unsigned int n_pag_blocks)
22 {
23  return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) / n_pag_blocks;
24 }
25 
26 /* Chapter 6.5.2 of TS 05.02 */
27 static inline unsigned int
28 gsm0502_get_paging_group(uint64_t imsi, unsigned int bs_cc_chans,
29  int n_pag_blocks)
30 {
31  return (imsi % 1000) % (bs_cc_chans * n_pag_blocks) % n_pag_blocks;
32 }
33 
34 unsigned int
35 gsm0502_calc_paging_group(struct gsm48_control_channel_descr *chan_desc, uint64_t imsi);
Definition: gsm_04_08.h:622