diff mbox

[33/33] Move detection of handover frames from sysmo-bts code to common code

Message ID 1409176492-13269-34-git-send-email-laforge@gnumonks.org
State Superseded
Headers show

Commit Message

Harald Welte Aug. 27, 2014, 9:54 p.m. UTC
From: Andreas Eversberg <jolly@eversberg.eu>

---
 src/common/l1sap.c         |  4 ++++
 src/osmo-bts-sysmo/l1_if.c | 13 -------------
 2 files changed, 4 insertions(+), 13 deletions(-)
diff mbox

Patch

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index e006412..5318085 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -762,6 +762,10 @@  static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
 		return -EINVAL;
 	}
 
+	/* report first valid received frame to handover process */
+	if (lchan->ho.active == HANDOVER_WAIT_FRAME)
+		handover_frame(lchan);
+
 	if (L1SAP_IS_LINK_SACCH(link_id)) {
 		radio_link_timeout(lchan, 0);
 		le = &lchan->lapdm_ch.lapdm_acch;
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 2ba7c3c..9707a22 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -819,22 +819,12 @@  static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
 			      struct msgb *l1p_msg)
 {
 	struct gsm_bts_trx *trx = fl1->priv;
-	struct gsm_lchan *lchan;
 	uint8_t chan_nr, link_id;
 	struct osmo_phsap_prim *l1sap;
 	uint32_t fn;
 	uint8_t *data, len;
 	int rc = 0;
 
-	lchan = l1if_hLayer_to_lchan(fl1->priv, data_ind->hLayer2);
-	if (!lchan) {
-		LOGP(DL1C, LOGL_ERROR,
-			"unable to resolve lchan by hLayer2 for 0x%x\n",
-			data_ind->hLayer2);
-		msgb_free(l1p_msg);
-		return -ENODEV;
-	}
-
 	chan_nr = chan_nr_by_sapi(trx->ts[data_ind->u8Tn].pchan, data_ind->sapi,
 		data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn);
 	if (!chan_nr) {
@@ -861,9 +851,6 @@  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);
-
 	/* check for TCH */
 	if (data_ind->sapi == GsmL1_Sapi_TchF
 	 || data_ind->sapi == GsmL1_Sapi_TchH) {