aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-08-17 11:57:34 +0200
committerHarald Welte <laforge@gnumonks.org>2018-08-17 16:24:26 +0000
commitb5a28bd9678c7af21679349b5f1972aef5ecaab3 (patch)
tree464577b0647fd5fbbb87cb3ad6e7c518a34f1ff0 /src
parent829263afc4aaf3304657acafb398ad403b045c27 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/common/l1sap.c6
-rw-r--r--src/common/measurement.c13
2 files changed, 14 insertions, 5 deletions
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);
+}