aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/l1_if.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-01-23 16:02:09 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-10 13:38:07 +0100
commitcfce4d65f212de92a664f6400e38921ba70dcd36 (patch)
tree393cbc5fd13467a977c3ea0618e9cf4f139be3c0 /src/osmo-bts-sysmo/l1_if.c
parent00b4e064ffc4c4bb2863c1f8ce40e4e1e1bbbbff (diff)
handover,sysmobts: Refactor the parsing/handling of the access delay
Diffstat (limited to 'src/osmo-bts-sysmo/l1_if.c')
-rw-r--r--src/osmo-bts-sysmo/l1_if.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index ccdd79c0..178ffcef 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -806,6 +806,15 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
return rc;
}
+static int check_acc_delay(GsmL1_PhRaInd_t *ra_ind, struct gsm_bts_role_bts *btsb,
+ uint8_t *acc_delay)
+{
+ if (ra_ind->measParam.i16BurstTiming < 0)
+ *acc_delay = 0;
+ else
+ *acc_delay = ra_ind->measParam.i16BurstTiming >> 2;
+ return *acc_delay <= btsb->max_ta;
+}
static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind)
{
@@ -838,11 +847,7 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind)
}
/* check for under/overflow / sign */
- if (ra_ind->measParam.i16BurstTiming < 0)
- acc_delay = 0;
- else
- acc_delay = ra_ind->measParam.i16BurstTiming >> 2;
- if (acc_delay > btsb->max_ta) {
+ if (!check_acc_delay(ra_ind, btsb, &acc_delay)) {
LOGP(DL1C, LOGL_INFO, "ignoring RACH request %u > max_ta(%u)\n",
acc_delay, btsb->max_ta);
return 0;