aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-09-06 22:39:52 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-09-06 22:40:04 +0700
commite2b20c4aa855fd295b72e090bd1df6cc12bd5993 (patch)
tree305ba4af74c2e298dbe1d05b38b6d8da62b2ce08
parent31fab3e8de568ddf4f88e740397720a705b04612 (diff)
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
-rw-r--r--src/osmo-bsc/osmo_bsc_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 5aa52cf62..ebae0a22e 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -261,7 +261,7 @@ static int generate_ma_for_ts(struct gsm_bts_trx_ts *ts)
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 @@ static int generate_ma_for_ts(struct gsm_bts_trx_ts *ts)
/* 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))