diff options
-rw-r--r-- | include/osmo-bts/measurement.h | 2 | ||||
-rw-r--r-- | src/common/measurement.c | 8 | ||||
-rw-r--r-- | src/common/rsl.c | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h index 283b0ffc..d98e9f0b 100644 --- a/include/osmo-bts/measurement.h +++ b/include/osmo-bts/measurement.h @@ -10,4 +10,6 @@ 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); +void lchan_meas_reset(struct gsm_lchan *lchan); + #endif 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); } |