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