diff options
Diffstat (limited to 'src/osmo-bts-sysmo/l1_if.c')
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 32da5d9f..bdd06f0d 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -47,6 +47,7 @@ #include <osmo-bts/paging.h> #include <osmo-bts/measurement.h> #include <osmo-bts/pcu_if.h> +#include <osmo-bts/handover.h> #include <sysmocom/femtobts/superfemto.h> #include <sysmocom/femtobts/gsml1prim.h> @@ -705,6 +706,9 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i data_ind->msgUnitParam.u8Size)); dump_meas_res(LOGL_DEBUG, &data_ind->measParam); + if (lchan->ho.active == HANDOVER_WAIT_FRAME) + handover_frame(lchan); + switch (data_ind->sapi) { case GsmL1_Sapi_Sacch: radio_link_timeout(lchan, (data_ind->msgUnitParam.u8Size == 0)); @@ -819,11 +823,26 @@ static int check_acc_delay(GsmL1_PhRaInd_t *ra_ind, struct gsm_bts_role_bts *bts return *acc_delay <= btsb->max_ta; } +static int handle_handover(struct gsm_lchan *lchan, struct gsm_bts_role_bts *btsb, + GsmL1_PhRaInd_t *ra_ind) +{ + uint8_t acc_delay; + if (!check_acc_delay(ra_ind, btsb, &acc_delay)) { + LOGP(DHO, LOGL_INFO, "%s ignoring RACH request %u > max_ta(%u)\n", + gsm_lchan_name(lchan), acc_delay, btsb->max_ta); + return 0; + } + + handover_rach(lchan, ra_ind->msgUnitParam.u8Buffer[0], acc_delay); + return 0; +} + static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind) { struct gsm_bts_trx *trx = fl1->priv; struct gsm_bts *bts = trx->bts; struct gsm_bts_role_bts *btsb = bts->role; + struct gsm_lchan *lchan; struct osmo_phsap_prim pp; struct lapdm_channel *lc; uint8_t acc_delay; @@ -836,6 +855,13 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind) if (ra_ind->measParam.fLinkQuality < fl1->min_qual_rach) return 0; + /* + * Check if this is a handover + */ + lchan = l1if_hLayer_to_lchan(trx, ra_ind->hLayer2); + if (lchan && lchan->ho.active == HANDOVER_ENABLED) + return handle_handover(lchan, btsb, ra_ind); + /* increment number of RACH slots with valid RACH burst */ if (trx == bts->c0) btsb->load.rach.access++; |