aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-03-17 16:40:02 +0300
committerfixeria <vyanitskiy@sysmocom.de>2022-04-05 13:45:31 +0000
commit333e35439db28b63f53264da3e881c8424b1ac3c (patch)
tree6f62a4a1bd4297496a1fc91b6ee246430fd3e098
parent6d04bd95ee03266f194993dc7a48c0282a21d3b2 (diff)
osmo-bts-trx: rx_{tchf,tchh}_fn(): ensure complete set of bursts
The idea of this change is to avoid attempting to decode the burst buffer unless it's filled up completely. This eliminates expected decoding errors in the beginning of lchan's lifetime. Moreover this allows us to be sure that the measurement history is complete, so that we can abuse it to store TDMA frame numbers later. Note that even in the absence of NOPE indications (TRXDv0 case) we can still be sure that the burst mask has no gaps due to lost bursts, because they are compensated by trx_sched_calc_frame_loss(). Change-Id: I56bebe1374eb803e3c1e9f08dda4da50a074ab0b
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchf.c14
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchh.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index a689a1f0..9a168af5 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -85,7 +85,7 @@ int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
if (bi->bid == 0) {
memcpy(*bursts_p, *bursts_p + 464, 464);
memset(*bursts_p + 464, 0, 464);
- *mask = 0x0;
+ *mask = *mask << 4;
}
/* update mask */
@@ -106,13 +106,13 @@ int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
if (bi->bid != 3)
return 0;
- /* check for complete set of bursts */
- if ((*mask & 0xf) != 0xf) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
- "Received incomplete frame (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
+ /* fill up the burst buffer so that we have 8 bursts in there */
+ if (OSMO_UNLIKELY((*mask & 0xff) != 0xff)) {
+ LOGL1SB(DL1P, LOGL_DEBUG, l1ts, bi,
+ "UL burst buffer is not filled up: mask=0x%02x != 0xff\n",
+ *mask);
+ return 0; /* TODO: send BFI */
}
- *mask = 0x0;
/* decode
* also shift buffer by 4 bursts for interleaving */
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 6b499745..627291ea 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -92,7 +92,7 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
memcpy(*bursts_p, *bursts_p + 232, 232);
memcpy(*bursts_p + 232, *bursts_p + 464, 232);
memset(*bursts_p + 464, 0, 232);
- *mask = 0x0;
+ *mask = *mask << 2;
}
/* update mask */
@@ -113,13 +113,13 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
if (bi->bid != 1)
return 0;
- /* check for complete set of bursts */
- if ((*mask & 0x3) != 0x3) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
- "Received incomplete frame (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
+ /* fill up the burst buffer so that we have 6 bursts in there */
+ if (OSMO_UNLIKELY((*mask & 0x3f) != 0x3f)) {
+ LOGL1SB(DL1P, LOGL_DEBUG, l1ts, bi,
+ "UL burst buffer is not filled up: mask=0x%02x != 0x3f\n",
+ *mask);
+ return 0; /* TODO: send BFI */
}
- *mask = 0x0;
/* skip decoding of the last 4 bursts of FACCH/H */
if (chan_state->ul_ongoing_facch) {