libosmogsm  0.9.6.270-38c0
Osmocom GSM library
 All Data Structures Files Functions Variables Enumerations Enumerator Modules Pages
sysinfo.h
1 #pragma once
2 
3 #include <stdbool.h>
4 
5 #include <osmocom/core/defs.h>
6 #include <osmocom/core/utils.h>
7 #include <osmocom/gsm/protocol/gsm_04_08.h>
8 
9 #define OSMO_EARFCN_INVALID 666
10 #define OSMO_EARFCN_MEAS_INVALID 0xff
11 
12 enum osmo_sysinfo_type {
13  SYSINFO_TYPE_NONE,
14  SYSINFO_TYPE_1,
15  SYSINFO_TYPE_2,
16  SYSINFO_TYPE_3,
17  SYSINFO_TYPE_4,
18  SYSINFO_TYPE_5,
19  SYSINFO_TYPE_6,
20  SYSINFO_TYPE_7,
21  SYSINFO_TYPE_8,
22  SYSINFO_TYPE_9,
23  SYSINFO_TYPE_10,
24  SYSINFO_TYPE_13,
25  SYSINFO_TYPE_16,
26  SYSINFO_TYPE_17,
27  SYSINFO_TYPE_18,
28  SYSINFO_TYPE_19,
29  SYSINFO_TYPE_20,
30  SYSINFO_TYPE_2bis,
31  SYSINFO_TYPE_2ter,
32  SYSINFO_TYPE_2quater,
33  SYSINFO_TYPE_5bis,
34  SYSINFO_TYPE_5ter,
35  SYSINFO_TYPE_EMO,
36  SYSINFO_TYPE_MEAS_INFO,
37  /* FIXME all the various bis and ter */
38  _MAX_SYSINFO_TYPE
39 };
40 
42  /* EARFCN (16 bits) array */
43  uint16_t *arfcn;
44  /* Measurement Bandwidth (3 bits), might be absent
45  (OSMO_EARFCN_MEAS_INVALID is stored in this case) */
46  uint8_t *meas_bw;
47  /* length of arfcn and meas_bw arrays (got to be the same) */
48  size_t length;
49  /* THRESH_E-UTRAN_high (5 bits) */
50  uint8_t thresh_hi;
51  /* THRESH_E-UTRAN_low (5 bits) */
52  uint8_t thresh_lo;
53  /* E-UTRAN_PRIORITY (3 bits) */
54  uint8_t prio;
55  /* E-UTRAN_QRXLEVMIN */
56  uint8_t qrxlm;
57  /* indicates whether thresh_lo value is valid
58  thresh_hi is mandatory and hence always considered valid */
59  bool thresh_lo_valid;
60  /* indicates whether prio value is valid */
61  bool prio_valid;
62  /* indicates whether qrxlm value is valid */
63  bool qrxlm_valid;
64 };
65 
66 typedef uint8_t sysinfo_buf_t[GSM_MACBLOCK_LEN];
67 
68 extern const struct value_string osmo_sitype_strs[_MAX_SYSINFO_TYPE];
69 int osmo_earfcn_add(struct osmo_earfcn_si2q *e, uint16_t arfcn, uint8_t meas_bw);
70 int osmo_earfcn_del(struct osmo_earfcn_si2q *e, uint16_t arfcn);
71 size_t osmo_earfcn_bit_size(const struct osmo_earfcn_si2q *e) OSMO_DEPRECATED("Use osmo_earfcn_bit_size_ext()instead.");
72 size_t osmo_earfcn_bit_size_ext(const struct osmo_earfcn_si2q *e, size_t offset);
73 void osmo_earfcn_init(struct osmo_earfcn_si2q *e);
74 uint8_t osmo_sitype2rsl(enum osmo_sysinfo_type si_type);
75 enum osmo_sysinfo_type osmo_rsl2sitype(uint8_t rsl_si);
Definition: sysinfo.h:41