Commit 9b1bc43c authored by Ting-An Lin's avatar Ting-An Lin

lte_init_NB_IoT.c

(remain error)
parent fffc6b02
......@@ -1201,6 +1201,7 @@ set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
${OPENAIR1_DIR}/PHY/INIT/init_top.c
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
${OPENAIR1_DIR}/PHY/INIT/lte_parms_NB_IoT.c
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
......@@ -1257,6 +1258,7 @@ set(PHY_SRC
# ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
${OPENAIR1_DIR}/PHY/INIT/lte_init.c
${OPENAIR1_DIR}/PHY/INIT/lte_init_NB_IoT.c
)
set(PHY_SRC_RU
......@@ -1510,6 +1512,7 @@ set (ENB_APP_SRC
${OPENAIR2_DIR}/ENB_APP/enb_config_SL.c
${OPENAIR2_DIR}/ENB_APP/enb_config_eMTC.c
${OPENAIR2_DIR}/ENB_APP/RRC_config_tools.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_config.c
)
add_library(L2
......@@ -2117,7 +2120,6 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/ru_control.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR_TARGETS}/RT/USER/init_lte.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-common.c
${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
......
This diff is collapsed.
#include "defs.h"
#include "common/utils/LOG/log.h"
#include "PHY/impl_defs_lte_NB_IoT.h"
int init_frame_parms_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,uint8_t osf)
{
uint8_t log2_osf;
#if DISABLE_LOG_X
printf("Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
#else
LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
#endif
frame_parms->nb_prefix_samples0 = 160;
frame_parms->nb_prefix_samples = 144;
frame_parms->symbols_per_tti = 14;
switch(osf) {
case 1:
log2_osf = 0;
break;
case 2:
log2_osf = 1;
break;
case 4:
log2_osf = 2;
break;
case 8:
log2_osf = 3;
break;
case 16:
log2_osf = 4;
break;
default:
printf("Illegal oversampling %d\n",osf);
return(-1);
}
switch (frame_parms->N_RB_DL) {
case 100:
if (osf>1) {
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
return(-1);
}
if (frame_parms->threequarter_fs) {
frame_parms->ofdm_symbol_size = 1536;
frame_parms->samples_per_tti = 23040;
frame_parms->first_carrier_offset = 1536-600;
frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
}
else {
frame_parms->ofdm_symbol_size = 2048;
frame_parms->samples_per_tti = 30720;
frame_parms->first_carrier_offset = 2048-600;
}
break;
case 75:
if (osf>1) {
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
return(-1);
}
frame_parms->ofdm_symbol_size = 1536;
frame_parms->samples_per_tti = 23040;
frame_parms->first_carrier_offset = 1536-450;
frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
break;
case 50:
if (osf>1) {
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
return(-1);
}
frame_parms->ofdm_symbol_size = 1024*osf;
frame_parms->samples_per_tti = 15360*osf;
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300;
frame_parms->nb_prefix_samples>>=(1-log2_osf);
frame_parms->nb_prefix_samples0>>=(1-log2_osf);
break;
case 25:
if (osf>2) {
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
return(-1);
}
frame_parms->ofdm_symbol_size = 512*osf;
frame_parms->samples_per_tti = 7680*osf;
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150;
frame_parms->nb_prefix_samples>>=(2-log2_osf);
frame_parms->nb_prefix_samples0>>=(2-log2_osf);
break;
case 15:
frame_parms->ofdm_symbol_size = 256*osf;
frame_parms->samples_per_tti = 3840*osf;
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90;
frame_parms->nb_prefix_samples>>=(3-log2_osf);
frame_parms->nb_prefix_samples0>>=(3-log2_osf);
break;
case 6:
frame_parms->ofdm_symbol_size = 128*osf;
frame_parms->samples_per_tti = 1920*osf;
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36;
frame_parms->nb_prefix_samples>>=(4-log2_osf);
frame_parms->nb_prefix_samples0>>=(4-log2_osf);
break;
default:
printf("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms);
return(-1);
break;
}
printf("lte_parms.c: Setting N_RB_DL to %d, ofdm_symbol_size %d\n",frame_parms->N_RB_DL, frame_parms->ofdm_symbol_size);
// frame_parms->tdd_config=3;
return(0);
}
#include "../defs_L1_NB_IoT.h"
// for NB-IoT testing
PHY_VARS_eNB_NB_IoT* init_lte_eNB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
uint8_t eNB_id,
uint8_t Nid_cell,
eNB_func_NB_IoT_t node_function,
uint8_t abstraction_flag);
int phy_init_lte_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNb,
unsigned char is_secondary_eNb,
unsigned char abstraction_flag);
\ No newline at end of file
......@@ -36,7 +36,7 @@
#include "common/config/config_userapi.h"
#include "PHY/TOOLS/lte_phy_scope.h"
#include "targets/RT/USER/stats.h"
#include "PHY/phy_vars_ue.h"
#include "PHY/phy_vars.h"
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
// at eNB 0, an UL scope for every UE
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
......
......@@ -30,13 +30,13 @@
#include <string.h>
#include <inttypes.h>
#include "log.h"
#include "log_extern.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log_extern.h"
#include "assertions.h"
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "sctp_eNB_task.h"
#include "SystemInformationBlockType2.h"
//#include "SystemInformationBlockType2.h"
#include "PHY/phy_extern.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
......@@ -47,6 +47,7 @@
#include "L1_paramdef.h"
#include "MACRLC_paramdef.h"
#include "LAYER2/MAC/proto_NB_IoT.h"
#include "PHY/INIT/defs_NB_IoT.h"
void RCconfig_NbIoTL1(void) {
......@@ -90,7 +91,7 @@ void RCconfig_NbIoTL1(void) {
LOG_I(PHY,"No " NBIOT_L1LIST_CONFIG_STRING " configuration found");
}
}
#if 0 //Ann
void RCconfig_NbIoTmacrlc(void) {
paramdef_t NbIoT_MacRLC_Params[] = MACRLCPARAMS_DESC;
paramlist_def_t NbIoT_MacRLC_ParamList = {NBIOT_MACRLCLIST_CONFIG_STRING,NULL,0};
......@@ -250,3 +251,4 @@ void RCConfig_NbIoT(RAN_CONTEXT_t *RC) {
config_getlist( &NbIoT_L1ParamList,NULL,0, NULL);
RC->nb_nb_iot_L1_inst = NbIoT_L1ParamList.numelt;
}
#endif //Ann
\ No newline at end of file
......@@ -31,14 +31,15 @@
*/
#include "common/config/config_paramdesc.h"
#include "SystemInformationBlockType2.h"
#include "DL-GapConfig-NB-r13.h"
#include "NPRACH-Parameters-NB-r13.h"
#include "PowerRampingParameters.h"
#include "BCCH-Config-NB-r13.h"
#include "PCCH-Config-NB-r13.h"
#include "ACK-NACK-NumRepetitions-NB-r13.h"
#include "TDD-Config.h"
#if 0 //Ann
#include "LTE_SystemInformationBlockType2.h"
#include "LTE_DL-GapConfig-NB-r13.h"
#include "LTE_NPRACH-Parameters-NB-r13.h"
#include "LTE_PowerRampingParameters.h"
#include "LTE_BCCH-Config-NB-r13.h"
#include "LTE_PCCH-Config-NB-r13.h"
#include "LTE_ACK-NACK-NumRepetitions-NB-r13.h"
#include "LTE_TDD-Config.h"
......@@ -393,8 +394,7 @@
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* NB IoT MACRLC configuration list section name */
#define NBIOT_MACRLCLIST_CONFIG_STRING "NB-IoT_MACRLCs"
#endif //Ann
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* NB IoT L1 configuration list section name */
#define NBIOT_L1LIST_CONFIG_STRING "NB-IoT_L1s"
This diff is collapsed.
This diff is collapsed.
/*
* 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
*/
#include "PHY/types.h"
#include "PHY/defs_L1_NB_IoT.h"
#include "PHY/defs_common.h"
#include "PHY/defs_eNB.h"
#include "PHY/impl_defs_top.h"
PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t eNB_id,
uint16_t Nid_cell,
node_function_t node_function,
uint8_t abstraction_flag);
PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t UE_id,
uint8_t abstraction_flag);
PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t RN_id,
uint8_t eMBMS_active_state);
void init_lte_vars(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs],
uint8_t frame_type,
uint8_t tdd_config,
uint8_t tdd_config_S,
uint8_t extended_prefix_flag,
uint8_t N_RB_DL,
uint16_t Nid_cell,
uint8_t cooperation_flag,
uint8_t nb_antenna_ports,
uint8_t abstraction_flag,
int nb_antennas_rx,
int nb_antennas_tx,
int nb_antennas_rx_ue,
uint8_t eMBMS_active_state);
// for NB-IoT testing
PHY_VARS_eNB_NB_IoT* init_lte_eNB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
uint8_t eNB_id,
uint8_t Nid_cell,
eNB_func_NB_IoT_t node_function,
uint8_t abstraction_flag);
\ No newline at end of file
This diff is collapsed.
......@@ -56,7 +56,7 @@
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
#include "PHY/phy_vars_ue.h"
#include "PHY/phy_vars.h"
#include "PHY/LTE_TRANSPORT/transport_vars.h"
#include "SCHED/sched_common_vars.h"
#include "PHY/MODULATION/modulation_vars.h"
......
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