diff mbox

openbsc[master]: Make si2q scheduling optional

Message ID gerrit.1463569751064.Ibe997803ffb894133fd4d838410fe735791d414f@gerrit.osmocom.org
State New
Headers show

Commit Message

gerrit-no-reply@lists.osmocom.org May 18, 2016, 11:09 a.m. UTC
Review at  https://gerrit.osmocom.org/81

Make si2q scheduling optional

Previously si2quater SI messages were always scheduled. Check for
neighbor configuration and only schedule si2q when necessary.

Change-Id: Ibe997803ffb894133fd4d838410fe735791d414f
Fixes: OS#1727
---
M openbsc/src/libbsc/system_information.c
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/81/81/1

Comments

gerrit-no-reply@lists.osmocom.org May 23, 2016, 8:26 p.m. UTC | #1
Patch Set 2:

Is there any way we can get a testcase for that? With broken/odd/unusual SIs phones might never attempt to attach to a network. It would be good to have some form of regression test to make sure that with a standard config these SIs don't change.
gerrit-no-reply@lists.osmocom.org May 30, 2016, 9:28 p.m. UTC | #2
Patch Set 4: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/81/4/openbsc/tests/gsm0408/gsm0408_test.ok
File openbsc/tests/gsm0408/gsm0408_test.ok:

Line 66: generated invalid SI2quater: [23] 59 06 07 c0 00 04 86 59 0a 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 
Can you say why it is invalid and why something is printed? Could you initialize with 0xAE before to see which bits were written?
gerrit-no-reply@lists.osmocom.org May 31, 2016, 8 a.m. UTC | #3
Patch Set 4:

That's how generation works for other SI - function for rest_octets is called and fills the buffer. If there's an error than buffer is not cleared, but the SI marked as invalid. I've added clarification comments into test code.
gerrit-no-reply@lists.osmocom.org May 31, 2016, 9:32 a.m. UTC | #4
Patch Set 5: Code-Review+2
diff mbox

Patch

diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c
index 1f1d81e..8e59817 100644
--- a/openbsc/src/libbsc/system_information.c
+++ b/openbsc/src/libbsc/system_information.c
@@ -648,7 +648,7 @@ 
 
 static int generate_si2quater(uint8_t *output, struct gsm_bts *bts)
 {
-	int rc;
+	int rc, i;
 	struct gsm48_system_information_type_2quater *si2q =
 		(struct gsm48_system_information_type_2quater *) output;
 
@@ -667,6 +667,13 @@ 
 	if (rc < 0)
 		return rc;
 
+	for (i = 0; i < MAX_EARFCN_LIST; i++)
+		if (bts->si_common.si2quater_neigh_list.arfcn[i] !=
+		    OSMO_EARFCN_INVALID)
+			break;
+	if (!bts->si_common.uarfcn_length && i == MAX_EARFCN_LIST)
+		bts->si_valid &= ~(1 << SYSINFO_TYPE_2quater);
+
 	return sizeof(*si2q) + rc;
 }