Change in osmo-bsc[master]: generate_ma_for_ts(): fix: properly encode ARFCN 0 (corner case)

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Sep 7 07:51:51 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/19998 )

Change subject: generate_ma_for_ts(): fix: properly encode ARFCN 0 (corner case)
......................................................................

generate_ma_for_ts(): fix: properly encode ARFCN 0 (corner case)

According to 3GPP TS 44.018, table 10.5.2.21.1 "Mobile Allocation
information element", in the cell allocation frequency list the
absolute RF channel numbers are placed in increasing order, except
that ARFCN 0, if included in the set, is put in the last position.

This basically means that the last bit of the Mobile Allocation
(MSB on the wire) corresponds to ARFCN 0, if it's included in
the cell allocation frequency list, or the last channel otherwise.

Recently introduced TTCN-3 test cases uncover the following problems:

  a) ARFCN 0 is encoded twice: as MSB and LSB of the bit-mask,
  b) ARFCN 0 is encoded one bit off its expected location.

Change-Id: I264a66a1405e72940a79e9e20ad6ad8f269a7bbc
Related: SYS#4868, OS#4545
---
M src/osmo-bsc/osmo_bsc_main.c
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 5aa52cf..ebae0a2 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -261,7 +261,7 @@
 	ts->hopping.ma_len = OSMO_BYTES_FOR_BITS(num_cell_arfcns);
 
 	n_chan = 0;
-	for (i = 0; i < 1024; i++) {
+	for (i = 1; i < 1024; i++) {
 		if (!bitvec_get_bit_pos(cell_chan, i))
 			continue;
 		/* set the corresponding bit in the MA */
@@ -275,7 +275,6 @@
 
 	/* ARFCN 0 is special: It is coded last in the bitmask */
 	if (bitvec_get_bit_pos(cell_chan, 0)) {
-		n_chan++;
 		/* set the corresponding bit in the MA */
 		bitnum = (ts->hopping.ma_len * 8) - 1 - n_chan;
 		if (bitvec_get_bit_pos(ts_arfcn, 0))

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/19998
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I264a66a1405e72940a79e9e20ad6ad8f269a7bbc
Gerrit-Change-Number: 19998
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200907/580ce339/attachment.htm>


More information about the gerrit-log mailing list