aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-06-27 04:12:50 +0700
committerlaforge <laforge@gnumonks.org>2019-07-16 04:16:13 +0000
commit54e104496a30c7a9a4a562e40cf59a025d111f1c (patch)
tree9e6f7094a703a3111b0653b6928f94730a4922e0 /src
parent01cc8c0d211158d46ecfe2755f3b9aa7c6995e7b (diff)
osmo-bts/scheduler: provide actual C/I values to OsmoPCU
C/I (Carrier-to-Interference ratio) is a value in cB (centiBels), computed from the training sequence of each received burst, by comparing the "ideal" training sequence with the actual one. So far, there was no way to expose more measurements from OsmoTRX, excluding both RSSI and ToA. Since the new version of TRXD header, we can receive C/I indications and send the averaged (per 4 bursts) values to OsmoPCU (as a part of PCUIF_DATA.ind). Please note that we also need to attach C/I measurements to the following L1SAP primitives: - PRIM_PH_RACH.ind, - PRIM_PH_DATA.ind, - PRIM_TCH.ind, but this will be done in the follow up changes. Change-Id: Ia58043bd2381a4d34d604522e02899ae64ee0d26 Fixes: OS#1855
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 294e73cb..7bdbc4f9 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -982,8 +982,11 @@ int rx_pdtch_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
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[EGPRS_0503_MAX_BYTES];
int n_errors, n_bursts_bits, n_bits_total;
+ int16_t lqual_cb;
uint16_t ber10k;
int rc;
@@ -1007,6 +1010,8 @@ int rx_pdtch_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
*rssi_num = 0;
*toa256_sum = 0;
*toa_num = 0;
+ *ci_cb_sum = 0;
+ *ci_cb_num = 0;
}
/* update mask + rssi */
@@ -1016,6 +1021,12 @@ int rx_pdtch_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
*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 */
if (bi->burst_len == EGPRS_BURST_LEN) {
burst = *bursts_p + bid * 348;
@@ -1069,13 +1080,15 @@ int rx_pdtch_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
bi->fn % l1ts->mf_period, l1ts->mf_period);
return 0;
}
+
+ 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, rc,
*rssi_sum / *rssi_num,
*toa256_sum / *toa_num,
- 0 /* FIXME: AVG C/I */,
- ber10k, PRES_INFO_BOTH);
+ lqual_cb, ber10k,
+ PRES_INFO_BOTH);
}
/*! \brief a single TCH/F burst was received by the PHY, process it */