Commit ec8a31ea authored by Matthieu Kanj's avatar Matthieu Kanj

creation of new extract_CQI function for NB_IoT (extract_CQI_NB_IoT)

+ creation of new file: openair1/PHY/LTE_TRANSPORT/uci_tools_NB_IoT.c
parent bd03c211
...@@ -1005,6 +1005,7 @@ set(PHY_SRC ...@@ -1005,6 +1005,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_NB_IoT.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_NB_IoT.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/uci_tools_NB_IoT.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs_NB_IoT.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs_NB_IoT.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c
......
...@@ -232,5 +232,7 @@ void ulsch_extract_rbs_single_NB_IoT(int32_t **rxdataF, ...@@ -232,5 +232,7 @@ void ulsch_extract_rbs_single_NB_IoT(int32_t **rxdataF,
uint8_t Ns, uint8_t Ns,
NB_IoT_DL_FRAME_PARMS *frame_parms); NB_IoT_DL_FRAME_PARMS *frame_parms);
void extract_CQI_NB_IoT(void *o,UCI_format_NB_IoT_t uci_format,NB_IoT_eNB_UE_stats *stats,uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode);
#endif #endif
...@@ -37,23 +37,6 @@ typedef enum { ...@@ -37,23 +37,6 @@ typedef enum {
unknown_cqi_NB_IoT// unknown_cqi_NB_IoT//
} UCI_format_NB_IoT_t; } UCI_format_NB_IoT_t;
typedef struct __attribute__((packed))
{
uint64_t padding:3;
uint64_t pmi:1;
uint64_t diffcqi2:26;
uint64_t cqi2:4;
uint64_t diffcqi1:26;
uint64_t cqi1:4;
}
HLC_subband_cqi_rank2_2A_20MHz_NB_IoT;
#define MAX_CQI_PAYLOAD_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT)*8*20)
#define MAX_CQI_BITS_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT)*8)
#define MAX_CQI_BYTES_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT))
#define MAX_ACK_PAYLOAD_NB_IoT 18
#define MAX_RI_PAYLOAD_NB_IoT 6
/*
// **********************************************1.5 MHz*************************************************************************** // **********************************************1.5 MHz***************************************************************************
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -61,8 +44,8 @@ typedef struct __attribute__((packed)) ...@@ -61,8 +44,8 @@ typedef struct __attribute__((packed))
uint32_t pmi:12; uint32_t pmi:12;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
wideband_cqi_rank1_2A_1_5MHz ; wideband_cqi_rank1_2A_1_5MHz_NB_IoT ;
#define sizeof_wideband_cqi_rank1_2A_1_5MHz 16 #define sizeof_wideband_cqi_rank1_2A_1_5MHz_NB_IoT 16
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -71,8 +54,8 @@ typedef struct __attribute__((packed)) ...@@ -71,8 +54,8 @@ typedef struct __attribute__((packed))
uint16_t cqi2:4; uint16_t cqi2:4;
uint16_t cqi1:4; uint16_t cqi1:4;
} }
wideband_cqi_rank2_2A_1_5MHz ; wideband_cqi_rank2_2A_1_5MHz_NB_IoT ;
#define sizeof_wideband_cqi_rank2_2A_1_5MHz 14 #define sizeof_wideband_cqi_rank2_2A_1_5MHz_NB_IoT 14
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -80,8 +63,8 @@ typedef struct __attribute__((packed)) ...@@ -80,8 +63,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:12; uint32_t diffcqi1:12;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_nopmi_1_5MHz; HLC_subband_cqi_nopmi_1_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_nopmi_1_5MHz 16 #define sizeof_HLC_subband_cqi_nopmi_1_5MHz_NB_IoT 16
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -90,8 +73,8 @@ typedef struct __attribute__((packed)) ...@@ -90,8 +73,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:12; uint32_t diffcqi1:12;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_rank1_2A_1_5MHz; HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz 18 #define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT 18
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -102,8 +85,8 @@ typedef struct __attribute__((packed)) ...@@ -102,8 +85,8 @@ typedef struct __attribute__((packed))
uint64_t diffcqi1:12; uint64_t diffcqi1:12;
uint64_t cqi1:4; uint64_t cqi1:4;
} }
HLC_subband_cqi_rank2_2A_1_5MHz; HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz 33 #define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT 33
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -111,8 +94,8 @@ typedef struct __attribute__((packed)) ...@@ -111,8 +94,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:12; uint32_t diffcqi1:12;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_modes123_1_5MHz; HLC_subband_cqi_modes123_1_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_modes123_1_5MHz 16 #define sizeof_HLC_subband_cqi_modes123_1_5MHz_NB_IoT 16
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -120,8 +103,8 @@ typedef struct __attribute__((packed)) ...@@ -120,8 +103,8 @@ typedef struct __attribute__((packed))
uint32_t crnti:16; uint32_t crnti:16;
uint32_t mcs:5; uint32_t mcs:5;
} }
HLC_subband_cqi_mcs_CBA_1_5MHz; HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz 21 #define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT 21
// **********************************************5 MHz*************************************************************************** // **********************************************5 MHz***************************************************************************
...@@ -131,8 +114,8 @@ typedef struct __attribute__((packed)) ...@@ -131,8 +114,8 @@ typedef struct __attribute__((packed))
uint32_t pmi:14; uint32_t pmi:14;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
wideband_cqi_rank1_2A_5MHz ; wideband_cqi_rank1_2A_5MHz_NB_IoT ;
#define sizeof_wideband_cqi_rank1_2A_5MHz 18 #define sizeof_wideband_cqi_rank1_2A_5MHz_NB_IoT 18
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -141,8 +124,8 @@ typedef struct __attribute__((packed)) ...@@ -141,8 +124,8 @@ typedef struct __attribute__((packed))
uint16_t cqi2:4; uint16_t cqi2:4;
uint16_t cqi1:4; uint16_t cqi1:4;
} }
wideband_cqi_rank2_2A_5MHz ; wideband_cqi_rank2_2A_5MHz_NB_IoT ;
#define sizeof_wideband_cqi_rank2_2A_5MHz 15 #define sizeof_wideband_cqi_rank2_2A_5MHz_NB_IoT 15
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -150,8 +133,8 @@ typedef struct __attribute__((packed)) ...@@ -150,8 +133,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:14; uint32_t diffcqi1:14;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_nopmi_5MHz; HLC_subband_cqi_nopmi_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_nopmi_5MHz 18 #define sizeof_HLC_subband_cqi_nopmi_5MHz_NB_IoT 18
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -160,8 +143,8 @@ typedef struct __attribute__((packed)) ...@@ -160,8 +143,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:14; uint32_t diffcqi1:14;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_rank1_2A_5MHz; HLC_subband_cqi_rank1_2A_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_rank1_2A_5MHz 20 #define sizeof_HLC_subband_cqi_rank1_2A_5MHz_NB_IoT 20
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -172,8 +155,8 @@ typedef struct __attribute__((packed)) ...@@ -172,8 +155,8 @@ typedef struct __attribute__((packed))
uint64_t diffcqi1:14; uint64_t diffcqi1:14;
uint64_t cqi1:4; uint64_t cqi1:4;
} }
HLC_subband_cqi_rank2_2A_5MHz; HLC_subband_cqi_rank2_2A_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_rank2_2A_5MHz 37 #define sizeof_HLC_subband_cqi_rank2_2A_5MHz_NB_IoT 37
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -181,8 +164,8 @@ typedef struct __attribute__((packed)) ...@@ -181,8 +164,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:14; uint32_t diffcqi1:14;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_modes123_5MHz; HLC_subband_cqi_modes123_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_modes123_5MHz 18 #define sizeof_HLC_subband_cqi_modes123_5MHz_NB_IoT 18
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -190,8 +173,8 @@ typedef struct __attribute__((packed)) ...@@ -190,8 +173,8 @@ typedef struct __attribute__((packed))
uint32_t crnti:16; uint32_t crnti:16;
uint32_t mcs:5; uint32_t mcs:5;
} }
HLC_subband_cqi_mcs_CBA_5MHz; HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz 21 #define sizeof_HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT 21
// **********************************************10 MHz*************************************************************************** // **********************************************10 MHz***************************************************************************
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
...@@ -200,8 +183,8 @@ typedef struct __attribute__((packed)) ...@@ -200,8 +183,8 @@ typedef struct __attribute__((packed))
uint32_t pmi:18; uint32_t pmi:18;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
wideband_cqi_rank1_2A_10MHz ; wideband_cqi_rank1_2A_10MHz_NB_IoT ;
#define sizeof_wideband_cqi_rank1_2A_10MHz 22 #define sizeof_wideband_cqi_rank1_2A_10MHz_NB_IoT 22
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -210,8 +193,8 @@ typedef struct __attribute__((packed)) ...@@ -210,8 +193,8 @@ typedef struct __attribute__((packed))
uint32_t cqi2:4; uint32_t cqi2:4;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
wideband_cqi_rank2_2A_10MHz ; wideband_cqi_rank2_2A_10MHz_NB_IoT ;
#define sizeof_wideband_cqi_rank2_2A_10MHz 17 #define sizeof_wideband_cqi_rank2_2A_10MHz_NB_IoT 17
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -219,8 +202,8 @@ typedef struct __attribute__((packed)) ...@@ -219,8 +202,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:18; uint32_t diffcqi1:18;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_nopmi_10MHz; HLC_subband_cqi_nopmi_10MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_nopmi_10MHz 22 #define sizeof_HLC_subband_cqi_nopmi_10MHz_NB_IoT 22
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -229,8 +212,8 @@ typedef struct __attribute__((packed)) ...@@ -229,8 +212,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:18; uint32_t diffcqi1:18;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_rank1_2A_10MHz; HLC_subband_cqi_rank1_2A_10MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_rank1_2A_10MHz 24 #define sizeof_HLC_subband_cqi_rank1_2A_10MHz_NB_IoT 24
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -241,8 +224,8 @@ typedef struct __attribute__((packed)) ...@@ -241,8 +224,8 @@ typedef struct __attribute__((packed))
uint64_t diffcqi1:18; uint64_t diffcqi1:18;
uint64_t cqi1:4; uint64_t cqi1:4;
} }
HLC_subband_cqi_rank2_2A_10MHz; HLC_subband_cqi_rank2_2A_10MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_rank2_2A_10MHz 45 #define sizeof_HLC_subband_cqi_rank2_2A_10MHz_NB_IoT 45
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -250,8 +233,8 @@ typedef struct __attribute__((packed)) ...@@ -250,8 +233,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:18; uint32_t diffcqi1:18;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_modes123_10MHz; HLC_subband_cqi_modes123_10MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_modes123_10MHz 22 #define sizeof_HLC_subband_cqi_modes123_10MHz_NB_IoT 22
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -259,8 +242,8 @@ typedef struct __attribute__((packed)) ...@@ -259,8 +242,8 @@ typedef struct __attribute__((packed))
uint32_t crnti:16; uint32_t crnti:16;
uint32_t mcs:5; uint32_t mcs:5;
} }
HLC_subband_cqi_mcs_CBA_10MHz; HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz 21 #define sizeof_HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT 21
// **********************************************20 MHz*************************************************************************** // **********************************************20 MHz***************************************************************************
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
...@@ -269,8 +252,8 @@ typedef struct __attribute__((packed)) ...@@ -269,8 +252,8 @@ typedef struct __attribute__((packed))
uint32_t pmi:26; uint32_t pmi:26;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
wideband_cqi_rank1_2A_20MHz ; wideband_cqi_rank1_2A_20MHz_NB_IoT ;
#define sizeof_wideband_cqi_rank1_2A_20MHz 20 #define sizeof_wideband_cqi_rank1_2A_20MHz_NB_IoT 20
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -279,8 +262,8 @@ typedef struct __attribute__((packed)) ...@@ -279,8 +262,8 @@ typedef struct __attribute__((packed))
uint32_t cqi2:4; uint32_t cqi2:4;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
wideband_cqi_rank2_2A_20MHz ; wideband_cqi_rank2_2A_20MHz_NB_IoT ;
#define sizeof_wideband_cqi_rank2_2A_20MHz 21 #define sizeof_wideband_cqi_rank2_2A_20MHz_NB_IoT 21
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -288,8 +271,8 @@ typedef struct __attribute__((packed)) ...@@ -288,8 +271,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:26; uint32_t diffcqi1:26;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_nopmi_20MHz; HLC_subband_cqi_nopmi_20MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_nopmi_20MHz 30 #define sizeof_HLC_subband_cqi_nopmi_20MHz_NB_IoT 30
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -298,8 +281,8 @@ typedef struct __attribute__((packed)) ...@@ -298,8 +281,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:26; uint32_t diffcqi1:26;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_rank1_2A_20MHz; HLC_subband_cqi_rank1_2A_20MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_rank1_2A_20MHz 32 #define sizeof_HLC_subband_cqi_rank1_2A_20MHz_NB_IoT 32
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -310,8 +293,8 @@ typedef struct __attribute__((packed)) ...@@ -310,8 +293,8 @@ typedef struct __attribute__((packed))
uint64_t diffcqi1:26; uint64_t diffcqi1:26;
uint64_t cqi1:4; uint64_t cqi1:4;
} }
HLC_subband_cqi_rank2_2A_20MHz; HLC_subband_cqi_rank2_2A_20MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_rank2_2A_20MHz 61 #define sizeof_HLC_subband_cqi_rank2_2A_20MHz_NB_IoT 61
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -319,8 +302,8 @@ typedef struct __attribute__((packed)) ...@@ -319,8 +302,8 @@ typedef struct __attribute__((packed))
uint32_t diffcqi1:26; uint32_t diffcqi1:26;
uint32_t cqi1:4; uint32_t cqi1:4;
} }
HLC_subband_cqi_modes123_20MHz; HLC_subband_cqi_modes123_20MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_modes123_20MHz 30 #define sizeof_HLC_subband_cqi_modes123_20MHz_NB_IoT 30
typedef struct __attribute__((packed)) typedef struct __attribute__((packed))
{ {
...@@ -328,14 +311,14 @@ typedef struct __attribute__((packed)) ...@@ -328,14 +311,14 @@ typedef struct __attribute__((packed))
uint32_t crnti:16; uint32_t crnti:16;
uint32_t mcs:5; uint32_t mcs:5;
} }
HLC_subband_cqi_mcs_CBA_20MHz; HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT;
#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz 21
#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT 21
#define MAX_CQI_PAYLOAD_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT)*8*20)
#define MAX_CQI_BITS_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT)*8)
#define MAX_CQI_BYTES_NB_IoT (sizeof(HLC_subband_cqi_rank2_2A_20MHz_NB_IoT))
#define MAX_ACK_PAYLOAD_NB_IoT 18
#define MAX_RI_PAYLOAD_NB_IoT 6
#define MAX_CQI_PAYLOAD (sizeof(HLC_subband_cqi_rank2_2A_20MHz)*8*20)
#define MAX_CQI_BITS (sizeof(HLC_subband_cqi_rank2_2A_20MHz)*8)
#define MAX_CQI_BYTES (sizeof(HLC_subband_cqi_rank2_2A_20MHz))
#define MAX_ACK_PAYLOAD 18
#define MAX_RI_PAYLOAD 6
*/
#endif #endif
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file PHY/LTE_TRANSPORT/phich.c
* \brief Routines for generation of and computations regarding the uplink control information (UCI) for PUSCH. V8.6 2009-03
* \author R. Knopp, F. Kaltenberger, A. Bhamri
* \date 2011
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr, florian.kaltenberger@eurecom.fr, ankit.bhamri@eurecom.fr
* \note
* \warning
*/
#include "PHY/defs_NB_IoT.h"
#include "PHY/extern_NB_IoT.h"
#ifdef DEBUG_UCI_TOOLS
#include "PHY/vars_NB_IoT.h"
#endif
void do_diff_cqi_NB_IoT(uint8_t N_RB_DL,
uint8_t *DL_subband_cqi,
uint8_t DL_cqi,
uint32_t diffcqi1)
{
uint8_t nb_sb,i,offset;
// This is table 7.2.1-3 from 36.213 (with k replaced by the number of subbands, nb_sb)
switch (N_RB_DL) {
case 6:
nb_sb=1;
break;
case 15:
nb_sb = 4;
break;
case 25:
nb_sb = 7;
break;
case 50:
nb_sb = 9;
break;
case 75:
nb_sb = 10;
break;
case 100:
nb_sb = 13;
break;
default:
nb_sb=0;
break;
}
memset(DL_subband_cqi,0,13);
for (i=0; i<nb_sb; i++) {
offset = (diffcqi1>>(2*i))&3;
if (offset == 3)
DL_subband_cqi[i] = DL_cqi - 1;
else
DL_subband_cqi[i] = DL_cqi + offset;
}
}
void extract_CQI_NB_IoT(void *o,UCI_format_NB_IoT_t uci_format,NB_IoT_eNB_UE_stats *stats, uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode)
{
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) {
case 6:
switch(uci_format) {
case wideband_cqi_rank1_2A_NB_IoT:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->pmi;
break;
case wideband_cqi_rank2_2A_NB_IoT:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_nopmi_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_1_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_1_5MHz_NB_IoT *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_1_5MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi1));
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_1_5MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_mcs_CBA_NB_IoT:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT *)o)->crnti) && (*crnti !=0)) {
*access_mode=CBA_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT *)o)->crnti);
} else {
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_1_5MHz_NB_IoT *)o)->crnti);
}
break;
case unknown_cqi:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci (rb %d)\n",N_RB_DL);
break;
}
break;
case 25:
switch(uci_format) {
case wideband_cqi_rank1_2A_NB_IoT:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_5MHz_NB_IoT *)o)->pmi;
break;
case wideband_cqi_rank2_2A_NB_IoT:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_5MHz_NB_IoT *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_5MHz_NB_IoT *)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 = stats->DL_pmi_single | (((stats->DL_pmi_dual&(1<i))>>i)*2)<<2*i;
break;
case HLC_subband_cqi_nopmi_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_5MHz_NB_IoT *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_5MHz_NB_IoT *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_5MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->diffcqi1));
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_5MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_mcs_CBA_NB_IoT:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT *)o)->crnti) && (*crnti !=0)) {
*access_mode=CBA_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT *)o)->crnti);
} else {
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_5MHz_NB_IoT *)o)->crnti);
}
break;
case unknown_cqi_NB_IoT:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci (rb %d)\n",N_RB_DL);
break;
}
break;
case 50:
switch(uci_format) {
case wideband_cqi_rank1_2A_NB_IoT:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_10MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_10MHz_NB_IoT *)o)->pmi;
break;
case wideband_cqi_rank2_2A_NB_IoT:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_10MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_10MHz_NB_IoT *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_10MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_nopmi_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_10MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_10MHz_NB_IoT *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_10MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_10MHz_NB_IoT *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_10MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->diffcqi1));
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_10MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_mcs_CBA_NB_IoT:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT *)o)->crnti) && (*crnti !=0)) {
*access_mode=CBA_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT *)o)->crnti);
} else {
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_10MHz_NB_IoT *)o)->crnti);
}
break;
case unknown_cqi_NB_IoT:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci (RB %d)\n",N_RB_DL);
break;
}
break;
case 100:
switch(uci_format) {
case wideband_cqi_rank1_2A_NB_IoT:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_20MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_20MHz_NB_IoT *)o)->pmi;
break;
case wideband_cqi_rank2_2A_NB_IoT:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_20MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_20MHz_NB_IoT *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_20MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_nopmi_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_20MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_20MHz_NB_IoT *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_20MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_20MHz_NB_IoT *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_20MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A_NB_IoT:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->diffcqi1));
do_diff_cqi_NB_IoT(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_20MHz_NB_IoT *)o)->pmi;
break;
case HLC_subband_cqi_mcs_CBA_NB_IoT:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT *)o)->crnti) && (*crnti !=0)) {
*access_mode=CBA_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT *)o)->crnti);
} else {
LOG_D(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_20MHz_NB_IoT *)o)->crnti);
}
break;
case unknown_cqi_NB_IoT:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci (RB %d)\n",N_RB_DL);
break;
}
break;
default:
LOG_N(PHY,"[eNB][UCI] unknown RB %d\n",N_RB_DL);
break;
}
}
...@@ -283,7 +283,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_ ...@@ -283,7 +283,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
eNB->nulsch[i]->harq_process->subframe_scheduling_flag=0; eNB->nulsch[i]->harq_process->subframe_scheduling_flag=0;
if (eNB->nulsch[i]->harq_process->cqi_crc_status == 1) { if (eNB->nulsch[i]->harq_process->cqi_crc_status == 1) {
extract_CQI(eNB->nulsch[i]->harq_process->o, extract_CQI_NB_IoT(eNB->nulsch[i]->harq_process->o,
eNB->nulsch[i]->harq_process->uci_format, eNB->nulsch[i]->harq_process->uci_format,
&eNB->UE_stats[i], &eNB->UE_stats[i],
fp->N_RB_DL, fp->N_RB_DL,
......
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