aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/l1sap.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-23 23:58:42 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-24 11:08:20 +0200
commitf2419bf8c38efa877644bdc88a99fc1278a89f58 (patch)
treed0c0c65e2245b2f1d31d091d7a6f545c5bafbcd3 /src/common/l1sap.c
parent03e3fae639a46fe5a2cffbda640c3a4a224beb51 (diff)
l1sap: Fix calculation of expired RACH slots in case of missing frame numbers
In case of a Combined CCCH (with SDCCH/4), the number of RACH slots depends on the frame number. So in case of lost/skipped frame numbers, we cannot simply compute the value for the current fn and then multiply it by the number of frame numbers expired. Rather, we have to 'replay' all missed frame numbers and individually determine how many RACH slots happened in that frame. Related: OS#3750 Change-Id: If4f8d2ea55fc722c64c330cde09e833b67ee98fe
Diffstat (limited to 'src/common/l1sap.c')
-rw-r--r--src/common/l1sap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index d9ffdb8f..52f2b334 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -493,6 +493,7 @@ static int l1sap_info_time_ind(struct gsm_bts *bts,
struct info_time_ind_param *info_time_ind)
{
int frames_expired;
+ int i;
DEBUGPFN(DL1P, info_time_ind->fn, "Rx MPH_INFO time ind\n");
@@ -513,8 +514,10 @@ static int l1sap_info_time_ind(struct gsm_bts *bts,
/* increment number of RACH slots that have passed by since the
* last time indication */
- bts->load.rach.total +=
- calc_exprd_rach_frames(bts, info_time_ind->fn) * frames_expired;
+ for (i = 0; i < frames_expired; i++) {
+ uint32_t fn = (info_time_ind->fn + GSM_HYPERFRAME - i) % GSM_HYPERFRAME;
+ bts->load.rach.total += calc_exprd_rach_frames(bts, fn);
+ }
return 0;
}