[PATCH] osmo-bts[master]: Fill measurements data for L1SAP

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Thu Jul 28 12:48:27 UTC 2016


Review at  https://gerrit.osmocom.org/623

Fill measurements data for L1SAP

Fill in values for BER, BTO, Link quality in L1SAP and send them to
PCU. Note: this increases the version of BTS <-> PCU protocol. It also
requires corresponding changes in libosmocore.

Change-Id: Ic9693a044756fb1c7bd2ff3cfa0db042c3c4e01c
Related: OS#1616
---
M include/osmo-bts/pcu_if.h
M include/osmo-bts/pcuif_proto.h
M src/common/l1sap.c
M src/common/pcu_sock.c
M src/osmo-bts-octphy/l1_if.c
5 files changed, 17 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/23/623/1

diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index 3ce4d0b..981b64b 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -10,7 +10,7 @@
 	uint16_t arfcn, uint8_t block_nr);
 int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
 	uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len,
-	int8_t rssi);
+		    int8_t rssi, uint8_t ber, int16_t bto, int16_t lqual);
 int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint8_t ra, uint32_t fn);
 int pcu_tx_time_ind(uint32_t fn);
 int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed);
diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h
index 9d740ac..d352a77 100644
--- a/include/osmo-bts/pcuif_proto.h
+++ b/include/osmo-bts/pcuif_proto.h
@@ -1,7 +1,7 @@
 #ifndef _PCUIF_PROTO_H
 #define _PCUIF_PROTO_H
 
-#define PCU_IF_VERSION		0x05
+#define PCU_IF_VERSION		0x06
 
 /* msg_type */
 #define PCU_IF_MSG_DATA_REQ	0x00	/* send data to given channel */
@@ -50,6 +50,9 @@
 	uint8_t		ts_nr;
 	uint8_t		block_nr;
 	int8_t		rssi;
+	uint8_t		ber;		/* Bit Error Rate in % */
+	int16_t		bto;		/* Burst Timing Offset in quarter bits */
+	int16_t		lqual;		/* Link quality in dB */
 } __attribute__ ((packed));
 
 struct gsm_pcu_if_rts_req {
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 7f73e3f..8d3d27e 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -812,7 +812,8 @@
 		if (L1SAP_IS_PTCCH(fn)) {
 			pcu_tx_data_ind(&trx->ts[tn], 1, fn,
 				0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn),
-				data, len, rssi);
+					data, len, rssi, data_ind->ber,
+					data_ind->bto, data_ind->lqual);
 
 			return 0;
 		}
@@ -821,7 +822,8 @@
 			return 0;
 		/* PDTCH / PACCH frame handling */
 		pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */,
-			L1SAP_FN2MACBLOCK(fn), data, len, rssi);
+			L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber,
+				data_ind->bto, data_ind->lqual);
 
 		return 0;
 	}
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 22b6fab..c391adf 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -337,7 +337,7 @@
 
 int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
 	uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len,
-	int8_t rssi)
+	int8_t rssi, uint8_t ber, int16_t bto, int16_t lqual)
 {
 	struct msgb *msg;
 	struct gsm_pcu_if *pcu_prim;
@@ -362,6 +362,9 @@
 	data_ind->ts_nr = ts->nr;
 	data_ind->block_nr = block_nr;
 	data_ind->rssi = rssi;
+	data_ind->ber = ber;
+	data_ind->bto = bto;
+	data_ind->lqual = lqual;
 	memcpy(data_ind->data, data, len);
 	data_ind->len = len;
 
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 760c988..d71d785 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -1029,6 +1029,10 @@
 	l1sap->u.data.chan_nr = chan_nr;
 	l1sap->u.data.fn = fn;
 	l1sap->u.data.rssi = rssi;
+	l1sap->u.data.ber = data_ind->MeasurementInfo.usBERCnt /
+		data_ind->MeasurementInfo.usBERTotalBitCnt;
+	l1sap->u.data.bto = data_ind->MeasurementInfo.sBurstTimingx4;
+	l1sap->u.data.lqual = data_ind->MeasurementInfo.sSNRDb;
 	l1sap->u.data.pdch_presence_info = PRES_INFO_BOTH; /* FIXME: consider EDGE support */
 
 	l1sap_up(trx, l1sap);

-- 
To view, visit https://gerrit.osmocom.org/623
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9693a044756fb1c7bd2ff3cfa0db042c3c4e01c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list