[PATCH] osmo-bts[master]: scheduler: add trx_sched_is_sacch_fn() function

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
Fri Feb 23 12:58:52 UTC 2018


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

scheduler: add trx_sched_is_sacch_fn() function

For proper measurement processing of RX{LEV,QUAL}-SUB, we will
need this information.

Related: OS#2978
Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
---
M include/osmo-bts/scheduler.h
M src/common/scheduler.c
2 files changed, 43 insertions(+), 0 deletions(-)


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

diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 9dbc946..11a30fd 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -188,4 +188,7 @@
 /* \brief close all logical channels and reset timeslots */
 void trx_sched_reset(struct l1sched_trx *l1t);
 
+/*! Determine if given frame number contains SACCH (true) or other (false) burst */
+bool trx_sched_is_sacch_fn(struct gsm_bts_trx_ts *ts, uint32_t fn, bool uplink);
+
 #endif /* TRX_SCHEDULER_H */
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 41b5d7a..4e48160 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1340,6 +1340,46 @@
 	return -1;
 }
 
+/* Determine if given frame number contains SACCH (true) or other (false) burst */
+bool trx_sched_is_sacch_fn(struct gsm_bts_trx_ts *ts, uint32_t fn, bool uplink)
+{
+	int i;
+	const struct trx_sched_multiframe *sched;
+	const struct trx_sched_frame *frame;
+	enum trx_chan_type ch_type;
+
+	i = find_sched_mframe_idx(ts->pchan, ts->nr);
+	if (i < 0)
+		return -EINVAL;
+	sched = &trx_sched_multiframes[i];
+	frame = &sched->frames[fn % sched->period];
+	if (uplink)
+		ch_type = frame->ul_chan;
+	else
+		ch_type = frame->dl_chan;
+
+	switch (ch_type) {
+	case TRXC_SACCH4_0:
+	case TRXC_SACCH4_1:
+	case TRXC_SACCH4_2:
+	case TRXC_SACCH4_3:
+	case TRXC_SACCH8_0:
+	case TRXC_SACCH8_1:
+	case TRXC_SACCH8_2:
+	case TRXC_SACCH8_3:
+	case TRXC_SACCH8_4:
+	case TRXC_SACCH8_5:
+	case TRXC_SACCH8_6:
+	case TRXC_SACCH8_7:
+	case TRXC_SACCHTF:
+	case TRXC_SACCHTH_0:
+	case TRXC_SACCHTH_1:
+		return true;
+	default:
+		return false;
+	}
+}
+
 /* set multiframe scheduler to given pchan */
 int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
 	enum gsm_phys_chan_config pchan)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list