Commit cf2b532a authored by lukashov's avatar lukashov

changes in dci_tools.c for TM4 to support tpmi2

parent f6e750fb
......@@ -1551,7 +1551,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch0_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch0_harq->pmi_alloc = DL_pmi_single;
dlsch1_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch1_harq->pmi_alloc = DL_pmi_single;
dlsch1_harq->pmi_alloc = DL_pmi_single^ 0x1555; //opposite; this is just random assignment for first trial
break;
default:
break;
......@@ -4806,9 +4806,9 @@ int generate_ue_dlsch_params_from_dci(int frame,
break;
case 2: // PUSCH precoding
dlsch0_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch0_harq->pmi_alloc = 0; //TODO: DL_pmi_single;
dlsch0_harq->pmi_alloc = dlsch0->pmi_alloc;
dlsch1_harq->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch1_harq->pmi_alloc = 0; //TODO: DL_pmi_single;
dlsch1_harq->pmi_alloc = dlsch0->pmi_alloc^0x1555;
break;
default:
break;
......@@ -5774,7 +5774,7 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
}
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subbands)
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
{
int i, aarx;
......@@ -5782,6 +5782,25 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subba
uint16_t pmivect = 0;
uint8_t rank = meas->rank[eNB_id];
int pmi_re,pmi_im;
int nb_subbands=0;
switch (nb_rb) {
case 6:
nb_subbands = 6;
break;
default:
case 25:
nb_subbands = 7;
break;
case 50:
nb_subbands = 9;
break;
case 100:
nb_subbands = 13;
break;
}
for (i=0; i<nb_subbands; i++) {
pmi_re = 0;
......@@ -5808,7 +5827,21 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subba
// printf("subband %d, pmi%d \n",i,pmiq);
pmivect |= (pmiq<<(2*i));
} else {
}
else if (rank==1) {
for (aarx=0; aarx<meas->nb_antennas_rx; aarx++) {
pmi_re += meas->subband_pmi_re[eNB_id][i][aarx];
pmi_im += meas->subband_pmi_im[eNB_id][i][aarx];
}
if (pmi_re > pmi_im)
pmiq = PMI_2A_11;
else if (pmi_re < pmi_im)
pmiq = PMI_2A_1m1;
printf("subband %d, pmi%d \n",i,pmiq);
pmivect |= (pmiq<<(2*i));
printf("subband %d pmivect %d \n",i, pmivect);
}
else {
// This needs to be done properly!!!
msg("PMI feedback for rank>1 not supported!\n");
pmivect = 0;
......
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