fixeria has uploaded this change for review.

View Change

bitvec2freq_list(): fix handling of E-GSM ARFCNs

According to 3GPP TS 44.018, section 10.5.2.1b.2, only ARFCN values
in range 1..124 can be encoded using the 'bit map 0' format. Before
this patch, ARFCN values belonging to E-GSM band (0, 975..1023) were
ignored in bitvec2freq_list(), and thus not present in the resulting
Cell Channel Description IE.

Let's fix this by falling back to other encoding formats.

Change-Id: I17739e6845cd84e2a81bc406dd532541f7c52cb6
Related: SYS#5854
---
M src/osmo-bsc/system_information.c
1 file changed, 17 insertions(+), 6 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/56/27356/1
diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c
index 974af3a..885bdd3 100644
--- a/src/osmo-bsc/system_information.c
+++ b/src/osmo-bsc/system_information.c
@@ -512,14 +512,25 @@
chan_list[0] = 0;

for (i = 0; i < bv->data_len*8; i++) {
- if (i >= 1 && i <= 124
- && bitvec_get_bit_pos(bv, i)) {
- rc = freq_list_bm0_set_arfcn(chan_list, i);
- if (rc < 0)
- return rc;
+ if (!bitvec_get_bit_pos(bv, i))
+ continue;
+ /* According to 3GPP TS 44.018, section 10.5.2.1b.2, only the
+ * ARFCN values in range 1..124 can be encoded using this format. */
+ if (i == 0 || i > 124) {
+ LOGP(DRR, LOGL_DEBUG, "ARFCN %d exceeds the range 1..124, "
+ "so we cannot use the 'bit map 0' format\n", i);
+ /* Attempt to use a different encoding format */
+ memset(chan_list, 0, 16);
+ rc = -ERANGE;
+ break;
}
+ rc = freq_list_bm0_set_arfcn(chan_list, i);
+ if (rc < 0)
+ return rc;
}
- return 0;
+
+ if (rc == 0)
+ return 0;
}

for (i = 0; i < bv->data_len*8; i++) {

To view, visit change 27356. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I17739e6845cd84e2a81bc406dd532541f7c52cb6
Gerrit-Change-Number: 27356
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange