[layer23] use gsm48_decode_freq_list() which has been moved into libosmocore
[osmocom-bb.git] / src / host / layer23 / include / osmocom / bb / mobile / sysinfo.h
1 #ifndef _SYSINFO_H
2 #define _SYSINFO_H
3
4 #include <osmocore/gsm48_ie.h>
5
6 /* collection of system information of the current cell */
7
8 /* frequency mask flags of frequency type */
9 #define FREQ_TYPE_SERV          0x01 /* frequency of the serving cell */
10 #define FREQ_TYPE_HOPP          0x02 /* frequency used for channel hopping */
11 #define FREQ_TYPE_NCELL         0x1c /* frequency of the neighbor cell */
12 #define FREQ_TYPE_NCELL_2       0x04 /* sub channel of SI 2 */
13 #define FREQ_TYPE_NCELL_2bis    0x08 /* sub channel of SI 2bis */
14 #define FREQ_TYPE_NCELL_2ter    0x10 /* sub channel of SI 2ter */
15 #define FREQ_TYPE_REP           0xe0 /* frequency to be reported */
16 #define FREQ_TYPE_REP_5         0x20 /* sub channel of SI 5 */
17 #define FREQ_TYPE_REP_5bis      0x40 /* sub channel of SI 5bis */
18 #define FREQ_TYPE_REP_5ter      0x80 /* sub channel of SI 5ter */
19 #define FREQ_TYPE_SI_2_5        0xfc /* both SI 2 and SI 5 */
20
21 /* structure of all received system informations */
22 struct gsm48_sysinfo {
23         /* flags of available information */
24         uint8_t                         si1, si2, si2bis, si2ter, si3,
25                                         si4, si5, si5bis, si5ter, si6;
26
27         /* memory maps to simply detect change in system info messages */
28         uint8_t                         si1_msg[23];
29         uint8_t                         si2_msg[23];
30         uint8_t                         si2b_msg[23];
31         uint8_t                         si2t_msg[23];
32         uint8_t                         si3_msg[23];
33         uint8_t                         si4_msg[23];
34         uint8_t                         si5_msg[18];
35         uint8_t                         si5b_msg[18];
36         uint8_t                         si5t_msg[18];
37         uint8_t                         si6_msg[18];
38
39         struct  gsm_sysinfo_freq        freq[1024]; /* all frequencies */
40         uint16_t                        hopping[64]; /* hopping arfcn */
41         uint8_t                         hopp_len;
42
43         /* serving cell */
44         uint16_t                        cell_id;
45         uint16_t                        mcc, mnc, lac; /* LAI */
46         uint8_t                         max_retrans; /* decoded */
47         uint8_t                         tx_integer; /* decoded */
48         uint8_t                         reest_denied; /* 1 = denied */
49         uint8_t                         cell_barr; /* 1 = barred */
50         uint16_t                        class_barr; /* bit 10 is emergency */
51
52         /* si3 rest */
53         uint8_t                         sp;
54         uint8_t                         sp_cbq;
55         uint8_t                         sp_cro;
56         uint8_t                         sp_to;
57         uint8_t                         sp_pt;
58         uint8_t                         po;
59         uint8_t                         po_value;
60         uint8_t                         si2ter_ind;
61         uint8_t                         ecsm;
62         uint8_t                         sched;
63         uint8_t                         sched_where;
64         uint8_t                         gi_ra_colour;
65         uint8_t                         gi_si13_pos;
66
67         /* cell selection */
68         int8_t                          ms_txpwr_max_cch;
69         int8_t                          cell_resel_hyst_db;
70         int8_t                          rxlev_acc_min_db;
71         uint8_t                         neci;
72         uint8_t                         acs;
73         /* bcch options */
74         uint8_t                         bcch_radio_link_timeout;
75         uint8_t                         bcch_dtx;
76         uint8_t                         bcch_pwrc;
77         /* sacch options */
78         uint8_t                         sacch_radio_link_timeout;
79         uint8_t                         sacch_dtx;
80         uint8_t                         sacch_pwrc;
81         /* control channel */
82         uint8_t                         ccch_conf;
83         uint8_t                         bs_ag_blks_res;
84         uint8_t                         att_allowed;
85         uint8_t                         pag_mf_periods;
86         int32_t                         t3212; /* real value in seconds */
87         /* channel description */
88         uint8_t                         tsc;
89         uint8_t                         h; /* using hopping */
90         uint16_t                        arfcn;
91         uint8_t                         maio;
92         uint8_t                         hsn;
93         uint8_t                         chan_nr; /* type, slot, sub slot */
94
95         /* neighbor cell */
96         uint8_t                         nb_ext_ind_si2;
97         uint8_t                         nb_ba_ind_si2;
98         uint8_t                         nb_ext_ind_si2bis;
99         uint8_t                         nb_ba_ind_si2bis;
100         uint8_t                         nb_multi_rep_si2ter; /* see GSM 05.08 8.4.3 */
101         uint8_t                         nb_ext_ind_si5;
102         uint8_t                         nb_ba_ind_si5;
103         uint8_t                         nb_ext_ind_si5bis;
104         uint8_t                         nb_ba_ind_si5bis;
105         uint8_t                         nb_multi_rep_si5ter;
106         uint8_t                         nb_ncc_permitted;
107         uint8_t                         nb_max_retrans; /* decoded */
108         uint8_t                         nb_tx_integer; /* decoded */
109         uint8_t                         nb_reest_denied; /* 1 = denied */
110         uint8_t                         nb_cell_barr; /* 1 = barred */
111         uint16_t                        nb_class_barr; /* bit 10 is emergency */
112 };
113
114 int gsm48_sysinfo_dump(struct gsm48_sysinfo *s, uint16_t arfcn,
115                         void (*print)(void *, const char *, ...), void *priv);
116
117 #endif /* _SYSINFO_H */