[PATCH] osmo-bts[master]: dyn PDCH: trx l1_if.c: factor out trx_set_ts_as_pchan() from...

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
Thu Jul 28 16:37:06 UTC 2016


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

dyn PDCH: trx l1_if.c: factor out trx_set_ts_as_pchan() from trx_set_ts()

To be able to set a specific pchan type for dynamic channels, have the
trx_set_ts_as_pchan() function with an explicit pchan argument instead of
using ts->pchan.

Keep trx_set_ts() as a thin wrapper to use ts->pchan directly.

Change-Id: I9eeef05d2a6763f86a5b89ee7c3b4211f6736e4d
---
M src/osmo-bts-trx/l1_if.c
1 file changed, 20 insertions(+), 3 deletions(-)


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

diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 49bcdbb..21627eb 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -374,13 +374,13 @@
 }
 
 /* set ts attributes */
-static uint8_t trx_set_ts(struct gsm_bts_trx_ts *ts)
+static uint8_t trx_set_ts_as_pchan(struct gsm_bts_trx_ts *ts,
+				   enum gsm_phys_chan_config pchan)
 {
 	struct phy_instance *pinst = trx_phy_instance(ts->trx);
 	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
 	uint8_t tn = ts->nr;
 	uint16_t tsc = ts->tsc;
-	enum gsm_phys_chan_config pchan = ts->pchan;
 	uint8_t slottype;
 	int rc;
 
@@ -398,7 +398,9 @@
 	if (!(l1h->config.slotmask & (1 << tn)))
 		return NM_NACK_RES_NOTAVAIL;
 
-	/* set physical channel */
+	/* set physical channel. For dynamic TCH/F_PDCH, the caller should have
+	 * decided on a more specific PCHAN type already. */
+	OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH);
 	rc = trx_sched_set_pchan(&l1h->l1s, tn, pchan);
 	if (rc)
 		return NM_NACK_RES_NOTAVAIL;
@@ -422,6 +424,21 @@
 	return 0;
 }
 
+static uint8_t trx_set_ts(struct gsm_bts_trx_ts *ts)
+{
+	enum gsm_phys_chan_config pchan = ts->pchan;
+
+	/* For dynamic TCH/F_PDCH, pick the pchan type that should currently be
+	 * active according to TS flags. This should only be called during
+	 * init, PDCH transitions will call trx_set_ts_as_pchan() directly. */
+	OSMO_ASSERT((ts->flags & TS_F_PDCH_PENDING_MASK) == 0);
+	if (pchan == GSM_PCHAN_TCH_F_PDCH)
+		pchan = (ts->flags & TS_F_PDCH_ACTIVE)? GSM_PCHAN_PDCH
+			                              : GSM_PCHAN_TCH_F;
+
+	return trx_set_ts_as_pchan(ts, pchan);
+}
+
 
 /*
  * primitive handling

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9eeef05d2a6763f86a5b89ee7c3b4211f6736e4d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: neels_test_account <neels at hofmeyr.de>



More information about the gerrit-log mailing list