From 2f05261f6b848c4eee7053c348f1e69c9d5089b9 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 17 Apr 2024 16:29:09 +0200 Subject: [PATCH] reject packets of 0's --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 15 +++++++++++++++ openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 1ca959c45e..ddb69bab23 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -119,7 +119,22 @@ static bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, LOG_D(PHY, "DLSCH received nok \n"); return true; //stop } + const int sz=A/8; + if (b[sz] == 0 && b[sz + 1] == 0) { // We search only a reccuring OAI error that propagates all 0 packets with a 0 CRC, so we + // do the check only if the 2 first bytes of the CRC are 0 (it can be CRC16 or CRC24) + int i = 0; + while (b[i] == 0 && i < sz) + i++; + if (i == sz) { + LOG_E(PHY, + "received all 0 pdu, consider it false reception, even if the TS 38.212 7.2.1 says only we should attach the " + "corresponding CRC, and nothing prevents to have a all 0 packet\n"); + dlsch->last_iteration_cnt = dlsch->max_ldpc_iterations + 1; + return true; // stop + } + } } + //LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for nr_slot_rx %d TBS %d mcs %d nb_rb %d harq_process->round %d\n", // phy_vars_ue->Mod_id,nr_slot_rx,harq_process->TBS,harq_process->mcs,harq_process->nb_rb, harq_process->round); harq_process->status = SCH_IDLE; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index b57f977b09..879c3b1a9d 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -173,7 +173,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, } } break; case FAPI_NR_CSIRS_IND: - memcpy(&rx->csirs_measurements, (fapi_nr_csirs_measurements_t *)typeSpecific, sizeof(fapi_nr_csirs_measurements_t)); + memcpy(&rx->csirs_measurements, typeSpecific, sizeof(fapi_nr_csirs_measurements_t)); break; default: break;