[MERGED] osmo-bts[master]: Fix ip.access style dyn PDCH, broken in 37af36e85eca54659508...

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue Aug 30 12:38:04 UTC 2016


Neels Hofmeyr has submitted this change and it was merged.

Change subject: Fix ip.access style dyn PDCH, broken in 37af36e85eca546595081246aec010fa7f6fd0be
......................................................................


Fix ip.access style dyn PDCH, broken in 37af36e85eca546595081246aec010fa7f6fd0be

Commit "sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCH"
introduced a check for TCH/F_PDCH intended only for TCH/F_TCH/H_PDCH. It looked
correct, but TCH/F_PDCH startup was designed differently:

For TCH/F_PDCH, the idea was to look it up in pchan_to_logChComb[] and obtain
the TCH/F channel combination, so that TCH/F_PDCH first initialize as TCH/F.
So pchan was in fact intended to be passed as TCH/F_PDCH.

For Osmocom TCH/F_TCH/H_PDCH, we've in the meantime added a ts_opstart()
function that makes this decision explicitly. So, instead of reverting the
erratic commit, add TCH/F_PDCH to ts_opstart(), for both sysmo and lc15.

In ts_opstart(), move to a switch statement to resolve the actual pchan to use
for ts_connect_as().

Drop TCH/F_PDCH and TCH/F_TCH/H_PDCH from pchan_to_logChComb[] and comment.

Change-Id: I376b92a06f4cbe943c1c913dea7487fac53a7d08
---
M src/osmo-bts-litecell15/oml.c
M src/osmo-bts-sysmo/oml.c
2 files changed, 38 insertions(+), 16 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved; Verified
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index 5ce510a..a175af4 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -89,11 +89,12 @@
 	[GSM_PCHAN_SDCCH8_SACCH8C]	= GsmL1_LogChComb_VII,
 	[GSM_PCHAN_SDCCH8_SACCH8C_CBCH]	= GsmL1_LogChComb_VII,
 	[GSM_PCHAN_PDCH]		= GsmL1_LogChComb_XIII,
-	[GSM_PCHAN_TCH_F_PDCH]		= GsmL1_LogChComb_I, /*< first init
-						like TCH/F, until PDCH ACT */
-	[GSM_PCHAN_TCH_F_TCH_H_PDCH]    = GsmL1_LogChComb_0, /*< first unused,
-						until first RSL CHAN ACT */
 	[GSM_PCHAN_UNKNOWN]		= GsmL1_LogChComb_0,
+	/*
+	 * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be
+	 * part of this, only "real" pchan values will be looked up here.
+	 * See the callers of ts_connect_as().
+	 */
 };
 
 static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb);
@@ -507,12 +508,22 @@
 
 static int ts_opstart(struct gsm_bts_trx_ts *ts)
 {
-	if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) {
-		/* First connect as NONE, until first RSL CHAN ACT. */
+	enum gsm_phys_chan_config pchan = ts->pchan;
+	switch (pchan) {
+	case GSM_PCHAN_TCH_F_TCH_H_PDCH:
 		ts->dyn.pchan_is = ts->dyn.pchan_want = GSM_PCHAN_NONE;
-		return ts_connect_as(ts, GSM_PCHAN_NONE, opstart_compl_cb, NULL);
+		/* First connect as NONE, until first RSL CHAN ACT. */
+		pchan = GSM_PCHAN_NONE;
+		break;
+	case GSM_PCHAN_TCH_F_PDCH:
+		/* First connect as TCH/F, expecting PDCH ACT. */
+		pchan = GSM_PCHAN_TCH_F;
+		break;
+	default:
+		/* simply use ts->pchan */
+		break;
 	}
-	return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL);
+	return ts_connect_as(ts, pchan, opstart_compl_cb, NULL);
 }
 
 GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan)
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 6f0629d..dea1c5e 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -86,11 +86,12 @@
 	[GSM_PCHAN_SDCCH8_SACCH8C]	= GsmL1_LogChComb_VII,
 	[GSM_PCHAN_SDCCH8_SACCH8C_CBCH]	= GsmL1_LogChComb_VII,
 	[GSM_PCHAN_PDCH]		= GsmL1_LogChComb_XIII,
-	[GSM_PCHAN_TCH_F_PDCH]		= GsmL1_LogChComb_I, /*< first init
-						like TCH/F, until PDCH ACT */
-	[GSM_PCHAN_TCH_F_TCH_H_PDCH]	= GsmL1_LogChComb_0, /*< first unused,
-						until first RSL CHAN ACT */
 	[GSM_PCHAN_UNKNOWN]		= GsmL1_LogChComb_0,
+	/*
+	 * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be
+	 * part of this, only "real" pchan values will be looked up here.
+	 * See the callers of ts_connect_as().
+	 */
 };
 
 static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb);
@@ -515,12 +516,22 @@
 
 static int ts_opstart(struct gsm_bts_trx_ts *ts)
 {
-	if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) {
-		/* First connect as NONE, until first RSL CHAN ACT. */
+	enum gsm_phys_chan_config pchan = ts->pchan;
+	switch (pchan) {
+	case GSM_PCHAN_TCH_F_TCH_H_PDCH:
 		ts->dyn.pchan_is = ts->dyn.pchan_want = GSM_PCHAN_NONE;
-		return ts_connect_as(ts, GSM_PCHAN_NONE, opstart_compl_cb, NULL);
+		/* First connect as NONE, until first RSL CHAN ACT. */
+		pchan = GSM_PCHAN_NONE;
+		break;
+	case GSM_PCHAN_TCH_F_PDCH:
+		/* First connect as TCH/F, expecting PDCH ACT. */
+		pchan = GSM_PCHAN_TCH_F;
+		break;
+	default:
+		/* simply use ts->pchan */
+		break;
 	}
-	return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL);
+	return ts_connect_as(ts, pchan, opstart_compl_cb, NULL);
 }
 
 GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I376b92a06f4cbe943c1c913dea7487fac53a7d08
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: neels_test_account <neels at hofmeyr.de>



More information about the gerrit-log mailing list