diff options
author | Max <msuraev@sysmocom.de> | 2017-05-15 12:02:29 +0200 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-05-15 15:13:01 +0200 |
commit | 845a3a4c594f56fc754eae3b261675b460aec2ac (patch) | |
tree | 35990cab7d93defbd677f64264e1a04f365b6e1e /openbsc/src/libbsc/system_information.c | |
parent | f39d03ad21d8120af847603d9b2ead71b8c4ba43 (diff) |
SI2quater: fix EARFCN inclusion check
Previously only the existance of bts->si_common.si2quater_neigh_list was
checked but not the actual number of EARFCNs in it. Fix it by using
si2q_earfcn_count() and adjust tests accordingly. While at it - reformat
tests to include extra information.
The correctness was checked manually by inspecting GSMTAP output.
Change-Id: Ic4fb2a9e870db66cac58b1e8d113587b30d64ce2
Related: RT#8792
Diffstat (limited to 'openbsc/src/libbsc/system_information.c')
-rw-r--r-- | openbsc/src/libbsc/system_information.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 0496506b6..644bebdf4 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -692,6 +692,10 @@ static inline bool si2quater_not_needed(struct gsm_bts *bts) size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e) { unsigned i, ret = 0; + + if (!e) + return 0; + for (i = 0; i < e->length; i++) if (e->arfcn[i] != OSMO_EARFCN_INVALID) ret++; @@ -777,7 +781,8 @@ static int generate_si3(enum osmo_sysinfo_type t, struct gsm_bts *bts) si_info.si2ter_indicator = 0; } if ((bts->si_valid & (1 << SYSINFO_TYPE_2quater))) { - LOGP(DRR, LOGL_INFO, "SI 2quater is included.\n"); + LOGP(DRR, LOGL_INFO, "SI 2quater is included, based on %zu EARFCNs and %zu UARFCNs.\n", + si2q_earfcn_count(&bts->si_common.si2quater_neigh_list), bts->si_common.uarfcn_length); si_info.si2quater_indicator = 1; } else { si_info.si2quater_indicator = 0; |