Change in osmocom-bb[master]: trxcon/scheduler: share FACCH/H TDMA frame mapping helpres

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Aug 15 02:46:05 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10459


Change subject: trxcon/scheduler: share FACCH/H TDMA frame mapping helpres
......................................................................

trxcon/scheduler: share FACCH/H TDMA frame mapping helpres

Change-Id: Iaf4cb33f1b79df23f8a90c8b14ebe0cd9907fbb9
---
M src/host/trxcon/sched_lchan_common.c
M src/host/trxcon/sched_prim.c
M src/host/trxcon/sched_trx.h
3 files changed, 87 insertions(+), 16 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/59/10459/1

diff --git a/src/host/trxcon/sched_lchan_common.c b/src/host/trxcon/sched_lchan_common.c
index 2767b90..4d45e66 100644
--- a/src/host/trxcon/sched_lchan_common.c
+++ b/src/host/trxcon/sched_lchan_common.c
@@ -168,3 +168,83 @@
 		return 0;
 	}
 }
+
+/**
+ * May an Uplink FACCH/H transmission be initiated on
+ * a given frame number and a given channel type?
+ *
+ * See GSM 05.02, clause 7, table 1
+ *
+ * @param  chan channel type (TRXC_TCHH_0 or TRXC_TCHH_1)
+ * @param  fn   the current frame number
+ * @return      true (yes) or false (no)
+ */
+bool sched_facch_h_ul_start(enum trx_lchan_type chan, uint32_t fn)
+{
+	uint32_t fn_mf;
+
+	/* Traffic multiframe period */
+	fn_mf = fn % 26;
+
+	/**
+	 * FACCH/H0 UL frame alignment
+	 * B0(0,2,4,6,8,10)
+	 * B1(8,10,13,15,17,19)
+	 * B2(17,19,21,23,0,2)
+	 */
+	if (chan == TRXC_TCHH_0)
+		if (fn_mf == 0 || fn_mf == 8 || fn_mf == 17)
+			return true;
+
+	/**
+	 * FACCH/H1 UL frame alignment
+	 * B0(1,3,5,7,9,11)
+	 * B1(9,11,14,16,18,20)
+	 * B2(18,20,22,24,1,3)
+	 */
+	if (chan == TRXC_TCHH_1)
+		if (fn_mf == 1 || fn_mf == 9 || fn_mf == 18)
+			return true;
+
+	return false;
+}
+
+/**
+ * May a Downlink FACCH/H transmission be finished on
+ * a given frame number and a given channel type?
+ *
+ * See GSM 05.02, clause 7, table 1
+ *
+ * @param  chan channel type (TRXC_TCHH_0 or TRXC_TCHH_1)
+ * @param  fn   the current frame number
+ * @return      true (yes) or false (no)
+ */
+bool sched_facch_h_dl_end(enum trx_lchan_type chan, uint32_t fn)
+{
+	uint32_t fn_mf;
+
+	/* Traffic multiframe period */
+	fn_mf = fn % 26;
+
+	/**
+	 * FACCH/H0 DL frame alignment
+	 * B0(4,6,8,10,13,15)
+	 * B1(13,15,17,19,21,23)
+	 * B2(21,23,0,2,4,6)
+	 */
+	if (chan == TRXC_TCHH_0)
+		if (fn_mf == 15 || fn_mf == 23 || fn_mf == 6)
+			return true;
+
+	/**
+	 * FACCH/H1 DL frame alignment
+	 * B0(5,7,9,11,14,16)
+	 * B1(14,16,18,20,22,24)
+	 * B2(22,24,1,3,5,7)
+	 */
+	if (chan == TRXC_TCHH_1)
+		if (fn_mf == 16 || fn_mf == 24 || fn_mf == 7)
+			return true;
+
+	return false;
+}
diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c
index e663bc3..723facb 100644
--- a/src/host/trxcon/sched_prim.c
+++ b/src/host/trxcon/sched_prim.c
@@ -248,23 +248,10 @@
 {
 	struct trx_ts_prim *facch;
 	struct trx_ts_prim *tch;
-	bool facch_now = false;
-	uint32_t fn_mf;
+	bool facch_now;
 
-	/* Traffic multiframe period */
-	fn_mf = fn % 26;
-
-	/* FACCH/H0 frame alignment */
-	if (lchan_type == TRXC_TCHH_0)
-		if (fn_mf == 0 || fn_mf == 8 || fn_mf == 17)
-			facch_now = true;
-
-	/* FACCH/H1 frame alignment */
-	if (lchan_type == TRXC_TCHH_1)
-		if (fn_mf == 1 || fn_mf == 9 || fn_mf == 18)
-			facch_now = true;
-
-	/* If FACCH/H is not allowed for a given frame number */
+	/* May we initiate an UL FACCH/H frame transmission now? */
+	facch_now = sched_facch_h_ul_start(lchan_type, fn);
 	if (!facch_now) /* Just dequeue a TCH/H prim */
 		goto no_facch;
 
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index 730923b..f8898cd 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -323,3 +323,7 @@
 	int bit_error_count, bool dec_failed, bool traffic);
 int sched_send_dt_conf(struct trx_instance *trx, struct trx_ts *ts,
 	struct trx_lchan_state *lchan, uint32_t fn, bool traffic);
+
+/* Interleaved FACCH/H block TDMA frame mapping */
+bool sched_facch_h_ul_start(enum trx_lchan_type chan, uint32_t fn);
+bool sched_facch_h_dl_end(enum trx_lchan_type chan, uint32_t fn);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf4cb33f1b79df23f8a90c8b14ebe0cd9907fbb9
Gerrit-Change-Number: 10459
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180815/7c6615ee/attachment.htm>


More information about the gerrit-log mailing list