aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-07-13 05:04:30 +0700
committerfixeria <vyanitskiy@sysmocom.de>2023-07-13 13:18:02 +0000
commitf2c902c2afc2b29fd8261ee396344f6b59cf293b (patch)
tree348282a0787dae769ab1317224100691bffa8d82
parentbb596dddc78e7e96b99d34080bf0c9a2e01502f0 (diff)
osmo-bts-trx: unify and enrich 'Received bad data' logging
-rw-r--r--src/osmo-bts-trx/sched_lchan_pdtch.c4
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchf.c14
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchh.c15
-rw-r--r--src/osmo-bts-trx/sched_lchan_xcch.c4
-rw-r--r--src/osmo-bts-trx/sched_utils.h4
5 files changed, 14 insertions, 27 deletions
diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c
index fd813b9b..17205375 100644
--- a/src/osmo-bts-trx/sched_lchan_pdtch.c
+++ b/src/osmo-bts-trx/sched_lchan_pdtch.c
@@ -122,8 +122,8 @@ int rx_pdtch_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
if (rc > 0) {
presence_info = PRES_INFO_BOTH;
} else {
- LOGL1SB(DL1P, LOGL_DEBUG, l1ts, bi, "Received bad PDTCH (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
+ LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
+ BAD_DATA_MSG_FMT "\n", BAD_DATA_MSG_ARGS);
rc = 0;
presence_info = PRES_INFO_INVALID;
}
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 2b2d1f4c..69ce488c 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -113,7 +113,6 @@ int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
int rc, amr = 0;
int n_errors = 0;
int n_bits_total = 0;
- bool bfi_flag = false;
unsigned int fn_begin;
uint16_t ber10k;
uint8_t is_sub = 0;
@@ -301,20 +300,13 @@ int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
trx_loop_amr_input(chan_state, &meas_avg);
/* Check if the frame is bad */
- if (rc < 0) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi, "Received bad data (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
- bfi_flag = true;
- } else if (rc < 4) {
+ if (rc < 4) {
LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
- "Received bad data (%u/%u) with invalid codec mode %d\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period, rc);
- bfi_flag = true;
+ BAD_DATA_MSG_FMT "\n", BAD_DATA_MSG_ARGS);
+ rc = 0; /* this is how we signal BFI to l1sap */
}
ber10k = compute_ber10k(n_bits_total, n_errors);
- if (bfi_flag)
- rc = 0; /* this is how we signal BFI to l1sap */
/* FACCH */
if (rc == GSM_MACBLOCK_LEN) {
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index d7f2227a..a1283206 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -169,7 +169,6 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
int amr = 0;
int n_errors = 0;
int n_bits_total = 0;
- bool bfi_flag = false;
enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S6N4;
struct l1sched_meas_set meas_avg;
unsigned int fn_begin;
@@ -358,19 +357,11 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
trx_loop_amr_input(chan_state, &meas_avg);
/* Check if the frame is bad */
- if (rc < 0) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi, "Received bad data (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
- bfi_flag = true;
- } else if (rc < 4) {
+ if (rc < 4) {
LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
- "Received bad data (%u/%u) with invalid codec mode %d\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period, rc);
- bfi_flag = true;
- }
-
- if (bfi_flag)
+ BAD_DATA_MSG_FMT "\n", BAD_DATA_MSG_ARGS);
rc = 0; /* this is how we signal BFI to l1sap */
+ }
/* FACCH */
if (rc == GSM_MACBLOCK_LEN) {
diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c
index 3c67b233..ccf685fc 100644
--- a/src/osmo-bts-trx/sched_lchan_xcch.c
+++ b/src/osmo-bts-trx/sched_lchan_xcch.c
@@ -113,8 +113,8 @@ int rx_data_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
/* decode */
rc = gsm0503_xcch_decode(l2, bursts_p, &n_errors, &n_bits_total);
if (rc) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi, "Received bad data (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
+ LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
+ BAD_DATA_MSG_FMT "\n", BAD_DATA_MSG_ARGS);
l2_len = 0;
/* When SACCH Repetition is active, we may try to decode the
diff --git a/src/osmo-bts-trx/sched_utils.h b/src/osmo-bts-trx/sched_utils.h
index 4521a2eb..4e8c17e9 100644
--- a/src/osmo-bts-trx/sched_utils.h
+++ b/src/osmo-bts-trx/sched_utils.h
@@ -35,6 +35,10 @@
extern void *tall_bts_ctx;
+#define BAD_DATA_MSG_FMT "Received bad data (rc=%d, BER %d/%d) ending at fn=%u/%u"
+#define BAD_DATA_MSG_ARGS \
+ rc, n_errors, n_bits_total, bi->fn % l1ts->mf_period, l1ts->mf_period
+
/* Compute the bit error rate in 1/10000 units */
static inline uint16_t compute_ber10k(int n_bits_total, int n_errors)
{