<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19323">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  neels: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">library/PCUIF_Types: version 10: add frequency hopping parameters<br><br>This change introduces new version 10 specific extensions, in<br>particular: the frequency hopping parameters of each timeslot.<br>These parameters are used to compose Channel Description IE<br>in the packet resource assignment messages.<br><br>In order to maintain backwards compatibility with version 9 of<br>the PCUIF, and thus to still be able to run test cases against<br>the latest release of osmo-pcu, I kept the old parts of the<br>INFO.ind and gruoped them together with the new records<br>into union 'PCUIF_InfoTrxs'.<br><br>During decoding, the content of this union is resolved by the<br>TITAN's RAW codec itself, depending on value of the 'version'<br>field.  During the encoding, it's the responsibility of the<br>API user to set a proper field of the union.  I implemented<br>both f_PCUIF_ver_INFO_{Trxs,PDCHMask} helpers for that.<br><br>Version 9 is kept as default, so this change can be merged<br>independently of the actual implementation.  We can bump<br>it and remove the compatibility glue once the new versions<br>of both osmo-bts and osmo-pcu are released.<br><br>Change-Id: Idf11bc4ba3ff0b00b32f2beab8fd020c67119d05<br>Related: SYS#4868, OS#4547<br>---<br>M bts/BTS_Tests.ttcn<br>M library/PCUIF_Types.ttcn<br>M pcu/PCU_Tests.ttcn<br>3 files changed, 107 insertions(+), 13 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn</span><br><span>index 1c8127b..dfda043 100644</span><br><span>--- a/bts/BTS_Tests.ttcn</span><br><span>+++ b/bts/BTS_Tests.ttcn</span><br><span>@@ -5444,7 +5444,7 @@</span><br><span>   var PCUIF_send_data sd;</span><br><span> </span><br><span>  [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {</span><br><span style="color: hsl(0, 100%, 40%);">-          var bitstring pdch_mask := sd.data.u.info_ind.trx[trx_nr].pdch_mask;</span><br><span style="color: hsl(120, 100%, 40%);">+          var bitstring pdch_mask := f_PCUIF_ver_INFO_PDCHMask(sd.data.u.info_ind, trx_nr);</span><br><span>            if (substr(pdch_mask, g_chan_nr.tn, 1) != exp) {</span><br><span>                     repeat;</span><br><span>              }</span><br><span>diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn</span><br><span>index 089403c..1c5b0af 100644</span><br><span>--- a/library/PCUIF_Types.ttcn</span><br><span>+++ b/library/PCUIF_Types.ttcn</span><br><span>@@ -20,7 +20,7 @@</span><br><span> };</span><br><span> </span><br><span> const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts";</span><br><span style="color: hsl(0, 100%, 40%);">-type integer PCUIF_Version (9); /* supported versions */</span><br><span style="color: hsl(120, 100%, 40%);">+type integer PCUIF_Version (9..10); /* supported versions */</span><br><span> </span><br><span> type enumerated PCUIF_MsgType {</span><br><span>  PCU_IF_MSG_DATA_REQ             ('00'O),</span><br><span>@@ -140,14 +140,38 @@</span><br><span>     uint8_t         ts_nr</span><br><span> } with { variant "" };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-type record PCUIF_InfoTrx {</span><br><span style="color: hsl(120, 100%, 40%);">+type record PCUIF_InfoTrxTs {</span><br><span style="color: hsl(120, 100%, 40%);">+       uint8_t                 tsc,</span><br><span style="color: hsl(120, 100%, 40%);">+  uint8_t                 hopping,</span><br><span style="color: hsl(120, 100%, 40%);">+      uint8_t                 hsn,</span><br><span style="color: hsl(120, 100%, 40%);">+  uint8_t                 maio,</span><br><span style="color: hsl(120, 100%, 40%);">+ bitstring               ma length(64)</span><br><span style="color: hsl(120, 100%, 40%);">+} with { variant (ma) "BYTEORDER(first), BITORDER(msb)" };</span><br><span style="color: hsl(120, 100%, 40%);">+private type record length(8) of PCUIF_InfoTrxTs PCUIF_InfoTrxTsList;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Version >= 10 specific coding */</span><br><span style="color: hsl(120, 100%, 40%);">+private type record PCUIF_InfoV10Trx {</span><br><span style="color: hsl(120, 100%, 40%);">+  uint16_t                arfcn,</span><br><span style="color: hsl(120, 100%, 40%);">+        BIT8                    pdch_mask,</span><br><span style="color: hsl(120, 100%, 40%);">+    uint32_t                hLayer1,</span><br><span style="color: hsl(120, 100%, 40%);">+      PCUIF_InfoTrxTsList     ts</span><br><span style="color: hsl(120, 100%, 40%);">+} with { variant (pdch_mask) "BITORDER(msb)" };</span><br><span style="color: hsl(120, 100%, 40%);">+private type record length(8) of PCUIF_InfoV10Trx PCUIF_InfoV10TrxList;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Version <= 9 specific coding */</span><br><span style="color: hsl(120, 100%, 40%);">+private type record PCUIF_InfoV09Trx {</span><br><span>      uint16_t        arfcn,</span><br><span>       BIT8            pdch_mask,</span><br><span>   OCT1            spare,</span><br><span>       OCT8            tsc,</span><br><span>         uint32_t        hLayer1</span><br><span> } with { variant (pdch_mask) "BITORDER(msb)" };</span><br><span style="color: hsl(0, 100%, 40%);">-type record length(8) of PCUIF_InfoTrx PCUIF_InfoTrxs;</span><br><span style="color: hsl(120, 100%, 40%);">+private type record length(8) of PCUIF_InfoV09Trx PCUIF_InfoV09TrxList;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+type union PCUIF_InfoTrxs {</span><br><span style="color: hsl(120, 100%, 40%);">+    PCUIF_InfoV09TrxList    v09,</span><br><span style="color: hsl(120, 100%, 40%);">+  PCUIF_InfoV10TrxList    v10</span><br><span style="color: hsl(120, 100%, 40%);">+} with { variant "" };</span><br><span> </span><br><span> type record PCUIF_info_ind {</span><br><span>    uint32_t        version,</span><br><span>@@ -187,7 +211,11 @@</span><br><span>      record length(2) of uint16_t    local_pprt,</span><br><span>  record length(2) of uint16_t    remote_port,</span><br><span>         record length(2) of OCT4        remote_ip</span><br><span style="color: hsl(0, 100%, 40%);">-} with { variant "" }</span><br><span style="color: hsl(120, 100%, 40%);">+} with {</span><br><span style="color: hsl(120, 100%, 40%);">+    /* NOTE: TITAN is not smart enough to handle 'version < 10' and 'version > 9',</span><br><span style="color: hsl(120, 100%, 40%);">+   * so we cannot support more than two versions at the same time here. Sigh. */</span><br><span style="color: hsl(120, 100%, 40%);">+        variant (trx) "CROSSTAG(v09, version = 9; v10, version = 10)"</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span> </span><br><span> type record PCUIF_act_req {</span><br><span>       uint8_t         is_activate,</span><br><span>@@ -676,9 +704,41 @@</span><br><span>  spare2 := '000'B</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               template (value) BIT8 pdch_mask := '00000001'B,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         OCT1 tsc := '07'O) := {</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) PCUIF_InfoTrxTs ts_PCUIF_InfoTrxTsH0(template (value) uint3_t tsc := 7) := {</span><br><span style="color: hsl(120, 100%, 40%);">+        tsc := tsc,</span><br><span style="color: hsl(120, 100%, 40%);">+   hopping := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+ hsn := 0, maio := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+  ma := f_pad_bit(''B, 64, '0'B)</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) PCUIF_InfoTrxTs ts_PCUIF_InfoTrxTsH1(template (value) uint3_t tsc := 7,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                      template (value) uint6_t hsn := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                    template (value) uint6_t maio := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                   template (value) bitstring ma := ''B) := {</span><br><span style="color: hsl(120, 100%, 40%);">+      tsc := tsc,</span><br><span style="color: hsl(120, 100%, 40%);">+   hopping := 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ hsn := hsn,</span><br><span style="color: hsl(120, 100%, 40%);">+   maio := maio,</span><br><span style="color: hsl(120, 100%, 40%);">+ ma := f_pad_bit(valueof(ma), 64, '0'B)</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) PCUIF_InfoV10Trx ts_PCUIF_InfoV10Trx(template (value) uint16_t arfcn := 871,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                 template (value) BIT8 pdch_mask := '00000001'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               template (value) uint3_t tsc := 7) := {</span><br><span style="color: hsl(120, 100%, 40%);">+ arfcn := arfcn,</span><br><span style="color: hsl(120, 100%, 40%);">+       pdch_mask := pdch_mask,</span><br><span style="color: hsl(120, 100%, 40%);">+       hLayer1 := 0,</span><br><span style="color: hsl(120, 100%, 40%);">+ ts := {</span><br><span style="color: hsl(120, 100%, 40%);">+               ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc),</span><br><span style="color: hsl(120, 100%, 40%);">+         ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc),</span><br><span style="color: hsl(120, 100%, 40%);">+         ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc),</span><br><span style="color: hsl(120, 100%, 40%);">+         ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc)</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) PCUIF_InfoV09Trx ts_PCUIF_InfoV09Trx(template (value) uint16_t arfcn := 871,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                      template (value) BIT8 pdch_mask := '00000001'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               OCT1 tsc := '07'O) := {</span><br><span>        arfcn := arfcn,</span><br><span>      pdch_mask := pdch_mask,</span><br><span>      spare := '00'O,</span><br><span>@@ -686,11 +746,25 @@</span><br><span>      hLayer1 := 0</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrxNULL := ts_PCUIF_InfoTrx(0, '00000000'B, '00'O);</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) PCUIF_InfoV09Trx ts_PCUIF_InfoV09TrxNULL := ts_PCUIF_InfoV09Trx(0, '00000000'B, '00'O);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-template (value) PCUIF_InfoTrxs ts_PCUIF_InfoTrxs_def := {</span><br><span style="color: hsl(0, 100%, 40%);">-            ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL,</span><br><span style="color: hsl(0, 100%, 40%);">-             ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL };</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) PCUIF_InfoTrxs ts_PCUIF_InfoV09Trxs_def := {</span><br><span style="color: hsl(120, 100%, 40%);">+      v09 := {</span><br><span style="color: hsl(120, 100%, 40%);">+              ts_PCUIF_InfoV09Trx, ts_PCUIF_InfoV09TrxNULL,</span><br><span style="color: hsl(120, 100%, 40%);">+         ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL,</span><br><span style="color: hsl(120, 100%, 40%);">+             ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL,</span><br><span style="color: hsl(120, 100%, 40%);">+             ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) PCUIF_InfoTrxs ts_PCUIF_InfoV10Trxs_def := {</span><br><span style="color: hsl(120, 100%, 40%);">+        v10 := {</span><br><span style="color: hsl(120, 100%, 40%);">+              ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx,</span><br><span style="color: hsl(120, 100%, 40%);">+             ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx,</span><br><span style="color: hsl(120, 100%, 40%);">+             ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx,</span><br><span style="color: hsl(120, 100%, 40%);">+             ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span> </span><br><span> template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr,</span><br><span>                                                template (value) PCUIF_info_ind info_ind) := {</span><br><span>@@ -830,4 +904,24 @@</span><br><span> }</span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* TODO: remove this as soon as we drop version 9 support */</span><br><span style="color: hsl(120, 100%, 40%);">+function f_PCUIF_ver_INFO_Trxs()</span><br><span style="color: hsl(120, 100%, 40%);">+return PCUIF_InfoTrxs {</span><br><span style="color: hsl(120, 100%, 40%);">+  if (PCUIF_Types.mp_pcuif_version >= 10) {</span><br><span style="color: hsl(120, 100%, 40%);">+          return valueof(ts_PCUIF_InfoV10Trxs_def);</span><br><span style="color: hsl(120, 100%, 40%);">+     } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              return valueof(ts_PCUIF_InfoV09Trxs_def);</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+function f_PCUIF_ver_INFO_PDCHMask(in PCUIF_info_ind info, uint8_t trx_nr)</span><br><span style="color: hsl(120, 100%, 40%);">+return bitstring {</span><br><span style="color: hsl(120, 100%, 40%);">+        if (PCUIF_Types.mp_pcuif_version >= 10) {</span><br><span style="color: hsl(120, 100%, 40%);">+          return info.trx.v10[trx_nr].pdch_mask;</span><br><span style="color: hsl(120, 100%, 40%);">+        } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              return info.trx.v09[trx_nr].pdch_mask;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> } with { encode "RAW" variant "BYTEORDER(first)" };</span><br><span>diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn</span><br><span>index f919dbe..dab87e0 100644</span><br><span>--- a/pcu/PCU_Tests.ttcn</span><br><span>+++ b/pcu/PCU_Tests.ttcn</span><br><span>@@ -62,7 +62,7 @@</span><br><span> friend template (value) PCUIF_info_ind ts_PCUIF_INFO_default := {</span><br><span>    version := PCUIF_Types.mp_pcuif_version,</span><br><span>     flags := c_PCUIF_Flags_default,</span><br><span style="color: hsl(0, 100%, 40%);">- trx := valueof(ts_PCUIF_InfoTrxs_def),</span><br><span style="color: hsl(120, 100%, 40%);">+        trx := f_PCUIF_ver_INFO_Trxs(),</span><br><span>      bsic := 7,</span><br><span>   mcc := 262,</span><br><span>  mnc := 42,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19323">change 19323</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-ttcn3-hacks/+/19323"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Idf11bc4ba3ff0b00b32f2beab8fd020c67119d05 </div>
<div style="display:none"> Gerrit-Change-Number: 19323 </div>
<div style="display:none"> Gerrit-PatchSet: 11 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>