diff options
author | Harld Welte <laforge@osmocom.org> | 2020-03-22 12:26:26 +0000 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-03-22 14:06:47 +0100 |
commit | 4e07b83a64553f7f71d7f685ebb31d07fa7186f2 (patch) | |
tree | b617833d4e27e2f2238f6c7e3eb323fd74793e96 /src | |
parent | f1efd727fb97c63037942e4a962315f381373a6d (diff) |
trx: Use NOPE indications from OsmoTRX for TCH/F and TCH/H
Without using the NOPE indication it might happen that we get
into the following situation:
* bursts 0,1,2 of a given block are received
* burst 3 is lost on the radio interface, OsmoTRX sends NOPE
* osmo-bts-trx doesn't pass the NOPE the the rx_tch*_fn()
* we never detect the end of the block, never perform decoding
and even if the burst could be fully decoded, we loose the block
For voice, it can lead to lost RTP frames in uplink, which is also
problematic.
Let's deal with burst_len=0 in rx_tch*_fn() and use it as nope_fn.
Closes: OS#4661
Related: OS#2975
Change-Id: I0fbf4617daf24bd8aecfd9cfe1efd66cf73a277a
Diffstat (limited to 'src')
-rw-r--r-- | src/common/scheduler.c | 3 | ||||
-rw-r--r-- | src/osmo-bts-trx/scheduler_trx.c | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c index e8df5373..054b6ca2 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -191,6 +191,7 @@ const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX] = { .rts_fn = rts_tchf_fn, .dl_fn = tx_tchf_fn, .ul_fn = rx_tchf_fn, + .nope_fn = rx_tchf_fn, }, [TRXC_TCHH_0] = { .name = "TCH/H(0)", /* 3GPP TS 05.02, section 3.2 */ @@ -211,6 +212,7 @@ const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX] = { .rts_fn = rts_tchh_fn, .dl_fn = tx_tchh_fn, .ul_fn = rx_tchh_fn, + .nope_fn = rx_tchh_fn, }, [TRXC_TCHH_1] = { .name = "TCH/H(1)", /* 3GPP TS 05.02, section 3.2 */ @@ -222,6 +224,7 @@ const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX] = { .rts_fn = rts_tchh_fn, .dl_fn = tx_tchh_fn, .ul_fn = rx_tchh_fn, + .nope_fn = rx_tchh_fn, }, [TRXC_SDCCH4_0] = { .name = "SDCCH/4(0)", /* 3GPP TS 05.02, section 3.3.4.1 */ diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 585e8872..f17354a8 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1165,8 +1165,11 @@ int rx_tchf_fn(struct l1sched_trx *l1t, enum trx_chan_type chan, /* copy burst to end of buffer of 8 bursts */ burst = *bursts_p + bid * 116 + 464; - memcpy(burst, bi->burst + 3, 58); - memcpy(burst + 58, bi->burst + 87, 58); + if (bi->burst_len > 0) { + memcpy(burst, bi->burst + 3, 58); + memcpy(burst + 58, bi->burst + 87, 58); + } else + memset(burst, 0, 116); /* wait until complete set of bursts */ if (bid != 3) @@ -1360,8 +1363,11 @@ int rx_tchh_fn(struct l1sched_trx *l1t, enum trx_chan_type chan, /* copy burst to end of buffer of 6 bursts */ burst = *bursts_p + bid * 116 + 464; - memcpy(burst, bi->burst + 3, 58); - memcpy(burst + 58, bi->burst + 87, 58); + if (bi->burst_len > 0) { + memcpy(burst, bi->burst + 3, 58); + memcpy(burst + 58, bi->burst + 87, 58); + } else + memset(burst, 0, 116); /* wait until complete set of bursts */ if (bid != 1) |