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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-bts/scheduler: provide actual C/I values to OsmoPCU<br><br>C/I (Carrier-to-Interference ratio) is a value in cB (centiBels),<br>computed from the training sequence of each received burst,<br>by comparing the "ideal" training sequence with the actual one.<br><br>So far, there was no way to expose more measurements from OsmoTRX,<br>excluding both RSSI and ToA. Since the new version of TRXD header,<br>we can receive C/I indications and send the averaged (per 4 bursts)<br>values to OsmoPCU (as a part of PCUIF_DATA.ind).<br><br>Please note that we also need to attach C/I measurements<br>to the following L1SAP primitives:<br><br>  - PRIM_PH_RACH.ind,<br>  - PRIM_PH_DATA.ind,<br>  - PRIM_TCH.ind,<br><br>but this will be done in the follow up changes.<br><br>Change-Id: Ia58043bd2381a4d34d604522e02899ae64ee0d26<br>Fixes: OS#1855<br>---<br>M include/osmo-bts/scheduler.h<br>M src/osmo-bts-trx/scheduler_trx.c<br>2 files changed, 18 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h</span><br><span>index 4f40636..e693e3e 100644</span><br><span>--- a/include/osmo-bts/scheduler.h</span><br><span>+++ b/include/osmo-bts/scheduler.h</span><br><span>@@ -79,11 +79,13 @@</span><br><span>         uint32_t                ul_first_fn;    /* fn of first burst */</span><br><span>      uint8_t                 ul_mask;        /* mask of received bursts */</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-       /* RSSI / TOA */</span><br><span style="color: hsl(120, 100%, 40%);">+      /* measurements */</span><br><span>   uint8_t                 rssi_num;       /* number of RSSI values */</span><br><span>  float                   rssi_sum;       /* sum of RSSI values */</span><br><span>     uint8_t                 toa_num;        /* number of TOA values */</span><br><span>   int32_t                 toa256_sum;     /* sum of TOA values (1/256 symbol) */</span><br><span style="color: hsl(120, 100%, 40%);">+        uint8_t                 ci_cb_num;      /* number of C/I values */</span><br><span style="color: hsl(120, 100%, 40%);">+    int32_t                 ci_cb_sum;      /* sum of C/I values (in centiBels) */</span><br><span> </span><br><span>   /* loss detection */</span><br><span>         uint8_t                 lost_frames;    /* how many L2 frames were lost */</span><br><span>diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c</span><br><span>index 294e73c..7bdbc4f 100644</span><br><span>--- a/src/osmo-bts-trx/scheduler_trx.c</span><br><span>+++ b/src/osmo-bts-trx/scheduler_trx.c</span><br><span>@@ -982,8 +982,11 @@</span><br><span>       uint8_t *rssi_num = &chan_state->rssi_num;</span><br><span>    int32_t *toa256_sum = &chan_state->toa256_sum;</span><br><span>        uint8_t *toa_num = &chan_state->toa_num;</span><br><span style="color: hsl(120, 100%, 40%);">+       int32_t *ci_cb_sum = &chan_state->ci_cb_sum;</span><br><span style="color: hsl(120, 100%, 40%);">+   uint8_t *ci_cb_num = &chan_state->ci_cb_num;</span><br><span>  uint8_t l2[EGPRS_0503_MAX_BYTES];</span><br><span>    int n_errors, n_bursts_bits, n_bits_total;</span><br><span style="color: hsl(120, 100%, 40%);">+    int16_t lqual_cb;</span><br><span>    uint16_t ber10k;</span><br><span>     int rc;</span><br><span> </span><br><span>@@ -1007,6 +1010,8 @@</span><br><span>          *rssi_num = 0;</span><br><span>               *toa256_sum = 0;</span><br><span>             *toa_num = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+         *ci_cb_sum = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+               *ci_cb_num = 0;</span><br><span>      }</span><br><span> </span><br><span>        /* update mask + rssi */</span><br><span>@@ -1016,6 +1021,12 @@</span><br><span>    *toa256_sum += bi->toa256;</span><br><span>        (*toa_num)++;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     /* C/I: Carrier-to-Interference ratio (in centiBels) */</span><br><span style="color: hsl(120, 100%, 40%);">+       if (bi->flags & TRX_BI_F_CI_CB) {</span><br><span style="color: hsl(120, 100%, 40%);">+              *ci_cb_sum += bi->ci_cb;</span><br><span style="color: hsl(120, 100%, 40%);">+           (*ci_cb_num)++;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  /* copy burst to buffer of 4 bursts */</span><br><span>       if (bi->burst_len == EGPRS_BURST_LEN) {</span><br><span>           burst = *bursts_p + bid * 348;</span><br><span>@@ -1069,13 +1080,15 @@</span><br><span>                     bi->fn % l1ts->mf_period, l1ts->mf_period);</span><br><span>                 return 0;</span><br><span>    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   lqual_cb = *ci_cb_num ? (*ci_cb_sum / *ci_cb_num) : 0;</span><br><span>       ber10k = compute_ber10k(n_bits_total, n_errors);</span><br><span>     return _sched_compose_ph_data_ind(l1t, bi->tn,</span><br><span>                                      *first_fn, chan, l2, rc,</span><br><span>                                     *rssi_sum / *rssi_num,</span><br><span>                                       *toa256_sum / *toa_num,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         0 /* FIXME: AVG C/I */,</span><br><span style="color: hsl(0, 100%, 40%);">-                                         ber10k, PRES_INFO_BOTH);</span><br><span style="color: hsl(120, 100%, 40%);">+                                      lqual_cb, ber10k,</span><br><span style="color: hsl(120, 100%, 40%);">+                                     PRES_INFO_BOTH);</span><br><span> }</span><br><span> </span><br><span> /*! \brief a single TCH/F burst was received by the PHY, process it */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/14613">change 14613</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-bts/+/14613"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ia58043bd2381a4d34d604522e02899ae64ee0d26 </div>
<div style="display:none"> Gerrit-Change-Number: 14613 </div>
<div style="display:none"> Gerrit-PatchSet: 8 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: ipse <Alexander.Chemeris@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: tnt <tnt@246tNt.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>