Change in osmo-bts[master]: CBCH: Move processing via 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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Sep 9 15:40:59 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10602 )

Change subject: CBCH: Move processing via L1SAP
......................................................................

CBCH: Move processing via L1SAP

for some historical reason, CBCH handling was not using the normal
L1SAP boundary.  Let's change that and traverse L1SAP just like for
e.g. BCCH which is quite similar to CBCH handling.

This also has the added benefit of logging CBCH via GSMTAP.

Change-Id: Ibdba4c5e808330f8406f441a97fe0e81170fce97
Closes: OS#3534
---
M include/osmo-bts/l1sap.h
M src/common/l1sap.c
M src/osmo-bts-litecell15/l1_if.c
M src/osmo-bts-octphy/l1_if.c
M src/osmo-bts-sysmo/l1_if.c
5 files changed, 16 insertions(+), 15 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h
index 4568b7e..3225a60 100644
--- a/include/osmo-bts/l1sap.h
+++ b/include/osmo-bts/l1sap.h
@@ -23,6 +23,7 @@
 #define L1SAP_IS_CHAN_RACH(chan_nr) ((chan_nr & 0xf8) == 0x88)
 #define L1SAP_IS_CHAN_AGCH_PCH(chan_nr) ((chan_nr & 0xf8) == 0x90)
 #define L1SAP_IS_CHAN_PDCH(chan_nr) ((chan_nr & 0xf8) == 0xc0)
+#define L1SAP_IS_CHAN_CBCH(chan_nr) ((chan_nr & 0xf8) == 0xc8)
 
 /* rach type from ra */
 #define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f)
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 55b4a4b..b29fcc7 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -53,6 +53,7 @@
 #include <osmo-bts/power_control.h>
 #include <osmo-bts/msg_utils.h>
 #include <osmo-bts/pcuif_proto.h>
+#include <osmo-bts/cbch.h>
 
 struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx,
 				       unsigned int chan_nr)
@@ -265,6 +266,8 @@
 			*chan_type = GSMTAP_CHANNEL_PCH;
 		else
 			*chan_type = GSMTAP_CHANNEL_AGCH;
+	} else if (L1SAP_IS_CHAN_CBCH(chan_nr)) {
+		*chan_type = GSMTAP_CHANNEL_CBCH51;
 	} else if (L1SAP_IS_CHAN_PDCH(chan_nr)) {
 		*chan_type = GSMTAP_CHANNEL_PDTCH;
 	}
@@ -737,6 +740,9 @@
 			memcpy(p, si, GSM_MACBLOCK_LEN);
 		else
 			memcpy(p, fill_frame, GSM_MACBLOCK_LEN);
+	} else if (L1SAP_IS_CHAN_CBCH(chan_nr)) {
+		p = msgb_put(msg, GSM_MACBLOCK_LEN);
+		bts_cbch_get(trx->bts, p, &g_time);
 	} else if (!(chan_nr & 0x80)) { /* only TCH/F, TCH/H, SDCCH/4 and SDCCH/8 have C5 bit cleared */
 		lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
 		if (!lchan) {
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index f582bf2..82299ff 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -50,7 +50,6 @@
 #include <osmo-bts/measurement.h>
 #include <osmo-bts/pcu_if.h>
 #include <osmo-bts/handover.h>
-#include <osmo-bts/cbch.h>
 #include <osmo-bts/bts_model.h>
 #include <osmo-bts/l1sap.h>
 #include <osmo-bts/msg_utils.h>
@@ -700,6 +699,9 @@
 	case GsmL1_Sapi_Bcch:
 		cbits = 0x10;
 		break;
+	case GsmL1_Sapi_Cbch:
+		cbits = 0xc8; /* Osmocom extension for CBCH via L1SAP */
+		break;
 	case GsmL1_Sapi_Sacch:
 		switch(pchan) {
 		case GSM_PCHAN_TCH_F:
@@ -867,10 +869,6 @@
 	case GsmL1_Sapi_Prach:
 		goto empty_frame;
 		break;
-	case GsmL1_Sapi_Cbch:
-		/* get them from bts->si_buf[] */
-		bts_cbch_get(bts, msu_param->u8Buffer, &g_time);
-		break;
 	default:
 		memcpy(msu_param->u8Buffer, fill_frame, GSM_MACBLOCK_LEN);
 		break;
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 91ef07b..35d0aa3 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -43,7 +43,6 @@
 #include <osmo-bts/logging.h>
 #include <osmo-bts/l1sap.h>
 #include <osmo-bts/handover.h>
-#include <osmo-bts/cbch.h>
 
 #include "l1_if.h"
 #include "l1_oml.h"
@@ -357,6 +356,9 @@
 	case cOCTVC1_GSM_SAPI_ENUM_BCCH:
 		cbits = 0x10;
 		break;
+	case cOCTVC1_GSM_SAPI_ENUM_CBCH:
+		cbits = 0xc8; /* Osmocom extension for CBCH via L1SAP */
+		break;
 	case cOCTVC1_GSM_SAPI_ENUM_SACCH:
 		switch (pchan) {
 		case GSM_PCHAN_TCH_F:
@@ -1017,10 +1019,6 @@
 		    	(g_time.t1 << 7) | (g_time.t2 << 2) | (t3p >> 1);
 		data_req->Data.abyDataContent[3] = (t3p & 1);
 		break;
-	case cOCTVC1_GSM_SAPI_ENUM_CBCH:
-		rc = bts_cbch_get(bts, data_req->Data.abyDataContent, &g_time);
-		data_req->Data.ulDataLength = 23;   /* GSM MAX BLK SIZE */
-		break;
 	case cOCTVC1_GSM_SAPI_ENUM_PRACH:
 #if 0
 		/* in case we decide to send an empty frame... */
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 1321fe6..c0b42b4 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -46,7 +46,6 @@
 #include <osmo-bts/measurement.h>
 #include <osmo-bts/pcu_if.h>
 #include <osmo-bts/handover.h>
-#include <osmo-bts/cbch.h>
 #include <osmo-bts/bts_model.h>
 #include <osmo-bts/l1sap.h>
 #include <osmo-bts/msg_utils.h>
@@ -697,6 +696,9 @@
 	case GsmL1_Sapi_Bcch:
 		cbits = 0x10;
 		break;
+	case GsmL1_Sapi_Cbch:
+		cbits = 0xc8; /* Osmocom extension for CBCH via L1SAP */
+		break;
 	case GsmL1_Sapi_Sacch:
 		switch(pchan) {
 		case GSM_PCHAN_TCH_F:
@@ -864,10 +866,6 @@
 	case GsmL1_Sapi_Prach:
 		goto empty_frame;
 		break;
-	case GsmL1_Sapi_Cbch:
-		/* get them from bts->si_buf[] */
-		bts_cbch_get(bts, msu_param->u8Buffer, &g_time);
-		break;
 	default:
 		memcpy(msu_param->u8Buffer, fill_frame, GSM_MACBLOCK_LEN);
 		break;

-- 
To view, visit https://gerrit.osmocom.org/10602
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibdba4c5e808330f8406f441a97fe0e81170fce97
Gerrit-Change-Number: 10602
Gerrit-PatchSet: 5
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180909/28228106/attachment.htm>


More information about the gerrit-log mailing list