Change in osmo-pcu[master]: direct_phy: Support submitting DATA.ind with len=0 to upper layers

pespin gerrit-no-reply at lists.osmocom.org
Mon Mar 8 12:12:13 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/23268 )


Change subject: direct_phy: Support submitting DATA.ind with len=0 to upper layers
......................................................................

direct_phy: Support submitting DATA.ind with len=0 to upper layers

Since recently (see Depends below), BTS side submits DATA.ind with len=0
to announce nothing was received on that UL block FN. This will allow
osmo-pcu track time more accurately, and use this information to quickly
find out if a UL block was expected as requested by RRBP or USF poll and
increment counters such as N3101 (finally being able to properly
implement timers such as T3619).

This patch does the same for direct phy feature, where the osmo-pcu
process receives the DATA.ind directly from the DSP.

Depends: osmo-bts.git Change-Id I343c7a721dab72411edbca816c8864926bc329fb

Related: OS#5033
Change-Id: I9a835e16ef0e5a68c003a93d1a33233aa43464ae
---
M src/osmo-bts-litecell15/lc15_l1_if.c
M src/osmo-bts-oc2g/oc2g_l1_if.c
M src/osmo-bts-sysmo/sysmo_l1_if.c
3 files changed, 43 insertions(+), 51 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/68/23268/1

diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c
index 8f64863..c87edaf 100644
--- a/src/osmo-bts-litecell15/lc15_l1_if.c
+++ b/src/osmo-bts-litecell15/lc15_l1_if.c
@@ -195,6 +195,8 @@
 	int rc = 0;
 	struct gprs_rlcmac_bts *bts;
 	struct pcu_l1_meas meas = {0};
+	uint8_t *data;
+	uint8_t data_len;
 
 	DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n",
 		get_value_string(lc15bts_l1sapi_names, data_ind->sapi),
@@ -202,14 +204,6 @@
 		osmo_hexdump(data_ind->msgUnitParam.u8Buffer,
 			     data_ind->msgUnitParam.u8Size));
 
-	/*
-	 * TODO: Add proper bad frame handling here. This could be used
-	 * to switch the used CS. Avoid a crash with the PCU right now
-	 * feed "0 - 1" amount of data.
-	 */
-	if (data_ind->msgUnitParam.u8Size == 0)
-		return -1;
-
 	bts = llist_first_entry_or_null(&the_pcu->bts_list, struct gprs_rlcmac_bts, list);
 
 	get_meas(&meas, &data_ind->measParam);
@@ -219,16 +213,19 @@
 	switch (data_ind->sapi) {
 	case GsmL1_Sapi_Pdtch:
 	case GsmL1_Sapi_Pacch:
-		/* drop incomplete UL block */
-		if (data_ind->msgUnitParam.u8Buffer[0]
-			!= GsmL1_PdtchPlType_Full)
-			break;
 		/* PDTCH / PACCH frame handling */
-		rc = pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn,
-			data_ind->msgUnitParam.u8Buffer + 1,
-			data_ind->msgUnitParam.u8Size - 1,
-			data_ind->u32Fn,
-			&meas);
+		if (data_ind->msgUnitParam.u8Size != 0 &&
+		    data_ind->msgUnitParam.u8Buffer[0] != GsmL1_PdtchPlType_Full) {
+			data = data_ind->msgUnitParam.u8Buffer + 1;
+			data_len = data_ind->msgUnitParam.u8Size - 1;
+			if (data_len == 0)
+				data = NULL;
+		} else {
+			data = NULL;
+			data_len = 0;
+		}
+		pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data,
+				      data_len, data_ind->u32Fn, &meas);
 		break;
 	default:
 		LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n",
diff --git a/src/osmo-bts-oc2g/oc2g_l1_if.c b/src/osmo-bts-oc2g/oc2g_l1_if.c
index d81bc4f..5d2ce69 100644
--- a/src/osmo-bts-oc2g/oc2g_l1_if.c
+++ b/src/osmo-bts-oc2g/oc2g_l1_if.c
@@ -195,6 +195,8 @@
 	int rc = 0;
 	struct gprs_rlcmac_bts *bts;
 	struct pcu_l1_meas meas = {0};
+	uint8_t *data;
+	uint8_t data_len;
 
 	DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n",
 		get_value_string(oc2gbts_l1sapi_names, data_ind->sapi),
@@ -202,14 +204,6 @@
 		osmo_hexdump(data_ind->msgUnitParam.u8Buffer,
 			     data_ind->msgUnitParam.u8Size));
 
