aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/l1sap.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-26 11:57:49 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-27 17:27:35 +0100
commitc2b4c668f3510b7b0baace749c5a310959010e90 (patch)
treee4796019dc76a1655ab4a0f99e79b27636126e0b /src/common/l1sap.c
parentb60d9e9464dabba64e7ba73a1a8f41adab21ff31 (diff)
Move rach_busy counting above L1SAP
In the past, rach_busy counting was performed below L1SAP, while reporting was handled above. This lead to subtle differences between the BTS models, such as osmo-bts-trx missing to increment rach_busy. Let's move the rach_busy counting above L1SAP to share more code. This means we need libosmocore Change-Id I9439810c3a3ad89ea0302753617b850749af887c for the additional required parameters in ph_rach_ind_param, as well as libosmocore Change-id I2b1926a37bde860dcfeb0d613eb55a71271928c5 for osmo-bts-trx to determine the RACH bit error rate. Change-Id: I3b989580cb38082e3fd8fc50a11fedda13991092 Closes: OS#3003
Diffstat (limited to 'src/common/l1sap.c')
-rw-r--r--src/common/l1sap.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 2623d84a..90f045a2 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1190,8 +1190,24 @@ static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
uint8_t acc_delay;
DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind");
+
+ /* check for handover access burst on dedicated channels */
+ if (!L1SAP_IS_CHAN_RACH(rach_ind->chan_nr)) {
+ rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_HO);
+ return l1sap_handover_rach(trx, l1sap, rach_ind);
+ }
+
rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_RCVD);
+ /* increment number of busy RACH slots, if required */
+ if (rach_ind->rssi >= btsb->load.rach.busy_thresh)
+ btsb->load.rach.busy++;
+
+ /* FIXME: RACH filtering due to BER limit */
+
+ /* increment number of RACH slots with valid non-handover RACH burst */
+ btsb->load.rach.access++;
+
lc = &trx->ts[0].lchan[CCCH_LCHAN].lapdm_ch;
/* check for under/overflow / sign */
@@ -1205,12 +1221,6 @@ static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
/* According to 3GPP TS 48.058 ยง 9.3.17 Access Delay is expressed same way as TA (number of symbols) */
set_ms_to_data(get_lchan_by_chan_nr(trx, rach_ind->chan_nr), acc_delay, false);
- /* check for handover rach */
- if (!L1SAP_IS_CHAN_RACH(rach_ind->chan_nr)) {
- rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_HO);
- return l1sap_handover_rach(trx, l1sap, rach_ind);
- }
-
/* check for packet access */
if ((trx == bts->c0 && L1SAP_IS_PACKET_RACH(rach_ind->ra)) ||
(trx == bts->c0 && rach_ind->is_11bit)) {