diff options
Diffstat (limited to 'src/common/l1sap.c')
-rw-r--r-- | src/common/l1sap.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 9648caa1..ce68599a 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -797,20 +797,6 @@ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx, return 1; } -/* special case where handover RACH is detected */ -static int l1sap_handover_rach(struct gsm_bts_trx *trx, - struct osmo_phsap_prim *l1sap, struct ph_rach_ind_param *rach_ind) -{ - struct gsm_lchan *lchan; - - lchan = get_lchan_by_chan_nr(trx, rach_ind->chan_nr); - - handover_rach(lchan, rach_ind->ra, rach_ind->acc_delay); - - /* must return 0, so in case of msg at l1sap, it will be freed */ - return 0; -} - static bool rtppayload_is_octet_aligned(const uint8_t *rtp_pl, uint8_t payload_len) { /* @@ -1195,6 +1181,23 @@ static bool rach_pass_filter(struct ph_rach_ind_param *rach_ind, return true; } +/* Special case where handover RACH is detected */ +static int l1sap_handover_rach(struct gsm_bts_trx *trx, + struct osmo_phsap_prim *l1sap, struct ph_rach_ind_param *rach_ind) +{ + /* Filter out noise / interference / ghosts */ + if (!rach_pass_filter(rach_ind, trx->bts->role)) { + rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_DROP); + return 0; + } + + handover_rach(get_lchan_by_chan_nr(trx, rach_ind->chan_nr), + rach_ind->ra, rach_ind->acc_delay); + + /* must return 0, so in case of msg at l1sap, it will be freed */ + return 0; +} + /* RACH received from bts model */ static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap, struct ph_rach_ind_param *rach_ind) |