From e24847b1300f90355dcfc0265af7a0ae59c07a30 Mon Sep 17 00:00:00 2001
From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr>
Date: Wed, 2 Dec 2015 11:25:16 +0100
Subject: [PATCH] fixing last commit

---
 openair1/PHY/LTE_TRANSPORT/proto.h     | 2 +-
 openair1/PHY/LTE_TRANSPORT/uci_tools.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h
index a790070efa..87f494e826 100644
--- a/openair1/PHY/LTE_TRANSPORT/proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/proto.h
@@ -1603,7 +1603,7 @@ uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
     @param rank (0 or 1)
     @returns subband PMI bitmap
 */
-uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi, unit8_t rank);
+uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi, uint8_t rank);
 
 /** \brief  This routine extracts a single subband PMI from a bitmap coming from UCI or the pmi_extend function
     @param N_RB_DL number of resource blocks
diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c
index 9719a8f3c1..cd6a4cdef2 100644
--- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c
@@ -178,6 +178,7 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_
   //unsigned char rank;
   //UCI_format fmt;
   //uint8_t N_RB_DL = 25;
+  uint8_t i;
   LOG_D(PHY,"[eNB][UCI] N_RB_DL %d uci format %d\n", N_RB_DL,uci_format);
 
   switch(N_RB_DL) {
@@ -287,8 +288,9 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_
       stats->DL_pmi_dual   = ((wideband_cqi_rank2_2A_5MHz *)o)->pmi;
       //this translates the 2-layer PMI into a single layer PMI for the first codeword
       //the PMI for the second codeword will be stats->DL_pmi_single^0x1555
+      stats->DL_pmi_single = 0;
       for (i=0;i<7;i++)
-	stats->DL_pmi_single&(1<<(2*i)) = (stats->DL_pmi_dual&(1<i))*2;  
+	stats->DL_pmi_single = stats->DL_pmi_single | (((stats->DL_pmi_dual&(1<i))>>i)*2)<<2*i;  
       break;
 
     case HLC_subband_cqi_nopmi:
-- 
2.26.2