From b5a28bd9678c7af21679349b5f1972aef5ecaab3 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 17 Aug 2018 11:57:34 +0200 Subject: cosmetic: unify measurement sample handling in one function In l1sap.c we call lchan_new_ul_meas() and lchan_meas_check_compute() directly in sequence. Lets unify thos two steps inside measurement.c so that we only need to call one function from l1sap.c. Change-Id: If48bc7442dfaab8c36b93949f741de6e836e792a Related: OS#2975 --- include/osmo-bts/measurement.h | 2 ++ src/common/l1sap.c | 6 +----- src/common/measurement.c | 13 +++++++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h index e32c8e81..283b0ffc 100644 --- a/include/osmo-bts/measurement.h +++ b/include/osmo-bts/measurement.h @@ -8,4 +8,6 @@ int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn); +void lchan_meas_process_measurement(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn); + #endif diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 8936674f..00ead8d5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -528,11 +528,7 @@ static int l1sap_info_meas_ind(struct gsm_bts_trx *trx, /* we assume that symbol period is 1 bit: */ set_ms_to_data(lchan, info_meas_ind->ta_offs_256bits / 256, true); - lchan_new_ul_meas(lchan, &ulm, info_meas_ind->fn); - - /* Check measurement period end and prepare the UL measurment - * report at Meas period End*/ - lchan_meas_check_compute(lchan, info_meas_ind->fn); + lchan_meas_process_measurement(lchan, &ulm, info_meas_ind->fn); return 0; } diff --git a/src/common/measurement.c b/src/common/measurement.c index 01f1e5dc..a75b54da 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -477,3 +477,16 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) return 1; } + +/* Process a single uplink measurement sample. This function is called from + * l1sap.c every time a measurement indication is received. It collects the + * measurement samples and automatically detects the end oft the measurement + * interval. */ +void lchan_meas_process_measurement(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn) +{ + lchan_new_ul_meas(lchan, ulm, fn); + + /* Check measurement period end and prepare the UL + * measurment report at Meas period End */ + lchan_meas_check_compute(lchan, fn); +} -- cgit v1.2.3