diff options
author | Max <msuraev@sysmocom.de> | 2016-03-17 11:51:09 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-03-17 14:07:19 +0100 |
commit | 03309b57e8ba0163032a1d3db6b44fc8a7e6147c (patch) | |
tree | 5da47f69684d70ef0d6cf7d585dd44e558118b95 /include/osmocom/gsm | |
parent | d4793212b5026fed01d132fa7397cc0ff2f543fe (diff) |
Add basic EARFCN support
Add structure representing group of EARFCNs with common priority,
threshold etc.
Add functions to populate this structure.
Diffstat (limited to 'include/osmocom/gsm')
-rw-r--r-- | include/osmocom/gsm/sysinfo.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/include/osmocom/gsm/sysinfo.h b/include/osmocom/gsm/sysinfo.h index 7d1fe2bc..346194e9 100644 --- a/include/osmocom/gsm/sysinfo.h +++ b/include/osmocom/gsm/sysinfo.h @@ -3,6 +3,9 @@ #include <osmocom/core/utils.h> #include <osmocom/gsm/protocol/gsm_04_08.h> +#define OSMO_EARFCN_INVALID 666 +#define OSMO_EARFCN_MEAS_INVALID 0xff + enum osmo_sysinfo_type { SYSINFO_TYPE_NONE, SYSINFO_TYPE_1, @@ -32,9 +35,36 @@ enum osmo_sysinfo_type { _MAX_SYSINFO_TYPE }; +struct earfcn { + /* EARFCN (16 bits) array */ + uint16_t *arfcn; + /* Measurement Bandwidth (3 bits), might be absent + (OSMO_EARFCN_MEAS_INVALID is stored in this case) */ + uint8_t *meas_bw; + /* length of arfcn and meas_bw arrays (got to be the same) */ + size_t length; + /* THRESH_E-UTRAN_high (5 bits) */ + uint8_t thresh_hi; + /* THRESH_E-UTRAN_low (5 bits) */ + uint8_t thresh_lo; + /* E-UTRAN_PRIORITY (3 bits) */ + uint8_t prio; + /* E-UTRAN_QRXLEVMIN */ + uint8_t qrxlm; + /* indicates whether thresh_lo value is valid + thresh_hi is mandatory and hence always considered valid */ + bool thresh_lo_valid; + /* indicates whether prio value is valid */ + bool prio_valid; + /* indicates whether qrxlm value is valid */ + bool qrxlm_valid; +}; + typedef uint8_t sysinfo_buf_t[GSM_MACBLOCK_LEN]; extern const struct value_string osmo_sitype_strs[_MAX_SYSINFO_TYPE]; - +int osmo_earfcn_add(struct earfcn *e, uint16_t arfcn, uint8_t meas_bw); +int osmo_earfcn_del(struct earfcn *e, uint16_t arfcn); +void osmo_earfcn_init(struct earfcn *e); uint8_t osmo_sitype2rsl(enum osmo_sysinfo_type si_type); enum osmo_sysinfo_type osmo_rsl2sitype(uint8_t rsl_si); |