[PATCH] osmo-bts[master]: dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH accordi...

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 Jun 21 19:59:12 UTC 2016


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

dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags

Analogous to 0d10f0e482cdd50acc916e75a8b3ba1beb94227c on osmo-bts-sysmo.

According to the PDCH Active flag, handle a TS as TCH/F or PDCH.

Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba
---
M src/osmo-bts-litecell15/l1_if.c
1 file changed, 15 insertions(+), 3 deletions(-)


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

diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index d823e31..395ee0d 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -615,11 +615,23 @@
 	return l1sap_up(trx, &l1sap);
 }
 
-static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan,
+static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts)
+{
+	if (ts->pchan != GSM_PCHAN_TCH_F_PDCH)
+		return ts->pchan;
+	if (ts->flags & TS_F_PDCH_ACTIVE)
+		return GSM_PCHAN_PDCH;
+	return GSM_PCHAN_TCH_F;
+}
+
+static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts,
 			       GsmL1_Sapi_t sapi, GsmL1_SubCh_t subCh,
 			       uint8_t u8Tn, uint32_t u32Fn)
 {
 	uint8_t cbits = 0;
+	enum gsm_phys_chan_config pchan = pick_pchan(ts);
+	OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH);
+
 	switch (sapi) {
 	case GsmL1_Sapi_Bcch:
 		cbits = 0x10;
@@ -728,7 +740,7 @@
 	uint32_t fn;
 
 	/* check if primitive should be handled by common part */
-	chan_nr = chan_nr_by_sapi(trx->ts[rts_ind->u8Tn].pchan, rts_ind->sapi,
+	chan_nr = chan_nr_by_sapi(&trx->ts[rts_ind->u8Tn], rts_ind->sapi,
 		rts_ind->subCh, rts_ind->u8Tn, rts_ind->u32Fn);
 	if (chan_nr) {
 		fn = rts_ind->u32Fn;
@@ -847,7 +859,7 @@
 	int rc = 0;
 	int8_t rssi;
 
-	chan_nr = chan_nr_by_sapi(trx->ts[data_ind->u8Tn].pchan, data_ind->sapi,
+	chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi,
 		data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn);
 	if (!chan_nr) {
 		LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi "

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

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



More information about the gerrit-log mailing list