aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-27 16:58:46 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-27 20:00:16 +0100
commitacefd0586e5d463b2e7a6a039131994bc12573fc (patch)
tree9d7b22f8a0453c4fb20d69835717a20db02e7a90
parentc092f4e1ded65447061198ea1c57458becc71574 (diff)
L1SAP: Increase resolution of reported burst timing
Before this patch we had: * osmo-bts-trx internally using 1/256th bit/symbol period * osmo-bts-sysmo internally using 1/4 bit/smbol period * PCU interface using 1/4 * L1SAP interface using 1/4 * measurement processing code on top of L1SAP using 1/256 So for sysmo/lc15/octphy we are not loosing resolution, but for osmo-bts-trx we're arbitrarily reducing the resolution via L1SAP only then to compute with higher resolution again. Let's change L1SAP to use 1/256 bits and hence not loose any resolution. This requires a corresponding change in libosmocore for l1sap.h, which is found in Change-Id Ibb58113c2819fe2d6d23ecbcfb8b3fce4055025d Change-Id: If9b0f617845ba6c4aa47969f521734388197c9a7
-rw-r--r--include/osmo-bts/scheduler_backend.h2
-rw-r--r--src/common/l1sap.c12
-rw-r--r--src/common/scheduler.c4
-rw-r--r--src/osmo-bts-litecell15/l1_if.c4
-rw-r--r--src/osmo-bts-octphy/l1_if.c6
-rw-r--r--src/osmo-bts-sysmo/l1_if.c4
-rw-r--r--src/osmo-bts-trx/l1_if.c2
-rw-r--r--src/osmo-bts-virtual/l1_if.c4
8 files changed, 19 insertions, 19 deletions
diff --git a/include/osmo-bts/scheduler_backend.h b/include/osmo-bts/scheduler_backend.h
index 5f11f9bc..dbd93195 100644
--- a/include/osmo-bts/scheduler_backend.h
+++ b/include/osmo-bts/scheduler_backend.h
@@ -51,7 +51,7 @@ struct msgb *_sched_dequeue_prim(struct l1sched_trx *l1t, int8_t tn, uint32_t fn
int _sched_compose_ph_data_ind(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t *l2,
uint8_t l2_len, float rssi,
- int16_t ta_offs_qbits, int16_t link_qual_cb,
+ int16_t ta_offs_256bits, int16_t link_qual_cb,
uint16_t ber10k,
enum osmo_ph_pres_info_type presence_info);
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index e095417e..330b40a1 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -512,8 +512,8 @@ static int l1sap_info_meas_ind(struct gsm_bts_trx *trx,
}
DEBUGPFN(DL1P, info_meas_ind->fn,
- "%s MPH_INFO meas ind, ta_offs_qbits=%d, ber10k=%d, inv_rssi=%u\n",
- gsm_lchan_name(lchan), info_meas_ind->ta_offs_qbits,
+ "%s MPH_INFO meas ind, ta_offs_256bits=%d, ber10k=%d, inv_rssi=%u\n",
+ gsm_lchan_name(lchan), info_meas_ind->ta_offs_256bits,
info_meas_ind->ber10k, info_meas_ind->inv_rssi);
/* in the GPRS case we are not interested in measurement
@@ -522,13 +522,13 @@ static int l1sap_info_meas_ind(struct gsm_bts_trx *trx,
return 0;
memset(&ulm, 0, sizeof(ulm));
- ulm.ta_offs_256bits = info_meas_ind->ta_offs_qbits*(256/4);
+ ulm.ta_offs_256bits = info_meas_ind->ta_offs_256bits;
ulm.ber10k = info_meas_ind->ber10k;
ulm.inv_rssi = info_meas_ind->inv_rssi;
ulm.is_sub = info_meas_ind->is_sub;
/* we assume that symbol period is 1 bit: */
- set_ms_to_data(lchan, info_meas_ind->ta_offs_qbits / 4, true);
+ set_ms_to_data(lchan, info_meas_ind->ta_offs_256bits / 256, true);
lchan_new_ul_meas(lchan, &ulm, info_meas_ind->fn);
@@ -1058,7 +1058,7 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PTCCH, fn,
0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn),
data, len, rssi, data_ind->ber10k,
- data_ind->ta_offs_qbits,
+ data_ind->ta_offs_256bits/64,
data_ind->lqual_cb);
} else {
/* drop incomplete UL block */
@@ -1067,7 +1067,7 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
/* PDTCH / PACCH frame handling */
pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PDTCH, fn, 0 /* ARFCN */,
L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k,
- data_ind->ta_offs_qbits, data_ind->lqual_cb);
+ data_ind->ta_offs_256bits/64, data_ind->lqual_cb);
}
return 0;
}
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index edd99d26..8c9d30d6 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -340,7 +340,7 @@ found_msg:
int _sched_compose_ph_data_ind(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
enum trx_chan_type chan, uint8_t *l2,
uint8_t l2_len, float rssi,
- int16_t ta_offs_qbits, int16_t link_qual_cb,
+ int16_t ta_offs_256bits, int16_t link_qual_cb,
uint16_t ber10k,
enum osmo_ph_pres_info_type presence_info)
{
@@ -359,7 +359,7 @@ int _sched_compose_ph_data_ind(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
l1sap->u.data.fn = fn;
l1sap->u.data.rssi = (int8_t) (rssi);
l1sap->u.data.ber10k = ber10k;
- l1sap->u.data.ta_offs_qbits = ta_offs_qbits;
+ l1sap->u.data.ta_offs_256bits = ta_offs_256bits;
l1sap->u.data.lqual_cb = link_qual_cb;
l1sap->u.data.pdch_presence_info = presence_info;
msg->l2h = msgb_put(msg, l2_len);
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 1b83fbde..9e122cd8 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -907,7 +907,7 @@ static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
PRIM_OP_INDICATION, NULL);
l1sap.u.info.type = PRIM_INFO_MEAS;
l1sap.u.info.u.meas_ind.chan_nr = chan_nr;
- l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming;
+ l1sap.u.info.u.meas_ind.ta_offs_256bits = m->i16BurstTiming*64;
l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 10000);
l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1);
l1sap.u.info.u.meas_ind.fn = fn;
@@ -983,7 +983,7 @@ static int handle_ph_data_ind(struct lc15l1_hdl *fl1, GsmL1_PhDataInd_t *data_in
l1sap->u.data.rssi = rssi;
if (!pcu_direct) {
l1sap->u.data.ber10k = data_ind->measParam.fBer * 10000;
- l1sap->u.data.ta_offs_qbits = data_ind->measParam.i16BurstTiming;
+ l1sap->u.data.ta_offs_256bits = data_ind->measParam.i16BurstTiming*64;
l1sap->u.data.lqual_cb = data_ind->measParam.fLinkQuality * 10;
}
return l1sap_up(trx, l1sap);
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 535ac8b7..e94b6427 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -876,7 +876,7 @@ static void process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
/* Update Timing offset for valid radio block */
if (data_len != 0) {
/* burst timing in 1x */
- l1sap.u.info.u.meas_ind.ta_offs_qbits = m->sBurstTiming;
+ l1sap.u.info.u.meas_ind.ta_offs_256bits = m->sBurstTiming4x*64;
} else {
/* FIXME, In current implementation, OCTPHY would send DATA_IND
* for all radio blocks (valid or invalid) But timing offset
@@ -884,7 +884,7 @@ static void process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
* counter to accumulate Timing offset.. even we add zero for
* invalid block.. timing offset average calucation would not
* correct. */
- l1sap.u.info.u.meas_ind.ta_offs_qbits = 0;
+ l1sap.u.info.u.meas_ind.ta_offs_256bits = 0;
}
l1sap.u.info.u.meas_ind.ber10k = oct_meas2ber10k(m);
@@ -1145,7 +1145,7 @@ static int handle_ph_data_ind(struct octphy_hdl *fl1,
l1sap->u.data.ber10k = oct_meas2ber10k(&data_ind->MeasurementInfo);
/* burst timing in 1x but PCU is expecting 4X */
- l1sap->u.data.ta_offs_qbits = data_ind->MeasurementInfo.sBurstTiming4x;
+ l1sap->u.data.ta_offs_256bits = data_ind->MeasurementInfo.sBurstTiming4x*64;
snr = data_ind->MeasurementInfo.sSNRDb;
/* FIXME: better converion formulae for SnR -> C / I?
l1sap->u.data.lqual_cb = (snr ? snr : (snr - 65536)) * 10 / 256;
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 08f584b2..46db69c3 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -904,7 +904,7 @@ static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
PRIM_OP_INDICATION, NULL);
l1sap.u.info.type = PRIM_INFO_MEAS;
l1sap.u.info.u.meas_ind.chan_nr = chan_nr;
- l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming;
+ l1sap.u.info.u.meas_ind.ta_offs_256bits = m->i16BurstTiming * 64;
l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 10000);
l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1);
l1sap.u.info.u.meas_ind.fn = fn;
@@ -965,7 +965,7 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
l1sap->u.data.rssi = (int8_t) (data_ind->measParam.fRssi);
if (!pcu_direct) { /* FIXME: if pcu_direct=1, then this is not set, what to do in pcu_tx_data_ind() in this case ?*/
l1sap->u.data.ber10k = data_ind->measParam.fBer * 10000;
- l1sap->u.data.ta_offs_qbits = data_ind->measParam.i16BurstTiming;
+ l1sap->u.data.ta_offs_256bits = data_ind->measParam.i16BurstTiming * 64;
l1sap->u.data.lqual_cb = data_ind->measParam.fLinkQuality * 10;
}
/* copy data from L1 primitive to L1SAP primitive */
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 4d2558c8..a8fb401f 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -495,7 +495,7 @@ static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, i
PRIM_OP_INDICATION, NULL);
l1sap->u.info.type = PRIM_INFO_MEAS;
l1sap->u.info.u.meas_ind.chan_nr = chan_nr;
- l1sap->u.info.u.meas_ind.ta_offs_qbits = toa256/64;
+ l1sap->u.info.u.meas_ind.ta_offs_256bits = toa256;
l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000);
l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1);
l1sap->u.info.u.meas_ind.fn = fn;
diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c
index 6904fe68..d0c368ee 100644
--- a/src/osmo-bts-virtual/l1_if.c
+++ b/src/osmo-bts-virtual/l1_if.c
@@ -145,7 +145,7 @@ static void virt_um_rcv_cb(struct virt_um_inst *vui, struct msgb *msg)
l1sap.u.data.fn = fn;
l1sap.u.data.rssi = 0; /* Radio Signal Strength Indicator. Best -> 0 */
l1sap.u.data.ber10k = 0; /* Bit Error Rate in 0.01%. Best -> 0 */
- l1sap.u.data.ta_offs_qbits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */
+ l1sap.u.data.ta_offs_256bits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */
l1sap.u.data.lqual_cb = 10 * signal_dbm; /* Link quality in centiBel = 10 * dB. */
l1sap.u.data.pdch_presence_info = PRES_INFO_BOTH;
l1if_process_meas_res(pinst->trx, timeslot, fn, chan_nr, 0, 0, 0, 0);
@@ -303,7 +303,7 @@ static void l1if_fill_meas_res(struct osmo_phsap_prim *l1sap, uint8_t chan_nr, f
PRIM_OP_INDICATION, NULL);
l1sap->u.info.type = PRIM_INFO_MEAS;
l1sap->u.info.u.meas_ind.chan_nr = chan_nr;
- l1sap->u.info.u.meas_ind.ta_offs_qbits = (int16_t)(ta*4);
+ l1sap->u.info.u.meas_ind.ta_offs_256bits = (int16_t)(ta*4);
l1sap->u.info.u.meas_ind.ber10k = (unsigned int) (ber * 10000);
l1sap->u.info.u.meas_ind.inv_rssi = (uint8_t) (rssi * -1);
l1sap->u.info.u.meas_ind.fn = fn;