aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/scheduler.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-06-27 03:57:11 +0700
committerlaforge <laforge@gnumonks.org>2019-07-16 04:16:13 +0000
commit01cc8c0d211158d46ecfe2755f3b9aa7c6995e7b (patch)
tree154486796368a1a4acbc76da8856cae1b47b900b /src/common/scheduler.c
parent55dbafc497a1406a3bfa9c87c5e7337d6e127249 (diff)
osmo-bts-trx/scheduler: pass trx_ul_burst_ind to lchan handlers
This change needs to be done in order avoid adding more and more arguments to the UL logical channel handlers (such as rx_rach_fn). Since we have different versions of the TRXD header, and may have other burst-based PHYs in the future, some fields of an Uplink burst indication have conditional presence. Change-Id: Iae6b78bafa4b86d0c681684de47320d641d3f7c0 Related: OS#4006, OS#1855
Diffstat (limited to 'src/common/scheduler.c')
-rw-r--r--src/common/scheduler.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 83779d79..95a1b00e 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1287,9 +1287,19 @@ static int trx_sched_calc_frame_loss(struct l1sched_trx *l1t,
* Instead of doing this, it makes sense to use the
* amount of lost frames in measurement calculations.
*/
- static sbit_t zero_burst[GSM_BURST_LEN] = { 0 };
trx_sched_ul_func *func;
+ /* Prepare dummy burst indication */
+ struct trx_ul_burst_ind bi = {
+ .flags = TRX_BI_F_NOPE_IND,
+ .burst_len = GSM_BURST_LEN,
+ .burst = { 0 },
+ .rssi = -128,
+ .toa256 = 0,
+ /* TDMA FN is set below */
+ .tn = tn,
+ };
+
for (i = 1; i < elapsed_fs; i++) {
fn_i = TDMA_FN_SUM(l1cs->last_tdma_fn, i);
offset = fn_i % l1ts->mf_period;
@@ -1303,8 +1313,8 @@ static int trx_sched_calc_frame_loss(struct l1sched_trx *l1t,
"Substituting lost TDMA frame=%u by all-zero "
"dummy burst\n", fn_i);
- func(l1t, tn, fn_i, frame->ul_chan, frame->ul_bid,
- zero_burst, GSM_BURST_LEN, -128, 0);
+ bi.fn = fn_i;
+ func(l1t, frame->ul_chan, frame->ul_bid, &bi);
l1cs->lost_tdma_fs--;
}
@@ -1365,9 +1375,8 @@ int trx_sched_ul_burst(struct l1sched_trx *l1t, struct trx_ul_burst_ind *bi)
}
}
- /* put burst to function
- * TODO: rather pass a pointer to trx_ul_burst_ind */
- func(l1t, bi->tn, bi->fn, chan, bid, bi->burst, bi->burst_len, bi->rssi, bi->toa256);
+ /* Invoke the logical channel handler */
+ func(l1t, chan, bid, bi);
return 0;
}