diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 035410eb25ecc09a6a8cc6729a8257b45f0d157a..c10e4dd3c14d082cc92d54271bc2998d3cb492a4 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -746,6 +746,14 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, } #endif +void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, + uint16_t max_harq_tx ) +{ + + PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id]; + phy_vars_ue->ulsch[eNB_id]->Mlimit = max_harq_tx; +} + void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, struct PhysicalConfigDedicated *physicalConfigDedicated ) { diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 92836ebcf951e134f6998b86e2768c26dc535282..e73bb94d413482a0ba65238de1dec7fe6cac2c76 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -6451,7 +6451,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, // ue->Mod_id,harq_pid, // proc->frame_rx, // subframe, - // UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx); + // ulsch->Mlimit); //#endif if (ulsch->harq_processes[harq_pid]->round > 0) // NACK detected on phich @@ -6460,7 +6460,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ulsch->harq_processes[harq_pid] = ulsch->harq_processes[8]; // LOG_I(PHY," Adaptative retransmission - copy temporary harq Process to current harq process. [harqId %d round %d] \n",harq_pid, ulsch->harq_processes[8]->round); - if (ulsch->harq_processes[harq_pid]->round >= UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx) + if (ulsch->harq_processes[harq_pid]->round >= ulsch->Mlimit) //UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx) { ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 0; ulsch->harq_processes[harq_pid]->round = 0; diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index f8d36d3bd4e08cf6b6d8ac7a93b8ab7e06e903d0..c41df6c9313d9a26cac3a03ba23e473111239abb 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -346,6 +346,8 @@ typedef struct { uint8_t num_cba_dci[10]; /// allocated CBA RNTI uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP]; + /// UL max-harq-retransmission + uint8_t Mlimit; } LTE_UE_ULSCH_t; typedef struct { diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 9a3287660264316dbaa334534beb88a648ff64c3..c7cc188893d8192f1d21d0d7c8f6c394d83853d3 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1381,13 +1381,13 @@ void rx_phich(PHY_VARS_UE *ue, HI16, nseq_PHICH, ngroup_PHICH, - UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx); + ulsch->Mlimit); //#endif // ulsch->harq_processes[harq_pid]->Ndi = 0; ulsch->harq_processes[harq_pid]->round++; - if ( ulsch->harq_processes[harq_pid]->round >= (UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx - 1) ) + if ( ulsch->harq_processes[harq_pid]->round >= (ulsch->Mlimit - 1) ) { // this is last push re transmission ulsch->harq_processes[harq_pid]->rvidx = rv_table[ulsch->harq_processes[harq_pid]->round&3]; @@ -1402,7 +1402,7 @@ void rx_phich(PHY_VARS_UE *ue, //ulsch->harq_processes[harq_pid]->round = 0; //LOG_I(PHY,"PUSCH MAX Retransmission acheived ==> flush harq buff (%d) \n",harq_pid); - //LOG_I(PHY,"[HARQ-UL harqId: %d] PHICH NACK MAX RETRANS(%d) ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->harq_processes[harq_pid]->round); + //LOG_I(PHY,"[HARQ-UL harqId: %d] PHICH NACK MAX RETRANS(%d) ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->Mlimit, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->harq_processes[harq_pid]->round); } else { diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 5dc629b90bb34eb71da27385e1694bbbebb8d4db..883099be3013567a364b93b2ef16d0e7364f11c7 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -1235,8 +1235,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB // deactivate service request // ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0; - LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx); - if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx - 1)) + LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit); + if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1)) { LOG_D(PHY,"PUSCH MAX Retransmission acheived ==> send last pusch (%d) \n"); ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0; diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 2ec37a423e8ff95a545dc937d738f2b4df7add6b..e4252ed50049afbc0f19362697f10e11956fe301 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -221,6 +221,7 @@ rrc_mac_config_req( } else { UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; } + mac_xface->phy_config_harq_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx); if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) { UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer; diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index 8c711e971de8d7fe0a955bcad5ca09904ad63b92..aeab9dfe665d84f25b8143312ec690ebc1aa4065 100644 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -185,6 +185,9 @@ typedef struct { void (*phy_config_dedicated_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index, struct PhysicalConfigDedicated *physicalConfigDedicated); + /// PHY-Config-harq UE + void (*phy_config_harq_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index, + uint16_t max_harq_tx); /// Configure Common PHY parameters from SIB1 void (*phy_config_sib1_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index, TDD_Config_t *tdd_config,