Commit 2c8f47be authored by masayuki.harada's avatar masayuki.harada Committed by Haruki NAOI

Fix pucch functions.

(cherry picked from commit 3bed7dc69db8dc43b28b62553f12834efbca349b)
parent 401eb087
...@@ -722,7 +722,7 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB, ...@@ -722,7 +722,7 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB,
uint32_t z[12*14]; uint32_t z[12*14];
int16_t *zptr; int16_t *zptr;
int16_t rxcomp[NB_ANTENNAS_RX][2*12*14]; int16_t rxcomp[NB_ANTENNAS_RX][2*12*14];
uint8_t ns,N_UL_symb,nsymb; uint8_t ns,N_UL_symb,nsymb,n_cs_base;
uint16_t i,j,re_offset; uint16_t i,j,re_offset;
uint8_t m,l; uint8_t m,l;
uint8_t n_cs,alpha_ind; uint8_t n_cs,alpha_ind;
...@@ -733,36 +733,25 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB, ...@@ -733,36 +733,25 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB,
int16_t *rxptr; int16_t *rxptr;
uint32_t symbol_offset; uint32_t symbol_offset;
uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift; uint32_t u0 = (frame_parms->pucch_config_common.grouphop[subframe<<1]) % 30;
uint8_t Ncs1_div_deltaPUCCH_Shift = frame_parms->pucch_config_common.nCS_AN; uint32_t u1 = (frame_parms->pucch_config_common.grouphop[1+(subframe<<1)]) % 30;
uint32_t u0 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1]) % 30;
uint32_t u1 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)]) % 30;
uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1]; uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)]; uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
int calc_cnt; int calc_cnt;
if ((deltaPUCCH_Shift==0) || (deltaPUCCH_Shift>3)) {
LOG_E(PHY,"[eNB] rx_pucch: Illegal deltaPUCCH_shift %d (should be 1,2,3)\n",deltaPUCCH_Shift);
return(-1);
}
if (Ncs1_div_deltaPUCCH_Shift > 7) {
LOG_E(PHY,"[eNB] rx_pucch: Illegal Ncs1_div_deltaPUCCH_Shift %d (should be 0...7)\n",Ncs1_div_deltaPUCCH_Shift);
return(-1);
}
zptr = (int16_t *)z; zptr = (int16_t *)z;
N_UL_symb = (frame_parms->Ncp==NORMAL) ? 7 : 6; N_UL_symb = (frame_parms->Ncp==NORMAL) ? 7 : 6;
interference_power=0.0; interference_power=0.0;
calc_cnt=0; calc_cnt=0;
// loop over 2 slots // loop over 2 slots
for (n_cs=0; n_cs<12; n_cs++) { for (n_cs_base=0; n_cs_base<12; n_cs_base++) {
zptr = (int16_t *)z;
for (ns=(subframe<<1),u=u0,v=v0; ns<(2+(subframe<<1)); ns++,u=u1,v=v1) { for (ns=(subframe<<1),u=u0,v=v0; ns<(2+(subframe<<1)); ns++,u=u1,v=v1) {
//loop over symbols in slot //loop over symbols in slot
for (l=0; l<N_UL_symb; l++) { for (l=0; l<N_UL_symb; l++) {
n_cs = eNB->ncs_cell[ns][l]+n_cs_base;
if(((l>1)&&(l<N_UL_symb-2)) || ((ns==(1+(subframe<<1))) && (shortened_format==1)) ){ if(((l>1)&&(l<N_UL_symb-2)) || ((ns==(1+(subframe<<1))) && (shortened_format==1)) ){
zptr+=24; zptr+=24;
continue; continue;
...@@ -796,7 +785,7 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB, ...@@ -796,7 +785,7 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB,
} // l } // l
} // ns } // ns
m = 0; m = 1;
nsymb = N_UL_symb<<1; nsymb = N_UL_symb<<1;
...@@ -837,7 +826,7 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB, ...@@ -837,7 +826,7 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB,
calc_cnt++; calc_cnt++;
} //re } //re
} // symbol } // symbol
interference_power+= (int32_t)(n0_IQ[0]*n0_IQ[0]+n0_IQ[1]*n0_IQ[1]); interference_power+= (double)(n0_IQ[0]*n0_IQ[0]+n0_IQ[1]*n0_IQ[1]);
} // antenna } // antenna
} }
interference_power /= calc_cnt; interference_power /= calc_cnt;
...@@ -896,8 +885,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -896,8 +885,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
uint8_t NRB2 = frame_parms->pucch_config_common.nRB_CQI; uint8_t NRB2 = frame_parms->pucch_config_common.nRB_CQI;
uint8_t Ncs1_div_deltaPUCCH_Shift = frame_parms->pucch_config_common.nCS_AN; uint8_t Ncs1_div_deltaPUCCH_Shift = frame_parms->pucch_config_common.nCS_AN;
uint32_t u0 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1]) % 30; uint32_t u0 = (frame_parms->pucch_config_common.grouphop[subframe<<1]) % 30;
uint32_t u1 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)]) % 30; uint32_t u1 = (frame_parms->pucch_config_common.grouphop[1+(subframe<<1)]) % 30;
uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1]; uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)]; uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
int chL; int chL;
......
...@@ -602,7 +602,7 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u ...@@ -602,7 +602,7 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u
// pdu->rx_ue_information.handle = handle; // pdu->rx_ue_information.handle = handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG; pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = rnti; pdu->rx_ue_information.rnti = rnti;
int SNRtimes10 = dB_fixed_x10(stat) - 10 * eNB->measurements.n0_subband_power_dB[0][0]; int SNRtimes10 = dB_fixed_x10(stat) - 10 * eNB->measurements.n0_pucch_dB;
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG; pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
if (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0; if (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0;
...@@ -1839,7 +1839,7 @@ void fill_uci_harq_indication (PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, i ...@@ -1839,7 +1839,7 @@ void fill_uci_harq_indication (PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, i
pdu->rx_ue_information.rnti = uci->rnti; pdu->rx_ue_information.rnti = uci->rnti;
// estimate UL_CQI for MAC (from antenna port 0 only) // estimate UL_CQI for MAC (from antenna port 0 only)
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG; pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
int SNRtimes10 = dB_fixed_x10(uci->stat) - 10 * eNB->measurements.n0_subband_power_dB[0][0]; int SNRtimes10 = dB_fixed_x10(uci->stat) - 10 * eNB->measurements.n0_pucch_dB;
if (SNRtimes10 < -100) if (SNRtimes10 < -100)
LOG_I (PHY, "uci->stat %d \n", uci->stat); LOG_I (PHY, "uci->stat %d \n", uci->stat);
......
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