diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-07-07 20:00:53 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2019-07-21 21:55:51 +0700 |
commit | b777c0f3ecb8b770f032db449e947f0f9731de11 (patch) | |
tree | ba1e306cae248c4171b3b2e98e63904b4e3f9770 | |
parent | 9649a42d5a3c24a21c14bb9f54e7c34a398da7b1 (diff) |
Move Access Burst link quality handling to L1SAP
Change-Id: I893ec9c6c2ebad71ea68b2dc5f9f5094dfc43b78
Depends: (libosmocore) Ie2a66ebd040b61d6daf49e04bf8a84d3d64764ee
-rw-r--r-- | src/common/l1sap.c | 8 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/l1_if.c | 8 | ||||
-rw-r--r-- | src/osmo-bts-oc2g/l1_if.c | 8 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 8 | ||||
-rw-r--r-- | src/osmo-bts-trx/scheduler_trx.c | 6 | ||||
-rw-r--r-- | tests/handover/handover_test.c | 2 |
6 files changed, 19 insertions, 21 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 79af8e21..f07e79ca 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1272,6 +1272,14 @@ static bool rach_pass_filter(struct ph_rach_ind_param *rach_ind, struct gsm_bts return false; } + /* Link quality defined by C/I (Carrier-to-Interference ratio) */ + if (rach_ind->lqual_cb < bts->min_qual_rach) { + LOGPFN(DL1C, LOGL_INFO, rach_ind->fn, "Ignoring RACH request: " + "link quality (%d) below the minimum (%d)\n", + rach_ind->lqual_cb, bts->min_qual_rach); + return false; + } + return true; } diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 77b72bd0..2ac0b7ab 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -997,18 +997,11 @@ static int handle_ph_ra_ind(struct lc15l1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, struct msgb *l1p_msg) { struct gsm_bts_trx *trx = lc15l1_hdl_trx(fl1); - struct gsm_bts *bts = trx->bts; struct gsm_lchan *lchan; struct osmo_phsap_prim *l1sap; int rc; struct ph_rach_ind_param rach_ind_param; - /* FIXME: this should be deprecated/obsoleted as it bypasses rach.busy counting */ - if (ra_ind->measParam.fLinkQuality * 10 < bts->min_qual_rach) { - msgb_free(l1p_msg); - return 0; - } - dump_meas_res(LOGL_DEBUG, &ra_ind->measParam); if ((ra_ind->msgUnitParam.u8Size != 1) && @@ -1029,6 +1022,7 @@ static int handle_ph_ra_ind(struct lc15l1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, .rssi = (int8_t) ra_ind->measParam.fRssi, .ber10k = (unsigned int) (ra_ind->measParam.fBer * 10000.0), .acc_delay_256bits = ra_ind->measParam.i16BurstTiming * 64, + .lqual_cb = (int16_t) ra_ind->measParam.fLinkQuality * 10, /* centiBels */ }; lchan = l1if_hLayer_to_lchan(trx, (uint32_t)ra_ind->hLayer2); diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c index 9affc89b..d987bb52 100644 --- a/src/osmo-bts-oc2g/l1_if.c +++ b/src/osmo-bts-oc2g/l1_if.c @@ -1053,18 +1053,11 @@ static int handle_ph_ra_ind(struct oc2gl1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, struct msgb *l1p_msg) { struct gsm_bts_trx *trx = oc2gl1_hdl_trx(fl1); - struct gsm_bts *bts = trx->bts; struct gsm_lchan *lchan; struct osmo_phsap_prim *l1sap; int rc; struct ph_rach_ind_param rach_ind_param; - /* FIXME: this should be deprecated/obsoleted as it bypasses rach.busy counting */ - if (ra_ind->measParam.fLinkQuality * 10 < bts->min_qual_rach) { - msgb_free(l1p_msg); - return 0; - } - dump_meas_res(LOGL_DEBUG, &ra_ind->measParam); if ((ra_ind->msgUnitParam.u8Size != 1) && @@ -1085,6 +1078,7 @@ static int handle_ph_ra_ind(struct oc2gl1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, .rssi = (int8_t) ra_ind->measParam.fRssi, .ber10k = (unsigned int) (ra_ind->measParam.fBer * 10000.0), .acc_delay_256bits = ra_ind->measParam.i16BurstTiming * 64, + .lqual_cb = (int16_t) ra_ind->measParam.fLinkQuality * 10, /* centiBels */ }; lchan = l1if_hLayer_to_lchan(trx, (uint32_t)ra_ind->hLayer2); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 58fc24ef..df39e2f4 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -991,18 +991,11 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, struct msgb *l1p_msg) { struct gsm_bts_trx *trx = femtol1_hdl_trx(fl1); - struct gsm_bts *bts = trx->bts; struct gsm_lchan *lchan; struct osmo_phsap_prim *l1sap; int rc; struct ph_rach_ind_param rach_ind_param; - /* FIXME: this should be deprecated/obsoleted as it bypasses rach.busy counting */ - if (ra_ind->measParam.fLinkQuality * 10 < bts->min_qual_rach) { - msgb_free(l1p_msg); - return 0; - } - dump_meas_res(LOGL_DEBUG, &ra_ind->measParam); if ((ra_ind->msgUnitParam.u8Size != 1) && @@ -1024,6 +1017,7 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, .rssi = (int8_t) ra_ind->measParam.fRssi, .ber10k = (unsigned int) (ra_ind->measParam.fBer * 10000.0), .acc_delay_256bits = ra_ind->measParam.i16BurstTiming * 64, + .lqual_cb = (int16_t) ra_ind->measParam.fLinkQuality * 10, /* centiBels */ }; lchan = l1if_hLayer_to_lchan(trx, ra_ind->hLayer2); diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 79e42e10..ec1d8320 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -823,6 +823,12 @@ int rx_rach_fn(struct l1sched_trx *l1t, enum trx_chan_type chan, l1sap.u.rach_ind.rssi = bi->rssi; l1sap.u.rach_ind.fn = bi->fn; + /* Link quality is defined by C/I (Carrier-to-Interference ratio), + * which has optional presence. If it's absent, report the + * minimum acceptable value to pass L1SAP checks. */ + /* TODO: check for TRX_BI_F_CI_CB, and use the value from UL.ind */ + l1sap.u.rach_ind.lqual_cb = l1t->trx->bts->min_qual_rach; + /* Decode RACH depending on its synch. sequence */ switch (synch_seq) { case RACH_SYNCH_SEQ_TS1: diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index a805554e..c9799af7 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -118,6 +118,8 @@ int main(int argc, char **argv) /* send access burst with wrong ref */ memset(&nl1sap, 0, sizeof(nl1sap)); osmo_prim_init(&nl1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION, NULL); + /* Report the minimum acceptable value to pass L1SAP checks */ + nl1sap.u.rach_ind.lqual_cb = bts->min_qual_rach; nl1sap.u.rach_ind.chan_nr = 0x0a; nl1sap.u.rach_ind.ra = 42; l1sap_up(trx, &nl1sap); |