Commit 6c347775 authored by General ABS's avatar General ABS Committed by abs

Clean DLSCH after receiving the reconfigurationWithSync

parent 46783a7d
......@@ -593,6 +593,7 @@ nr_phy_data_t UE_dl_preprocessing(PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc)
if (UE->synch_request.received_synch_request == 1 && UE->target_Nid_cell == -1) {
UE->is_synchronized = 0;
UE->target_Nid_cell = UE->synch_request.synch_req.target_Nid_cell;
clean_UE_dlsch(UE, proc->gNB_id);
clean_UE_ulsch(UE, proc->gNB_id);
} else if (UE->synch_request.received_synch_request == 1 && UE->target_Nid_cell != -1) {
UE->synch_request.received_synch_request = 0;
......
......@@ -65,6 +65,26 @@ void nr_ue_dlsch_init(NR_UE_DLSCH_t *dlsch_list, int num_dlsch, uint8_t max_ldpc
}
}
int8_t clean_UE_dlsch(PHY_VARS_NR_UE *UE, uint8_t gNB_id)
{
for (int harq_pid = 0; harq_pid < NR_MAX_DLSCH_HARQ_PROCESSES; harq_pid++) {
for (int j = 0; j < 2; j++) {
NR_DL_UE_HARQ_t *dl_harq_process = &UE->dl_harq_processes[j][harq_pid];
dl_harq_process->status = SCH_IDLE;
dl_harq_process->first_rx = 1;
dl_harq_process->DLround = 0;
dl_harq_process->Ndi = 2;
dl_harq_process->ack = DL_ACKNACK_NO_SET;
dl_harq_process->B = 0;
dl_harq_process->C = 0;
dl_harq_process->Z = 0;
dl_harq_process->K = 0;
dl_harq_process->F = 0;
}
}
return 0;
}
void nr_dlsch_unscrambling(int16_t *llr, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI)
{
nr_codeword_unscrambling(llr, size, q, Nid, n_RNTI);
......
......@@ -255,6 +255,7 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
const uint8_t n_antenna_ports,
c16_t **txdataF);
int8_t clean_UE_dlsch(PHY_VARS_NR_UE *UE, uint8_t gNB_id);
int8_t clean_UE_ulsch(PHY_VARS_NR_UE *UE, uint8_t gNB_id);
void nr_dlsch_unscrambling(int16_t* llr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment