schedule msg3 retransmission for no signal scenario
This commit is contained in:
@@ -119,7 +119,7 @@ static bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue,
|
|||||||
LOG_D(PHY, "DLSCH received nok \n");
|
LOG_D(PHY, "DLSCH received nok \n");
|
||||||
return true; //stop
|
return true; //stop
|
||||||
}
|
}
|
||||||
const int sz=A/8;
|
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
|
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)
|
// do the check only if the 2 first bytes of the CRC are 0 (it can be CRC16 or CRC24)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|||||||
@@ -276,10 +276,12 @@ static void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req)
|
|||||||
bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter);
|
bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter);
|
||||||
ulsch_harq->processedSegments++;
|
ulsch_harq->processedSegments++;
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
"processing result of segment: %d, processed %d/%d\n",
|
"processing result of segment: %d, processed %d/%d, %s\n",
|
||||||
rdata->segment_r,
|
rdata->segment_r,
|
||||||
ulsch_harq->processedSegments,
|
ulsch_harq->processedSegments,
|
||||||
rdata->nbSegments);
|
rdata->nbSegments,
|
||||||
|
decodeSuccess ? "Decoded Successfully" : "Decoding Unsuccessful");
|
||||||
|
|
||||||
if (decodeSuccess) {
|
if (decodeSuccess) {
|
||||||
memcpy(ulsch_harq->b + rdata->offset, ulsch_harq->c[r], rdata->Kr_bytes - (ulsch_harq->F >> 3) - ((ulsch_harq->C > 1) ? 3 : 0));
|
memcpy(ulsch_harq->b + rdata->offset, ulsch_harq->c[r], rdata->Kr_bytes - (ulsch_harq->F >> 3) - ((ulsch_harq->C > 1) ? 3 : 0));
|
||||||
|
|
||||||
@@ -466,11 +468,16 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
|
|||||||
|
|
||||||
// put timing advance command in 0..63 range
|
// put timing advance command in 0..63 range
|
||||||
timing_advance_update += 31;
|
timing_advance_update += 31;
|
||||||
|
timing_advance_update = max(timing_advance_update, 0);
|
||||||
|
timing_advance_update = min(timing_advance_update, 63);
|
||||||
|
|
||||||
if (timing_advance_update < 0) timing_advance_update = 0;
|
if (crc_flag == 0)
|
||||||
if (timing_advance_update > 63) timing_advance_update = 63;
|
LOG_D(PHY,
|
||||||
|
"%d.%d : Received PUSCH : Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n",
|
||||||
if (crc_flag == 0) LOG_D(PHY, "%d.%d : Received PUSCH : Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", frame,slot_rx,sync_pos,timing_advance_update);
|
frame,
|
||||||
|
slot_rx,
|
||||||
|
sync_pos,
|
||||||
|
timing_advance_update);
|
||||||
|
|
||||||
// estimate UL_CQI for MAC
|
// estimate UL_CQI for MAC
|
||||||
int SNRtimes10 =
|
int SNRtimes10 =
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ static int nr_process_mac_pdu(instance_t module_idP,
|
|||||||
// fixed length
|
// fixed length
|
||||||
mac_subheader_len = 1;
|
mac_subheader_len = 1;
|
||||||
|
|
||||||
if ( rx_lcid == UL_SCH_LCID_CCCH1 ) {
|
if (rx_lcid == UL_SCH_LCID_CCCH1) {
|
||||||
// RRCResumeRequest1 message includes the full I-RNTI and has a size of 8 bytes
|
// RRCResumeRequest1 message includes the full I-RNTI and has a size of 8 bytes
|
||||||
mac_len = 8;
|
mac_len = 8;
|
||||||
|
|
||||||
@@ -615,6 +615,26 @@ void handle_nr_ul_harq(const int CC_idP,
|
|||||||
NR_SCHED_UNLOCK(&nrmac->sched_lock);
|
NR_SCHED_UNLOCK(&nrmac->sched_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handle_msg3_failed_rx(NR_RA_t *ra, int i, int harq_round_max)
|
||||||
|
{
|
||||||
|
// for CFRA (NSA) do not schedule retransmission of msg3
|
||||||
|
if (ra->cfra) {
|
||||||
|
LOG_D(NR_MAC, "Random Access %i failed at state %s (NSA msg3 reception failed)\n", i, nrra_text[ra->ra_state]);
|
||||||
|
nr_clear_ra_proc(ra);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ra->msg3_round >= harq_round_max - 1) {
|
||||||
|
LOG_W(NR_MAC, "Random Access %i failed at state %s (Reached msg3 max harq rounds)\n", i, nrra_text[ra->ra_state]);
|
||||||
|
nr_clear_ra_proc(ra);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_D(NR_MAC, "Random Access %i Msg3 CRC did not pass\n", i);
|
||||||
|
ra->msg3_round++;
|
||||||
|
ra->ra_state = nrRA_Msg3_retransmission;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When data are received on PHY and transmitted to MAC
|
* When data are received on PHY and transmitted to MAC
|
||||||
*/
|
*/
|
||||||
@@ -714,7 +734,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (sduP != NULL){
|
if (sduP != NULL) {
|
||||||
LOG_D(NR_MAC, "Received PDU at MAC gNB \n");
|
LOG_D(NR_MAC, "Received PDU at MAC gNB \n");
|
||||||
|
|
||||||
UE->UE_sched_ctrl.pusch_consecutive_dtx_cnt = 0;
|
UE->UE_sched_ctrl.pusch_consecutive_dtx_cnt = 0;
|
||||||
@@ -728,7 +748,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
|
|||||||
else {
|
else {
|
||||||
NR_UE_ul_harq_t *cur_harq = &UE_scheduling_control->ul_harq_processes[harq_pid];
|
NR_UE_ul_harq_t *cur_harq = &UE_scheduling_control->ul_harq_processes[harq_pid];
|
||||||
/* reduce sched_ul_bytes when cur_harq->round == 3 */
|
/* reduce sched_ul_bytes when cur_harq->round == 3 */
|
||||||
if (cur_harq->round == 3){
|
if (cur_harq->round == 3) {
|
||||||
const uint32_t tb_size = UE_scheduling_control->ul_harq_processes[harq_pid].sched_pusch.tb_size;
|
const uint32_t tb_size = UE_scheduling_control->ul_harq_processes[harq_pid].sched_pusch.tb_size;
|
||||||
UE_scheduling_control->sched_ul_bytes -= tb_size;
|
UE_scheduling_control->sched_ul_bytes -= tb_size;
|
||||||
if (UE_scheduling_control->sched_ul_bytes < 0)
|
if (UE_scheduling_control->sched_ul_bytes < 0)
|
||||||
@@ -747,20 +767,16 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
|
|||||||
nr_mac_trigger_ul_failure(&UE->UE_sched_ctrl, UE->current_UL_BWP.scs);
|
nr_mac_trigger_ul_failure(&UE->UE_sched_ctrl, UE->current_UL_BWP.scs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(sduP) {
|
} else if (sduP) {
|
||||||
|
|
||||||
bool no_sig = true;
|
bool no_sig = true;
|
||||||
for (int k = 0; k < sdu_lenP; k++) {
|
for (int k = 0; k < sdu_lenP; k++) {
|
||||||
if(sduP[k]!=0) {
|
if(sduP[k] != 0) {
|
||||||
no_sig = false;
|
no_sig = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(no_sig) {
|
|
||||||
LOG_W(NR_MAC, "No signal\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
|
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
|
||||||
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
|
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
|
||||||
T_BUFFER(sduP, sdu_lenP));
|
T_BUFFER(sduP, sdu_lenP));
|
||||||
@@ -774,8 +790,8 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (no_sig) {
|
if (no_sig) {
|
||||||
LOG_D(NR_MAC, "Random Access %i failed at state %s (no signal)\n", i, nrra_text[ra->ra_state]);
|
LOG_W(NR_MAC, "Random Access %i ULSCH with no signal\n", i);
|
||||||
nr_clear_ra_proc(ra);
|
handle_msg3_failed_rx(ra, i, gNB_mac->ul_bler.harq_round_max);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -912,23 +928,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
|
|||||||
if( (frameP!=ra->Msg3_frame) || (slotP!=ra->Msg3_slot))
|
if( (frameP!=ra->Msg3_frame) || (slotP!=ra->Msg3_slot))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// for CFRA (NSA) do not schedule retransmission of msg3
|
handle_msg3_failed_rx(ra, i, gNB_mac->ul_bler.harq_round_max);
|
||||||
if (ra->cfra) {
|
|
||||||
LOG_D(NR_MAC, "Random Access %i failed at state %s (NSA msg3 reception failed)\n", i, nrra_text[ra->ra_state]);
|
|
||||||
nr_clear_ra_proc(ra);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ra->msg3_round >= gNB_mac->ul_bler.harq_round_max - 1) {
|
|
||||||
LOG_W(NR_MAC, "Random Access %i failed at state %s (Reached msg3 max harq rounds)\n", i, nrra_text[ra->ra_state]);
|
|
||||||
nr_clear_ra_proc(ra);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG_D(NR_MAC, "Random Access %i Msg3 CRC did not pass)\n", i);
|
|
||||||
|
|
||||||
ra->msg3_round++;
|
|
||||||
ra->ra_state = nrRA_Msg3_retransmission;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user