-	/*
-	 * TODO: Add proper bad frame handling here. This could be used
-	 * to switch the used CS. Avoid a crash with the PCU right now
-	 * feed "0 - 1" amount of data.
-	 */
-	if (data_ind->msgUnitParam.u8Size == 0)
-		return -1;
-
 	bts = llist_first_entry_or_null(&the_pcu->bts_list, struct gprs_rlcmac_bts, list);
 
 	gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK,
@@ -224,16 +218,19 @@
 	switch (data_ind->sapi) {
 	case GsmL1_Sapi_Pdtch:
 	case GsmL1_Sapi_Pacch:
-		/* drop incomplete UL block */
-		if (data_ind->msgUnitParam.u8Buffer[0]
-			!= GsmL1_PdtchPlType_Full)
-			break;
 		/* PDTCH / PACCH frame handling */
-		pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn,
-			data_ind->msgUnitParam.u8Buffer + 1,
-			data_ind->msgUnitParam.u8Size - 1,
-			data_ind->u32Fn,
-			&meas);
+		if (data_ind->msgUnitParam.u8Size != 0 &&
+		    data_ind->msgUnitParam.u8Buffer[0] != GsmL1_PdtchPlType_Full) {
+			data = data_ind->msgUnitParam.u8Buffer + 1;
+			data_len = data_ind->msgUnitParam.u8Size - 1;
+			if (data_len == 0)
+				data = NULL;
+		} else {
+			data = NULL;
+			data_len = 0;
+		}
+		pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data,
+				      data_len, data_ind->u32Fn, &meas);
 		break;
 	default:
 		LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n",
diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c
index f9db0b8..4faccaa 100644
--- a/src/osmo-bts-sysmo/sysmo_l1_if.c
+++ b/src/osmo-bts-sysmo/sysmo_l1_if.c
@@ -177,6 +177,9 @@
 	int rc = 0;
 	struct gprs_rlcmac_bts *bts;
 	struct pcu_l1_meas meas = {0};
+	uint8_t *data;
+	uint8_t data_len;
+
 
 	DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n",
 		get_value_string(femtobts_l1sapi_names, data_ind->sapi),
@@ -187,14 +190,6 @@
 	bts = llist_first_entry_or_null(&the_pcu->bts_list, struct gprs_rlcmac_bts, list);
 	pcu_rx_block_time(bts, data_ind->u16Arfcn, data_ind->u32Fn, data_ind->u8Tn);
 
-	/*
-	 * TODO: Add proper bad frame handling here. This could be used
-	 * to switch the used CS. Avoid a crash with the PCU right now
-	 * feed "0 - 1" amount of data.
-	 */
-	if (data_ind->msgUnitParam.u8Size == 0)
-		return -1;
-
 	get_meas(&meas, &data_ind->measParam);
 	bts_update_tbf_ta(bts, "PH-DATA", data_ind->u32Fn, fl1h->trx_no,
 			  data_ind->u8Tn, sign_qta2ta(meas.bto), false);
@@ -202,16 +197,19 @@
 	switch (data_ind->sapi) {
 	case GsmL1_Sapi_Pdtch:
 	case GsmL1_Sapi_Pacch:
-		/* drop incomplete UL block */
-		if (data_ind->msgUnitParam.u8Buffer[0]
-			!= GsmL1_PdtchPlType_Full)
-			break;
 		/* PDTCH / PACCH frame handling */
-		pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn,
-			data_ind->msgUnitParam.u8Buffer + 1,
-			data_ind->msgUnitParam.u8Size - 1,
-			data_ind->u32Fn,
-			&meas);
+		if (data_ind->msgUnitParam.u8Size != 0 &&
+		    data_ind->msgUnitParam.u8Buffer[0] != GsmL1_PdtchPlType_Full) {
+			data = data_ind->msgUnitParam.u8Buffer + 1;
+			data_len = data_ind->msgUnitParam.u8Size - 1;
+			if (data_len == 0)
+				data = NULL;
+		} else {
+			data = NULL;
+			data_len = 0;
+		}
+		pcu_rx_data_ind_pdtch(bts, fl1h->trx_no, data_ind->u8Tn, data,
+				      data_len, data_ind->u32Fn, &meas);
 		break;
 	default:
 		LOGP(DL1IF, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n",

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/23268
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I9a835e16ef0e5a68c003a93d1a33233aa43464ae
Gerrit-Change-Number: 23268
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210308/0d5d1461/attachment.htm>


More information about the gerrit-log mailing list