Harald Welte has submitted this change and it was merged.

Change subject: sysinfo: Fix scheduling of downlink SACCH information
......................................................................


sysinfo: Fix scheduling of downlink SACCH information

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
---
M src/common/sysinfo.c
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 3582027..b5fd061 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -163,13 +163,15 @@
 /* obtain the next to-be transmitted dowlink SACCH frame (L2 hdr + L3); 
returns pointer to lchan->si buffer */
 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 GSM_LCHAN_SI(lchan, tmp);
        }
+       LOGP(DL1P, LOGL_NOTICE, "%s SACCH no SI available\n", 
gsm_lchan_name(lchan));
        return NULL;
 }

-- 
To view, visit https://gerrit.osmocom.org/7218
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ica801f9b9c118f00d9e3dc2780b3123e925f59b4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to