fixeria has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/14689 )

Change subject: osmo-bts-trx/scheduler: rx_data_fn(): provide actual C/I ratio 
to L1SAP
......................................................................

osmo-bts-trx/scheduler: rx_data_fn(): provide actual C/I ratio to L1SAP

Change-Id: Iea0dad65e9bc511f99375fd3ee2eb44e47a6168f
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 14 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 8144956..532eca5 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -896,8 +896,11 @@
        uint8_t *rssi_num = &chan_state->rssi_num;
        int32_t *toa256_sum = &chan_state->toa256_sum;
        uint8_t *toa_num = &chan_state->toa_num;
+       int32_t *ci_cb_sum = &chan_state->ci_cb_sum;
+       uint8_t *ci_cb_num = &chan_state->ci_cb_num;
        uint8_t l2[GSM_MACBLOCK_LEN], l2_len;
        int n_errors, n_bits_total;
+       int16_t lqual_cb;
        uint16_t ber10k;
        int rc;

@@ -924,6 +927,8 @@
                *rssi_num = 0;
                *toa256_sum = 0;
                *toa_num = 0;
+               *ci_cb_sum = 0;
+               *ci_cb_num = 0;
        }

        /* update mask + RSSI */
@@ -933,6 +938,12 @@
        *toa256_sum += bi->toa256;
        (*toa_num)++;

+       /* C/I: Carrier-to-Interference ratio (in centiBels) */
+       if (bi->flags & TRX_BI_F_CI_CB) {
+               *ci_cb_sum += bi->ci_cb;
+               (*ci_cb_num)++;
+       }
+
        /* copy burst to buffer of 4 bursts */
        burst = *bursts_p + bid * 116;
        memcpy(burst, bi->burst + 3, 58);
@@ -978,13 +989,14 @@
                              n_errors, n_bits_total,
                              *rssi_sum / *rssi_num,
                              *toa256_sum / *toa_num);
+       lqual_cb = *ci_cb_num ? (*ci_cb_sum / *ci_cb_num) : 0;
        ber10k = compute_ber10k(n_bits_total, n_errors);
        return _sched_compose_ph_data_ind(l1t, bi->tn, *first_fn,
                                          chan, l2, l2_len,
                                          *rssi_sum / *rssi_num,
                                          *toa256_sum / *toa_num,
-                                         0 /* FIXME: AVG C/I */,
-                                         ber10k, PRES_INFO_UNKNOWN);
+                                         lqual_cb, ber10k,
+                                         PRES_INFO_UNKNOWN);
 }

 /*! \brief a single PDTCH burst was received by the PHY, process it */

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/14689
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iea0dad65e9bc511f99375fd3ee2eb44e47a6168f
Gerrit-Change-Number: 14689
Gerrit-PatchSet: 9
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to