From 2fa1ed783c115616a789900cfb125aa68d8d1a2f Mon Sep 17 00:00:00 2001 From: knopp <knopp@mycompany.com> Date: Sat, 20 Jun 2015 20:28:49 +0000 Subject: [PATCH] UE component for PUCCH power control git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7615 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair1/PHY/INIT/lte_init.c | 3 --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 11 +++++++++++ openair1/PHY/LTE_TRANSPORT/pucch.c | 3 ++- openair1/SCHED/pucch_pc.c | 6 +++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 1a4feb0bec..b4c964ce2e 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -207,9 +207,6 @@ void phy_config_sib2_eNB(uint8_t Mod_id, lte_frame_parms->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH; lte_frame_parms->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha; lte_frame_parms->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH; - - - lte_frame_parms->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3; lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1; lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b; diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 24d1516bd5..fd52bdf079 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -3775,6 +3775,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, rballoc = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rballoc; rah = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rah; rv = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rv; + TPC = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->TPC; ndi = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->ndi; harq_pid = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->harq_pid; } else { @@ -3782,6 +3783,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, rah = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rah; rballoc = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rballoc; rv = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rv; + TPC = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->TPC; ndi = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->ndi; harq_pid = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->harq_pid; } @@ -3794,6 +3796,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, rballoc = ((DCI1_5MHz_TDD_t *)dci_pdu)->rballoc; rah = ((DCI1_5MHz_TDD_t *)dci_pdu)->rah; rv = ((DCI1_5MHz_TDD_t *)dci_pdu)->rv; + TPC = ((DCI1_5MHz_TDD_t *)dci_pdu)->TPC; ndi = ((DCI1_5MHz_TDD_t *)dci_pdu)->ndi; harq_pid = ((DCI1_5MHz_TDD_t *)dci_pdu)->harq_pid; } else { @@ -3801,6 +3804,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, rah = ((DCI1_5MHz_FDD_t *)dci_pdu)->rah; rballoc = ((DCI1_5MHz_FDD_t *)dci_pdu)->rballoc; rv = ((DCI1_5MHz_FDD_t *)dci_pdu)->rv; + TPC = ((DCI1_5MHz_FDD_t *)dci_pdu)->TPC; ndi = ((DCI1_5MHz_FDD_t *)dci_pdu)->ndi; harq_pid = ((DCI1_5MHz_FDD_t *)dci_pdu)->harq_pid; } @@ -3813,6 +3817,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, rballoc = ((DCI1_10MHz_TDD_t *)dci_pdu)->rballoc; rah = ((DCI1_10MHz_TDD_t *)dci_pdu)->rah; rv = ((DCI1_10MHz_TDD_t *)dci_pdu)->rv; + TPC = ((DCI1_10MHz_TDD_t *)dci_pdu)->TPC; ndi = ((DCI1_10MHz_TDD_t *)dci_pdu)->ndi; harq_pid = ((DCI1_10MHz_TDD_t *)dci_pdu)->harq_pid; } else { @@ -3820,6 +3825,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, rah = ((DCI1_10MHz_FDD_t *)dci_pdu)->rah; rballoc = ((DCI1_10MHz_FDD_t *)dci_pdu)->rballoc; rv = ((DCI1_10MHz_FDD_t *)dci_pdu)->rv; + TPC = ((DCI1_10MHz_FDD_t *)dci_pdu)->TPC; ndi = ((DCI1_10MHz_FDD_t *)dci_pdu)->ndi; harq_pid = ((DCI1_10MHz_FDD_t *)dci_pdu)->harq_pid; } @@ -3832,6 +3838,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, rballoc = ((DCI1_20MHz_TDD_t *)dci_pdu)->rballoc; rah = ((DCI1_20MHz_TDD_t *)dci_pdu)->rah; rv = ((DCI1_20MHz_TDD_t *)dci_pdu)->rv; + TPC = ((DCI1_20MHz_TDD_t *)dci_pdu)->TPC; ndi = ((DCI1_20MHz_TDD_t *)dci_pdu)->ndi; harq_pid = ((DCI1_20MHz_TDD_t *)dci_pdu)->harq_pid; } else { @@ -3839,6 +3846,7 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe, rah = ((DCI1_20MHz_FDD_t *)dci_pdu)->rah; rballoc = ((DCI1_20MHz_FDD_t *)dci_pdu)->rballoc; rv = ((DCI1_20MHz_FDD_t *)dci_pdu)->rv; + TPC = ((DCI1_20MHz_FDD_t *)dci_pdu)->TPC; ndi = ((DCI1_20MHz_FDD_t *)dci_pdu)->ndi; harq_pid = ((DCI1_20MHz_FDD_t *)dci_pdu)->harq_pid; } @@ -3852,6 +3860,7 @@ 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]->current_harq_pid = harq_pid; dlsch[0]->harq_ack[subframe].harq_id = harq_pid; @@ -3872,6 +3881,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]; + if (TPC!=1) + LOG_I(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH); dlsch0_harq->rvidx = rv; diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 4d3f9c857b..84c043edbc 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -761,7 +761,6 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, LOG_D(PHY,"[eNB] PUCCH fmt0: stat_max : %d, sigma2_dB %d, phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phase_max); #endif - // This is a moving average of the PUCCH1 statistics conditioned on being above or below the threshold if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) { *payload = 1; @@ -871,6 +870,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {// + *Po_PUCCH = ((*Po_PUCCH*1023) + stat_max)>>10; + for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (re=0; re<12; re++) { chest_re=0; diff --git a/openair1/SCHED/pucch_pc.c b/openair1/SCHED/pucch_pc.c index 1db276e360..10a03607a1 100644 --- a/openair1/SCHED/pucch_pc.c +++ b/openair1/SCHED/pucch_pc.c @@ -56,7 +56,7 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id 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; + // 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+ @@ -97,7 +97,7 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id } if (pucch_fmt!=pucch_format1) { - LOG_D(PHY,"[UE %d][PDSCH %x] frame %d, subframe %d: Po_PUCCH %d dBm : Po_NOMINAL_PUCCH %d dBm, PL %d dB, g_pucch %d dB\n", + LOG_I(PHY,"[UE %d][PDSCH %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, phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,phy_vars_ue->frame_tx,subframe, Po_PUCCH, @@ -105,7 +105,7 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id), phy_vars_ue->g_pucch[eNB_id]); } else { - LOG_D(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", + 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, phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,phy_vars_ue->frame_tx,subframe, Po_PUCCH, -- GitLab