Change in osmo-bts[master]: measurement: make sure state is reset on chan act.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Mon Aug 20 16:28:18 UTC 2018


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10554


Change subject: measurement: make sure state is reset on chan act.
......................................................................

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
---
M include/osmo-bts/measurement.h
M src/common/measurement.c
M src/common/rsl.c
3 files changed, 11 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/10554/1

diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h
index 283b0ff..d98e9f0 100644
--- a/include/osmo-bts/measurement.h
+++ b/include/osmo-bts/measurement.h
@@ -10,4 +10,6 @@
 
 void lchan_meas_process_measurement(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn);
 
+void lchan_meas_reset(struct gsm_lchan *lchan);
+
 #endif
diff --git a/src/common/measurement.c b/src/common/measurement.c
index a75b54d..bd2c0b7 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -490,3 +490,11 @@
 	 * 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 a24c444..ff2d997 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -750,7 +750,7 @@
 	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);
 }

-- 
To view, visit https://gerrit.osmocom.org/10554
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I880ae3030df6dcd60c32b7144c3430528429bdea
Gerrit-Change-Number: 10554
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180820/53b2af68/attachment.htm>


More information about the gerrit-log mailing list