aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-11 21:20:41 +0100
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2018-07-22 22:15:28 +0300
commit79798badd46969a3a2fe398f7faa4fde81dde007 (patch)
treef18308f92f14958249ea34d994a3dbc85a775ce9
parente70baa8e267d50bce4d640c97085f4f33d2f08e6 (diff)
sysinfo: Fix scheduling of downlink SACCH informationfairwaves/package
The existing algorithm (present since 2012!) failed to work in the sole case that only *one* SACCH filling type was present. So if you had your BTS configured to only broadcast SI5, but not broadcast SI5ter, SI6 or any other SACCH filling, it would send the SI5 message only once on a newly-established channel, and never again. The old code was working for more-than-one SACCH filling, as well as for no SACCH filling at all. Let's also add a NOTICE message if there is no SACCH filling available at all. This is highly unusual and definitely a noticeable event. Change-Id: Ica801f9b9c118f00d9e3dc2780b3123e925f59b4 Closes: OS#3057 Related: OS#2963
-rw-r--r--src/common/sysinfo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 177ed58..1a2dd2b 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -148,13 +148,15 @@ uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg)
uint8_t *lchan_sacch_get(struct gsm_lchan *lchan)
{
- uint32_t tmp;
+ uint32_t tmp, i;
- for (tmp = lchan->si.last + 1; tmp != lchan->si.last; tmp = (tmp + 1) % _MAX_SYSINFO_TYPE) {
+ for (i = 0; i < _MAX_SYSINFO_TYPE; i++) {
+ tmp = (lchan->si.last + 1 + i) % _MAX_SYSINFO_TYPE;
if (!(lchan->si.valid & (1 << tmp)))
continue;
lchan->si.last = tmp;
return lchan->si.buf[tmp];
}
+ LOGP(DL1P, LOGL_NOTICE, "%s SACCH no SI available\n", gsm_lchan_name(lchan));
return NULL;
}