diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 8ec9ccf0a..d16690905 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -998,7 +998,7 @@ static int rts_tchf_fn(const struct l1sched_ts *l1ts, const struct trx_dl_burst_ /* 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] = { +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) */ diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c index 55a185e7b..fe166ae75 100644 --- a/src/osmo-bts-trx/sched_lchan_tchh.c +++ b/src/osmo-bts-trx/sched_lchan_tchh.c @@ -75,6 +75,9 @@ static const uint8_t sched_tchh_ul_facch_map[26] = { [3] = 1, /* FACCH/H(1): B2(18,20,22,24,1,3) */ }; +/* TDMA frame number of burst 'a' is used as the table index. */ +extern const uint8_t sched_tchh_dl_facch_map[26]; + /*! \brief a single TCH/H burst was received by the PHY, process it */ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi) { @@ -407,6 +410,15 @@ int tx_tchh_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br) }; LOGL1SB(DL1P, LOGL_INFO, l1ts, br, "No TCH or FACCH prim for transmit.\n"); + + /* FACCH/H can only be scheduled at specific TDMA offset */ + if (!sched_tchh_dl_facch_map[br->fn % 26]) { + /* FACCH/H is not allowed, send half-filled bursts with even numbered + * bits contaning 232 encoded bits of the previous L2 frame, and 232 + * odd numbered bits all set to 0. */ + goto send_burst; + } + gsm0503_tch_hr_encode(*bursts_p, dummy, sizeof(dummy)); chan_state->dl_ongoing_facch = 1; chan_state->dl_facch_bursts = 6;