diff options
author | Max <msuraev@sysmocom.de> | 2016-04-20 15:57:13 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-04-22 14:55:33 +0200 |
commit | 26679e0475593aca645c7029e1aad899da73217a (patch) | |
tree | b42d881edde2eccfbb350c26def3fd59d9de99db /openbsc/include | |
parent | 27c3e76aa7e0912d3404b96a4a043e7208044d0f (diff) |
Add basic UARFCN support
* add data structures, generation functions
* vty interface for neightbor UARFCNs specific to SI2quater
* vty test
* unit test
Fixes: OS#1666
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/gsm_data_shared.h | 3 | ||||
-rw-r--r-- | openbsc/include/openbsc/rest_octets.h | 8 | ||||
-rw-r--r-- | openbsc/include/openbsc/system_information.h | 9 |
3 files changed, 16 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 52e480583..8658fe717 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -717,6 +717,7 @@ struct gsm_bts { struct bitvec cell_alloc; struct bitvec si5_neigh_list; struct osmo_earfcn_si2q si2quater_neigh_list; + size_t uarfcn_length; /* index for uarfcn and scramble lists */ struct { /* bitmask large enough for all possible ARFCN's */ uint8_t neigh_list[1024/8]; @@ -725,6 +726,8 @@ struct gsm_bts { uint8_t si5_neigh_list[1024/8]; uint8_t meas_bw_list[MAX_EARFCN_LIST]; uint16_t earfcn_list[MAX_EARFCN_LIST]; + uint16_t uarfcn_list[MAX_EARFCN_LIST]; + uint16_t scramble_list[MAX_EARFCN_LIST]; } data; } si_common; diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index fd5ec6a74..32b996317 100644 --- a/openbsc/include/openbsc/rest_octets.h +++ b/openbsc/include/openbsc/rest_octets.h @@ -5,11 +5,13 @@ #include <openbsc/gsm_04_08.h> #include <osmocom/gsm/sysinfo.h> +#define SI2Q_MAX_LEN 160 +#define SI2Q_MIN_LEN 18 + /* generate SI1 rest octets */ int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); -int rest_octets_si2quater(uint8_t *data, - const struct osmo_earfcn_si2q *e, bool uarfcn, - bool earfcn); +int rest_octets_si2quater(uint8_t *data, const struct osmo_earfcn_si2q *e, + const uint16_t *u, const uint16_t *sc, size_t u_len); struct gsm48_si_selection_params { uint16_t penalty_time:5, diff --git a/openbsc/include/openbsc/system_information.h b/openbsc/include/openbsc/system_information.h index 6a5684821..ecc696422 100644 --- a/openbsc/include/openbsc/system_information.h +++ b/openbsc/include/openbsc/system_information.h @@ -6,5 +6,12 @@ struct gsm_bts; int gsm_generate_si(struct gsm_bts *bts, enum osmo_sysinfo_type type); - +uint16_t encode_fdd(uint16_t scramble, bool diversity); +unsigned uarfcn_size(const uint16_t *u, const uint16_t *sc, size_t u_len); +unsigned earfcn_size(const struct osmo_earfcn_si2q *e); +unsigned range1024_p(unsigned n); +unsigned range512_q(unsigned m); +int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble); +int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble, + bool diversity); #endif |