l1: Pass all L1 measurements upwards

Currently only the RSSI value is passed to the upper layers. Other
values like TA and BER which are needed for TA update respectively CS
selection are not propagated.

This commit introduces and passes a struct that contains a set of
measurement values.

Sponsored-by: On-Waves ehf
diff --git a/src/sysmo_l1_if.c b/src/sysmo_l1_if.c
index 6e1e9e4..fc4b59b 100644
--- a/src/sysmo_l1_if.c
+++ b/src/sysmo_l1_if.c
@@ -166,10 +166,23 @@
 	return rc;
 }
 
+static void get_meas(struct pcu_l1_meas *meas, const GsmL1_MeasParam_t *l1_meas)
+{
+	meas->rssi = (int8_t) (l1_meas->fRssi);
+	meas->have_rssi = 1;
+	meas->ber  = (uint8_t) (l1_meas->fBer * 100);
+	meas->have_ber = 1;
+	meas->bto  = (int16_t) (l1_meas->i16BurstTiming);
+	meas->have_bto = 1;
+	meas->link_qual  = (int16_t) (l1_meas->fLinkQuality);
+	meas->have_link_qual = 1;
+}
+
 static int handle_ph_data_ind(struct femtol1_hdl *fl1h,
 	GsmL1_PhDataInd_t *data_ind, struct msgb *l1p_msg)
 {
 	int rc = 0;
+	struct pcu_l1_meas meas = {0};
 
 	DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n",
 		get_value_string(femtobts_l1sapi_names, data_ind->sapi),
@@ -190,8 +203,7 @@
 			data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1,
 			data_ind->msgUnitParam.u8Size-1);
 
-
-
+	get_meas(&meas, &data_ind->measParam);
 
 	switch (data_ind->sapi) {
 	case GsmL1_Sapi_Pdtch:
@@ -205,7 +217,7 @@
 			data_ind->msgUnitParam.u8Buffer + 1,
 			data_ind->msgUnitParam.u8Size - 1,
 			data_ind->u32Fn,
-			(int8_t) (data_ind->measParam.fRssi));
+			&meas);
 		break;
 	case GsmL1_Sapi_Ptcch:
 		// FIXME