aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-03-18 15:30:49 +0300
committerfixeria <vyanitskiy@sysmocom.de>2022-04-05 13:45:31 +0000
commitda433bba7b70cccd8990ed530593efee4b197470 (patch)
tree2ae9d9c76fa4cf8dd77e18a0ba8af58bfc0fe9b9 /src
parentbd7ef4101b3fdfdac835f1f3c68832217b987444 (diff)
osmo-bts-trx: rx_tchh_fn(): get rid of chan_state->meas_avg_facch
FACCH/H takes out two speech frames, so we send two BFIs once we have received it in rx_tchh_fn(). The upper layers responsible for handling of the Uplink measurements expect a fixed amount of measurement samples, so currently we do: * send a FACCH frame with the associated measurememnts (S6N6), * send the 1st BFI with invalidated measurements (RSSI=0), * send the 2nd BFI with the stored measurememnts of FACCH. This is achieved by preserving a copy of the FACCH measurememnts in chan_state->meas_avg_facch and then using it two bursts later. The same goal can be achieved a lot easier by sending the associated measurements with both BFIs as if no FACCH was received: * send a FACCH frame with invalidated measurememnts (RSSI=0), * send the 1st BFI with the associated measurememnts (S6N4), * send the 2nd BFI with the associated measurememnts (S6N4). This eliminates the need to store anything outside of the existing measurement history and simplifies the code a lot. Also, this eliminates the need for using a dedicated averaging mode S6N6. Varified by running BTS_Tests.TC_meas_res_speech_tchh_facch. Change-Id: I7902b4709bc3f418174e8373f52e87bb31cdc826 Related: I1ad9fa3815feb2b4da608ab7df716a87ba1f2f91
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchh.c38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 45531321..e97adbd3 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -71,7 +71,6 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
uint16_t ber10k = 0;
uint8_t is_sub = 0;
uint8_t ft;
- bool mask_stolen_tch_block = false;
bool fn_is_cmi;
/* If handover RACH detection is turned on, treat this burst as an Access Burst.
@@ -127,11 +126,7 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
memcpy(*bursts_p + 232, *bursts_p + 464, 232);
/* we have already sent the first BFI when a FACCH/H frame
* was decoded (see below), now send the second one. */
- memset(&meas_avg, 0, sizeof(meas_avg));
- /* In order to provide an even stream of measurement reports
- * we ask the code below to mask the missing TCH/H block
- * measurement report with the FACCH measurement results. */
- mask_stolen_tch_block = true;
+ trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
goto bfi;
}
@@ -248,8 +243,6 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
ber10k = compute_ber10k(n_bits_total, n_errors);
/* average measurements of the last N (depends on mode) bursts */
- if (rc == GSM_MACBLOCK_LEN)
- meas_avg_mode = SCHED_MEAS_AVG_M_S6N6;
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
/* Check if the frame is bad */
@@ -277,22 +270,15 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_FACCH_H0);
else
fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_FACCH_H1);
+ /* In order to provide an even stream of measurement reports, here we
+ * intentionally invalidate RSSI, so that this report gets dropped in
+ * process_l1sap_meas_data(). The averaged results will still be sent
+ * with the first BFI (see below). */
_sched_compose_ph_data_ind(l1ts, fn_begin, bi->chan,
tch_data + amr, GSM_MACBLOCK_LEN,
- meas_avg.rssi, meas_avg.toa256,
- meas_avg.ci_cb, ber10k,
+ 0, /* intentionally invalidate RSSI */
+ meas_avg.toa256, meas_avg.ci_cb, ber10k,
PRES_INFO_UNKNOWN);
-
- /* Keep a copy of the measurement results of the last FACCH
- * transmission in order to be able to create a replacement
- * measurement result for the one missing TCH block
- * measurement */
- memcpy(&chan_state->meas_avg_facch, &meas_avg, sizeof(meas_avg));
-
- /* Invalidate the current measurement result to prevent the
- * code below from handing up the current measurement a second
- * time. */
- memset(&meas_avg, 0, sizeof(meas_avg));
ber10k = 0;
bfi:
/* A FACCH/H frame replaces two speech frames, so we need to send two BFIs.
@@ -363,16 +349,6 @@ compose_l1sap:
else
fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H1);
- /* A FACCH/H transmission takes out two TCH/H voice blocks and the
- * related measurement results. The first measurement result is handed
- * up directly with the FACCH (see above), the second one needs to be
- * compensated by filling the gap with the measurement result we got
- * from the FACCH transmission. */
- if (mask_stolen_tch_block) {
- memcpy(&meas_avg, &chan_state->meas_avg_facch, sizeof(meas_avg));
- memset(&chan_state->meas_avg_facch, 0, sizeof(meas_avg));
- }
-
return _sched_compose_tch_ind(l1ts, fn_begin, bi->chan, tch_data, rc,
/* FIXME: what should we use for BFI here? */
bfi_flag ? bi->toa256 : meas_avg.toa256, ber10k,