diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-03-05 20:56:20 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2018-03-05 22:44:08 +0700 |
commit | 1ef544ea246a73ef4404cb9622ca41fbe8e0b76b (patch) | |
tree | 81a3c3a69d99f163b8e1cb0d598f8560725a05a8 /src | |
parent | 4f14804f8a023eff0ce2ac1712dd65383d1e0b96 (diff) |
common/l1sap.c: limit the minimal ToA for RACH bursts
In general, RACH bursts should not arrive with negative offset.
Let's limit early signal arrival up to 2 symbols, otherwise it
is most likely noise, interference or a ghost.
TTCN-3 test case: Icccc88545ed3aabd6da28a40599a8a77d1de477d
Change-Id: I662294fe3136cf7a259be13816a3e63f7db9a948
Diffstat (limited to 'src')
-rw-r--r-- | src/common/l1sap.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ce68599a..83801756 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1159,9 +1159,13 @@ static int l1sap_tch_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap, return 0; } +#define RACH_MIN_TOA256 -2 * 256 + static bool rach_pass_filter(struct ph_rach_ind_param *rach_ind, struct gsm_bts_role_bts *btsb) { + int16_t toa256 = rach_ind->acc_delay_256bits; + /* Check for RACH exceeding BER threshold (ghost RACH) */ if (rach_ind->ber10k > btsb->max_ber10k_rach) { LOGPFN(DL1C, LOGL_INFO, rach_ind->fn, "Ignoring RACH request: " @@ -1170,11 +1174,15 @@ static bool rach_pass_filter(struct ph_rach_ind_param *rach_ind, return false; } - /* Make sure that ToA (Timing of Arrival) is acceptable */ - if (rach_ind->acc_delay > btsb->max_ta) { + /** + * Make sure that ToA (Timing of Arrival) is acceptable. + * We allow early arrival up to 2 symbols, and delay + * according to maximal allowed Timing Advance value. + */ + if (toa256 < RACH_MIN_TOA256 || toa256 > btsb->max_ta * 256) { LOGPFN(DL1C, LOGL_INFO, rach_ind->fn, "Ignoring RACH request: " - "ToA(%u) exceeds the maximal allowed TA(%u) value\n", - rach_ind->acc_delay, btsb->max_ta); + "ToA(%d) exceeds the allowed range (%d..%d)\n", + toa256, RACH_MIN_TOA256, btsb->max_ta * 256); return false; } |