aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-08-20 10:54:15 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2018-08-20 12:19:30 +0200
commit9feddb7edfc95b6864e5f594211bd94d54d4ab46 (patch)
tree35014e15be8936f241dc349e105e2a596b357760 /src/common
parentb5a28bd9678c7af21679349b5f1972aef5ecaab3 (diff)
measurement: make sure state is reset on chan act.
At the moment only lchan_meas_reset is reset on channel activation. All other states are not reset. This may lead to irretations in the first measurement interval if there are still leftover messages from a previous connection. Lets ensure everything is reset to zero by zeroing out the whole .meas struct in struct lchan. - Add a centralized function that does the reset - Call that function from rsl_tx_chan_act_ack() in rsl.c Change-Id: I880ae3030df6dcd60c32b7144c3430528429bdea Related: OS#2975 Related: OS#2987
Diffstat (limited to 'src/common')
-rw-r--r--src/common/measurement.c8
-rw-r--r--src/common/rsl.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/common/measurement.c b/src/common/measurement.c
index a75b54da..bd2c0b79 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -490,3 +490,11 @@ void lchan_meas_process_measurement(struct gsm_lchan *lchan, struct bts_ul_meas
* measurment report at Meas period End */
lchan_meas_check_compute(lchan, fn);
}
+
+/* Reset all measurement related struct members to their initial values. This
+ * function will be called every time an lchan is activated to ensure the
+ * measurement process starts with a defined state. */
+void lchan_meas_reset(struct gsm_lchan *lchan)
+{
+ memset(&lchan->meas, 0, sizeof(lchan->meas));
+}
diff --git a/src/common/rsl.c b/src/common/rsl.c
index a24c444e..ff2d9977 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -750,7 +750,7 @@ static int rsl_tx_chan_act_ack(struct gsm_lchan *lchan)
msg->trx = lchan->ts->trx;
/* since activation was successful, do some lchan initialization */
- lchan->meas.res_nr = 0;
+ lchan_meas_reset(lchan);
return abis_bts_rsl_sendmsg(msg);
}