Commit cebe8b79 authored by francescomani's avatar francescomani

do not process rar in case of nack

parent 1d09adc7
...@@ -3560,6 +3560,12 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t ...@@ -3560,6 +3560,12 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
module_id_t mod_id = dl_info->module_id; module_id_t mod_id = dl_info->module_id;
frame_t frame = dl_info->frame; frame_t frame = dl_info->frame;
int slot = dl_info->slot; int slot = dl_info->slot;
if(dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.ack_nack == 0) {
LOG_W(NR_MAC,"[UE %d][RAPROC][%d.%d] CRC check failed on RAR (NAK)\n", mod_id, frame, slot);
return 0;
}
int cc_id = dl_info->cc_id; int cc_id = dl_info->cc_id;
uint8_t gNB_id = dl_info->gNB_index; uint8_t gNB_id = dl_info->gNB_index;
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
...@@ -3622,46 +3628,46 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t ...@@ -3622,46 +3628,46 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
unsigned char csi_req; unsigned char csi_req;
#endif #endif
// TC-RNTI // TC-RNTI
ra->t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8); ra->t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8);
// TA command // TA command
ul_time_alignment->apply_ta = 1; ul_time_alignment->apply_ta = 1;
ul_time_alignment->ta_command = 31 + rar->TA2 + (rar->TA1 << 5); ul_time_alignment->ta_command = 31 + rar->TA2 + (rar->TA1 << 5);
#ifdef DEBUG_RAR #ifdef DEBUG_RAR
// CSI // CSI
csi_req = (unsigned char) (rar->UL_GRANT_4 & 0x01); csi_req = (unsigned char) (rar->UL_GRANT_4 & 0x01);
#endif #endif
// TPC // TPC
tpc_command = (unsigned char) ((rar->UL_GRANT_4 >> 1) & 0x07); tpc_command = (unsigned char) ((rar->UL_GRANT_4 >> 1) & 0x07);
switch (tpc_command){ switch (tpc_command){
case 0: case 0:
ra->Msg3_TPC = -6; ra->Msg3_TPC = -6;
break; break;
case 1: case 1:
ra->Msg3_TPC = -4; ra->Msg3_TPC = -4;
break; break;
case 2: case 2:
ra->Msg3_TPC = -2; ra->Msg3_TPC = -2;
break; break;
case 3: case 3:
ra->Msg3_TPC = 0; ra->Msg3_TPC = 0;
break; break;
case 4: case 4:
ra->Msg3_TPC = 2; ra->Msg3_TPC = 2;
break; break;
case 5: case 5:
ra->Msg3_TPC = 4; ra->Msg3_TPC = 4;
break; break;
case 6: case 6:
ra->Msg3_TPC = 6; ra->Msg3_TPC = 6;
break; break;
case 7: case 7:
ra->Msg3_TPC = 8; ra->Msg3_TPC = 8;
break; break;
} }
// MCS // MCS
rar_grant.mcs = (unsigned char) (rar->UL_GRANT_4 >> 4); rar_grant.mcs = (unsigned char) (rar->UL_GRANT_4 >> 4);
// time alloc // time alloc
......
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