diff options
author | Max <msuraev@sysmocom.de> | 2016-07-28 14:46:00 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-08-08 17:41:27 +0000 |
commit | 4b76a323b3bb71f8d3f4dc7439ecd9bad0f13bcf (patch) | |
tree | 25fc6161bdc7eb8d070188d84b06b22e9a6b432d /src/osmo-bts-octphy | |
parent | b0f8fa814376d46ff9d7ef0e94e8480ce63442f9 (diff) |
Fill measurements data for L1SAP
Fill in values for BER, BTO, Link quality in L1SAP and send them to
PCU. Note: this increases the version of BTS <-> PCU protocol. It also
requires corresponding changes in libosmocore.
All BTS models provide measurements data unless direct DSP access for
PCU is enabled. For BTS-specific notes see below.
Octphy: conversion from sSNRDb to Link Quality uses formulae which works
in practice instead of what's documented for sSNRDb value. Subject to
change in future revisions.
TRX: C / I link quality estimator is not computed.
Change-Id: Ic9693a044756fb1c7bd2ff3cfa0db042c3c4e01c
Related: OS#1616
Diffstat (limited to 'src/osmo-bts-octphy')
-rw-r--r-- | src/osmo-bts-octphy/l1_if.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 760c988f..d621bcf5 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -961,7 +961,8 @@ static int handle_ph_data_ind(struct octphy_hdl *fl1, struct osmo_phsap_prim *l1sap; uint32_t fn; uint8_t *data; - uint16_t len; + uint16_t len, b_total, b_error; + int16_t snr; int8_t rssi; int rc; @@ -1029,6 +1030,16 @@ static int handle_ph_data_ind(struct octphy_hdl *fl1, l1sap->u.data.chan_nr = chan_nr; l1sap->u.data.fn = fn; l1sap->u.data.rssi = rssi; + b_total = data_ind->MeasurementInfo.usBERTotalBitCnt; + b_error =data_ind->MeasurementInfo.usBERCnt; + l1sap->u.data.ber10k = b_total ? 10000 * b_error / b_total : 0; + l1sap->u.data.ta_offs_qbits = data_ind->MeasurementInfo.sBurstTiming4x; + snr = data_ind->MeasurementInfo.sSNRDb; + /* FIXME: better converion formulae for SnR -> C / I? + l1sap->u.data.lqual_cb = (snr ? snr : (snr - 65536)) * 10 / 256; + LOGP(DL1C, LOGL_ERROR, "SnR: raw %d, computed %d\n", snr, l1sap->u.data.lqual_cb); + */ + l1sap->u.data.lqual_cb = (snr ? snr : (snr - 65536)) * 100; l1sap->u.data.pdch_presence_info = PRES_INFO_BOTH; /* FIXME: consider EDGE support */ l1sap_up(trx, l1sap); |