aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-03-20 03:22:14 +0300
committerfixeria <vyanitskiy@sysmocom.de>2022-04-05 13:45:31 +0000
commit12b3921a4acb30b847acc5f7e61d031f1b2ab571 (patch)
treeaf848a45a0e50d8542ec9f28f7f8ed3f61d98242 /include
parent333e35439db28b63f53264da3e881c8424b1ac3c (diff)
osmo-bts-trx: rx_{tchf,tchh}_fn(): get TDMA FN from meas history
Once we have an Uplink speech or FACCH frame decoded, we need to hand it over to the upper layers indicating TDMA frame number of the *first* burst corresponding to the beginning of a block. Currently we use libosmogsm's gsm0502_fn_remap() API to calculate the first TDMA frame number from the given last frame number. This API involves iterating over the pre-calculated offset tables for different channel and payload types, and thus imposes some additional CPU cycles. Another downside of the current approach is that we have to perform such lookups several times for each decoded L2 frame, e.g. for FACCH on TCH/AHS we do it three times! In this patch I propose an alternative approach of storing TDMA frame numbers in the measurement history, together with the associated samples. This way we can easily get N-th frame number from there without performing any additional computations, other than what we already do during the measurement processing. Change-Id: Id9a2b7b0f1a1ad7cfbbab862faf521e135c90605
Diffstat (limited to 'include')
-rw-r--r--include/osmo-bts/scheduler.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index f671874f..e39315f4 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -80,6 +80,7 @@ enum trx_mod_type {
/* A set of measurements belonging to one Uplink burst */
struct l1sched_meas_set {
+ uint32_t fn; /* TDMA frame number */
int16_t toa256; /* Timing of Arrival (1/256 of a symbol) */
int16_t ci_cb; /* Carrier-to-Interference (cB) */
float rssi; /* RSSI (dBm) */
@@ -325,3 +326,5 @@ void trx_sched_meas_push(struct l1sched_chan_state *chan_state,
void trx_sched_meas_avg(const struct l1sched_chan_state *chan_state,
struct l1sched_meas_set *avg,
enum sched_meas_avg_mode mode);
+uint32_t trx_sched_lookup_fn(const struct l1sched_chan_state *chan_state,
+ const unsigned int shift);