diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c index fd813b9b4..172053757 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 2b2d1f4c6..69ce488c6 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 d7f2227aa..a12832067 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 3c67b2339..ccf685fcf 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 4521a2eb3..4e8c17e94 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) {