diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 073b8ac97e..c02f327f1d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -708,7 +708,7 @@ include_directories("${OPENAIR_BIN_DIR}") # add directories to find all include files # the internal rule is to use generic names such as defs.h # but to make it uniq name as adding the relative path in the include directtive -# example: #include "RRC/LTE/defs.h" +# example: #include "RRC/LTE/rrc_defs.h" #find_path (include_dirs_all *.h ${OPENAIR_DIR}) #find_path (include_dirs_all *.h PATHS /usr/include NO_CMAKE_PATH) #include_directories("${include_dirs_all}") @@ -1063,6 +1063,7 @@ set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c + ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/srs_modulation.c ${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c ${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_cell_spec.c @@ -1148,7 +1149,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/prach_ue.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/pmch_ue.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/pch_ue.c - ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/srs_modulation.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/drs_modulation.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/ulsch_coding.c @@ -1891,7 +1891,6 @@ add_executable(lte-softmodem ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c @@ -1923,14 +1922,13 @@ target_link_libraries (lte-softmodem ${T_LIB}) add_executable(lte-softmodem-nos1 ${rrc_h} ${s1ap_h} -# ${OPENAIR_BIN_DIR}/messages_xml.h + ${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c @@ -1966,7 +1964,6 @@ add_executable(lte-uesoftmodem ${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c @@ -2001,7 +1998,6 @@ add_executable(lte-uesoftmodem-nos1 ${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c @@ -2063,7 +2059,6 @@ add_executable(oaisim ${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c - ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c ${OPENAIR_TARGETS}/SIMU/USER/sinr_sim.c ${OPENAIR_TARGETS}/SIMU/USER/cor_SF_sim.c @@ -2110,7 +2105,6 @@ add_executable(oaisim_nos1 ${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c - ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c ${OPENAIR_TARGETS}/SIMU/USER/sinr_sim.c ${OPENAIR_TARGETS}/SIMU/USER/cor_SF_sim.c diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index c63d504e43..0497912af2 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -47,7 +47,7 @@ extern RAN_CONTEXT_t RC; #include "fapi_stub.h" //#include "fapi_l1.h" #include "UTIL/LOG/log.h" -#include "openair2/LAYER2/MAC/proto.h" +#include "openair2/LAYER2/MAC/mac_proto.h" #define NUM_P5_PHY 2 diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 07c3f1aa91..9184aa6e9d 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -37,7 +37,8 @@ #include "vendor_ext.h" #include "nfapi_vnf.h" - +#include "PHY/defs_eNB.h" +#include "PHY/LTE_TRANSPORT/transport_proto.h" #include "common/ran_context.h" extern RAN_CONTEXT_t RC; diff --git a/openair1/PHY/CODING/lte_rate_matching.c b/openair1/PHY/CODING/lte_rate_matching.c index c7af202ced..af5d1a169e 100644 --- a/openair1/PHY/CODING/lte_rate_matching.c +++ b/openair1/PHY/CODING/lte_rate_matching.c @@ -28,9 +28,8 @@ #include #include #endif -#include "PHY/defs_common.h" +#include "PHY/defs_eNB.h" #include "PHY/LTE_TRANSPORT/transport_common.h" -#include "assertions.h" //#define cmin(a,b) ((a)<(b) ? (a) : (b)) diff --git a/openair1/PHY/CODING/lte_segmentation.c b/openair1/PHY/CODING/lte_segmentation.c index 2d662a63f2..ba79b0171e 100644 --- a/openair1/PHY/CODING/lte_segmentation.c +++ b/openair1/PHY/CODING/lte_segmentation.c @@ -24,7 +24,7 @@ author: raymond.knopp@eurecom.fr date: 21.10.2009 */ -#include "PHY/defs_common.h" +#include "PHY/defs_eNB.h" #include "PHY/LTE_TRANSPORT/transport_common.h" #include "PHY/CODING/coding_defs.h" diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index a7a0662a50..4f3de5bce0 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -19,6 +19,7 @@ * contact@openairinterface.org */ +#include "PHY/defs_eNB.h" #include "phy_init.h" #include "SCHED/sched_eNB.h" #include "PHY/phy_extern.h" diff --git a/openair1/PHY/LTE_REFSIG/lte_ul_ref.c b/openair1/PHY/LTE_REFSIG/lte_ul_ref.c index a0251e4dd3..01b27205c2 100644 --- a/openair1/PHY/LTE_REFSIG/lte_ul_ref.c +++ b/openair1/PHY/LTE_REFSIG/lte_ul_ref.c @@ -25,6 +25,7 @@ #include #endif #include "lte_refsig.h" +#include "PHY/defs_eNB.h" uint16_t dftsizes[33] = {12,24,36,48,60,72,96,108,120,144,180,192,216,240,288,300,324,360,384,432,480,540,576,600,648,720,864,900,960,972,1080,1152,1200}; diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c index a9cccfc1be..5dbf6c10a9 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c @@ -925,6 +925,200 @@ uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci) } +uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe) +{ + uint8_t ret = 255; + + if (frame_parms->frame_type == FDD) { + ret = (((frame*10)+subframe)&7); + } else { + + switch (frame_parms->tdd_config) { + + case 1: + if ((subframe==2) || + (subframe==3) || + (subframe==7) || + (subframe==8)) + switch (subframe) { + case 2: + case 3: + ret = (subframe-2); + break; + + case 7: + case 8: + ret = (subframe-5); + break; + + default: + LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); + ret = (255); + break; + } + + break; + + case 2: + if ((subframe!=2) && (subframe!=7)) { + LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); + ret=255; + } + else ret = (subframe/7); + break; + + case 3: + if ((subframe<2) || (subframe>4)) { + LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); + ret = (255); + } + else ret = (subframe-2); + break; + + case 4: + if ((subframe<2) || (subframe>3)) { + LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); + ret = (255); + } + else ret = (subframe-2); + break; + + case 5: + if (subframe!=2) { + LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); + ret = (255); + } + else ret = (subframe-2); + break; + + default: + LOG_E(PHY,"subframe2_harq_pid, Unsupported TDD mode %d\n",frame_parms->tdd_config); + ret = (255); + } + } + + AssertFatal(ret!=255, + "invalid harq_pid(%d) at SFN/SF = %d/%d\n", (int8_t)ret, frame, subframe); + return ret; +} + +uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n) +{ + uint8_t ul_subframe = 255; + + if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 1) && + ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 + ul_subframe = ((n+6)%10); + else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 6) && + ((n==0)||(n==1)||(n==5)||(n==6))) + ul_subframe = ((n+7)%10); + else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 6) && + (n==9)) // tdd_config 6 SF 9 + ul_subframe = ((n+5)%10); + else + ul_subframe = ((n+4)%10); + + AssertFatal(frame_parms->frame_type == FDD || subframe_select(frame_parms,ul_subframe) == SF_UL,"illegal ul_subframe %d (n %d)\n",ul_subframe,n); + + LOG_D(PHY, "subframe %d: PUSCH subframe = %d\n", n, ul_subframe); + return ul_subframe; +} + +uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n) +{ + if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 1) && + ((n==7)||(n==2))) // tdd_config 0,1 SF 1,5 + return((n==7)? 1 : 6); + else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 6) && + ((n==7)||(n==8)||(n==2)||(n==3))) + return((n+3)%10); + else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 6) && + (n==4)) // tdd_config 6 SF 9 + return(9); + else + return((n+6)%10); +} + +uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n) +{ + uint32_t ul_frame; + + if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 1) && + ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 + ul_frame = (frame + (n==1 ? 0 : 1)); + else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 6) && + ((n==0)||(n==1)||(n==5)||(n==6))) + ul_frame = (frame + (n>=5 ? 1 : 0)); + else if ((frame_parms->frame_type == TDD) && + (frame_parms->tdd_config == 6) && + (n==9)) // tdd_config 6 SF 9 + ul_frame = (frame+1); + else + ul_frame = (frame+(n>=6 ? 1 : 0)); + + LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, n, ul_frame); + return ul_frame % 1024; +} + +uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi, uint8_t rank) +{ + + uint8_t i,wideband_pmi2; + uint32_t pmi_ex = 0; + + if (frame_parms->N_RB_DL!=25) { + LOG_E(PHY,"pmi_extend not yet implemented for anything else than 25PRB\n"); + return(-1); + } + + if (rank==0) { + wideband_pmi2=wideband_pmi&3; + for (i=0; i<14; i+=2) + pmi_ex|=(wideband_pmi2<>2)&3)<<4) + (((pmil>>4)&3)<<8) + (((pmil>>6)&3)<<12) + + (((pmil>>8)&3)<<16) + (((pmil>>10)&3)<<20) + (((pmil>>12)&3)<<24) + + (((pmil>>14)&3)<<28) + (((pmil>>16)&3)<<32) + (((pmil>>18)&3)<<36) + + (((pmil>>20)&3)<<40) + (((pmil>>22)&3)<<44) + (((pmil>>24)&3)<<48)); +} + +uint64_t pmi2hex_2Ar2(uint32_t pmi) +{ + + uint64_t pmil = (uint64_t)pmi; + return ((pmil&1) + (((pmil>>1)&1)<<4) + (((pmil>>2)&1)<<8) + (((pmil>>3)&1)<<12) + + (((pmil>>4)&1)<<16) + (((pmil>>5)&1)<<20) + (((pmil>>6)&1)<<24) + + (((pmil>>7)&1)<<28) + (((pmil>>8)&1)<<32) + (((pmil>>9)&1)<<36) + + (((pmil>>10)&1)<<40) + (((pmil>>11)&1)<<44) + (((pmil>>12)&1)<<48)); +} + + int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) { switch (dci->format) { diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h index d7ab63397a..7fd176fd04 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h @@ -1,3 +1,43 @@ +/* + * 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.1 (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/transport_proto.h + * \brief Function prototypes for eNB PHY physical/transport channel processing and generation V8.6 2009-03 + * \author R. Knopp, F. Kaltenberger + * \date 2011 + * \version 0.1 + * \company Eurecom + * \email: knopp@eurecom.fr + * \note + * \warning + */ +#ifndef __LTE_TRANSPORT_COMMON_PROTO__H__ +#define __LTE_TRANSPORT_COMMON_PROTO__H__ +#include "PHY/defs_common.h" + + + + +// Functions below implement minor procedures from 36-211 and 36-212 + /** \brief Compute Q (modulation order) based on I_MCS PDSCH. Implements table 7.1.7.1-1 from 36.213. @param I_MCS */ uint8_t get_Qm(uint8_t I_MCS); @@ -215,6 +255,18 @@ void init_prach_tables(int N_ZC); int is_pmch_subframe(frame_t frame, int subframe, LTE_DL_FRAME_PARMS *frame_parms); +/** \brief This routine expands a single (wideband) PMI to subband PMI bitmap similar to the one used in the UCI and in the dlsch_modulation routine + @param frame_parms Pointer to DL frame configuration parameters + @param wideband_pmi (0,1,2,3 for rank 0 and 0,1 for rank 1) + @param rank (0 or 1) + @returns subband PMI bitmap +*/ +uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi, uint8_t rank); + +uint64_t pmi2hex_2Ar1(uint32_t pmi); + +uint64_t pmi2hex_2Ar2(uint32_t pmi); + // DL power control functions double get_pa_dB(uint8_t pa); @@ -223,8 +275,11 @@ uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t n_ra_prboffset, uint8_t tdd_mapindex, uint16_t Nf); +uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t subframe); uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n); uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL); void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t *rb_alloc2); + +#endif diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h index 3fd01a8bd1..b61828c16a 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h @@ -34,6 +34,7 @@ #include "PHY/defs_eNB.h" #include #include "nfapi_interface.h" +#include "transport_common_proto.h" // Functions below implement 36-211 and 36-212 diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index 406a46b845..28f908c726 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -2697,148 +2697,6 @@ int generate_ue_dlsch_params_from_dci(int frame, } -uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe) -{ - uint8_t ret = 255; - - if (frame_parms->frame_type == FDD) { - ret = (((frame*10)+subframe)&7); - } else { - - switch (frame_parms->tdd_config) { - - case 1: - if ((subframe==2) || - (subframe==3) || - (subframe==7) || - (subframe==8)) - switch (subframe) { - case 2: - case 3: - ret = (subframe-2); - break; - - case 7: - case 8: - ret = (subframe-5); - break; - - default: - LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); - ret = (255); - break; - } - - break; - - case 2: - if ((subframe!=2) && (subframe!=7)) { - LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); - ret=255; - } - else ret = (subframe/7); - break; - - case 3: - if ((subframe<2) || (subframe>4)) { - LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); - ret = (255); - } - else ret = (subframe-2); - break; - - case 4: - if ((subframe<2) || (subframe>3)) { - LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); - ret = (255); - } - else ret = (subframe-2); - break; - - case 5: - if (subframe!=2) { - LOG_E(PHY,"subframe2_harq_pid, Illegal subframe %d for TDD mode %d\n",subframe,frame_parms->tdd_config); - ret = (255); - } - else ret = (subframe-2); - break; - - default: - LOG_E(PHY,"subframe2_harq_pid, Unsupported TDD mode %d\n",frame_parms->tdd_config); - ret = (255); - } - } - - AssertFatal(ret!=255, - "invalid harq_pid(%d) at SFN/SF = %d/%d\n", (int8_t)ret, frame, subframe); - return ret; -} - -uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n) -{ - uint8_t ul_subframe = 255; - - if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 1) && - ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 - ul_subframe = ((n+6)%10); - else if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 6) && - ((n==0)||(n==1)||(n==5)||(n==6))) - ul_subframe = ((n+7)%10); - else if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 6) && - (n==9)) // tdd_config 6 SF 9 - ul_subframe = ((n+5)%10); - else - ul_subframe = ((n+4)%10); - - AssertFatal(frame_parms->frame_type == FDD || subframe_select(frame_parms,ul_subframe) == SF_UL,"illegal ul_subframe %d (n %d)\n",ul_subframe,n); - - LOG_D(PHY, "subframe %d: PUSCH subframe = %d\n", n, ul_subframe); - return ul_subframe; -} - -uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n) -{ - if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 1) && - ((n==7)||(n==2))) // tdd_config 0,1 SF 1,5 - return((n==7)? 1 : 6); - else if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 6) && - ((n==7)||(n==8)||(n==2)||(n==3))) - return((n+3)%10); - else if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 6) && - (n==4)) // tdd_config 6 SF 9 - return(9); - else - return((n+6)%10); -} - -uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n) -{ - uint32_t ul_frame; - - if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 1) && - ((n==1)||(n==6))) // tdd_config 0,1 SF 1,5 - ul_frame = (frame + (n==1 ? 0 : 1)); - else if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 6) && - ((n==0)||(n==1)||(n==5)||(n==6))) - ul_frame = (frame + (n>=5 ? 1 : 0)); - else if ((frame_parms->frame_type == TDD) && - (frame_parms->tdd_config == 6) && - (n==9)) // tdd_config 6 SF 9 - ul_frame = (frame+1); - else - ul_frame = (frame+(n>=6 ? 1 : 0)); - - LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, n, ul_frame); - return ul_frame % 1024; -} int32_t pmi_convert_rank1_from_rank2(uint16_t pmi_alloc, int tpmi, int nb_rb) { @@ -3408,34 +3266,7 @@ void reset_cba_uci(void *o) } -uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi, uint8_t rank) -{ - uint8_t i,wideband_pmi2; - uint32_t pmi_ex = 0; - - if (frame_parms->N_RB_DL!=25) { - LOG_E(PHY,"pmi_extend not yet implemented for anything else than 25PRB\n"); - return(-1); - } - - if (rank==0) { - wideband_pmi2=wideband_pmi&3; - for (i=0; i<14; i+=2) - pmi_ex|=(wideband_pmi2<>2)&3)<<4) + (((pmil>>4)&3)<<8) + (((pmil>>6)&3)<<12) + - (((pmil>>8)&3)<<16) + (((pmil>>10)&3)<<20) + (((pmil>>12)&3)<<24) + - (((pmil>>14)&3)<<28) + (((pmil>>16)&3)<<32) + (((pmil>>18)&3)<<36) + - (((pmil>>20)&3)<<40) + (((pmil>>22)&3)<<44) + (((pmil>>24)&3)<<48)); -} - -uint64_t pmi2hex_2Ar2(uint32_t pmi) -{ - - uint64_t pmil = (uint64_t)pmi; - return ((pmil&1) + (((pmil>>1)&1)<<4) + (((pmil>>2)&1)<<8) + (((pmil>>3)&1)<<12) + - (((pmil>>4)&1)<<16) + (((pmil>>5)&1)<<20) + (((pmil>>6)&1)<<24) + - (((pmil>>7)&1)<<28) + (((pmil>>8)&1)<<32) + (((pmil>>9)&1)<<36) + - (((pmil>>10)&1)<<40) + (((pmil>>11)&1)<<44) + (((pmil>>12)&1)<<48)); -} uint64_t cqi2hex(uint32_t cqi) { diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index eb86af9165..34799bff7a 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -23,6 +23,7 @@ #include #include "lte_phy_scope.h" +#include "PHY/defs_common.h" #define TPUT_WINDOW_LENGTH 100 int otg_enabled; diff --git a/openair1/PHY/TOOLS/tools_defs.h b/openair1/PHY/TOOLS/tools_defs.h index 31174a11b6..e3b04babdc 100644 --- a/openair1/PHY/TOOLS/tools_defs.h +++ b/openair1/PHY/TOOLS/tools_defs.h @@ -30,7 +30,7 @@ */ #include - +#include "PHY/sse_intrin.h" struct complex { diff --git a/openair1/PHY/defs_L1_NB_IoT.h b/openair1/PHY/defs_L1_NB_IoT.h index 25ee646548..6eb4ce0e95 100644 --- a/openair1/PHY/defs_L1_NB_IoT.h +++ b/openair1/PHY/defs_L1_NB_IoT.h @@ -40,7 +40,7 @@ #include #include "common_lib.h" #include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h" - +#include "defs_eNB.h" //#include #include "assertions.h" #ifdef MEX diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 4b83a13b31..f992bb75cf 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -58,7 +58,7 @@ #include "msc.h" #include "defs_common.h" - +#include "impl_defs_top.h" #include "PHY/TOOLS/time_meas.h" #include "PHY/CODING/coding_defs.h" @@ -67,7 +67,7 @@ #include "PHY/LTE_UE_TRANSPORT/transport_ue.h" #include "PHY/LTE_TRANSPORT/transport_eNB.h" // for SIC #include - +#include "assertions.h" /// Context data structure for RX/TX portion of subframe processing diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index b88aaf9824..9418f63abc 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -59,73 +59,11 @@ //#include -#include "assertions.h" - -#include "sse_intrin.h" -#ifdef MEX -# define msg mexPrintf -#endif -//use msg in the real-time thread context -#define msg_nrt printf -//use msg_nrt in the non real-time context (for initialization, ...) -#ifndef malloc16 -# ifdef __AVX2__ -# define malloc16(x) memalign(32,x) -# else -# define malloc16(x) memalign(16,x) -# endif -#endif -#define free16(y,x) free(y) -#define bigmalloc malloc -#define bigmalloc16 malloc16 -#define openair_free(y,x) free((y)) -#define PAGE_SIZE 4096 -#define free_and_zero(PtR) do { \ - if (PtR) { \ - free(PtR); \ - PtR = NULL; \ - } \ - } while (0) - -#define RX_NB_TH_MAX 2 -#define RX_NB_TH 2 - - -//! \brief Allocate \c size bytes of memory on the heap with alignment 16 and zero it afterwards. -//! If no more memory is available, this function will terminate the program with an assertion error. -static inline void* malloc16_clear( size_t size ) -{ -#ifdef __AVX2__ - void* ptr = memalign(32, size); -#else - void* ptr = memalign(16, size); -#endif - DevAssert(ptr); - memset( ptr, 0, size ); - return ptr; -} -#define PAGE_MASK 0xfffff000 -#define virt_to_phys(x) (x) - -#define openair_sched_exit() exit(-1) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#define min(a,b) ((a)<(b) ? (a) : (b)) - - -#define bzero(s,n) (memset((s),0,(n))) - -#define cmax(a,b) ((a>b) ? (a) : (b)) -#define cmin(a,b) ((ac) ? (cmax(a,b)) : (c)) - -/// suppress compiler warning for unused arguments -#define UNUSED(x) (void)x; #include "PHY/TOOLS/time_meas.h" diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 3071266a0d..d39d187a53 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -58,15 +58,17 @@ #include "msc.h" - +#include "defs_common.h" +#include "impl_defs_top.h" #include "PHY/TOOLS/time_meas.h" -#include "PHY/CODING/coding_defs.h" +//#include "PHY/CODING/coding_defs.h" #include "PHY/TOOLS/tools_defs.h" #include "platform_types.h" #include "PHY/LTE_TRANSPORT/transport_common.h" #include "PHY/LTE_TRANSPORT/transport_eNB.h" #include + #include "openair2/PHY_INTERFACE/IF_Module.h" typedef struct RU_proc_t_s { diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 263108371c..27c0a2e6ae 100644 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -274,8 +274,43 @@ typedef struct { #define MAX_FRAME_NUMBER 0x400 #include "openairinterface5g_limits.h" +#include "assertions.h" +#define cmax(a,b) ((a>b) ? (a) : (b)) +#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c)) +#define cmin(a,b) ((a -#include "openair1/PHY/extern.h" +#include "openair1/PHY/phy_extern.h" #include "common/utils/load_module_shlib.h" #define NBIOT_INTERFACE_SOURCE #include "NB_IoT_interface.h" diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index aa5bbdb3c7..50ebf13f79 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -45,9 +45,9 @@ #endif #include "sctp_default_values.h" #include "SystemInformationBlockType2.h" -#include "LAYER2/MAC/extern.h" -#include "LAYER2/MAC/proto.h" -#include "PHY/extern.h" +#include "LAYER2/MAC/mac_extern.h" +#include "LAYER2/MAC/mac_proto.h" +#include "PHY/phy_extern.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "nfapi_vnf.h" #include "nfapi_pnf.h" diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index 4b0a22300f..3bbea167d3 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -35,11 +35,11 @@ #include "flexran_agent_extern.h" #include "flexran_agent_net_comm.h" #include "flexran_agent_ran_api.h" -#include "PHY/extern.h" +//#include "PHY/extern.h" #include "log.h" -#include "SCHED/defs.h" -#include "RRC/LITE/extern.h" +//#include "SCHED/defs.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "rrc_eNB_UE_context.h" diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 42ed105f23..6be1c948c9 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -32,7 +32,6 @@ #include "COMMON/platform_types.h" #include "COMMON/platform_constants.h" -#include "SCHED/defs.h" #include "SystemInformationBlockType2.h" //#include "RadioResourceConfigCommonSIB.h" #include "RadioResourceConfigDedicated.h" @@ -43,9 +42,9 @@ #include "MeasObjectToAddModList.h" #include "TDD-Config.h" #include "MAC-MainConfig.h" -#include "defs.h" -#include "proto.h" -#include "extern.h" +#include "mac.h" +#include "mac_proto.h" +#include "mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 8dab2a9b71..75a2fe462e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -30,23 +30,18 @@ */ #include "assertions.h" -#include "PHY/defs.h" -#include "PHY/extern.h" -#include "SCHED/defs.h" -#include "SCHED/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_extern.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/extern.h" - -#include "LAYER2/MAC/proto.h" +#include "LAYER2/MAC/mac_proto.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" @@ -60,6 +55,8 @@ #include "intertask_interface.h" #endif +#include "assertions.h" + #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 @@ -583,6 +580,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, break; } } + // Note: This should not be done in the MAC! for (int ii=0; iiulsch[ii]; if((ulsch != NULL) && (ulsch->rnti == rnti)){ diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 3005ecf464..59eabe8b80 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -34,24 +34,19 @@ #include "assertions.h" #include "platform_types.h" -#include "PHY/defs.h" -#include "PHY/extern.h" #include "msc.h" -#include "SCHED/defs.h" -#include "SCHED/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_extern.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/extern.h" - -#include "LAYER2/MAC/proto.h" +#include "LAYER2/MAC/mac_proto.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" @@ -61,10 +56,14 @@ #include "intertask_interface.h" #endif -#include "SIMULATION/TOOLS/defs.h" // for taus +#include "SIMULATION/TOOLS/sim.h" // for taus #include "T.h" +#include "common/ran_context.h" + +extern RAN_CONTEXT_t RC; + extern uint8_t nfapi_mode; extern int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index de4641fac6..ec69bc5548 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -30,22 +30,16 @@ */ #include "assertions.h" -#include "PHY/defs.h" -#include "PHY/extern.h" - -#include "SCHED/defs.h" -#include "SCHED/extern.h" - -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/proto.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" @@ -58,6 +52,9 @@ #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 +#include "common/ran_context.h" + +extern RAN_CONTEXT_t RC; // NEED TO ADD schedule_SI_BR for SIB1_BR and SIB23_BR // CCE_allocation_infeasible to be done for EPDCCH/MPDCCH diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 0729073eba..66b3c57610 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -29,29 +29,25 @@ */ -#include "assertions.h" -#include "PHY/defs.h" -#include "PHY/extern.h" -#include "SCHED/defs.h" -#include "SCHED/extern.h" - -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/proto.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" #include "pdcp.h" -#include "SIMULATION/TOOLS/defs.h" // for taus +#include "SIMULATION/TOOLS/sim.h" // for taus + +#include "assertions.h" #if defined(ENABLE_ITTI) #include "intertask_interface.h" diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c index 37b13d2de7..5997596119 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c @@ -29,36 +29,32 @@ */ -#include "assertions.h" -#include "PHY/defs.h" -#include "PHY/extern.h" -#include "SCHED/defs.h" -#include "SCHED/extern.h" - -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/proto.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" #include "pdcp.h" +#include "assertions.h" #if defined(ENABLE_ITTI) #include "intertask_interface.h" #endif -#include "SIMULATION/TOOLS/defs.h" // for taus +#include "SIMULATION/TOOLS/sim.h" // for taus #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 +#include "common/ran_context.h" extern RAN_CONTEXT_t RC; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 110afc1a5a..08beb41114 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -30,23 +30,18 @@ */ #include "assertions.h" -#include "PHY/defs.h" -#include "PHY/extern.h" -#include "SCHED/defs.h" -#include "SCHED/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_extern.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/extern.h" - -#include "LAYER2/MAC/proto.h" +#include "LAYER2/MAC/mac_proto.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" @@ -61,6 +56,10 @@ #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 +#include "common/ran_context.h" + +extern RAN_CONTEXT_t RC; + extern int n_active_slices; int choose(int n, int k) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 9ccb0e66ab..ba98f85268 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -31,25 +31,21 @@ /* indented with: indent -kr eNB_scheduler_RA.c */ -#include "assertions.h" -#include "PHY/defs.h" -#include "PHY/extern.h" -#include "SCHED/defs.h" -#include "SCHED/extern.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/proto.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" +#include "assertions.h" //#include "LAYER2/MAC/pre_processor.c" #include "pdcp.h" diff --git a/openair2/LAYER2/MAC/l1_helpers.c b/openair2/LAYER2/MAC/l1_helpers.c index 6afd7a2607..0cb5c17f0f 100644 --- a/openair2/LAYER2/MAC/l1_helpers.c +++ b/openair2/LAYER2/MAC/l1_helpers.c @@ -29,10 +29,10 @@ */ -#include "defs.h" -#include "extern.h" +#include "mac.h" +#include "mac_extern.h" #include "UTIL/LOG/log.h" -#include "proto.h" +#include "mac_proto.h" int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP, uint8_t CC_id) { diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index ceb8ced124..dfdb433366 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -43,8 +43,6 @@ #include #include -//#include "PHY/defs.h" -//#include "PHY/LTE_TRANSPORT/defs.h" #include "COMMON/platform_constants.h" #include "BCCH-BCH-Message.h" #include "RadioResourceConfigCommon.h" @@ -69,6 +67,12 @@ #include "nfapi_interface.h" #include "PHY_INTERFACE/IF_Module.h" +#include "PHY/TOOLS/time_meas.h" + +#include "PHY/defs_common.h" // for PRACH_RESOURCES_t + +#include "targets/ARCH/COMMON/common_lib.h" + /** @defgroup _mac MAC * @ingroup _oai2 * @{ @@ -393,7 +397,6 @@ typedef struct { uint16_t Pdu_size; } __attribute__ ((__packed__)) ULSCH_PDU; -#include "PHY/impl_defs_top.h" /*!\brief RA process state*/ typedef enum { @@ -817,8 +820,8 @@ typedef struct { ///Contention resolution timer used during random access uint8_t mac_ContentionResolutionTimer; - uint16_t max_rbs_allowed_slice[MAX_NUM_CCs][MAX_NUM_SLICES]; - uint16_t max_rbs_allowed_slice_uplink[MAX_NUM_CCs][MAX_NUM_SLICES]; + uint16_t max_rbs_allowed_slice[NFAPI_CC_MAX][MAX_NUM_SLICES]; + uint16_t max_rbs_allowed_slice_uplink[NFAPI_CC_MAX][MAX_NUM_SLICES]; uint8_t max_mcs[MAX_NUM_LCID]; @@ -827,14 +830,14 @@ typedef struct { // resource scheduling information /// Current DL harq round per harq_pid on each CC - uint8_t round[MAX_NUM_CCs][10]; + uint8_t round[NFAPI_CC_MAX][10]; /// Current Active TBs per harq_pid on each CC - uint8_t tbcnt[MAX_NUM_CCs][10]; + uint8_t tbcnt[NFAPI_CC_MAX][10]; /// Current UL harq round per harq_pid on each CC - uint8_t round_UL[MAX_NUM_CCs][8]; - uint8_t dl_pow_off[MAX_NUM_CCs]; - uint16_t pre_nb_available_rbs[MAX_NUM_CCs]; - unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX]; + uint8_t round_UL[NFAPI_CC_MAX][8]; + uint8_t dl_pow_off[NFAPI_CC_MAX]; + uint16_t pre_nb_available_rbs[NFAPI_CC_MAX]; + unsigned char rballoc_sub_UE[NFAPI_CC_MAX][N_RBG_MAX]; uint16_t ta_timer; int16_t ta_update; uint16_t ul_consecutive_errors; @@ -939,7 +942,7 @@ typedef struct { /*! \brief subband bitmap confguration (for ALU icic algo purpose), in test phase */ typedef struct { - uint8_t sbmap[NUMBER_OF_SUBBANDS_MAX]; //13 = number of SB MAX for 100 PRB + uint8_t sbmap[13]; //13 = number of SB MAX for 100 PRB uint8_t periodicity; uint8_t first_subframe; uint8_t sb_size; @@ -949,34 +952,34 @@ typedef struct { typedef struct { /// Dedicated information for UEs struct PhysicalConfigDedicated - *physicalConfigDedicated[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + *physicalConfigDedicated[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; /// DLSCH pdu - DLSCH_PDU DLSCH_pdu[MAX_NUM_CCs][2][NUMBER_OF_UE_MAX]; + DLSCH_PDU DLSCH_pdu[NFAPI_CC_MAX][2][MAX_MOBILES_PER_ENB]; /// DCI template and MAC connection parameters for UEs - UE_TEMPLATE UE_template[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + UE_TEMPLATE UE_template[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; /// DCI template and MAC connection for RA processes - int pCC_id[NUMBER_OF_UE_MAX]; + int pCC_id[MAX_MOBILES_PER_ENB]; /// sorted downlink component carrier for the scheduler - int ordered_CCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + int ordered_CCids[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; /// number of downlink active component carrier - int numactiveCCs[NUMBER_OF_UE_MAX]; + int numactiveCCs[MAX_MOBILES_PER_ENB]; /// sorted uplink component carrier for the scheduler - int ordered_ULCCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + int ordered_ULCCids[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; /// number of uplink active component carrier - int numactiveULCCs[NUMBER_OF_UE_MAX]; + int numactiveULCCs[MAX_MOBILES_PER_ENB]; /// number of downlink active component carrier - uint8_t dl_CC_bitmap[NUMBER_OF_UE_MAX]; + uint8_t dl_CC_bitmap[MAX_MOBILES_PER_ENB]; /// eNB to UE statistics - eNB_UE_STATS eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + eNB_UE_STATS eNB_UE_stats[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; /// scheduling control info - UE_sched_ctrl UE_sched_ctrl[NUMBER_OF_UE_MAX]; - int next[NUMBER_OF_UE_MAX]; + UE_sched_ctrl UE_sched_ctrl[MAX_MOBILES_PER_ENB]; + int next[MAX_MOBILES_PER_ENB]; int head; - int next_ul[NUMBER_OF_UE_MAX]; + int next_ul[MAX_MOBILES_PER_ENB]; int head_ul; int avail; int num_UEs; - boolean_t active[NUMBER_OF_UE_MAX]; + boolean_t active[MAX_MOBILES_PER_ENB]; /// Sorting criteria for the UE list in the MAC preprocessor uint16_t sorting_criteria[MAX_NUM_SLICES][CR_NUM]; @@ -1057,82 +1060,82 @@ typedef struct { /*! \brief top level eNB MAC structure */ typedef struct eNB_MAC_INST_s { /// Ethernet parameters for northbound midhaul interface - eth_params_t eth_params_n; - /// Ethernet parameters for fronthaul interface - eth_params_t eth_params_s; - /// - module_id_t Mod_id; - /// frame counter - frame_t frame; - /// subframe counter - sub_frame_t subframe; - /// Pointer to IF module instance for PHY - IF_Module_t *if_inst; - /// Common cell resources - COMMON_channels_t common_channels[MAX_NUM_CCs]; - /// current PDU index (BCH,MCH,DLSCH) - uint16_t pdu_index[MAX_NUM_CCs]; - - /// NFAPI Config Request Structure - nfapi_config_request_t config[MAX_NUM_CCs]; - /// Preallocated DL pdu list - nfapi_dl_config_request_pdu_t - dl_config_pdu_list[MAX_NUM_CCs][MAX_NUM_DL_PDU]; - /// NFAPI DL Config Request Structure - nfapi_dl_config_request_t DL_req[MAX_NUM_CCs]; - /// Preallocated UL pdu list - nfapi_ul_config_request_pdu_t - ul_config_pdu_list[MAX_NUM_CCs][MAX_NUM_UL_PDU]; - /// Preallocated UL pdu list for ULSCH (n+k delay) - nfapi_ul_config_request_pdu_t - ul_config_pdu_list_tmp[MAX_NUM_CCs][10][MAX_NUM_UL_PDU]; - /// NFAPI UL Config Request Structure, send to L1 4 subframes before processing takes place - nfapi_ul_config_request_t UL_req[MAX_NUM_CCs]; - /// NFAPI "Temporary" UL Config Request Structure, holds future UL_config requests - nfapi_ul_config_request_t UL_req_tmp[MAX_NUM_CCs][10]; - /// Preallocated HI_DCI0 pdu list - nfapi_hi_dci0_request_pdu_t - hi_dci0_pdu_list[MAX_NUM_CCs][MAX_NUM_HI_DCI0_PDU]; - /// NFAPI HI/DCI0 Config Request Structure - nfapi_hi_dci0_request_t HI_DCI0_req[MAX_NUM_CCs]; - /// Prealocated TX pdu list - nfapi_tx_request_pdu_t - tx_request_pdu[MAX_NUM_CCs][MAX_NUM_TX_REQUEST_PDU]; - /// NFAPI DL PDU structure - nfapi_tx_request_t TX_req[MAX_NUM_CCs]; - /// UL handle - uint32_t ul_handle; - UE_list_t UE_list; - - ///subband bitmap configuration - SBMAP_CONF sbmap_conf; - /// CCE table used to build DCI scheduling information - int CCE_table[MAX_NUM_CCs][800]; - /// active flag for Other lcid - uint8_t lcid_active[NB_RB_MAX]; - /// eNB stats - eNB_STATS eNB_stats[MAX_NUM_CCs]; - // MAC function execution peformance profiler - /// processing time of eNB scheduler - time_stats_t eNB_scheduler; - /// processing time of eNB scheduler for SI - time_stats_t schedule_si; - /// processing time of eNB scheduler for Random access - time_stats_t schedule_ra; - /// processing time of eNB ULSCH scheduler - time_stats_t schedule_ulsch; - /// processing time of eNB DCI generation - time_stats_t fill_DLSCH_dci; - /// processing time of eNB MAC preprocessor - time_stats_t schedule_dlsch_preprocessor; - /// processing time of eNB DLSCH scheduler - time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor - /// processing time of eNB MCH scheduler - time_stats_t schedule_mch; - /// processing time of eNB ULSCH reception - time_stats_t rx_ulsch_sdu; // include rlc_data_ind - /// processing time of eNB PCH scheduler - time_stats_t schedule_pch; + eth_params_t eth_params_n; + /// Ethernet parameters for fronthaul interface + eth_params_t eth_params_s; + /// + module_id_t Mod_id; + /// frame counter + frame_t frame; + /// subframe counter + sub_frame_t subframe; + /// Pointer to IF module instance for PHY + IF_Module_t *if_inst; + /// Common cell resources + COMMON_channels_t common_channels[NFAPI_CC_MAX]; + /// current PDU index (BCH,MCH,DLSCH) + uint16_t pdu_index[NFAPI_CC_MAX]; + + /// NFAPI Config Request Structure + nfapi_config_request_t config[NFAPI_CC_MAX]; + /// Preallocated DL pdu list + nfapi_dl_config_request_pdu_t + dl_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_DL_PDU]; + /// NFAPI DL Config Request Structure + nfapi_dl_config_request_t DL_req[NFAPI_CC_MAX]; + /// Preallocated UL pdu list + nfapi_ul_config_request_pdu_t + ul_config_pdu_list[NFAPI_CC_MAX][MAX_NUM_UL_PDU]; + /// Preallocated UL pdu list for ULSCH (n+k delay) + nfapi_ul_config_request_pdu_t + ul_config_pdu_list_tmp[NFAPI_CC_MAX][10][MAX_NUM_UL_PDU]; + /// NFAPI UL Config Request Structure, send to L1 4 subframes before processing takes place + nfapi_ul_config_request_t UL_req[NFAPI_CC_MAX]; + /// NFAPI "Temporary" UL Config Request Structure, holds future UL_config requests + nfapi_ul_config_request_t UL_req_tmp[NFAPI_CC_MAX][10]; + /// Preallocated HI_DCI0 pdu list + nfapi_hi_dci0_request_pdu_t + hi_dci0_pdu_list[NFAPI_CC_MAX][MAX_NUM_HI_DCI0_PDU]; + /// NFAPI HI/DCI0 Config Request Structure + nfapi_hi_dci0_request_t HI_DCI0_req[NFAPI_CC_MAX]; + /// Prealocated TX pdu list + nfapi_tx_request_pdu_t + tx_request_pdu[NFAPI_CC_MAX][MAX_NUM_TX_REQUEST_PDU]; + /// NFAPI DL PDU structure + nfapi_tx_request_t TX_req[NFAPI_CC_MAX]; + /// UL handle + uint32_t ul_handle; + UE_list_t UE_list; + + ///subband bitmap configuration + SBMAP_CONF sbmap_conf; + /// CCE table used to build DCI scheduling information + int CCE_table[NFAPI_CC_MAX][800]; + /// active flag for Other lcid + uint8_t lcid_active[NB_RB_MAX]; + /// eNB stats + eNB_STATS eNB_stats[NFAPI_CC_MAX]; + // MAC function execution peformance profiler + /// processing time of eNB scheduler + time_stats_t eNB_scheduler; + /// processing time of eNB scheduler for SI + time_stats_t schedule_si; + /// processing time of eNB scheduler for Random access + time_stats_t schedule_ra; + /// processing time of eNB ULSCH scheduler + time_stats_t schedule_ulsch; + /// processing time of eNB DCI generation + time_stats_t fill_DLSCH_dci; + /// processing time of eNB MAC preprocessor + time_stats_t schedule_dlsch_preprocessor; + /// processing time of eNB DLSCH scheduler + time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor + /// processing time of eNB MCH scheduler + time_stats_t schedule_mch; + /// processing time of eNB ULSCH reception + time_stats_t rx_ulsch_sdu; // include rlc_data_ind + /// processing time of eNB PCH scheduler + time_stats_t schedule_pch; } eNB_MAC_INST; /* @@ -1264,7 +1267,7 @@ typedef struct { /// Outgoing RAR pdu for PHY RAR_PDU RAR_pdu; /// Incoming DLSCH pdu for PHY - DLSCH_PDU DLSCH_pdu[NUMBER_OF_UE_MAX][2]; + DLSCH_PDU DLSCH_pdu[MAX_MOBILES_PER_ENB][2]; /// number of attempt for rach uint8_t RA_attempt_number; /// Random-access procedure flag @@ -1305,7 +1308,7 @@ typedef struct { /// power backoff due to power management (as allowed by P-MPRc) for this cell uint8_t PHR_reporting_active; /// power backoff due to power management (as allowed by P-MPRc) for this cell - uint8_t power_backoff_db[NUMBER_OF_eNB_MAX]; + uint8_t power_backoff_db[MAX_eNB]; /// BSR report falg management uint8_t BSR_reporting_active; /// retxBSR-Timer expires flag diff --git a/openair2/LAYER2/MAC/mac_proto.h b/openair2/LAYER2/MAC/mac_proto.h index ce5d26d6f9..6fb5d541f8 100644 --- a/openair2/LAYER2/MAC/mac_proto.h +++ b/openair2/LAYER2/MAC/mac_proto.h @@ -30,6 +30,7 @@ #define __LAYER2_MAC_PROTO_H__ #include "LAYER2/MAC/mac.h" +#include "PHY/defs_common.h" // for PRACH_RESOURCES_t and lte_subframe_t /** \addtogroup _mac * @{ @@ -207,13 +208,13 @@ void dlsch_scheduler_pre_processor_reset(int module_idP, int UE_id, int subframeP, int N_RBG, uint16_t - nb_rbs_required[MAX_NUM_CCs] - [NUMBER_OF_UE_MAX], + nb_rbs_required[NFAPI_CC_MAX] + [MAX_MOBILES_PER_ENB], unsigned char - rballoc_sub[MAX_NUM_CCs] + rballoc_sub[NFAPI_CC_MAX] [N_RBG_MAX], unsigned char - MIMO_mode_indicator[MAX_NUM_CCs] + MIMO_mode_indicator[NFAPI_CC_MAX] [N_RBG_MAX]); // eNB functions @@ -229,7 +230,7 @@ void dlsch_scheduler_pre_processor(module_id_t module_idP, slice_id_t slice_idP, frame_t frameP, sub_frame_t subframe, - int N_RBG[MAX_NUM_CCs], + int N_RBG[NFAPI_CC_MAX], int *mbsfn_flag); @@ -240,19 +241,10 @@ void dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id, int transmission_mode, int min_rb_unit, uint8_t N_RB_DL, - uint16_t - nb_rbs_required[MAX_NUM_CCs] - [NUMBER_OF_UE_MAX], - uint16_t - nb_rbs_required_remaining - [MAX_NUM_CCs] - [NUMBER_OF_UE_MAX], - unsigned char - rballoc_sub[MAX_NUM_CCs] - [N_RBG_MAX], - unsigned char - MIMO_mode_indicator - [MAX_NUM_CCs][N_RBG_MAX]); + uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint16_t nb_rbs_required_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + unsigned char rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], + unsigned char MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]); /* \brief Function to trigger the eNB scheduling procedure. It is called by PHY at the beginning of each subframe, \f$n$\f and generates all DLSCH allocations for subframe \f$n\f$ and ULSCH allocations for subframe \f$n+k$\f. @@ -638,8 +630,6 @@ uint8_t *parse_ulsch_header(uint8_t * mac_header, int to_prb(int); int to_rbg(int); -int l2_init(LTE_DL_FRAME_PARMS * frame_parms, int eMBMS_active, - char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active); int mac_init(void); int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti, int harq_pid #ifdef Rel14 diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index afee163203..819523dcf8 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -29,21 +29,18 @@ */ -#include "defs.h" -#include "proto.h" -#include "extern.h" +#include "mac.h" +#include "mac_proto.h" +#include "mac_extern.h" #include "assertions.h" -#include "PHY_INTERFACE/extern.h" -#include "PHY/defs.h" -#include "SCHED/defs.h" +//#include "PHY_INTERFACE/phy_extern.h" +//#include "PHY/defs_eNB.h" +//#include "SCHED/sched_eNB.h" #include "LAYER2/PDCP_v10.1.0/pdcp.h" -#include "RRC/LITE/defs.h" +#include "RRC/LTE/rrc_defs.h" #include "UTIL/LOG/log.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" -#include "SCHED/defs.h" - - #include "common/ran_context.h" extern RAN_CONTEXT_t RC; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 2cdcfc7de8..7c2a17eff2 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -33,24 +33,21 @@ #include #include "assertions.h" -#include "PHY/defs.h" -#include "PHY/extern.h" - -#include "SCHED/defs.h" -#include "SCHED/extern.h" - -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/proto.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_proto.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "rlc.h" +#include "common/ran_context.h" + +extern RAN_CONTEXT_t RC; #define DEBUG_eNB_SCHEDULER 1 #define DEBUG_HEADER_PARSING 1 @@ -107,7 +104,7 @@ store_dlsch_buffer(module_id_t Mod_id, slice_id_t slice_id, frame_t frameP, UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_TEMPLATE *UE_template; - for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { + for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { if (UE_list->active[UE_id] != TRUE) continue; @@ -190,8 +187,8 @@ assign_rbs_required(module_id_t Mod_id, frame_t frameP, sub_frame_t subframe, uint16_t - nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX], - int min_rb_unit[MAX_NUM_CCs]) + nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + int min_rb_unit[NFAPI_CC_MAX]) { uint16_t TBS = 0; @@ -202,7 +199,7 @@ assign_rbs_required(module_id_t Mod_id, int N_RB_DL; // clear rb allocations across all CC_id - for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { + for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { if (UE_list->active[UE_id] != TRUE) continue; if (!ue_slice_membership(UE_id, slice_id)) @@ -226,7 +223,7 @@ assign_rbs_required(module_id_t Mod_id, &UE_list->eNB_UE_stats[UE_list-> ordered_CCids[i][UE_id]][UE_id]; for (j = i + 1; j < UE_list->numactiveCCs[UE_id]; j++) { - DevAssert(j < MAX_NUM_CCs); + DevAssert(j < NFAPI_CC_MAX); eNB_UE_stats_j = &UE_list-> eNB_UE_stats[UE_list->ordered_CCids[j][UE_id]][UE_id]; @@ -310,7 +307,7 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame, UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; COMMON_channels_t *cc; - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + for (CC_id = 0; CC_id < NFAPI_CC_MAX; CC_id++) { cc = &RC.mac[Mod_id]->common_channels[CC_id]; @@ -485,14 +482,14 @@ void decode_sorting_policy(module_id_t Mod_idP, slice_id_t slice_id) { void sort_UEs(module_id_t Mod_idP, slice_id_t slice_id, int frameP, sub_frame_t subframeP) { int i; - int list[NUMBER_OF_UE_MAX]; + int list[MAX_MOBILES_PER_ENB]; int list_size = 0; int rnti; struct sort_ue_dl_params params = { Mod_idP, frameP, subframeP, slice_id }; UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list; - for (i = 0; i < NUMBER_OF_UE_MAX; i++) { + for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { if (UE_list->active[i] == FALSE) continue; @@ -597,11 +594,11 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, slice_id_t slice_id, frame_t frameP, sub_frame_t subframeP, - int N_RBG[MAX_NUM_CCs], - int min_rb_unit[MAX_NUM_CCs], - uint8_t rballoc_sub[MAX_NUM_CCs][N_RBG_MAX], - uint8_t MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX], - uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]) { + int N_RBG[NFAPI_CC_MAX], + int min_rb_unit[NFAPI_CC_MAX], + uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], + uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX], + uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]) { int UE_id, CC_id; @@ -609,22 +606,22 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, rnti_t rnti; uint8_t harq_pid, round, transmission_mode; - uint8_t total_rbs_used[MAX_NUM_CCs]; - uint8_t total_ue_count[MAX_NUM_CCs]; - uint16_t average_rbs_per_user[MAX_NUM_CCs]; - uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; - uint16_t nb_rbs_required_remaining_1[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + uint8_t total_rbs_used[NFAPI_CC_MAX]; + uint8_t total_ue_count[NFAPI_CC_MAX]; + uint16_t average_rbs_per_user[NFAPI_CC_MAX]; + uint16_t nb_rbs_required_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; + uint16_t nb_rbs_required_remaining_1[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; int N_RB_DL; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_sched_ctrl *ue_sched_ctl; COMMON_channels_t *cc; - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + for (CC_id = 0; CC_id < NFAPI_CC_MAX; CC_id++) { total_ue_count[CC_id] = 0; total_rbs_used[CC_id] = 0; average_rbs_per_user[CC_id] = 0; - for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; ++UE_id) { + for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; ++UE_id) { nb_rbs_required_remaining[CC_id][UE_id] = 0; } } @@ -815,9 +812,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, transmission_mode, min_rb_unit [CC_id], - to_prb(RC.mac - [Mod_id]->common_channels - [CC_id].mib->message.dl_Bandwidth), + to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth), nb_rbs_required, nb_rbs_required_remaining, rballoc_sub, @@ -997,18 +992,18 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, slice_id_t slice_id, frame_t frameP, sub_frame_t subframeP, - int N_RBG[MAX_NUM_CCs], + int N_RBG[NFAPI_CC_MAX], int *mbsfn_flag) { int UE_id; uint8_t CC_id; uint16_t i, j; - uint8_t rballoc_sub[MAX_NUM_CCs][N_RBG_MAX]; - uint8_t MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]; // If TM5 is revisited, we can move this inside accounting + uint8_t rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX]; + uint8_t MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]; // If TM5 is revisited, we can move this inside accounting - int min_rb_unit[MAX_NUM_CCs]; - uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + int min_rb_unit[NFAPI_CC_MAX]; + uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_sched_ctrl *ue_sched_ctl; @@ -1025,14 +1020,14 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, UE_sched_ctrl *ue_sched_ctl1, *ue_sched_ctl2; #endif - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + for (CC_id = 0; CC_id < NFAPI_CC_MAX; CC_id++) { if (mbsfn_flag[CC_id] > 0) // If this CC is allocated for MBSFN skip it here continue; min_rb_unit[CC_id] = get_min_rb_unit(Mod_id, CC_id); - for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; ++UE_id) { + for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; ++UE_id) { if (UE_list->active[UE_id] != TRUE) continue; @@ -1076,7 +1071,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, #ifdef TM5 // This has to be revisited!!!! - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + for (CC_id = 0; CC_id < NFAPI_CC_MAX; CC_id++) { i1 = 0; i2 = 0; i3 = 0; @@ -1150,13 +1145,13 @@ dlsch_scheduler_pre_processor_reset(int module_idP, int frameP, int subframeP, int N_RBG, - uint16_t nb_rbs_required[MAX_NUM_CCs] - [NUMBER_OF_UE_MAX], + uint16_t nb_rbs_required[NFAPI_CC_MAX] + [MAX_MOBILES_PER_ENB], unsigned char - rballoc_sub[MAX_NUM_CCs] + rballoc_sub[NFAPI_CC_MAX] [N_RBG_MAX], unsigned char - MIMO_mode_indicator[MAX_NUM_CCs] + MIMO_mode_indicator[NFAPI_CC_MAX] [N_RBG_MAX]) { int i, j; @@ -1338,17 +1333,10 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id, int transmission_mode, int min_rb_unit, uint8_t N_RB_DL, - uint16_t - nb_rbs_required[MAX_NUM_CCs] - [NUMBER_OF_UE_MAX], - uint16_t - nb_rbs_required_remaining - [MAX_NUM_CCs] - [NUMBER_OF_UE_MAX], unsigned char - rballoc_sub[MAX_NUM_CCs] - [N_RBG_MAX], unsigned char - MIMO_mode_indicator - [MAX_NUM_CCs][N_RBG_MAX]) + uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + uint16_t nb_rbs_required_remaining[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + unsigned char rballoc_sub[NFAPI_CC_MAX][N_RBG_MAX], + unsigned char MIMO_mode_indicator[NFAPI_CC_MAX][N_RBG_MAX]) { int i; @@ -1418,11 +1406,11 @@ ulsch_scheduler_pre_processor(module_id_t module_idP, int16_t i; uint16_t UE_id, n, r; uint8_t CC_id, harq_pid; - uint16_t nb_allocated_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX], - total_allocated_rbs[MAX_NUM_CCs], - average_rbs_per_user[MAX_NUM_CCs]; - int16_t total_remaining_rbs[MAX_NUM_CCs]; - uint16_t total_ue_count[MAX_NUM_CCs]; + uint16_t nb_allocated_rbs[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], + total_allocated_rbs[NFAPI_CC_MAX], + average_rbs_per_user[NFAPI_CC_MAX]; + int16_t total_remaining_rbs[NFAPI_CC_MAX]; + uint16_t total_ue_count[NFAPI_CC_MAX]; rnti_t rnti = -1; UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; UE_TEMPLATE *UE_template = 0; @@ -1440,7 +1428,7 @@ ulsch_scheduler_pre_processor(module_id_t module_idP, // we need to distribute RBs among UEs // step1: reset the vars - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + for (CC_id = 0; CC_id < NFAPI_CC_MAX; CC_id++) { total_allocated_rbs[CC_id] = 0; total_remaining_rbs[CC_id] = 0; average_rbs_per_user[CC_id] = 0; @@ -1613,7 +1601,7 @@ ulsch_scheduler_pre_processor(module_id_t module_idP, /* this logging is wrong, ue_sched_ctl may not be valid here * TODO: fix */ - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { + for (CC_id = 0; CC_id < NFAPI_CC_MAX; CC_id++) { if (total_allocated_rbs[CC_id] > 0) { LOG_D(MAC, "[eNB %d] total RB allocated for all UEs = %d/%d\n", @@ -1644,7 +1632,7 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_id, int frameP, int Ncp; int N_RB_UL; - for (i = 0; i < NUMBER_OF_UE_MAX; i++) { + for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { if (UE_list->active[i] != TRUE) continue; @@ -1672,14 +1660,14 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_id, int frameP, // This is the actual CC_id in the list CC_id = UE_list->ordered_ULCCids[n][UE_id]; - if (CC_id >= MAX_NUM_CCs) { + if (CC_id >= NFAPI_CC_MAX) { LOG_E(MAC, "CC_id %u should be < %u, loop n=%u < numactiveULCCs[%u]=%u", - CC_id, MAX_NUM_CCs, n, UE_id, UE_list->numactiveULCCs[UE_id]); + CC_id, NFAPI_CC_MAX, n, UE_id, UE_list->numactiveULCCs[UE_id]); } - AssertFatal(CC_id < MAX_NUM_CCs, + AssertFatal(CC_id < NFAPI_CC_MAX, "CC_id %u should be < %u, loop n=%u < numactiveULCCs[%u]=%u", - CC_id, MAX_NUM_CCs, n, UE_id, + CC_id, NFAPI_CC_MAX, n, UE_id, UE_list->numactiveULCCs[UE_id]); UE_template = &UE_list->UE_template[CC_id][UE_id]; @@ -1841,14 +1829,14 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP) { int i; - int list[NUMBER_OF_UE_MAX]; + int list[MAX_MOBILES_PER_ENB]; int list_size = 0; int rnti; struct sort_ue_ul_params params = { module_idP, frameP, subframeP }; UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; - for (i = 0; i < NUMBER_OF_UE_MAX; i++) { + for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { if (UE_list->active[i] == FALSE) continue; if ((rnti = UE_RNTI(module_idP, i)) == NOT_A_RNTI) diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index 6261eaf356..68183f2f89 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -28,10 +28,10 @@ */ -#include "defs.h" -#include "proto.h" -#include "extern.h" -#include "SIMULATION/TOOLS/defs.h" +#include "mac.h" +#include "mac_proto.h" +#include "mac_extern.h" +#include "SIMULATION/TOOLS/sim.h" #include "UTIL/LOG/log.h" #include "OCG.h" #include "OCG_extern.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 00557ce7e0..ea67a660ae 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -36,8 +36,8 @@ #include "pdcp_util.h" #include "pdcp_sequence_manager.h" #include "LAYER2/RLC/rlc.h" -#include "LAYER2/MAC/extern.h" -#include "RRC/LITE/proto.h" +#include "LAYER2/MAC/mac_extern.h" +#include "RRC/LTE/rrc_proto.h" #include "pdcp_primitives.h" #include "OCG.h" #include "OCG_extern.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index 2de1b3fc74..8f1bc7898a 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -46,10 +46,10 @@ extern int otg_enabled; #define rtf_put write #define rtf_get read -#include "../MAC/extern.h" +#include "../MAC/mac_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "NETWORK_DRIVER/LITE/constant.h" -#include "SIMULATION/ETH_TRANSPORT/extern.h" +//#include "SIMULATION/ETH_TRANSPORT/extern.h" #include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG_extern.h" #include "UTIL/LOG/log.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c index 0df8e59e6d..f0b15d9888 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c @@ -55,7 +55,7 @@ #include "UTIL/LOG/log.h" #include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG_extern.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "pdcp.h" #include "pdcp_primitives.h" diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c index 2554eb145a..2c29053297 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c @@ -34,7 +34,7 @@ #include "UTIL/LOG/vcd_signal_dumper.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "pdcp.h" #include "msc.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index 0e21d5cfac..34c9baf537 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -37,7 +37,7 @@ #include "mac_primitives.h" #include "rlc_primitives.h" #include "list.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UL-AM-RLC.h" #include "DL-AM-RLC.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.c index a133ce0992..996dd96f35 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.c @@ -30,7 +30,7 @@ #define RLC_AM_IN_SDU_C 1 //----------------------------------------------------------------------------- #include "rlc_am.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #define TRACE_RLC_AM_FREE_SDU 0 diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c index 01a635656e..0b0a55bd2b 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c @@ -24,7 +24,7 @@ #include //----------------------------------------------------------------------------- #include "rlc_am.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" //----------------------------------------------------------------------------- void diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c index d0b5b52395..83b0dfd46b 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c @@ -30,7 +30,7 @@ #include "rlc.h" #include "rlc_am.h" #include "list.h" -#include "LAYER2/MAC/extern.h" +//#include "LAYER2/MAC/extern.h" #include "UTIL/LOG/log.h" #include "msc.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c index b1facdfb02..be4b43d1a0 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c @@ -28,7 +28,7 @@ #include "rlc.h" #include "rlc_am.h" #include "list.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c index 9e1db8a95b..42e8498623 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c @@ -26,7 +26,7 @@ //----------------------------------------------------------------------------- #include "rlc_am.h" #include "rlc.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "msc.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c index dc1ed21163..c0ce57708b 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c @@ -27,7 +27,7 @@ #include "assertions.h" #include "list.h" #include "rlc_am.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c index c16e897bb6..fe99e137a4 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c @@ -29,7 +29,7 @@ #include "msc.h" #include "list.h" #include "rlc_am.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c index 092c7c65f1..3ace3cc51f 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c @@ -32,7 +32,6 @@ #include "assertions.h" #include "list.h" #include "rlc_am.h" -#include "LAYER2/MAC/extern.h" #include "UTIL/LOG/log.h" # if ENABLE_ITTI diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c index 0b88e7c650..1e3b8b916d 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c @@ -27,7 +27,7 @@ #include "platform_constants.h" //----------------------------------------------------------------------------- #include "rlc_am.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "msc.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c index b9383980a4..fd0feceeb0 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c @@ -26,7 +26,7 @@ #include "platform_constants.h" //----------------------------------------------------------------------------- #include "rlc_am.h" -# include "LAYER2/MAC/extern.h" +# include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "msc.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c index 13d4205c28..84c0edbefd 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c @@ -26,7 +26,7 @@ #include "platform_constants.h" //----------------------------------------------------------------------------- #include "rlc_am.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "msc.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c index ee2ff57c1e..23a4d0eb04 100644 --- a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c +++ b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.c @@ -29,7 +29,7 @@ #include "mac_primitives.h" #include "rlc_primitives.h" #include "list.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" //----------------------------------------------------------------------------- void rlc_tm_send_sdu ( diff --git a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.c b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.c index 15dc90f175..70c1f37221 100644 --- a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.c +++ b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.c @@ -23,7 +23,7 @@ #define RLC_TM_INIT_C 1 //----------------------------------------------------------------------------- #include "rlc_tm.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" //----------------------------------------------------------------------------- void config_req_rlc_tm ( const protocol_ctxt_t* const ctxt_pP, diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c index 7bd0da83a9..0be2ef1686 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c @@ -35,7 +35,7 @@ #include "list.h" #include "rlc_primitives.h" #include "mac_primitives.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c index 4e2723a8f4..2561ff81be 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c @@ -28,7 +28,7 @@ #include "rlc_primitives.h" #include "list.h" #include "rrm_config_structs.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "rlc_um_control_primitives.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_fsm.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_fsm.c index 758630b3cc..bc61ed302e 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_fsm.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_fsm.c @@ -24,7 +24,7 @@ #include "platform_types.h" //----------------------------------------------------------------------------- #include "rlc_um.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c index 91e1ba66d1..65aaadb9fa 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c @@ -33,7 +33,7 @@ #include "rlc_um.h" #include "rlc_primitives.h" #include "list.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "msc.h" diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c index 783441bd58..4f7e4812e9 100644 --- a/openair2/LAYER2/RLC/rlc.c +++ b/openair2/LAYER2/RLC/rlc.c @@ -29,7 +29,7 @@ #define RLC_C #include "rlc.h" #include "mem_block.h" -#include "../MAC/extern.h" +#include "../MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/OCG/OCG_vars.h" #include "UTIL/LOG/vcd_signal_dumper.h" diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h index b33c47b559..b70583e51b 100644 --- a/openair2/LAYER2/RLC/rlc.h +++ b/openair2/LAYER2/RLC/rlc.h @@ -174,7 +174,7 @@ typedef struct { //----------------------------------------------------------------------------- #define RLC_MAX_MBMS_LC (maxSessionPerPMCH * maxServiceCount) -#define RLC_MAX_LC ((max_val_DRB_Identity+1)* NUMBER_OF_UE_MAX) +#define RLC_MAX_LC ((max_val_DRB_Identity+1)* MAX_MOBILES_PER_ENB) protected_rlc(void (*rlc_rrc_data_ind)( const protocol_ctxt_t* const ctxtP, @@ -236,8 +236,8 @@ typedef struct rlc_mbms_id_s { #endif //public_rlc(rlc_mbms_t rlc_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h //public_rlc(rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h -public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[NUMBER_OF_UE_MAX][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h -public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[NUMBER_OF_eNB_MAX][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h +public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[MAX_MOBILES_PER_ENB][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h +public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h #define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD] ; @@ -253,8 +253,8 @@ public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[NUMBER_OF_e rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD] = lOG_cH_iD; \ } while (0); -public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_ue [NUMBER_OF_UE_MAX][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ -public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_eNB[NUMBER_OF_eNB_MAX][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ +public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_ue [MAX_MOBILES_PER_ENB][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ +public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ #define RLC_COLL_KEY_VALUE(eNB_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \ diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c index 497937d073..ded682ee7c 100644 --- a/openair2/LAYER2/RLC/rlc_mac.c +++ b/openair2/LAYER2/RLC/rlc_mac.c @@ -30,7 +30,7 @@ //----------------------------------------------------------------------------- #define RLC_MAC_C #include "rlc.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/OCG/OCG_vars.h" #include "hashtable.h" diff --git a/openair2/LAYER2/RLC/rlc_rrc.c b/openair2/LAYER2/RLC/rlc_rrc.c index dee6ba7000..5dd1d82279 100644 --- a/openair2/LAYER2/RLC/rlc_rrc.c +++ b/openair2/LAYER2/RLC/rlc_rrc.c @@ -43,7 +43,7 @@ #include "PMCH-InfoList-r9.h" #endif -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "assertions.h" //----------------------------------------------------------------------------- rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index f66d1142ab..0c884a806c 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -32,8 +32,8 @@ #include #include "LAYER2/RLC/rlc.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/PDCP_v10.1.0/pdcp.h" #include "UTIL/LOG/log.h" #include "common/ran_context.h" diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index d0b8e57558..6d9fe013a5 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -1,8 +1,8 @@ -#include "openair1/PHY/defs.h" +#include "openair1/PHY/defs_eNB.h" #include "openair2/PHY_INTERFACE/IF_Module.h" -#include "openair1/PHY/extern.h" -#include "LAYER2/MAC/extern.h" -#include "LAYER2/MAC/proto.h" +#include "openair1/PHY/phy_extern.h" +#include "LAYER2/MAC/mac_extern.h" +#include "LAYER2/MAC/mac_proto.h" #include "common/ran_context.h" #define MAX_IF_MODULES 100 diff --git a/openair2/PHY_INTERFACE/extern.h b/openair2/PHY_INTERFACE/phy_interface_extern.h similarity index 100% rename from openair2/PHY_INTERFACE/extern.h rename to openair2/PHY_INTERFACE/phy_interface_extern.h diff --git a/openair2/PHY_INTERFACE/vars.h b/openair2/PHY_INTERFACE/phy_interface_vars.h similarity index 98% rename from openair2/PHY_INTERFACE/vars.h rename to openair2/PHY_INTERFACE/phy_interface_vars.h index 566f4347b6..5f205d3024 100644 --- a/openair2/PHY_INTERFACE/vars.h +++ b/openair2/PHY_INTERFACE/phy_interface_vars.h @@ -23,7 +23,7 @@ #define __PHY_INTERFACE_VARS_H__ //#include "SIMULATION/PHY_EMULATION/spec_defs.h" -#include "defs.h" +#include "phy_interface.h" #ifdef PHY_EMUL #include "SIMULATION/PHY_EMULATION/DEVICE_DRIVER/defs.h" diff --git a/openair2/RRC/LTE/L2_interface.c b/openair2/RRC/LTE/L2_interface.c index 91834d9c9d..b21cf77f4d 100644 --- a/openair2/RRC/LTE/L2_interface.c +++ b/openair2/RRC/LTE/L2_interface.c @@ -29,26 +29,14 @@ */ #include "platform_types.h" -//#include "openair_defs.h" -//#include "openair_proto.h" -#include "defs.h" -#include "extern.h" -//#include "mac_lchan_interface.h" -//#include "openair_rrc_utils.h" -//#include "openair_rrc_main.h" +#include "rrc_defs.h" +#include "rrc_extern.h" #include "UTIL/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" #include "msc.h" #include "common/ran_context.h" -#ifdef PHY_EMUL -#include "SIMULATION/simulation_defs.h" -extern EMULATION_VARS *Emul_vars; -extern eNB_MAC_INST *eNB_mac_inst; -extern UE_MAC_INST *UE_mac_inst; -#endif - #if defined(ENABLE_ITTI) # include "intertask_interface.h" #endif diff --git a/openair2/RRC/LTE/L2_interface_common.c b/openair2/RRC/LTE/L2_interface_common.c index 1b83252152..d72cc2f5be 100644 --- a/openair2/RRC/LTE/L2_interface_common.c +++ b/openair2/RRC/LTE/L2_interface_common.c @@ -29,26 +29,14 @@ */ #include "platform_types.h" -//#include "openair_defs.h" -//#include "openair_proto.h" -#include "defs.h" -#include "extern.h" -//#include "mac_lchan_interface.h" -//#include "openair_rrc_utils.h" -//#include "openair_rrc_main.h" +#include "rrc_defs.h" +#include "rrc_extern.h" #include "UTIL/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" #include "msc.h" #include "common/ran_context.h" -#ifdef PHY_EMUL -#include "SIMULATION/simulation_defs.h" -extern EMULATION_VARS *Emul_vars; -extern eNB_MAC_INST *eNB_mac_inst; -extern UE_MAC_INST *UE_mac_inst; -#endif - #if defined(ENABLE_ITTI) # include "intertask_interface.h" #endif diff --git a/openair2/RRC/LTE/L2_interface_ue.c b/openair2/RRC/LTE/L2_interface_ue.c index 244f0d2253..856ba96174 100644 --- a/openair2/RRC/LTE/L2_interface_ue.c +++ b/openair2/RRC/LTE/L2_interface_ue.c @@ -29,13 +29,8 @@ */ #include "platform_types.h" -//#include "openair_defs.h" -//#include "openair_proto.h" -#include "defs.h" -#include "extern.h" -//#include "mac_lchan_interface.h" -//#include "openair_rrc_utils.h" -//#include "openair_rrc_main.h" +#include "rrc_defs.h" +#include "rrc_extern.h" #include "UTIL/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 77ba0c4cad..6c7e6e4ead 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -57,8 +57,8 @@ //#define MRB1 1 #endif -#include "RRC/LITE/defs.h" -#include "RRC/LITE/extern.h" +#include "RRC/LTE/rrc_defs.h" +#include "RRC/LTE/rrc_extern.h" #include "RRCConnectionSetupComplete.h" #include "RRCConnectionReconfigurationComplete.h" #include "RRCConnectionReconfiguration.h" @@ -71,7 +71,7 @@ #include "BCCH-DL-SCH-Message.h" -#include "PHY/defs.h" +//#include "PHY/defs.h" #include "MeasObjectToAddModList.h" #include "ReportConfigToAddModList.h" diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.h b/openair2/RRC/LTE/MESSAGES/asn1_msg.h index 05396bf727..0dad83f1a6 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.h @@ -39,7 +39,7 @@ #include #include /* for _ASN_DEFAULT_STACK_MAX */ -#include "RRC/LITE/defs.h" +#include "RRC/LTE/rrc_defs.h" /* * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c index 43721bbfd5..2d91828861 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c @@ -53,7 +53,7 @@ #include "RRCConnectionSetup-NB.h" #include "SRB-ToAddModList-NB-r13.h" #include "DRB-ToAddModList-NB-r13.h" -#include "RRC/LITE/defs_NB_IoT.h" +#include "RRC/LTE/defs_NB_IoT.h" #include "RRCConnectionSetupComplete-NB.h" #include "RRCConnectionReconfigurationComplete-NB.h" #include "RRCConnectionReconfiguration-NB.h" diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 3edf230ac2..4c07b9ec7a 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -34,16 +34,15 @@ #include "assertions.h" #include "hashtable.h" #include "asn1_conversions.h" -#include "defs.h" -#include "PHY/TOOLS/dB_routines.h" -#include "extern.h" +#include "rrc_defs.h" +#include "rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "LAYER2/RLC/rlc.h" #include "COMMON/mac_rrc_primitives.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #ifndef CELLULAR -#include "RRC/LITE/MESSAGES/asn1_msg.h" +#include "RRC/LTE/MESSAGES/asn1_msg.h" #endif #include "RRCConnectionRequest.h" #include "RRCConnectionReconfiguration.h" @@ -80,7 +79,7 @@ # include "intertask_interface.h" #endif -#include "SIMULATION/TOOLS/defs.h" // for taus +#include "SIMULATION/TOOLS/sim.h" // for taus #ifdef PHY_EMUL @@ -94,7 +93,7 @@ extern void *bigphys_malloc(int); //#define XER_PRINT -//extern int8_t dB_fixed2(uint32_t x,uint32_t y); + extern void pdcp_config_set_security( const protocol_ctxt_t* const ctxt_pP, diff --git a/openair2/RRC/LTE/rrc_common.c b/openair2/RRC/LTE/rrc_common.c index a6a2bbb613..0acb0d7701 100644 --- a/openair2/RRC/LTE/rrc_common.c +++ b/openair2/RRC/LTE/rrc_common.c @@ -28,9 +28,9 @@ * \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr */ -#include "defs.h" -#include "extern.h" -#include "LAYER2/MAC/extern.h" +#include "rrc_defs.h" +#include "rrc_extern.h" +#include "LAYER2/MAC/mac_extern.h" #include "COMMON/openair_defs.h" #include "COMMON/platform_types.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" @@ -43,10 +43,6 @@ #include "rrc_eNB_UE_context.h" #include "common/ran_context.h" -#ifdef LOCALIZATION -#include -#endif - #define DEBUG_RRC 1 extern RAN_CONTEXT_t RC; extern UE_MAC_INST *UE_mac_inst; @@ -61,33 +57,6 @@ rrc_init_global_param( //----------------------------------------------------------------------------- { - // Rrc_xface = (RRC_XFACE*)malloc16(sizeof(RRC_XFACE)); - - // Rrc_xface->openair_rrc_top_init = openair_rrc_top_init; - // Rrc_xface->openair_rrc_eNB_init = openair_rrc_eNB_init; - // Rrc_xface->openair_rrc_UE_init = openair_rrc_ue_init; - // Rrc_xface->mac_rrc_data_ind = mac_rrc_data_ind; - //Rrc_xface->mac_rrc_data_req = mac_rrc_data_req; - // Rrc_xface->rrc_data_indP = (void *)rlcrrc_data_ind; - // Rrc_xface->rrc_rx_tx = rrc_rx_tx; - // Rrc_xface->mac_rrc_meas_ind = mac_rrc_meas_ind; - // Rrc_xface->get_rrc_status = get_rrc_status; - - //Rrc_xface->rrc_get_status = ... - - // Mac_rlc_xface->mac_out_of_sync_ind=mac_out_of_sync_ind; - -#ifndef NO_RRM - // Rrc_xface->fn_rrc=fn_rrc; -#endif - // LOG_D(RRC, "[RRC]INIT_GLOBAL_PARAM: Mac_rlc_xface %p, rrc_rlc_register %p,rlcrrc_data_ind%p\n",Mac_rlc_xface,Mac_rlc_xface->rrc_rlc_register_rrc,rlcrrc_data_ind); - /* - if((Mac_rlc_xface==NULL) || (Mac_rlc_xface->rrc_rlc_register_rrc==NULL) || - (rlcrrc_data_ind==NULL)) { - LOG_E(RRC,"Data structured is not initialized \n"); - return -1; - } - */ rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc DCCH_LCHAN_DESC.transport_block_size = 4; diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 9faa686ef6..3fd2b8d79d 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -30,17 +30,17 @@ #define RRC_ENB #define RRC_ENB_C -#include "defs.h" -#include "extern.h" +#include "rrc_defs.h" +#include "rrc_extern.h" #include "assertions.h" #include "common/ran_context.h" #include "asn1_conversions.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" #include "LAYER2/RLC/rlc.h" -#include "LAYER2/MAC/proto.h" +#include "LAYER2/MAC/mac_proto.h" #include "UTIL/LOG/log.h" #include "COMMON/mac_rrc_primitives.h" -#include "RRC/LITE/MESSAGES/asn1_msg.h" +#include "RRC/LTE/MESSAGES/asn1_msg.h" #include "RRCConnectionRequest.h" #include "RRCConnectionReestablishmentRequest.h" //#include "ReestablishmentCause.h" @@ -52,7 +52,6 @@ #include "TDD-Config.h" #include "HandoverCommand.h" #include "rlc.h" -#include "SIMULATION/ETH_TRANSPORT/extern.h" #include "rrc_eNB_UE_context.h" #include "platform_types.h" #include "msc.h" @@ -93,7 +92,7 @@ # include "rrc_eNB_ral.h" #endif -#include "SIMULATION/TOOLS/defs.h" // for taus +#include "SIMULATION/TOOLS/sim.h" // for taus //#define XER_PRINT diff --git a/openair2/RRC/LTE/rrc_vars.h b/openair2/RRC/LTE/rrc_vars.h index e3bab5f5eb..089cb02d5b 100644 --- a/openair2/RRC/LTE/rrc_vars.h +++ b/openair2/RRC/LTE/rrc_vars.h @@ -19,7 +19,7 @@ * contact@openairinterface.org */ -/*! \file vars.hles +/*! \file rrc_vars.h * \brief rrc variables * \author Raymond Knopp and Navid Nikaein * \date 2013 @@ -31,15 +31,15 @@ #ifndef __OPENAIR_RRC_VARS_H__ #define __OPENAIR_RRC_VARS_H__ -#include "defs.h" +#include "rrc_defs.h" #include "LAYER2/RLC/rlc.h" #include "COMMON/mac_rrc_primitives.h" -#include "LAYER2/MAC/defs.h" +#include "LAYER2/MAC/mac.h" UE_PF_PO_t UE_PF_PO[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; pthread_mutex_t ue_pf_po_mutex; UE_RRC_INST *UE_rrc_inst; -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac_extern.h" #define MAX_U32 0xFFFFFFFF uint8_t DRB2LCHAN[8]; diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c index 1efe6f73eb..70d29af252 100644 --- a/targets/COMMON/create_tasks.c +++ b/targets/COMMON/create_tasks.c @@ -36,7 +36,7 @@ # include "lteRALue.h" # include "lteRALenb.h" # endif -# include "RRC/LITE/defs.h" +# include "RRC/LTE/rrc_defs.h" # endif # include "enb_app.h" diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index e1c5d10de5..a4bb8cfd60 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -44,7 +44,12 @@ #include "PHY/types.h" -#include "PHY/defs.h" +#include "PHY/INIT/phy_init.h" + +#include "PHY/defs_eNB.h" +#include "SCHED/sched_eNB.h" +#include "PHY/LTE_TRANSPORT/transport_proto.h" + #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all @@ -55,22 +60,14 @@ #include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h" -#include "PHY/extern.h" -#include "SCHED/extern.h" -#include "LAYER2/MAC/extern.h" +#include "PHY/phy_extern.h" -#include "../../SIMU/USER/init_lte.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/extern.h" -#include "LAYER2/MAC/proto.h" -#include "RRC/LITE/extern.h" -#include "PHY_INTERFACE/extern.h" -#include "PHY_INTERFACE/defs.h" -#ifdef SMBV -#include "PHY/TOOLS/smbv.h" -unsigned short config_frames[4] = {2,9,11,13}; -#endif +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_extern.h" +#include "LAYER2/MAC/mac_proto.h" +#include "RRC/LTE/rrc_extern.h" +#include "PHY_INTERFACE/phy_interface.h" #include "UTIL/LOG/log_extern.h" #include "UTIL/OTG/otg_tx.h" #include "UTIL/OTG/otg_externs.h" @@ -78,7 +75,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "enb_config.h" -//#include "PHY/TOOLS/time_meas.h" + #ifndef OPENAIR2 #include "UTIL/OTG/otg_extern.h" @@ -218,7 +215,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam // UE-specific RX processing for subframe n if (nfapi_mode == 0 || nfapi_mode == 1) { - phy_procedures_eNB_uespec_RX(eNB, proc, no_relay ); + phy_procedures_eNB_uespec_RX(eNB, proc); } pthread_mutex_lock(&eNB->UL_INFO_mutex); @@ -241,7 +238,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam if (oai_exit) return(-1); - phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1); + phy_procedures_eNB_TX(eNB, proc, 1); stop_meas( &softmodem_stats_rxtx_sf ); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index d9bda6a037..8b025336b0 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -60,7 +60,7 @@ #include "PHY/types.h" -#include "PHY/defs.h" +#include "PHY/defs_common.h" #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all @@ -70,22 +70,16 @@ #include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h" -#include "PHY/extern.h" -#include "SCHED/extern.h" -#include "LAYER2/MAC/extern.h" +#include "PHY/phy_extern.h" +#include "LAYER2/MAC/mac_extern.h" -#include "../../SIMU/USER/init_lte.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/extern.h" -#include "LAYER2/MAC/proto.h" -#include "RRC/LITE/extern.h" -#include "PHY_INTERFACE/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_extern.h" +#include "LAYER2/MAC/mac_proto.h" +#include "RRC/LTE/rrc_extern.h" +#include "PHY_INTERFACE/phy_interface.h" -#ifdef SMBV -#include "PHY/TOOLS/smbv.h" -unsigned short config_frames[4] = {2,9,11,13}; -#endif #include "UTIL/LOG/log_extern.h" #include "UTIL/OTG/otg_tx.h" #include "UTIL/OTG/otg_externs.h" diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 676ea89884..c48b89ea13 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -47,7 +47,7 @@ #include "PHY/types.h" -#include "PHY/defs.h" +#include "PHY/defs_eNB.h" #include "common/ran_context.h" #include "common/config/config_userapi.h" #include "common/utils/load_module_shlib.h" @@ -59,17 +59,14 @@ //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all -#include "PHY/vars.h" -#include "SCHED/vars.h" -#include "LAYER2/MAC/vars.h" +#include "PHY/phy_vars.h" +#include "SCHED/sched_common_vars.h" +#include "LAYER2/MAC/mac_vars.h" -#include "../../SIMU/USER/init_lte.h" - -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/vars.h" -#include "LAYER2/MAC/proto.h" -#include "RRC/LITE/vars.h" -#include "PHY_INTERFACE/vars.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_proto.h" +#include "RRC/LTE/rrc_vars.h" +#include "PHY_INTERFACE/phy_interface_vars.h" #ifdef SMBV #include "PHY/TOOLS/smbv.h" diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index f1f66d8869..9de60c37c2 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -29,6 +29,7 @@ #include "msc.h" #include "PHY/types.h" #include "PHY/defs_eNB.h" +#include "PHY/defs_UE.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" #include "flexran_agent.h" diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c index c1e5996d44..497fdb1f46 100644 --- a/targets/RT/USER/rt_wrapper.c +++ b/targets/RT/USER/rt_wrapper.c @@ -44,7 +44,7 @@ #include #include "rt_wrapper.h" -#include "openair1/PHY/defs.h" +#include "openair1/PHY/defs_common.h" static int latency_target_fd = -1; static int32_t latency_target_value = 0; diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c index 0818629727..13b9026640 100644 --- a/targets/SIMU/USER/init_lte.c +++ b/targets/SIMU/USER/init_lte.c @@ -29,12 +29,12 @@ #include "init_lte.h" -#include "PHY/extern.h" +#include "PHY/phy_extern.h" -#include "LAYER2/MAC/defs.h" -#include "LAYER2/MAC/extern.h" +#include "LAYER2/MAC/mac.h" +#include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log_if.h" -#include "PHY_INTERFACE/extern.h" +#include "PHY_INTERFACE/phy_interface.h" /*