[MERGED] osmo-bts[master]: L1SAP: Use RSL_CHAN_OSMO_PDCH across 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
Wed Aug 9 10:03:14 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP
......................................................................


L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP

So far, L1SAP code is hiding RSL_CHAN_OSMO_PDCH from the bts specific
code below L1SAP.  This is some kind of a hack/workaround, making code
and debug output / logs more difficult to understand.

So let's teach the lower layer how to treat RSL_CHAN_OSMO_PDCH and
remove the "hiding" code from the common l1sap.c code.

Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19
---
M include/osmo-bts/l1sap.h
M src/common/l1sap.c
M src/common/scheduler.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
6 files changed, 12 insertions(+), 14 deletions(-)

Approvals:
  dexter: Looks good to me, but someone else must approve; Verified
  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 4e9c9e2..ad13145 100644
--- a/include/osmo-bts/l1sap.h
+++ b/include/osmo-bts/l1sap.h
@@ -22,6 +22,7 @@
 #define L1SAP_IS_CHAN_BCCH(chan_nr) ((chan_nr & 0xf8) == 0x80)
 #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)
 
 /* 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 7c69561..4bf24a5 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -263,6 +263,8 @@
 			*chan_type = GSMTAP_CHANNEL_PCH;
 		else
 			*chan_type = GSMTAP_CHANNEL_AGCH;
+	} else if (L1SAP_IS_CHAN_PDCH(chan_nr)) {
+		*chan_type = GSMTAP_CHANNEL_PDTCH;
 	}
 	if (L1SAP_IS_LINK_SACCH(link_id))
 		*chan_type |= GSMTAP_CHANNEL_ACCH;
@@ -1218,7 +1220,7 @@
 	l1sap = msgb_l1sap_prim(msg);
 	osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_PH_DATA, PRIM_OP_REQUEST,
 		msg);
-	l1sap->u.data.chan_nr = 0x08 | ts->nr;
+	l1sap->u.data.chan_nr = RSL_CHAN_OSMO_PDCH | ts->nr;
 	l1sap->u.data.link_id = 0x00;
 	l1sap->u.data.fn = fn;
 	msg->l2h = msgb_put(msg, len);
@@ -1264,11 +1266,6 @@
 		enum osmo_mph_info_type type, uint8_t sacch_only)
 {
 	struct osmo_phsap_prim l1sap;
-
-	/* The caller may pass a non-standard RSL_CHAN_OSMO_PDCH, which the L1
-	 * doesn't understand. Use the normal TCH/F cbits instead. */
-	if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH)
-		chan_nr = RSL_CHAN_Bm_ACCHs | (chan_nr & ~RSL_CHAN_NR_MASK);
 
 	memset(&l1sap, 0, sizeof(l1sap));
 	osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_REQUEST,
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 08603d2..f6cb07e 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -152,8 +152,8 @@
       {	0,	TRXC_SACCH8_5,	0x68,	LID_SACCH,	"SACCH/8(5)",	rts_data_fn,	tx_data_fn,	rx_data_fn,	0 },
       {	0,	TRXC_SACCH8_6,	0x70,	LID_SACCH,	"SACCH/8(6)",	rts_data_fn,	tx_data_fn,	rx_data_fn,	0 },
       {	0,	TRXC_SACCH8_7,	0x78,	LID_SACCH,	"SACCH/8(7)",	rts_data_fn,	tx_data_fn,	rx_data_fn,	0 },
-      {	1,	TRXC_PDTCH,	0x08,	LID_DEDIC,	"PDTCH",	rts_data_fn,	tx_pdtch_fn,	rx_pdtch_fn,	0 },
-      {	1,	TRXC_PTCCH,	0x08,	LID_DEDIC,	"PTCCH",	rts_data_fn,	tx_data_fn,	rx_data_fn,	0 },
+      {	1,	TRXC_PDTCH,	0xc0,	LID_DEDIC,	"PDTCH",	rts_data_fn,	tx_pdtch_fn,	rx_pdtch_fn,	0 },
+      {	1,	TRXC_PTCCH,	0xc0,	LID_DEDIC,	"PTCCH",	rts_data_fn,	tx_data_fn,	rx_data_fn,	0 },
 };
 
 const struct value_string trx_chan_type_names[] = {
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index a3b9556..12c2470 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -358,9 +358,9 @@
 	lchan = get_lchan_by_chan_nr(trx, chan_nr);
 	if (L1SAP_IS_LINK_SACCH(link_id)) {
 		sapi = GsmL1_Sapi_Sacch;
-		if (!L1SAP_IS_CHAN_TCHF(chan_nr))
+		if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr))
 			subCh = l1sap_chan2ss(chan_nr);
-	} else if (L1SAP_IS_CHAN_TCHF(chan_nr)) {
+	} else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) {
 		if (ts_is_pdch(&trx->ts[u8Tn])) {
 			if (L1SAP_IS_PTCCH(u32Fn)) {
 				sapi = GsmL1_Sapi_Ptcch;
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 20a84f8..cb792d7 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -473,9 +473,9 @@
 	subCh = 0xf1;
 	if (L1SAP_IS_LINK_SACCH(link_id)) {
 		sapi = cOCTVC1_GSM_SAPI_ENUM_SACCH;
-		if (!L1SAP_IS_CHAN_TCHF(chan_nr))
+		if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr))
 			subCh = l1sap_chan2ss(chan_nr);
-	} else if (L1SAP_IS_CHAN_TCHF(chan_nr)) {
+	} else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) {
 		if (trx->ts[u8Tn].pchan == GSM_PCHAN_PDCH) {
 			if (L1SAP_IS_PTCCH(u32Fn)) {
 				sapi = cOCTVC1_GSM_SAPI_ENUM_PTCCH;
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 781900e..8f68210 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -354,9 +354,9 @@
 	lchan = get_lchan_by_chan_nr(trx, chan_nr);
 	if (L1SAP_IS_LINK_SACCH(link_id)) {
 		sapi = GsmL1_Sapi_Sacch;
-		if (!L1SAP_IS_CHAN_TCHF(chan_nr))
+		if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr))
 			subCh = l1sap_chan2ss(chan_nr);
-	} else if (L1SAP_IS_CHAN_TCHF(chan_nr)) {
+	} else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) {
 		if (ts_is_pdch(&trx->ts[u8Tn])) {
 			if (L1SAP_IS_PTCCH(u32Fn)) {
 				sapi = GsmL1_Sapi_Ptcch;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list