<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/19998">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">generate_ma_for_ts(): fix: properly encode ARFCN 0 (corner case)<br><br>According to 3GPP TS 44.018, table 10.5.2.21.1 "Mobile Allocation<br>information element", in the cell allocation frequency list the<br>absolute RF channel numbers are placed in increasing order, except<br>that ARFCN 0, if included in the set, is put in the last position.<br><br>This basically means that the last bit of the Mobile Allocation<br>(MSB on the wire) corresponds to ARFCN 0, if it's included in<br>the cell allocation frequency list, or the last channel otherwise.<br><br>Recently introduced TTCN-3 test cases uncover the following problems:<br><br>  a) ARFCN 0 is encoded twice: as MSB and LSB of the bit-mask,<br>  b) ARFCN 0 is encoded one bit off its expected location.<br><br>Change-Id: I264a66a1405e72940a79e9e20ad6ad8f269a7bbc<br>Related: SYS#4868, OS#4545<br>---<br>M src/osmo-bsc/osmo_bsc_main.c<br>1 file changed, 1 insertion(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/98/19998/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c</span><br><span>index 5aa52cf..ebae0a2 100644</span><br><span>--- a/src/osmo-bsc/osmo_bsc_main.c</span><br><span>+++ b/src/osmo-bsc/osmo_bsc_main.c</span><br><span>@@ -261,7 +261,7 @@</span><br><span>     ts->hopping.ma_len = OSMO_BYTES_FOR_BITS(num_cell_arfcns);</span><br><span> </span><br><span>    n_chan = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-     for (i = 0; i < 1024; i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+       for (i = 1; i < 1024; i++) {</span><br><span>              if (!bitvec_get_bit_pos(cell_chan, i))</span><br><span>                       continue;</span><br><span>            /* set the corresponding bit in the MA */</span><br><span>@@ -275,7 +275,6 @@</span><br><span> </span><br><span>  /* ARFCN 0 is special: It is coded last in the bitmask */</span><br><span>    if (bitvec_get_bit_pos(cell_chan, 0)) {</span><br><span style="color: hsl(0, 100%, 40%);">-         n_chan++;</span><br><span>            /* set the corresponding bit in the MA */</span><br><span>            bitnum = (ts->hopping.ma_len * 8) - 1 - n_chan;</span><br><span>           if (bitvec_get_bit_pos(ts_arfcn, 0))</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/19998">change 19998</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bsc/+/19998"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I264a66a1405e72940a79e9e20ad6ad8f269a7bbc </div>
<div style="display:none"> Gerrit-Change-Number: 19998 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>