diff options
author | Max <msuraev@sysmocom.de> | 2017-06-02 11:41:58 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-06-15 19:18:47 +0000 |
commit | 340cff51f49f6e798cb5fb6d1b9febdd09902906 (patch) | |
tree | c7b9ac126e9beec32c5137747ab01c8c22d8a7e3 /src/common/sysinfo.c | |
parent | 0b7a3e9f62bd3eaf2a9bf2c75028a91c8072d389 (diff) |
RSL: receive and send multiple SI2q messages
* change BCCH Info handler to explicitly support multiple SI2quater
messages sent from BSC
* change SI scheduler to send SI2q in round-robin way
Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51
Related: OS#1660
Diffstat (limited to 'src/common/sysinfo.c')
-rw-r--r-- | src/common/sysinfo.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7a536274..9276c7bb 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -25,6 +25,16 @@ #include <osmo-bts/logging.h> #include <osmo-bts/gsm_data.h> +/* properly increment SI2q index and return SI2q data for scheduling */ +static inline uint8_t *get_si2q_inc_index(struct gsm_bts *bts) +{ + uint8_t i = bts->si2q_index; + /* si2q_count is the max si2q_index value, not the number of messages */ + bts->si2q_index = (bts->si2q_index + 1) % (bts->si2q_count + 1); + + return (uint8_t *)GSM_BTS_SI2Q(bts, i); +} + /* Apply the rules from 05.02 6.3.1.3 Mapping of BCCH Data */ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) { @@ -99,6 +109,10 @@ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) else { /* increment static counter by one, modulo count */ btsb->si.tc4_ctr = (btsb->si.tc4_ctr + 1) % tc4_cnt; + + if (tc4_sub[btsb->si.tc4_ctr] == SYSINFO_TYPE_2quater) + return get_si2q_inc_index(bts); + return GSM_BTS_SI(bts, tc4_sub[btsb->si.tc4_ctr]); } case 5: @@ -114,7 +128,7 @@ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time) else if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2quater) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2bis) && !GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_2ter)) - return GSM_BTS_SI(bts, SYSINFO_TYPE_2quater); + return get_si2q_inc_index(bts); break; case 6: return GSM_BTS_SI(bts, SYSINFO_TYPE_3); |