From 6f0e50c8337355eb59033903ede9ab6528890835 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 12 Apr 2017 15:30:54 +0200 Subject: Prepare for extended SI2quater support Supporting SI2quater as per 3GPP TS 44.018 will require chnages to the way System Information is stored because it uses 1:n instead of 1:1 mapping between SI type and generated SI content. This should not affect other SI types though. To facilitate this transition: * convert the code to always use GSM_BTS_SI helper instead of accessing buffer directly * make helper more robust by adding extra parenthesis * add similar helper for gsm_lchan * add function estimating number of SI2quater message to hold configured number of (U|E)ARFCNs * add SI2q index/count fields and pass them to rest_octets generator explicitly * internalize buffer access in generate_si* functions Change-Id: I74e4e3cb86364cec869a1472a41b4a95af0d50dd Related: RT#8792 --- openbsc/tests/gsm0408/gsm0408_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'openbsc/tests') diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 08cf43f50..81dc177d7 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -99,13 +99,12 @@ static inline void gen(struct gsm_bts *bts) bts->si_valid = 0; bts->si_valid |= (1 << SYSINFO_TYPE_2quater); /* should be no-op as entire buffer is filled with padding: */ - memset(bts->si_buf[SYSINFO_TYPE_2quater], 0xAE, GSM_MACBLOCK_LEN); + memset(GSM_BTS_SI(bts, SYSINFO_TYPE_2quater), 0xAE, GSM_MACBLOCK_LEN); int r = gsm_generate_si(bts, SYSINFO_TYPE_2quater); bool v = bts->si_valid & (1 << SYSINFO_TYPE_2quater); if (r > 0) printf("generated %s SI2quater: [%d] %s\n", - v ? "valid" : "invalid", r, - osmo_hexdump(bts->si_buf[SYSINFO_TYPE_2quater], r)); + v ? "valid" : "invalid", r, osmo_hexdump(GSM_BTS_SI(bts, SYSINFO_TYPE_2quater), r)); else printf("failed to generate SI2quater: %s\n", strerror(-r)); } -- cgit v1.2.3