diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index fd52bdf0794616e5d051d7d2dff81d092fdd7413..926ee4dd2f27ffebe38ca2126112dc2c7622b61d 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -3531,6 +3531,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; NPRB = RIV2nb_rb_LUT6[rballoc]; dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; } if (vrb_type == 0) @@ -3580,6 +3581,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; NPRB = RIV2nb_rb_LUT25[rballoc]; dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; } if (vrb_type == 0) @@ -3628,6 +3630,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; NPRB = RIV2nb_rb_LUT50[rballoc]; dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; } if (vrb_type == 0) { @@ -3678,6 +3681,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; NPRB = RIV2nb_rb_LUT100[rballoc]; dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; } if (vrb_type == 0) { @@ -3861,6 +3865,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; + dlsch[0]->current_harq_pid = harq_pid; dlsch[0]->harq_ack[subframe].harq_id = harq_pid; @@ -3881,6 +3887,8 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, // printf("NPRB %d\n",NPRB); dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; + if (TPC!=1) LOG_I(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH); @@ -4181,6 +4189,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, dlsch0_harq->mcs = mcs1; dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; /* if (dlsch0_harq->mcs>20) { msg("dci_tools.c: mcs > 20 disabled for now (asked %d)\n",dlsch0_harq->mcs); @@ -4588,7 +4597,9 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, // printf("NPRB %d\n",NPRB); dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch0->g_pucch += delta_PUCCH_lut[TPC&3]; dlsch1_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch1->g_pucch += delta_PUCCH_lut[TPC&3]; dlsch0_harq->mcs = mcs1; dlsch1_harq->mcs = mcs2; @@ -4830,6 +4841,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, dlsch0_harq->mcs = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->mcs; dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->TPC&3]; + dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index fa2258be2ecc5fe98757d1c7529ee3659452bad5..c3b990d836b3325962efbca2d50efa8674048ddf 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -685,6 +685,8 @@ typedef struct { uint8_t Kmimo; /// Maximum number of Turbo iterations uint8_t max_turbo_iterations; + /// accumulated tx power adjustment for PUCCH + int8_t g_pucch; } LTE_UE_DLSCH_t; typedef enum {format0, diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index 5a2f7e74ea2918659b9d965846b816a2fc3e179d..2eab37beb03f948246cab987036e897f13efeab3 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -113,9 +113,9 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0)+ phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ - phy_vars_ue->g_pucch[0], + phy_vars_ue->dlsch_ue[0][0]->g_pucch, phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - phy_vars_ue->g_pucch[0]); + phy_vars_ue->dlsch_ue[0][0]->g_pucch); } //for (eNB=0;eNB<NUMBER_OF_eNB_MAX;eNB++) { for (eNB=0; eNB<1; eNB++) { diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 6cde667765efc22d5801f5fe42ac518e6d086d2b..b73d804ad86a73bdc60dbcdb899af7dbaf845f4d 100755 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -484,7 +484,6 @@ typedef struct { uint8_t pucch_payload[22]; UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX]; - int8_t g_pucch[NUMBER_OF_CONNECTED_eNB_MAX]; /// cell-specific reference symbols uint32_t lte_gold_table[7][20][2][14]; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 513c2efa50cecafa46f64af8294bb63360689df9..7fbd89f2251d23b14987f31df2f14e1a5c753716 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2520,11 +2520,10 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac } #ifdef DLSCH_THREAD - if (phy_vars_ue->dlsch_ue[eNB_id][0]->active == 1) { // activate thread since Chest is now done for slot before slot_rx if (l==0) { - LOG_D(PHY,"frame %d, slot_rx %d: Calling rx_pdsch_thread for harq_pid %d\n",frame_rx,slot_rx, phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid); + LOG_I(PHY,"frame %d, slot_rx %d: Calling rx_pdsch_thread for harq_pid %d\n",frame_rx,slot_rx, phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid); if (pthread_mutex_lock (&rx_pdsch_mutex) != 0) { // Signal MAC_PHY Scheduler LOG_E(PHY,"[UE %d] ERROR pthread_mutex_lock\n",phy_vars_ue->Mod_id); // lock before accessing shared resource diff --git a/openair1/SCHED/pucch_pc.c b/openair1/SCHED/pucch_pc.c index 10a03607a190b14bbdc4d58f934d7379d1ad841a..3cfb5f9bcebcf2575830b6fd9fbf91df549230a1 100644 --- a/openair1/SCHED/pucch_pc.c +++ b/openair1/SCHED/pucch_pc.c @@ -53,14 +53,13 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id if ((pucch_fmt == pucch_format1a) || (pucch_fmt == pucch_format1b)) { // Update g_pucch based on TPC/delta_PUCCH received in PDCCH for this process harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id; - phy_vars_ue->g_pucch[eNB_id] += phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->delta_PUCCH; + //this is now done in dci_tools + //phy_vars_ue->g_pucch[eNB_id] += phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->delta_PUCCH; } - // phy_vars_ue->g_pucch[eNB_id] = 0; - Po_PUCCH = get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id)+ - phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ - phy_vars_ue->g_pucch[eNB_id]; + phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ + phy_vars_ue->dlsch_ue[eNB_id][0]->g_pucch; switch (pucch_fmt) { case pucch_format1: @@ -103,7 +102,7 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id Po_PUCCH, phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id), - phy_vars_ue->g_pucch[eNB_id]); + phy_vars_ue->dlsch_ue[eNB_id][0]->g_pucch); } else { LOG_I(PHY,"[UE %d][SR %x] frame %d, subframe %d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB g_pucch %d dB\n", phy_vars_ue->Mod_id, @@ -111,7 +110,7 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id Po_PUCCH, phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id), - phy_vars_ue->g_pucch[eNB_id]); + phy_vars_ue->dlsch_ue[eNB_id][0]->g_pucch); } return(Po_PUCCH);