Harald Welte has submitted this change and it was merged.

Change subject: scheduler: add trx_sched_is_sacch_fn() function
......................................................................


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(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>

Reply via email to