diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-01-23 13:14:56 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-01-23 13:16:19 +0100 |
commit | f3e295a24f15e924a89b37ad5a29602973b2a6c9 (patch) | |
tree | 7d2f73577c02cd918c3007d7180fb59d7798c55c /src | |
parent | 76ba99c3fe89a1491f5cf4e8bc3b521dffdd2dfb (diff) |
wip: Continue with hacks to support handover...
it appears to work without encryption... using the E71
Diffstat (limited to 'src')
-rw-r--r-- | src/common/handover.c | 23 | ||||
-rw-r--r-- | src/common/rsl.c | 3 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/femtobts.c | 1 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 17 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/oml.c | 11 |
5 files changed, 37 insertions, 18 deletions
diff --git a/src/common/handover.c b/src/common/handover.c index 04aadb03..f20f05ed 100644 --- a/src/common/handover.c +++ b/src/common/handover.c @@ -35,7 +35,7 @@ #include <osmo-bts/handover.h> /* Transmit a handover related PHYS INFO on given lchan */ -static int ho_tx_phys_info(struct gsm_lchan *lchan, uint8_t ta) +static int ho_tx_phys_info(struct gsm_lchan *lchan) { struct msgb *msg = msgb_alloc_headroom(1024, 128, "PHYS INFO"); struct gsm48_hdr *gh; @@ -52,7 +52,7 @@ static int ho_tx_phys_info(struct gsm_lchan *lchan, uint8_t ta) gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); gh->proto_discr = GSM48_PDISC_RR; gh->msg_type = GSM48_MT_RR_HANDO_INFO; - msgb_put_u8(msg, ta); + msgb_put_u8(msg, lchan->rqd_ta); rsl_rll_push_l3(msg, RSL_MT_UNIT_DATA_REQ, gsm_lchan2chan_nr(lchan), 0x00, 0); @@ -86,16 +86,15 @@ static void ho_t3105_cb(void *data) return; } - ho_tx_phys_info(lchan, lchan->rqd_ta); + ho_tx_phys_info(lchan); lchan->ho.phys_info_count++; osmo_timer_schedule(&lchan->ho.t3105, 0, btsb->t3105_ms * 1000); } /* received random access on dedicated channel */ -void handover_rach(struct gsm_bts_trx *trx, uint8_t chan_nr, - struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay) +void handover_rach(struct gsm_lchan *lchan, uint8_t ra) { - struct gsm_bts *bts = trx->bts; + struct gsm_bts *bts = lchan->ts->trx->bts; struct gsm_bts_role_bts *btsb = bts->role; /* Ignore invalid handover ref */ @@ -107,11 +106,8 @@ void handover_rach(struct gsm_bts_trx *trx, uint8_t chan_nr, } LOGP(DHO, LOGL_NOTICE, - "%s RACH on dedicated channel received with TA=%u\n", - gsm_lchan_name(lchan), acc_delay); - - /* Set timing advance */ - lchan->rqd_ta = acc_delay; + "%s RACH on dedicated channel received\n", + gsm_lchan_name(lchan)); /* Stop handover detection, wait for valid frame */ lchan->ho.active = HANDOVER_WAIT_FRAME; @@ -124,11 +120,11 @@ void handover_rach(struct gsm_bts_trx *trx, uint8_t chan_nr, } /* Send HANDover DETect to BSC */ - rsl_tx_hando_det(lchan, &acc_delay); + rsl_tx_hando_det(lchan, NULL); /* Send PHYS INFO */ lchan->ho.phys_info_count = 1; - ho_tx_phys_info(lchan, acc_delay); + ho_tx_phys_info(lchan); /* Start T3105 */ LOGP(DHO, LOGL_DEBUG, @@ -144,7 +140,6 @@ void handover_frame(struct gsm_lchan *lchan) { LOGP(DHO, LOGL_INFO, "%s First valid frame detected\n", gsm_lchan_name(lchan)); - reset_handover(lchan); } diff --git a/src/common/rsl.c b/src/common/rsl.c index 09b815b2..077b836a 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -739,7 +739,8 @@ static int rsl_rx_chan_activ(struct msgb *msg) TLVP_PRESENT(&tp, RSL_IE_HANDO_REF)) { lchan->ho.active = HANDOVER_ENABLED; lchan->ho.ref = *TLVP_VAL(&tp, RSL_IE_HANDO_REF); - LOGP(DRSL, LOGL_INFO, "Channel activation due to handover (id %i)", lchan->ho.ref); + LOGP(DRSL, LOGL_INFO, + "Channel activation due to handover (id %i)\n", lchan->ho.ref); } /* 9.3.4 BS Power */ diff --git a/src/osmo-bts-sysmo/femtobts.c b/src/osmo-bts-sysmo/femtobts.c index 28d861c4..da165c5d 100644 --- a/src/osmo-bts-sysmo/femtobts.c +++ b/src/osmo-bts-sysmo/femtobts.c @@ -173,6 +173,7 @@ const SuperFemto_PrimId_t femtobts_sysprim_req2conf[SuperFemto_PrimId_NUM] = { }; const struct value_string femtobts_l1sapi_names[GsmL1_Sapi_NUM+1] = { + { GsmL1_Sapi_Idle, "IDLE" }, { GsmL1_Sapi_Fcch, "FCCH" }, { GsmL1_Sapi_Sch, "SCH" }, { GsmL1_Sapi_Sacch, "SACCH" }, diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 957668d9..73e98555 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> @@ -711,6 +712,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)); @@ -812,12 +816,18 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i return rc; } +static int handle_handover(struct gsm_lchan *lchan, GsmL1_PhRaInd_t *ra_ind) +{ + handover_rach(lchan, ra_ind->msgUnitParam.u8Buffer[0]); + 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; @@ -830,6 +840,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, ra_ind); + /* increment number of RACH slots with valid RACH burst */ if (trx == bts->c0) btsb->load.rach.access++; diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 7cd8358a..58c6f54a 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1389,11 +1389,13 @@ static int check_sapi_release(struct gsm_lchan *lchan, int sapi, int dir) static int release_sapis_for_ho(struct gsm_lchan *lchan) { int res = 0; - unsigned int i; + int i; - for (i = sapis_for_ho.num_sapis - 1; i >= 0; --i) + const struct lchan_sapis *s4l = &sapis_for_ho; + + for (i = s4l->num_sapis-1; i >= 0; i--) res |= check_sapi_release(lchan, - sapis_for_ho.sapis[i].sapi, sapis_for_ho.sapis[i].dir); + s4l->sapis[i].sapi, s4l->sapis[i].dir); return res; } @@ -1585,6 +1587,9 @@ int bts_model_rsl_chan_mod(struct gsm_lchan *lchan) if (lchan->ho.active == HANDOVER_NONE) return -1; + LOGP(DHO, LOGL_ERROR, "%s modifying channel for handover\n", + gsm_lchan_name(lchan)); + /* Give up listening to RACH bursts */ release_sapis_for_ho(lchan); |