Attention is currently required from: pespin.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-upf/+/27221
to look at the new patch set (#7).
Change subject: libosmo-pfcp: add pfcp_proto.h pfcp_strs.h
......................................................................
libosmo-pfcp: add pfcp_proto.h pfcp_strs.h
Related: SYS#5599
Change-Id: I568b821e89007ed52eeefcdbcb6edd8052a8b5be
---
M configure.ac
M include/osmocom/Makefile.am
A include/osmocom/pfcp/Makefile.am
A include/osmocom/pfcp/pfcp_proto.h
A include/osmocom/pfcp/pfcp_strs.h
M src/Makefile.am
A src/libosmo-pfcp/Makefile.am
A src/libosmo-pfcp/pfcp_strs.c
8 files changed, 1,152 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/21/27221/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27221
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I568b821e89007ed52eeefcdbcb6edd8052a8b5be
Gerrit-Change-Number: 27221
Gerrit-PatchSet: 7
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-upf/+/27222
to look at the new patch set (#11).
Change subject: libosmo-pfcp: implement/generate TLV and IE value coding
......................................................................
libosmo-pfcp: implement/generate TLV and IE value coding
Related: SYS#5599
Change-Id: I3069045b2d42dac88d955c636230adc64a7a4aa7
---
M include/osmocom/pfcp/Makefile.am
A include/osmocom/pfcp/pfcp_ies_custom.h
M src/libosmo-pfcp/Makefile.am
A src/libosmo-pfcp/gen__pfcp_ies_auto.c
A src/libosmo-pfcp/pfcp_ies_custom.c
5 files changed, 1,565 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/22/27222/11
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27222
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I3069045b2d42dac88d955c636230adc64a7a4aa7
Gerrit-Change-Number: 27222
Gerrit-PatchSet: 11
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/27559 )
Change subject: osmo-bts-trx: detect half burst filling, filter BER10k
......................................................................
osmo-bts-trx: detect half burst filling, filter BER10k
According to 3GPP TS 45.002, section A.2.2, in DTXu mode the MS may
use half burst filling, so that only half of the encoded block is
present. In this case we can still decode a valid L2 frame (partial
SID), but as expected the calulated BER would be around 50%.
Half burst filling for TCH/F can be visualized as follows:
7 6 5 4 3 2 1 0
+---+---+---+---+---+---+---+---+---+---+---+---+
| | | | | | | | | a | b | c | d | Partial SID (BER ~50%)
+---+---+---+---+---+---+---+---+---+---+---+---+
| | | | | a | b | c | d | e | f | g | h | SID (BER 0%)
+---+---+---+---+---+---+---+---+---+---+---+---+
| a | b | c | d | e | f | g | h | | | | | Partial SID (BER ~50%)
+---+---+---+---+---+---+---+---+---+---+---+---+
|<----------------------------->|
Burst buffer
Half burst filling for TCH/H can be visualized as follows:
7 6 5 4 3 2 1 0
+---+---+---+---+---+---+---+---+
| | | | | a | b | c | d | Partial SID (BER ~50%)
+---+---+---+---+---+---+---+---+
| | | a | b | c | d | | | SID (BER 0%)
+---+---+---+---+---+---+---+---+
| a | b | c | d | | | | | Partial SID (BER ~50%)
+---+---+---+---+---+---+---+---+
|<--------------------->|
Burst buffer
In both cases an empty cell corresponds to a NOPE.ind (missing burst).
We need to detect such cases and fliter out the expected BER of 50%.
This can be achieved by checking completeness of the burst buffer,
in particular by maintaining an additional sliding mask of NOPE.ind.
Change-Id: Ia46d68603292b5c5c65f5c6552494223f10ee813
Related: SYS#5853
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
3 files changed, 77 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/59/27559/1
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index e39315f..ff7c36f 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -101,6 +101,7 @@
sbit_t *ul_bursts_prev;/* previous burst buffer for RX (repeated SACCH) */
uint32_t ul_first_fn; /* fn of first burst */
uint8_t ul_mask; /* mask of received bursts */
+ uint16_t nope_mask; /* mask of received NOPE.ind */
/* loss detection */
uint8_t lost_frames; /* how many L2 frames were lost */
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 6a9a0f0..e1593e4 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -45,12 +45,33 @@
#include <sched_utils.h>
#include <loops.h>
+static bool is_partial_sid(const struct gsm_lchan *lchan, uint16_t nope_mask)
+{
+ /* 7 6 5 4 3 2 1 0
+ * +---+---+---+---+---+---+---+---+---+---+---+---+
+ * | | | | | | | | | a | b | c | d | Partial SID (BER ~50%)
+ * +---+---+---+---+---+---+---+---+---+---+---+---+
+ * | | | | | a | b | c | d | e | f | g | h | SID (BER 0%)
+ * +---+---+---+---+---+---+---+---+---+---+---+---+
+ * | a | b | c | d | e | f | g | h | | | | | Partial SID (BER ~50%)
+ * +---+---+---+---+---+---+---+---+---+---+---+---+
+ * |<----------------------------->|
+ * Burst buffer
+ */
+ if (!lchan->tch.dtx.ul_sid)
+ return false;
+ if ((~nope_mask & 0xff) == 0xff)
+ return false;
+ return true;
+}
+
/*! \brief a single TCH/F burst was received by the PHY, process it */
int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
{
struct l1sched_chan_state *chan_state = &l1ts->chan_state[bi->chan];
struct gsm_lchan *lchan = chan_state->lchan;
sbit_t *burst, **bursts_p = &chan_state->ul_bursts;
+ uint16_t *nope_mask = &chan_state->nope_mask;
uint8_t *mask = &chan_state->ul_mask;
uint8_t rsl_cmode = chan_state->rsl_cmode;
uint8_t tch_mode = chan_state->tch_mode;
@@ -85,11 +106,15 @@
if (bi->bid == 0) {
memcpy(*bursts_p, *bursts_p + 464, 464);
memset(*bursts_p + 464, 0, 464);
+ *nope_mask = *nope_mask << 4;
*mask = *mask << 4;
}
/* update mask */
*mask |= (1 << bi->bid);
+ /* update NOPE.ind mask */
+ if (bi->flags & TRX_BI_F_NOPE_IND)
+ *nope_mask |= (1 << bi->bid);
/* store measurements */
trx_sched_meas_push(chan_state, bi);
@@ -206,6 +231,8 @@
return -EINVAL;
}
+ ber10k = compute_ber10k(n_bits_total, n_errors);
+
/* average measurements of the last N (depends on mode) bursts */
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
/* meas_avg.fn now contains TDMA frame number of the first burst */
@@ -221,12 +248,23 @@
"Received bad data (%u/%u) with invalid codec mode %d\n",
bi->fn % l1ts->mf_period, l1ts->mf_period, rc);
bfi_flag = true;
+ } else if (ber10k > 0 && is_partial_sid(lchan, *nope_mask)) {
+ /* In DTXu mode the MS may use half burst filling (see 3GPP TS 45.002,
+ * section A.2.2), so that only half of the encoded block is present.
+ * In this case we can still decode a valid L2 frame (partial SID),
+ * but as expected the calulated BER would be around 50%. */
+ LOGL1SB(DL1P, LOGL_DEBUG, l1ts, bi,
+ "Half burst filling detected: mask=0x%04x, ber10k=%d (%d/%d)\n",
+ *nope_mask, ber10k, n_errors, n_bits_total);
+ /* Filter out the expected 50% of BER (+1% to be sure) */
+ if (ber10k < 5100)
+ ber10k = 0;
+ /* TODO: shall we set is_sub=1 for partial SID frames? */
}
if (rc != GSM_MACBLOCK_LEN && lchan->ecu_state)
osmo_ecu_frame_in(lchan->ecu_state, bfi_flag, tch_data, rc);
- ber10k = compute_ber10k(n_bits_total, n_errors);
if (bfi_flag)
goto bfi;
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 369e35b..36f8abb 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -45,12 +45,33 @@
#include <sched_utils.h>
#include <loops.h>
+static bool is_partial_sid(const struct gsm_lchan *lchan, uint16_t nope_mask)
+{
+ /* 7 6 5 4 3 2 1 0
+ * +---+---+---+---+---+---+---+---+
+ * | | | | | a | b | c | d | Partial SID (BER ~50%)
+ * +---+---+---+---+---+---+---+---+
+ * | | | a | b | c | d | | | SID (BER 0%)
+ * +---+---+---+---+---+---+---+---+
+ * | a | b | c | d | | | | | Partial SID (BER ~50%)
+ * +---+---+---+---+---+---+---+---+
+ * |<--------------------->|
+ * Burst buffer
+ */
+ if (!lchan->tch.dtx.ul_sid)
+ return false;
+ if ((~nope_mask & 0x3c) == 0x3c)
+ return false;
+ return true;
+}
+
/*! \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)
{
struct l1sched_chan_state *chan_state = &l1ts->chan_state[bi->chan];
struct gsm_lchan *lchan = chan_state->lchan;
sbit_t *burst, **bursts_p = &chan_state->ul_bursts;
+ uint16_t *nope_mask = &chan_state->nope_mask;
uint8_t *mask = &chan_state->ul_mask;
uint8_t rsl_cmode = chan_state->rsl_cmode;
uint8_t tch_mode = chan_state->tch_mode;
@@ -91,11 +112,15 @@
memcpy(*bursts_p, *bursts_p + 232, 232);
memcpy(*bursts_p + 232, *bursts_p + 464, 232);
memset(*bursts_p + 464, 0, 232);
+ *nope_mask = *nope_mask << 2;
*mask = *mask << 2;
}
/* update mask */
*mask |= (1 << bi->bid);
+ /* update NOPE.ind mask */
+ if (bi->flags & TRX_BI_F_NOPE_IND)
+ *nope_mask |= (1 << bi->bid);
/* store measurements */
trx_sched_meas_push(chan_state, bi);
@@ -248,6 +273,18 @@
"Received bad data (%u/%u) with invalid codec mode %d\n",
bi->fn % l1ts->mf_period, l1ts->mf_period, rc);
bfi_flag = true;
+ } else if (ber10k > 0 && is_partial_sid(lchan, *nope_mask)) {
+ /* In DTXu mode the MS may use half burst filling (see 3GPP TS 45.002,
+ * section A.2.2), so that only half of the encoded block is present.
+ * In this case we can still decode a valid L2 frame (partial SID),
+ * but as expected the calulated BER would be around 50%. */
+ LOGL1SB(DL1P, LOGL_DEBUG, l1ts, bi,
+ "Half burst filling detected: mask=0x%04x, ber10k=%d (%d/%d)\n",
+ *nope_mask, ber10k, n_errors, n_bits_total);
+ /* Filter out the expected 50% of BER (+1% to be sure) */
+ if (ber10k < 5100)
+ ber10k = 0;
+ /* TODO: shall we set is_sub=1 for partial SID frames? */
}
if (rc != GSM_MACBLOCK_LEN && lchan->ecu_state)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27559
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ia46d68603292b5c5c65f5c6552494223f10ee813
Gerrit-Change-Number: 27559
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/27557 )
Change subject: osmo-bts-trx: rx_{tchh,tchf}_fn(): use AMR CMI lookup tables
......................................................................
osmo-bts-trx: rx_{tchh,tchf}_fn(): use AMR CMI lookup tables
3GPP TS 45.009 defines that Codec Mode Indications shall be sent
with speech frames having specific TDMA frame numbers of their
*first* bursts, which are defined in tables 3.2.1.3-{1,2,3,4}.
Performance-wise it's batter to have these tables implemented as
arrays, rather then using the 'switch' statement. We can simplify
things even further and have TDMA frame numbers corresponding to
the *last* bursts in them. This eliminates the need of doing an
additional last-to-first mapping, so that bi->fn can be used.
Change-Id: I46def864729c8f9063af201750456771ea5558d5
---
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
M src/osmo-bts-trx/sched_utils.h
3 files changed, 20 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/27557/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index c8ad383..6a9a0f0 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -131,8 +131,7 @@
* the first FN 4,13,21 defines that CMR is included in frame.
* NOTE: A frame ends 7 FN after start.
*/
- fn_begin = trx_sched_lookup_fn(chan_state, 8);
- amr_is_cmr = !ul_amr_fn_is_cmi(fn_begin);
+ amr_is_cmr = !sched_tchf_ul_amr_cmi_map[bi->fn % 26];
/* The AFS_ONSET frame itself does not result into an RTP frame
* since it only contains a recognition pattern that marks the
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 1778d36..369e35b 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -165,16 +165,7 @@
break;
}
- /* Calculate the frame number where the block begins. Note that
- * we need to traverse the measurement histort back by 6 bursts,
- * not by 4 bursts. The reason for this is that the burst shift
- * buffer we use for decoding is 6 bursts wide (one SACCH block) but
- * TCH/H blocks are only 4 bursts wide. The decoder functions look
- * at the beginning of the buffer while we shift into it at the end,
- * this means that TCH/H blocks always decoded delayed by two frame
- * number positions late. */
- fn_begin = trx_sched_lookup_fn(chan_state, 6);
- fn_is_cmi = ul_amr_fn_is_cmi(fn_begin);
+ fn_is_cmi = sched_tchh_ul_amr_cmi_map[bi->fn % 26];
/* See comment in function rx_tchf_fn() */
amr = 2;
diff --git a/src/osmo-bts-trx/sched_utils.h b/src/osmo-bts-trx/sched_utils.h
index f76e49b..398083d 100644
--- a/src/osmo-bts-trx/sched_utils.h
+++ b/src/osmo-bts-trx/sched_utils.h
@@ -37,6 +37,24 @@
return 10000 * n_errors / n_bits_total;
}
+/* 3GPP TS 45.009, table 3.2.1.3-{1,3}: AMR on Uplink TCH/F */
+static const uint8_t sched_tchf_ul_amr_cmi_map[26] = {
+ [7] = 1, /* TCH/F: first=0 / last=7 */
+ [16] = 1, /* TCH/F: first=8 / last=16 */
+ [24] = 1, /* TCH/F: first=17 / last=24 */
+};
+
+/* 3GPP TS 45.009, table 3.2.1.3-{2,4}: AMR on Uplink TCH/H */
+static const uint8_t sched_tchh_ul_amr_cmi_map[26] = {
+ [6] = 1, /* TCH/H(0): first=0 / last=6 */
+ [15] = 1, /* TCH/H(0): first=8 / last=15 */
+ [23] = 1, /* TCH/H(0): first=17 / last=23 */
+
+ [7] = 1, /* TCH/H(1): first=1 / last=7 */
+ [16] = 1, /* TCH/H(1): first=9 / last=16 */
+ [24] = 1, /* TCH/H(1): first=18 / last=24 */
+};
+
/*! determine whether an uplink AMR block is CMI according to 3GPP TS 45.009.
* \param[in] fn_begin frame number of the beginning of the block.
* \returns true in case of CMI; false otherwise. */
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27557
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I46def864729c8f9063af201750456771ea5558d5
Gerrit-Change-Number: 27557
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/27558 )
Change subject: trx_sched_ul_burst(): get rid of the 'switch' statement
......................................................................
trx_sched_ul_burst(): get rid of the 'switch' statement
Both TRXC_RACH and TRXC_PTCCH are handled in the rx_rach_fn(),
so we can eliminate the need of having a 'switch' statement in
the general (perfrmance critical) code path.
Change-Id: I66d8785a63215af37a77e258039549e4e6292e49
---
M src/common/scheduler.c
M src/osmo-bts-trx/sched_lchan_rach.c
2 files changed, 7 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/27558/1
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index b27d7ea..e6a664f 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1546,16 +1546,9 @@
/* handle NOPE indications */
if (bi->flags & TRX_BI_F_NOPE_IND) {
- switch (bi->chan) {
- case TRXC_PTCCH:
- case TRXC_RACH:
- /* For some logical channel types NOPE.ind is valueless. */
- return 0;
- default:
- /* NOTE: Uplink burst handler must check bi->burst_len before
- * accessing bi->burst to avoid uninitialized memory access. */
- return func(l1ts, bi);
- }
+ /* NOTE: Uplink burst handler must check bi->burst_len before
+ * accessing bi->burst to avoid uninitialized memory access. */
+ return func(l1ts, bi);
}
/* decrypt */
diff --git a/src/osmo-bts-trx/sched_lchan_rach.c b/src/osmo-bts-trx/sched_lchan_rach.c
index c3abf32..5d9d0b1 100644
--- a/src/osmo-bts-trx/sched_lchan_rach.c
+++ b/src/osmo-bts-trx/sched_lchan_rach.c
@@ -112,6 +112,10 @@
uint8_t ra;
int rc;
+ /* Ignore NOPE indications, they're of no use here */
+ if (bi->flags & TRX_BI_F_NOPE_IND)
+ return 0;
+
/* TSC (Training Sequence Code) is an optional parameter of the UL burst
* indication. We need this information in order to decide whether an
* Access Burst is 11-bit encoded or not (see OS#1854). If this information
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27558
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I66d8785a63215af37a77e258039549e4e6292e49
Gerrit-Change-Number: 27558
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/27554 )
Change subject: osmo-bts-trx: rx_{tchf,tchh}_fn(): shift Rx burst buffer on bid=0
......................................................................
osmo-bts-trx: rx_{tchf,tchh}_fn(): shift Rx burst buffer on bid=0
For both TCH/F and TCH/H, the receive burst buffer needs to be
periodically shifted leftwards due to the nature of block-diagonal
interleaving. Currently we do this on receipt of bid=3 for TCH/F
and bid=1 for TCH/H, right after attempting to decode the buffer.
If for some reason we return early before attempting to decode the
buffer, the content of that buffer might not be shifted and some
bursts might be overwritten. This can be easily avoided by doing
the shifting on receipt of bid=0 for both TCH/H and TCH/F.
Change-Id: I0bd69f5a8f5c665fb5f00c127bc3fe1d91167abb
---
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
2 files changed, 6 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/27554/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index c6c5532..a689a1f 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -81,8 +81,9 @@
return -ENOMEM;
}
- /* clear burst */
+ /* shift the buffer by 4 bursts leftwards */
if (bi->bid == 0) {
+ memcpy(*bursts_p, *bursts_p + 464, 464);
memset(*bursts_p + 464, 0, 464);
*mask = 0x0;
}
@@ -205,7 +206,6 @@
tch_mode);
return -EINVAL;
}
- memcpy(*bursts_p, *bursts_p + 464, 464);
/* average measurements of the last N (depends on mode) bursts */
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 3a66321..6b49974 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -87,8 +87,10 @@
return -ENOMEM;
}
- /* clear burst */
+ /* shift the buffer by 2 bursts leftwards */
if (bi->bid == 0) {
+ memcpy(*bursts_p, *bursts_p + 232, 232);
+ memcpy(*bursts_p + 232, *bursts_p + 464, 232);
memset(*bursts_p + 464, 0, 232);
*mask = 0x0;
}
@@ -122,8 +124,6 @@
/* skip decoding of the last 4 bursts of FACCH/H */
if (chan_state->ul_ongoing_facch) {
chan_state->ul_ongoing_facch = 0;
- memcpy(*bursts_p, *bursts_p + 232, 232);
- memcpy(*bursts_p + 232, *bursts_p + 464, 232);
/* we have already sent the first BFI when a FACCH/H frame
* was decoded (see below), now send the second one. */
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
@@ -238,8 +238,7 @@
tch_mode);
return -EINVAL;
}
- memcpy(*bursts_p, *bursts_p + 232, 232);
- memcpy(*bursts_p + 232, *bursts_p + 464, 232);
+
ber10k = compute_ber10k(n_bits_total, n_errors);
/* average measurements of the last N (depends on mode) bursts */
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27554
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I0bd69f5a8f5c665fb5f00c127bc3fe1d91167abb
Gerrit-Change-Number: 27554
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/27555 )
Change subject: osmo-bts-trx: rx_{tchf,tchh}_fn(): ensure complete set of bursts
......................................................................
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
---
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
2 files changed, 14 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/55/27555/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index a689a1f..9a168af 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -85,7 +85,7 @@
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 @@
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 6b49974..627291e 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -92,7 +92,7 @@
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 @@
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) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27555
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I56bebe1374eb803e3c1e9f08dda4da50a074ab0b
Gerrit-Change-Number: 27555
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/27556 )
Change subject: osmo-bts-trx: rx_{tchf,tchh}_fn(): get TDMA FN from meas history
......................................................................
osmo-bts-trx: rx_{tchf,tchh}_fn(): get TDMA FN from meas history
Once we have an Uplink speech or FACCH frame decoded, we need to
hand it over to the upper layers indicating TDMA frame number of
the *first* burst corresponding to the beginning of a block.
Currently we use libosmogsm's gsm0502_fn_remap() API to calculate
the first TDMA frame number from the given last frame number.
This API involves iterating over the pre-calculated offset tables
for different channel and payload types, and thus imposes some
additional CPU cycles. Another downside of the current approach
is that we have to perform such lookups several times for each
decoded L2 frame, e.g. for FACCH on TCH/AHS we do it three times!
In this patch I propose an alternative approach of storing TDMA
frame numbers in the measurement history, together with the
associated samples. This way we can easily get N-th frame number
from there without performing any additional computations, other
than what we already do during the measurement processing.
Change-Id: Id9a2b7b0f1a1ad7cfbbab862faf521e135c90605
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
M src/osmo-bts-trx/scheduler_trx.c
4 files changed, 38 insertions(+), 36 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/27556/1
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index f671874..e39315f 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -80,6 +80,7 @@
/* A set of measurements belonging to one Uplink burst */
struct l1sched_meas_set {
+ uint32_t fn; /* TDMA frame number */
int16_t toa256; /* Timing of Arrival (1/256 of a symbol) */
int16_t ci_cb; /* Carrier-to-Interference (cB) */
float rssi; /* RSSI (dBm) */
@@ -325,3 +326,5 @@
void trx_sched_meas_avg(const struct l1sched_chan_state *chan_state,
struct l1sched_meas_set *avg,
enum sched_meas_avg_mode mode);
+uint32_t trx_sched_lookup_fn(const struct l1sched_chan_state *chan_state,
+ const unsigned int shift);
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 9a168af..c8ad383 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -131,7 +131,7 @@
* the first FN 4,13,21 defines that CMR is included in frame.
* NOTE: A frame ends 7 FN after start.
*/
- fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_TCH_F);
+ fn_begin = trx_sched_lookup_fn(chan_state, 8);
amr_is_cmr = !ul_amr_fn_is_cmi(fn_begin);
/* The AFS_ONSET frame itself does not result into an RTP frame
@@ -209,6 +209,8 @@
/* average measurements of the last N (depends on mode) bursts */
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
+ /* meas_avg.fn now contains TDMA frame number of the first burst */
+ fn_begin = meas_avg.fn;
/* Check if the frame is bad */
if (rc < 0) {
@@ -231,7 +233,6 @@
/* FACCH */
if (rc == GSM_MACBLOCK_LEN) {
- fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_FACCH_F);
_sched_compose_ph_data_ind(l1ts, fn_begin, bi->chan,
tch_data + amr, GSM_MACBLOCK_LEN,
meas_avg.rssi, meas_avg.toa256,
@@ -300,7 +301,6 @@
/* TCH or BFI */
compose_l1sap:
- fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_TCH_F);
return _sched_compose_tch_ind(l1ts, fn_begin, bi->chan, tch_data, rc,
meas_avg.toa256, ber10k, meas_avg.rssi,
meas_avg.ci_cb, is_sub);
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 627291e..1778d36 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -67,7 +67,6 @@
enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S6N4;
struct l1sched_meas_set meas_avg;
unsigned int fn_begin;
- unsigned int fn_tch_end;
uint16_t ber10k = 0;
uint8_t is_sub = 0;
uint8_t ft;
@@ -127,6 +126,8 @@
/* we have already sent the first BFI when a FACCH/H frame
* was decoded (see below), now send the second one. */
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
+ /* meas_avg.fn now contains TDMA frame number of the first burst */
+ fn_begin = meas_avg.fn;
goto bfi;
}
@@ -164,15 +165,15 @@
break;
}
- /* Calculate the frame number where the block begins */
- if (bi->fn % 13 < 4)
- fn_tch_end = GSM_TDMA_FN_SUB(bi->fn, 5);
- else
- fn_tch_end = GSM_TDMA_FN_SUB(bi->fn, 4);
- if (lchan->nr == 0)
- fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H0);
- else
- fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H1);
+ /* Calculate the frame number where the block begins. Note that
+ * we need to traverse the measurement histort back by 6 bursts,
+ * not by 4 bursts. The reason for this is that the burst shift
+ * buffer we use for decoding is 6 bursts wide (one SACCH block) but
+ * TCH/H blocks are only 4 bursts wide. The decoder functions look
+ * at the beginning of the buffer while we shift into it at the end,
+ * this means that TCH/H blocks always decoded delayed by two frame
+ * number positions late. */
+ fn_begin = trx_sched_lookup_fn(chan_state, 6);
fn_is_cmi = ul_amr_fn_is_cmi(fn_begin);
/* See comment in function rx_tchf_fn() */
@@ -243,6 +244,8 @@
/* average measurements of the last N (depends on mode) bursts */
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
+ /* meas_avg.fn now contains TDMA frame number of the first burst */
+ fn_begin = meas_avg.fn;
/* Check if the frame is bad */
if (rc < 0) {
@@ -265,10 +268,6 @@
/* FACCH */
if (rc == GSM_MACBLOCK_LEN) {
chan_state->ul_ongoing_facch = 1;
- if (lchan->nr == 0)
- fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_FACCH_H0);
- else
- fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_FACCH_H1);
/* In order to provide an even stream of measurement reports, here we
* intentionally invalidate RSSI, so that this report gets dropped in
* process_l1sap_meas_data(). The averaged results will still be sent
@@ -329,25 +328,6 @@
compose_l1sap:
/* TCH or BFI */
-
- /* The input to gsm0502_fn_remap() needs to get the frame number we
- * got two bursts ago. The reason for this is that the burst shift
- * buffer we use for decoding is 6 bursts wide (one SACCH block) but
- * TCH/H blocks are only 4 bursts wide. The decoder functions look
- * at the beginning of the buffer while we shift into it at the end,
- * this means that TCH/H blocks always decode delayed by two frame
- * number positions late. To calculatue the ending frame number of
- * the TCH/H we need to subtract 4 or 5 frames if there was a SACCH
- * in between. (Note: this is TCH/H, 4 frames ==> 2 bursts) */
- if (bi->fn % 13 < 4)
- fn_tch_end = GSM_TDMA_FN_SUB(bi->fn, 5);
- else
- fn_tch_end = GSM_TDMA_FN_SUB(bi->fn, 4);
- if (lchan->nr == 0)
- fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H0);
- else
- fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H1);
-
return _sched_compose_tch_ind(l1ts, fn_begin, bi->chan, tch_data, rc,
meas_avg.toa256, ber10k, meas_avg.rssi,
meas_avg.ci_cb, is_sub);
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 6ce5a9a..d772620 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -623,6 +623,7 @@
unsigned int current = chan_state->meas.current;
chan_state->meas.buf[current] = (struct l1sched_meas_set) {
+ .fn = bi->fn,
.ci_cb = (bi->flags & TRX_BI_F_CI_CB) ? bi->ci_cb : 0,
.toa256 = bi->toa256,
.rssi = bi->rssi,
@@ -669,8 +670,13 @@
ci_cb_sum += set->ci_cb;
}
+ /* First sample contains TDMA frame number of the first burst */
+ pos = (current + hist_size - shift) % hist_size;
+ set = &chan_state->meas.buf[pos];
+
/* Calculate the average for each value */
*avg = (struct l1sched_meas_set) {
+ .fn = set->fn, /* first burst */
.rssi = (rssi_sum / num),
.toa256 = (toa256_sum / num),
.ci_cb = (ci_cb_sum / num),
@@ -682,3 +688,16 @@
chan_state->lchan ? " " : "",
num, shift, avg->rssi, avg->toa256, avg->ci_cb);
}
+
+/* Lookup TDMA frame number of the N-th sample in the history */
+uint32_t trx_sched_lookup_fn(const struct l1sched_chan_state *chan_state,
+ const unsigned int shift)
+{
+ const unsigned int hist_size = ARRAY_SIZE(chan_state->meas.buf);
+ const unsigned int current = chan_state->meas.current;
+ unsigned int pos;
+
+ /* First sample contains TDMA frame number of the first burst */
+ pos = (current + hist_size - shift) % hist_size;
+ return chan_state->meas.buf[pos].fn;
+}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27556
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id9a2b7b0f1a1ad7cfbbab862faf521e135c90605
Gerrit-Change-Number: 27556
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/27552 )
Change subject: osmo-bts-trx: rx_tchh_fn(): get rid of chan_state->meas_avg_facch
......................................................................
osmo-bts-trx: rx_tchh_fn(): get rid of chan_state->meas_avg_facch
FACCH/H takes out two speech frames, so we send two BFIs once we
have received it in rx_tchh_fn(). The upper layers responsible
for handling of the Uplink measurements expect a fixed amount of
measurement samples, so currently we do:
* send a FACCH frame with the associated measurememnts (S6N6),
* send the 1st BFI with invalidated measurements (RSSI=0),
* send the 2nd BFI with the stored measurememnts of FACCH.
This is achieved by preserving a copy of the FACCH measurememnts
in chan_state->meas_avg_facch and then using it two bursts later.
The same goal can be achieved a lot easier by sending the associated
measurements with both BFIs as if no FACCH was received:
* send a FACCH frame with invalidated measurememnts (RSSI=0),
* send the 1st BFI with the associated measurememnts (S6N4),
* send the 2nd BFI with the associated measurememnts (S6N4).
This eliminates the need to store anything outside of the existing
measurement history and simplifies the code a lot. Also, this
eliminates the need for using a dedicated averaging mode S6N6.
Varified by running BTS_Tests.TC_meas_res_speech_tchh_facch.
Change-Id: I7902b4709bc3f418174e8373f52e87bb31cdc826
Related: I1ad9fa3815feb2b4da608ab7df716a87ba1f2f91
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/sched_lchan_tchh.c
2 files changed, 7 insertions(+), 32 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/27552/1
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 2806117..f671874 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -125,7 +125,6 @@
/* TCH/H */
uint8_t dl_ongoing_facch; /* FACCH/H on downlink */
uint8_t ul_ongoing_facch; /* FACCH/H on uplink */
- struct l1sched_meas_set meas_avg_facch; /* measurement results for last FACCH */
uint8_t dl_facch_bursts; /* number of remaining DL FACCH bursts */
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 4553132..e97adbd 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -71,7 +71,6 @@
uint16_t ber10k = 0;
uint8_t is_sub = 0;
uint8_t ft;
- bool mask_stolen_tch_block = false;
bool fn_is_cmi;
/* If handover RACH detection is turned on, treat this burst as an Access Burst.
@@ -127,11 +126,7 @@
memcpy(*bursts_p + 232, *bursts_p + 464, 232);
/* we have already sent the first BFI when a FACCH/H frame
* was decoded (see below), now send the second one. */
- memset(&meas_avg, 0, sizeof(meas_avg));
- /* In order to provide an even stream of measurement reports
- * we ask the code below to mask the missing TCH/H block
- * measurement report with the FACCH measurement results. */
- mask_stolen_tch_block = true;
+ trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
goto bfi;
}
@@ -248,8 +243,6 @@
ber10k = compute_ber10k(n_bits_total, n_errors);
/* average measurements of the last N (depends on mode) bursts */
- if (rc == GSM_MACBLOCK_LEN)
- meas_avg_mode = SCHED_MEAS_AVG_M_S6N6;
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
/* Check if the frame is bad */
@@ -277,22 +270,15 @@
fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_FACCH_H0);
else
fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_FACCH_H1);
+ /* In order to provide an even stream of measurement reports, here we
+ * intentionally invalidate RSSI, so that this report gets dropped in
+ * process_l1sap_meas_data(). The averaged results will still be sent
+ * with the first BFI (see below). */
_sched_compose_ph_data_ind(l1ts, fn_begin, bi->chan,
tch_data + amr, GSM_MACBLOCK_LEN,
- meas_avg.rssi, meas_avg.toa256,
- meas_avg.ci_cb, ber10k,
+ 0, /* intentionally invalidate RSSI */
+ meas_avg.toa256, meas_avg.ci_cb, ber10k,
PRES_INFO_UNKNOWN);
-
- /* Keep a copy of the measurement results of the last FACCH
- * transmission in order to be able to create a replacement
- * measurement result for the one missing TCH block
- * measurement */
- memcpy(&chan_state->meas_avg_facch, &meas_avg, sizeof(meas_avg));
-
- /* Invalidate the current measurement result to prevent the
- * code below from handing up the current measurement a second
- * time. */
- memset(&meas_avg, 0, sizeof(meas_avg));
ber10k = 0;
bfi:
/* A FACCH/H frame replaces two speech frames, so we need to send two BFIs.
@@ -363,16 +349,6 @@
else
fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H1);
- /* A FACCH/H transmission takes out two TCH/H voice blocks and the
- * related measurement results. The first measurement result is handed
- * up directly with the FACCH (see above), the second one needs to be
- * compensated by filling the gap with the measurement result we got
- * from the FACCH transmission. */
- if (mask_stolen_tch_block) {
- memcpy(&meas_avg, &chan_state->meas_avg_facch, sizeof(meas_avg));
- memset(&chan_state->meas_avg_facch, 0, sizeof(meas_avg));
- }
-
return _sched_compose_tch_ind(l1ts, fn_begin, bi->chan, tch_data, rc,
/* FIXME: what should we use for BFI here? */
bfi_flag ? bi->toa256 : meas_avg.toa256, ber10k,
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27552
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7902b4709bc3f418174e8373f52e87bb31cdc826
Gerrit-Change-Number: 27552
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/27553 )
Change subject: osmo-bts-trx: rx_{tchf,tchh}_fn(): also use meas_avg for BFI
......................................................................
osmo-bts-trx: rx_{tchf,tchh}_fn(): also use meas_avg for BFI
In the current implementation of both TCH/F and TCH/H lchans, we
set the 'bfi_flag' to true only if decoding fails. Perhaps this
was not the case when I wrote [1], so using meas_avg might result
in using uninitialized memory. This is not the case anymore.
Pass the *averaged* measurememnts regardless of decoding result.
Change-Id: I23f767364a018d30d04885990adf69b50b2c9738
Related: [1] I2b02b51fea5664f161382a4ddc63dbf14ffc9ac5
---
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
2 files changed, 4 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/27553/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 0388ec0..c6c5532 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -302,11 +302,8 @@
compose_l1sap:
fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_TCH_F);
return _sched_compose_tch_ind(l1ts, fn_begin, bi->chan, tch_data, rc,
- /* FIXME: what should we use for BFI here? */
- bfi_flag ? bi->toa256 : meas_avg.toa256, ber10k,
- bfi_flag ? bi->rssi : meas_avg.rssi,
- bfi_flag ? bi->ci_cb : meas_avg.ci_cb,
- is_sub);
+ meas_avg.toa256, ber10k, meas_avg.rssi,
+ meas_avg.ci_cb, is_sub);
}
/* common section for generation of TCH bursts (TCH/H and TCH/F).
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index e97adbd..3a66321 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -350,11 +350,8 @@
fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H1);
return _sched_compose_tch_ind(l1ts, fn_begin, bi->chan, tch_data, rc,
- /* FIXME: what should we use for BFI here? */
- bfi_flag ? bi->toa256 : meas_avg.toa256, ber10k,
- bfi_flag ? bi->rssi : meas_avg.rssi,
- bfi_flag ? bi->ci_cb : meas_avg.ci_cb,
- is_sub);
+ meas_avg.toa256, ber10k, meas_avg.rssi,
+ meas_avg.ci_cb, is_sub);
}
/* common section for generation of TCH bursts (TCH/H and TCH/F).
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27553
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I23f767364a018d30d04885990adf69b50b2c9738
Gerrit-Change-Number: 27553
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange