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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">rlcmac: support decode FDD_CELL_INFORMATION of "UTRAN FDD Description<br><br>Port of patch (+ later fixes squashed) of wireshark.git commit<br>dea5452b95dfaf18e38670a8e2b3b38f9175fdfd, from Lei Chen:<br>https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6856<br><br>Squashed wireshark.git fix commits:<br>774be29de0b4d93d01aecb1518c41d7d551071a9<br>51c31cd7bd3d8fc196a9f90a8af466ad84e9e6a8<br>6aca10831f86c562970b13efa811f46e25ee3091<br>c1ceac58cdb77051e9bd14c1f6f7669cf5779a86<br><br>Change-Id: I08523bc1bbdffde479ef974b4c7b56cfa5639591<br>---<br>M src/csn1.c<br>M src/csn1.h<br>M src/gsm_rlcmac.c<br>3 files changed, 247 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/csn1.c b/src/csn1.c</span><br><span>index 7172847..36b6882 100644</span><br><span>--- a/src/csn1.c</span><br><span>+++ b/src/csn1.c</span><br><span>@@ -1433,7 +1433,13 @@</span><br><span> </span><br><span>       case CSN_CALLBACK:</span><br><span>       {</span><br><span style="color: hsl(0, 100%, 40%);">-        return ProcessError(readIndex,"csnStreamDecoder Callback not implemented", -1, pDescr);</span><br><span style="color: hsl(120, 100%, 40%);">+        guint16  no_of_bits;</span><br><span style="color: hsl(120, 100%, 40%);">+        DissectorCallbackFcn_t callback = (DissectorCallbackFcn_t)pDescr->aux_fn;</span><br><span style="color: hsl(120, 100%, 40%);">+        LOGPC(DCSN1, LOGL_DEBUG, "CSN_CALLBACK(%s) | ", pDescr->sz);</span><br><span style="color: hsl(120, 100%, 40%);">+        no_of_bits = callback(vector, readIndex, pvDATA(data, pDescr->i), pvDATA(data, pDescr->offset));</span><br><span style="color: hsl(120, 100%, 40%);">+        remaining_bits_len -= no_of_bits;</span><br><span style="color: hsl(120, 100%, 40%);">+        bit_offset += no_of_bits;</span><br><span style="color: hsl(120, 100%, 40%);">+        pDescr++;</span><br><span>         break;</span><br><span>       }</span><br><span> </span><br><span>diff --git a/src/csn1.h b/src/csn1.h</span><br><span>index a637d57..d178ada 100644</span><br><span>--- a/src/csn1.h</span><br><span>+++ b/src/csn1.h</span><br><span>@@ -71,6 +71,8 @@</span><br><span> } csnStream_t;</span><br><span> </span><br><span> typedef gint16 (*StreamSerializeFcn_t)(csnStream_t* ar, struct bitvec *vector, unsigned *readIndex, void* data);</span><br><span style="color: hsl(120, 100%, 40%);">+typedef CSN_CallBackStatus_t (*DissectorCallbackFcn_t)(struct bitvec *vector, unsigned *readIndex, void* param1, void* param2);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> typedef enum</span><br><span> {</span><br><span>   CSN_END = 0,</span><br><span>diff --git a/src/gsm_rlcmac.c b/src/gsm_rlcmac.c</span><br><span>index 5a6634c..b421624 100644</span><br><span>--- a/src/gsm_rlcmac.c</span><br><span>+++ b/src/gsm_rlcmac.c</span><br><span>@@ -37,6 +37,7 @@</span><br><span> /* Initialize the protocol and registered fields</span><br><span> */</span><br><span> #include <assert.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <arpa/inet.h></span><br><span> #include <gprs_debug.h></span><br><span> </span><br><span> /* Payload type as defined in TS 44.060 / 10.4.7 */</span><br><span>@@ -2637,12 +2638,27 @@</span><br><span>   M_TYPE       (Cell_Selection_Params_With_FreqDiff_t, Cell_SelectionParams, Cell_Selection_t),</span><br><span> CSN_DESCR_END  (Cell_Selection_Params_With_FreqDiff_t)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+CSN_CallBackStatus_t callback_init_Cell_Selection_Params_FREQUENCY_DIFF(struct bitvec *vector, void* param1, void* param2, int bit_offset)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    guint  i;</span><br><span style="color: hsl(120, 100%, 40%);">+    guint8 freq_diff_len = *(guint8*)param1;</span><br><span style="color: hsl(120, 100%, 40%);">+    Cell_Selection_Params_With_FreqDiff_t *pCell_Sel_Param = (Cell_Selection_Params_With_FreqDiff_t*)param2;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    for( i=0; i<16; i++, pCell_Sel_Param++ )</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+        pCell_Sel_Param->FREQ_DIFF_LENGTH = freq_diff_len;</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%);">+    return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static const</span><br><span> CSN_DESCR_BEGIN(NeighbourCellParameters_t)</span><br><span>   M_UINT       (NeighbourCellParameters_t,  START_FREQUENCY,  10),</span><br><span>   M_TYPE       (NeighbourCellParameters_t, Cell_Selection, Cell_Selection_t),</span><br><span>   M_UINT       (NeighbourCellParameters_t,  NR_OF_REMAINING_CELLS,  4),</span><br><span>   M_UINT_OFFSET(NeighbourCellParameters_t, FREQ_DIFF_LENGTH, 3, 1),/* offset 1 */</span><br><span style="color: hsl(120, 100%, 40%);">+  M_CALLBACK   (NeighbourCellParameters_t, callback_init_Cell_Selection_Params_FREQUENCY_DIFF, FREQ_DIFF_LENGTH, Cell_Selection_Params_With_FreqDiff),</span><br><span>   M_VAR_TARRAY (NeighbourCellParameters_t, Cell_Selection_Params_With_FreqDiff, Cell_Selection_Params_With_FreqDiff_t, NR_OF_REMAINING_CELLS),</span><br><span> CSN_DESCR_END  (NeighbourCellParameters_t)</span><br><span> </span><br><span>@@ -2741,6 +2757,20 @@</span><br><span>   M_TYPE       (CellSelectionParamsWithFreqDiff_t, CellSelectionParams, Cell_Selection_2_t),</span><br><span> CSN_DESCR_END  (CellSelectionParamsWithFreqDiff_t)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+CSN_CallBackStatus_t callback_init_Cell_Sel_Param_2_FREQUENCY_DIFF(struct bitvec *vector, void* param1, void* param2, int bit_offset)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    guint  i;</span><br><span style="color: hsl(120, 100%, 40%);">+    guint8 freq_diff_len = *(guint8*)param1;</span><br><span style="color: hsl(120, 100%, 40%);">+    CellSelectionParamsWithFreqDiff_t *pCell_Sel_Param = (CellSelectionParamsWithFreqDiff_t*)param2;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    for( i=0; i<16; i++, pCell_Sel_Param++ )</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+        pCell_Sel_Param->FREQ_DIFF_LENGTH = freq_diff_len;</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%);">+    return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static const</span><br><span> CSN_DESCR_BEGIN(Add_Frequency_list_t)</span><br><span>   M_UINT       (Add_Frequency_list_t,  START_FREQUENCY,  10),</span><br><span>@@ -2752,6 +2782,8 @@</span><br><span>   M_UINT       (Add_Frequency_list_t,  NR_OF_FREQUENCIES,  5),</span><br><span>   M_UINT_OFFSET(Add_Frequency_list_t, FREQ_DIFF_LENGTH, 3, 1),/*offset 1*/</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  M_CALLBACK   (Add_Frequency_list_t, callback_init_Cell_Sel_Param_2_FREQUENCY_DIFF, FREQ_DIFF_LENGTH, CellSelectionParamsWithFreqDiff),</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   M_VAR_TARRAY (Add_Frequency_list_t, CellSelectionParamsWithFreqDiff, CellSelectionParamsWithFreqDiff_t, NR_OF_FREQUENCIES),</span><br><span> CSN_DESCR_END  (Add_Frequency_list_t)</span><br><span> </span><br><span>@@ -2923,13 +2955,99 @@</span><br><span>   CSN_ERROR    (CDMA2000_Description_t, "Not Implemented", CSN_ERROR_STREAM_NOT_SUPPORTED),</span><br><span> CSN_DESCR_END  (CDMA2000_Description_t)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#if 0</span><br><span style="color: hsl(120, 100%, 40%);">+static const guint8 NR_OF_FDD_CELLS_map[32] = {0, 10, 19, 28, 36, 44, 52, 60, 67, 74, 81, 88, 95, 102, 109, 116, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+#if 0</span><br><span style="color: hsl(120, 100%, 40%);">+static CSN_CallBackStatus_t callback_UTRAN_FDD_map_NrOfFrequencies(proto_tree *tree _U_, tvbuff_t *tvb _U_, void* param1, void* param2,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                   int bit_offset _U_, int ett_csn1 _U_, packet_info* pinfo _U_)</span><br><span style="color: hsl(120, 100%, 40%);">+{   /* TS 44.060 Table 11.2.9b.2.a */</span><br><span style="color: hsl(120, 100%, 40%);">+  guint8 *pNrOfCells = (guint8*)param1;</span><br><span style="color: hsl(120, 100%, 40%);">+  guint8 *pBitsInCellInfo = (guint8*)param2;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  if ( *pNrOfCells < 32 )</span><br><span style="color: hsl(120, 100%, 40%);">+  {</span><br><span style="color: hsl(120, 100%, 40%);">+    *pBitsInCellInfo = NR_OF_FDD_CELLS_map[*pNrOfCells];</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+  else</span><br><span style="color: hsl(120, 100%, 40%);">+  {</span><br><span style="color: hsl(120, 100%, 40%);">+    *pBitsInCellInfo = 0;</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%);">+  return 0;</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%);">+static CSN_CallBackStatus_t callback_UTRAN_FDD_compute_FDD_CELL_INFORMATION(proto_tree *tree, tvbuff_t *tvb, void* param1, void* param2 _U_,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                            int bit_offset, int ett_csn1, packet_info* pinfo _U_)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+  proto_tree   *subtree;</span><br><span style="color: hsl(120, 100%, 40%);">+  UTRAN_FDD_NeighbourCells_t * pUtranFddNcell = (UTRAN_FDD_NeighbourCells_t*)param1;</span><br><span style="color: hsl(120, 100%, 40%);">+  gint xdd_cell_info, wsize, nwi, jwi, w[64], i, iused;</span><br><span style="color: hsl(120, 100%, 40%);">+  gint curr_bit_offset, idx;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  curr_bit_offset = bit_offset;</span><br><span style="color: hsl(120, 100%, 40%);">+  idx = pUtranFddNcell->BitsInCellInfo;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  if ( idx > 0 )</span><br><span style="color: hsl(120, 100%, 40%);">+  {</span><br><span style="color: hsl(120, 100%, 40%);">+    subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, 1, ett_csn1, NULL, "FDD_CELL_INFORMATION: ");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    if (pUtranFddNcell->Indic0)</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+      proto_tree_add_uint(tree, hf_gsm_rlcmac_scrambling_code, tvb, curr_bit_offset>>3, 0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+      proto_tree_add_uint(tree, hf_gsm_rlcmac_diversity, tvb, curr_bit_offset>>3, 0, 0);</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%);">+    if (idx)</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+      wsize = 10;</span><br><span style="color: hsl(120, 100%, 40%);">+      nwi = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+      jwi = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+      i = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      while (idx > 0)</span><br><span style="color: hsl(120, 100%, 40%);">+      {</span><br><span style="color: hsl(120, 100%, 40%);">+        w[i] = tvb_get_bits(tvb, curr_bit_offset, wsize, ENC_BIG_ENDIAN);</span><br><span style="color: hsl(120, 100%, 40%);">+        curr_bit_offset += wsize;</span><br><span style="color: hsl(120, 100%, 40%);">+        idx -= wsize;</span><br><span style="color: hsl(120, 100%, 40%);">+        if (w[i] == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+        {</span><br><span style="color: hsl(120, 100%, 40%);">+          idx = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+        if (++jwi==nwi)</span><br><span style="color: hsl(120, 100%, 40%);">+        {</span><br><span style="color: hsl(120, 100%, 40%);">+          jwi = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+          nwi <<= 1;</span><br><span style="color: hsl(120, 100%, 40%);">+          wsize--;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+        i++;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+      if (idx < 0)</span><br><span style="color: hsl(120, 100%, 40%);">+      {</span><br><span style="color: hsl(120, 100%, 40%);">+        curr_bit_offset += idx;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+      iused = i-1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      for (i=1; i <= iused; i++)</span><br><span style="color: hsl(120, 100%, 40%);">+      {</span><br><span style="color: hsl(120, 100%, 40%);">+        xdd_cell_info = f_k(i, w, 1024);</span><br><span style="color: hsl(120, 100%, 40%);">+        proto_tree_add_uint(subtree, hf_gsm_rlcmac_scrambling_code, tvb, curr_bit_offset>>3, 0, xdd_cell_info & 0x01FF);</span><br><span style="color: hsl(120, 100%, 40%);">+        proto_tree_add_uint(subtree, hf_gsm_rlcmac_diversity, tvb, curr_bit_offset>>3, 0, (xdd_cell_info >> 9) & 0x01);</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 style="color: hsl(120, 100%, 40%);">+  return curr_bit_offset - bit_offset;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static const</span><br><span> CSN_DESCR_BEGIN(UTRAN_FDD_NeighbourCells_t)</span><br><span>   M_UINT       (UTRAN_FDD_NeighbourCells_t,  ZERO,      1),</span><br><span>   M_UINT       (UTRAN_FDD_NeighbourCells_t,  UARFCN,   14),</span><br><span>   M_UINT       (UTRAN_FDD_NeighbourCells_t,  Indic0,      1),</span><br><span>   M_UINT       (UTRAN_FDD_NeighbourCells_t,  NrOfCells,   5),</span><br><span style="color: hsl(0, 100%, 40%);">-/*  M_CALLBACK   (UTRAN_FDD_NeighbourCells_t, (void*) 14, NrOfCells, BitsInCellInfo), */</span><br><span>   M_VAR_BITMAP (UTRAN_FDD_NeighbourCells_t, CellInfo,  BitsInCellInfo, 0),</span><br><span> CSN_DESCR_END  (UTRAN_FDD_NeighbourCells_t)</span><br><span> </span><br><span>@@ -2940,14 +3058,101 @@</span><br><span>   M_REC_TARRAY (UTRAN_FDD_Description_t, CellParams, UTRAN_FDD_NeighbourCells_t, NrOfFrequencies),</span><br><span> CSN_DESCR_END  (UTRAN_FDD_Description_t)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static const guint8 NR_OF_TDD_CELLS_map[32] = {0, 9, 17, 25, 32, 39, 46, 53, 59, 65, 71, 77, 83, 89, 95, 101, 106, 111, 116, 121, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};</span><br><span style="color: hsl(120, 100%, 40%);">+static CSN_CallBackStatus_t callback_UTRAN_TDD_map_NrOfFrequencies(struct bitvec *vector, unsigned *readIndex, void* param1, void* param2)</span><br><span style="color: hsl(120, 100%, 40%);">+{  /* TS 44.060 Table 11.2.9b.2.b */</span><br><span style="color: hsl(120, 100%, 40%);">+  guint8 * pNrOfCells = (guint8*)param1;</span><br><span style="color: hsl(120, 100%, 40%);">+  guint8 * pBitsInCellInfo = (guint8*)param2;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  if ( *pNrOfCells < 32 )</span><br><span style="color: hsl(120, 100%, 40%);">+  {</span><br><span style="color: hsl(120, 100%, 40%);">+    *pBitsInCellInfo = NR_OF_TDD_CELLS_map[*pNrOfCells];</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+  else</span><br><span style="color: hsl(120, 100%, 40%);">+  {</span><br><span style="color: hsl(120, 100%, 40%);">+    *pBitsInCellInfo = 0;</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%);">+  return 0;</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%);">+static CSN_CallBackStatus_t callback_UTRAN_TDD_compute_TDD_CELL_INFORMATION(struct bitvec *vector, unsigned *readIndex, void* param1, void* param2)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+  UTRAN_TDD_NeighbourCells_t *pUtranTddNcell = (UTRAN_TDD_NeighbourCells_t *)param1;</span><br><span style="color: hsl(120, 100%, 40%);">+  gint wsize, nwi, jwi, w[64], i, iused;</span><br><span style="color: hsl(120, 100%, 40%);">+  guint bit_offset, curr_bit_offset;</span><br><span style="color: hsl(120, 100%, 40%);">+  gint idx;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  bit_offset = *readIndex;</span><br><span style="color: hsl(120, 100%, 40%);">+  curr_bit_offset = bit_offset;</span><br><span style="color: hsl(120, 100%, 40%);">+  idx = pUtranTddNcell->BitsInCellInfo;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  if ( idx > 0 )</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%);">+    subtree = proto_tree_add_subtree(tree, tvb, curr_bit_offset>>3, 1, ett_csn1, NULL, "TDD_CELL_INFORMATION: ");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    if (pUtranTddNcell->Indic0)</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+      proto_tree_add_uint(tree, hf_gsm_rlcmac_cell_parameter, tvb, curr_bit_offset>>3, 0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+      proto_tree_add_uint(tree, hf_gsm_rlcmac_sync_case_tstd, tvb, curr_bit_offset>>3, 0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+      proto_tree_add_uint(tree, hf_gsm_rlcmac_diversity_tdd, tvb, curr_bit_offset>>3, 0, 0);</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%);">+    if (idx)</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+      wsize = 10;</span><br><span style="color: hsl(120, 100%, 40%);">+      nwi = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+      jwi = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+      i = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      while (idx > 0)</span><br><span style="color: hsl(120, 100%, 40%);">+      {</span><br><span style="color: hsl(120, 100%, 40%);">+        w[i] = ntohs((uint16_t)bitvec_read_field(vector, &curr_bit_offset, wsize));</span><br><span style="color: hsl(120, 100%, 40%);">+        idx -= wsize;</span><br><span style="color: hsl(120, 100%, 40%);">+        if (w[i] == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+        {</span><br><span style="color: hsl(120, 100%, 40%);">+          idx = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+        if (++jwi==nwi)</span><br><span style="color: hsl(120, 100%, 40%);">+        {</span><br><span style="color: hsl(120, 100%, 40%);">+          jwi = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+          nwi <<= 1;</span><br><span style="color: hsl(120, 100%, 40%);">+          wsize--;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+        i++;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+      if (idx < 0)</span><br><span style="color: hsl(120, 100%, 40%);">+      {</span><br><span style="color: hsl(120, 100%, 40%);">+        curr_bit_offset += idx;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+      iused = i-1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      for (i=1; i <= iused; i++)</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%);">+        xdd_cell_info = f_k(i, w, 1024);</span><br><span style="color: hsl(120, 100%, 40%);">+        proto_tree_add_uint(subtree, hf_gsm_rlcmac_cell_parameter, tvb, curr_bit_offset>>3, 0, xdd_cell_info & 0x007F);</span><br><span style="color: hsl(120, 100%, 40%);">+        proto_tree_add_uint(subtree, hf_gsm_rlcmac_sync_case_tstd, tvb, curr_bit_offset>>3, 0, (xdd_cell_info >> 7) & 0x01);</span><br><span style="color: hsl(120, 100%, 40%);">+        proto_tree_add_uint(subtree, hf_gsm_rlcmac_diversity_tdd, tvb, curr_bit_offset>>3, 0, (xdd_cell_info >> 8) & 0x01);</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 style="color: hsl(120, 100%, 40%);">+  *readIndex = curr_bit_offset;</span><br><span style="color: hsl(120, 100%, 40%);">+  return curr_bit_offset - bit_offset;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static const</span><br><span> CSN_DESCR_BEGIN(UTRAN_TDD_NeighbourCells_t)</span><br><span>   M_UINT       (UTRAN_TDD_NeighbourCells_t,  ZERO,      1),</span><br><span>   M_UINT       (UTRAN_TDD_NeighbourCells_t,  UARFCN,   14),</span><br><span>   M_UINT       (UTRAN_TDD_NeighbourCells_t,  Indic0,      1),</span><br><span>   M_UINT       (UTRAN_TDD_NeighbourCells_t,  NrOfCells,   5),</span><br><span style="color: hsl(0, 100%, 40%);">-/*  M_CALLBACK   (UTRAN_TDD_NeighbourCells_t, (void*) 23, NrOfCells, BitsInCellInfo), */</span><br><span style="color: hsl(0, 100%, 40%);">-  M_VAR_BITMAP (UTRAN_TDD_NeighbourCells_t, CellInfo,  BitsInCellInfo, 0),</span><br><span style="color: hsl(120, 100%, 40%);">+  M_CALLBACK   (UTRAN_TDD_NeighbourCells_t, callback_UTRAN_TDD_map_NrOfFrequencies, NrOfCells, BitsInCellInfo),</span><br><span style="color: hsl(120, 100%, 40%);">+  M_CALLBACK   (UTRAN_TDD_NeighbourCells_t, callback_UTRAN_TDD_compute_TDD_CELL_INFORMATION, ZERO, CellInfo),</span><br><span> CSN_DESCR_END  (UTRAN_TDD_NeighbourCells_t)</span><br><span> </span><br><span> static const</span><br><span>@@ -3093,6 +3298,20 @@</span><br><span>   M_TYPE       (lu_ModeOnlyCellSelectionParamsWithFreqDiff_t, lu_ModeOnlyCellSelectionParams, lu_ModeOnlyCellSelection_t),</span><br><span> CSN_DESCR_END  (lu_ModeOnlyCellSelectionParamsWithFreqDiff_t)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+CSN_CallBackStatus_t callback_init_luMode_Cell_Sel_Param_FREQUENCY_DIFF(struct bitvec *vector, unsigned *readIndex, void* param1, void* param2)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    guint  i;</span><br><span style="color: hsl(120, 100%, 40%);">+    guint8 freq_diff_len = *(guint8*)param1;</span><br><span style="color: hsl(120, 100%, 40%);">+    lu_ModeOnlyCellSelectionParamsWithFreqDiff_t *pArray = (lu_ModeOnlyCellSelectionParamsWithFreqDiff_t*)param2;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    for( i=0; i<16; i++, pArray++ )</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+        pArray->FREQ_DIFF_LENGTH = freq_diff_len;</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%);">+    return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static const</span><br><span> CSN_DESCR_BEGIN(Add_lu_ModeOnlyFrequencyList_t)</span><br><span>   M_UINT       (Add_lu_ModeOnlyFrequencyList_t,  START_FREQUENCY,  10),</span><br><span>@@ -3104,6 +3323,8 @@</span><br><span>   M_UINT       (Add_lu_ModeOnlyFrequencyList_t,  NR_OF_FREQUENCIES,  5),</span><br><span>   M_UINT       (Add_lu_ModeOnlyFrequencyList_t,  FREQ_DIFF_LENGTH,  3),</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  M_CALLBACK   (Add_lu_ModeOnlyFrequencyList_t, callback_init_luMode_Cell_Sel_Param_FREQUENCY_DIFF, FREQ_DIFF_LENGTH, lu_ModeOnlyCellSelectionParamsWithFreqDiff),</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   M_VAR_TARRAY (Add_lu_ModeOnlyFrequencyList_t, lu_ModeOnlyCellSelectionParamsWithFreqDiff, lu_ModeOnlyCellSelectionParamsWithFreqDiff_t, NR_OF_FREQUENCIES),</span><br><span> CSN_DESCR_END  (Add_lu_ModeOnlyFrequencyList_t)</span><br><span> </span><br><span>@@ -4692,13 +4913,23 @@</span><br><span> </span><br><span> static const</span><br><span> CSN_DESCR_BEGIN(COMPACT_Neighbour_Cell_Param_Remaining_t)</span><br><span style="color: hsl(0, 100%, 40%);">-  /* this FREQ_DIFF_LENGTH is not initialised, it should be the SAME as COMPACT_Neighbour_Cell_Param_t.FREQ_DIFF_LENGTH.</span><br><span style="color: hsl(0, 100%, 40%);">-  * So it is buggy, but there is no way to handle it. Same issue is in Cell_Selection_Params_With_FreqDiff_t.FREQ_DIFF_LENGTH.</span><br><span style="color: hsl(0, 100%, 40%);">-  */</span><br><span>   M_VAR_BITMAP (COMPACT_Neighbour_Cell_Param_Remaining_t,  FREQUENCY_DIFF, FREQ_DIFF_LENGTH, 0),</span><br><span>   M_TYPE       (COMPACT_Neighbour_Cell_Param_Remaining_t,  COMPACT_Cell_Sel_Remain_Cells, COMPACT_Cell_Sel_t),</span><br><span> CSN_DESCR_END  (COMPACT_Neighbour_Cell_Param_Remaining_t)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+CSN_CallBackStatus_t callback_init_COMP_Ncell_Param_FREQUENCY_DIFF(struct bitvec *vector, unsigned *readIndex, void* param1, void* param2)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    guint  i;</span><br><span style="color: hsl(120, 100%, 40%);">+    guint8 freq_diff_len = *(guint8*)param1;</span><br><span style="color: hsl(120, 100%, 40%);">+    COMPACT_Neighbour_Cell_Param_Remaining_t *pCom_NCell_Param_rem = (COMPACT_Neighbour_Cell_Param_Remaining_t*)param2;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    for( i=0; i<16; i++, pCom_NCell_Param_rem++ )</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+        pCom_NCell_Param_rem->FREQ_DIFF_LENGTH = freq_diff_len;</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%);">+    return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span> </span><br><span> static const</span><br><span> CSN_DESCR_BEGIN(COMPACT_Neighbour_Cell_Param_t)</span><br><span>@@ -4706,6 +4937,7 @@</span><br><span>   M_TYPE       (COMPACT_Neighbour_Cell_Param_t,  COMPACT_Cell_Sel, COMPACT_Cell_Sel_t),</span><br><span>   M_UINT       (COMPACT_Neighbour_Cell_Param_t,  NR_OF_REMAINING_CELLS, 4),</span><br><span>   M_UINT_OFFSET(COMPACT_Neighbour_Cell_Param_t,  FREQ_DIFF_LENGTH, 3, 1),</span><br><span style="color: hsl(120, 100%, 40%);">+  M_CALLBACK   (COMPACT_Neighbour_Cell_Param_t,  callback_init_COMP_Ncell_Param_FREQUENCY_DIFF, FREQ_DIFF_LENGTH, COMPACT_Neighbour_Cell_Param_Remaining),</span><br><span>   M_VAR_TARRAY (COMPACT_Neighbour_Cell_Param_t,  COMPACT_Neighbour_Cell_Param_Remaining, COMPACT_Neighbour_Cell_Param_Remaining_t, NR_OF_REMAINING_CELLS),</span><br><span> CSN_DESCR_END  (COMPACT_Neighbour_Cell_Param_t)</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17628">change 17628</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-pcu/+/17628"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I08523bc1bbdffde479ef974b4c7b56cfa5639591 </div>
<div style="display:none"> Gerrit-Change-Number: 17628 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>