diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-04-10 01:22:47 +0300 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-04-10 18:25:53 +0300 |
commit | 93e3a220b1a9c83a982f90647b7a620a8f91369c (patch) | |
tree | 88b4b41c0e84de3d1601437bd3ad021e007dbfbe | |
parent | 14b00bb8b2753549ac0730dca5034c0dceba492d (diff) |
scheduler: rts_tchh_fn(): use a lookup table for FACCH/H
Unlike TCH/F, TCH/H imposes some additional requirements on the FACCH
transmission, so that a signalling block can be transmitted only at
specific TDMA frame numbers defined in 3GPP TS 45.002, table 1.
This is why in rts_tchh_fn() we need to check the given TDMA frame
number and tell rts_tch_common() whether FACCH/H is permitted or
not. The check is based on a magic formula, which I find a bit
hard to read and understand. Let's better use a lookup table.
Change-Id: I3dba243e5a1b7c8008ef0178ea18ed885256c50d
Related: SYS#5916, OS#5518
-rw-r--r-- | src/common/scheduler.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 99ab597f..96189ef2 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -996,12 +996,21 @@ static int rts_tchf_fn(const struct l1sched_ts *l1ts, const struct trx_dl_burst_ return rts_tch_common(l1ts, br, true); } +/* FACCH/H channel mapping for Downlink (see 3GPP TS 45.002, table 1). + * This mapping is valid for both FACCH/H(0) and FACCH/H(1). */ +static const uint8_t sched_tchh_dl_facch_map[26] = { + [4] = 1, /* FACCH/H(0): B0(4,6,8,10,13,15) */ + [5] = 1, /* FACCH/H(1): B0(5,7,9,11,14,16) */ + [13] = 1, /* FACCH/H(0): B1(13,15,17,19,21,23) */ + [14] = 1, /* FACCH/H(1): B1(14,16,18,20,22,24) */ + [21] = 1, /* FACCH/H(0): B2(21,23,0,2,4,6) */ + [22] = 1, /* FACCH/H(1): B2(22,24,1,3,5,7) */ +}; /* RTS for half rate traffic frame */ static int rts_tchh_fn(const struct l1sched_ts *l1ts, const struct trx_dl_burst_req *br) { - /* the FN 4/5, 13/14, 21/22 defines that FACCH may be included. */ - return rts_tch_common(l1ts, br, ((br->fn % 26) >> 2) & 1); + return rts_tch_common(l1ts, br, sched_tchh_dl_facch_map[br->fn % 26]); } /* set multiframe scheduler to given pchan */ |