enb_config.h 9.19 KB
Newer Older
1
/*******************************************************************************
nikaeinn's avatar
nikaeinn committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom

    OpenAirInterface is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.


    OpenAirInterface is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with OpenAirInterface.The full GNU General Public License is
   included in this distribution in the file called "COPYING". If not,
   see <http://www.gnu.org/licenses/>.

  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
  OpenAirInterface Dev  : openair4g-devel@eurecom.fr

ghaddab's avatar
ghaddab committed
26
  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
nikaeinn's avatar
nikaeinn committed
27

28
*******************************************************************************/
nikaeinn's avatar
nikaeinn committed
29

gauthier's avatar
gauthier committed
30 31 32
/*
                                enb_config.h
                             -------------------
33
  AUTHOR  : Lionel GAUTHIER, Navid Nikaein, Laurent Winckel
gauthier's avatar
gauthier committed
34
  COMPANY : EURECOM
35
  EMAIL   : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr
gauthier's avatar
gauthier committed
36
*/
37 38 39

#ifndef ENB_CONFIG_H_
#define ENB_CONFIG_H_
nikaeinn's avatar
nikaeinn committed
40
#include  <netinet/in.h>
41 42

#include "commonDef.h"
43
#include "platform_types.h"
nikaeinn's avatar
nikaeinn committed
44
#include "platform_constants.h"
45
#include "PHY/impl_defs_lte.h"
46
#include "s1ap_messages_types.h"
47
#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
48

49 50 51
// Hard to find a defined value for max enb...
#define MAX_ENB 16

gauthier's avatar
gauthier committed
52 53 54 55 56 57 58 59
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
            struct in_addr inp;\
            if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\
                AssertFatal (0, MeSsAgE);\
            } else {\
                NwBo = inp.s_addr;\
            }\
        } while (0);
60

61 62 63 64 65 66 67 68 69 70 71 72 73
typedef struct mme_ip_address_s {
    unsigned  ipv4:1;
    unsigned  ipv6:1;
    unsigned  active:1;
    char     *ipv4_address;
    char     *ipv6_address;
} mme_ip_address_t;

typedef struct Enb_properties_s {
    /* Unique eNB_id to identify the eNB within EPC.
     * For macro eNB ids this field should be 20 bits long.
     * For home eNB ids this field should be 28 bits long.
     */
74
    uint32_t            eNB_id;
75 76

    /* The type of the cell */
77
    enum cell_type_e    cell_type;
78 79 80 81 82

    /* Optional name for the cell
     * NOTE: the name can be NULL (i.e no name) and will be cropped to 150
     * characters.
     */
83
    char               *eNB_name;
84 85

    /* Tracking area code */
86
    uint16_t            tac;
87 88 89 90

    /* Mobile Country Code
     * Mobile Network Code
     */
91 92
    uint16_t            mcc;
    uint16_t            mnc;
nikaeinn's avatar
nikaeinn committed
93
    uint8_t             mnc_digit_length;
94

95

96 97

    /* Physical parameters */
98
  int16_t                 nb_cc;
99 100 101 102 103 104 105 106 107 108 109 110
  lte_frame_type_t        frame_type[1+MAX_NUM_CCs];
  uint8_t                 tdd_config[1+MAX_NUM_CCs];
  uint8_t                 tdd_config_s[1+MAX_NUM_CCs];
  lte_prefix_type_t       prefix_type[1+MAX_NUM_CCs];
  int16_t                 eutra_band[1+MAX_NUM_CCs];
  uint64_t                downlink_frequency[1+MAX_NUM_CCs];
  int32_t                 uplink_frequency_offset[1+MAX_NUM_CCs];

  int16_t                 Nid_cell[1+MAX_NUM_CCs];// for testing, change later
  int16_t                 N_RB_DL[1+MAX_NUM_CCs];// for testing, change later
  int	                  nb_antennas_tx[1+MAX_NUM_CCs];   
  int                     nb_antennas_rx[1+MAX_NUM_CCs];   
knopp's avatar
knopp committed
111 112
  int	                  tx_gain[1+MAX_NUM_CCs];   
  int                     rx_gain[1+MAX_NUM_CCs];   
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
  long                    prach_root[1+MAX_NUM_CCs];   
  long                    prach_config_index[1+MAX_NUM_CCs]; 
  BOOLEAN_t               prach_high_speed[1+MAX_NUM_CCs]; 
  long                    prach_zero_correlation[1+MAX_NUM_CCs]; 
  long                    prach_freq_offset[1+MAX_NUM_CCs]; 
  long                    pucch_delta_shift[1+MAX_NUM_CCs]; 
  long                    pucch_nRB_CQI[1+MAX_NUM_CCs]; 
  long                    pucch_nCS_AN[1+MAX_NUM_CCs];
#ifndef Rel10 
  long                    pucch_n1_AN[1+MAX_NUM_CCs]; 
#endif
  long                    pdsch_referenceSignalPower[1+MAX_NUM_CCs]; 
  long                    pdsch_p_b[1+MAX_NUM_CCs]; 
  long                    pusch_n_SB[1+MAX_NUM_CCs];
  long                    pusch_hoppingMode[1+MAX_NUM_CCs];
  long                    pusch_hoppingOffset[1+MAX_NUM_CCs];
  BOOLEAN_t               pusch_enable64QAM[1+MAX_NUM_CCs]; 
  BOOLEAN_t               pusch_groupHoppingEnabled[1+MAX_NUM_CCs]; 
  long                    pusch_groupAssignment[1+MAX_NUM_CCs]; 
  BOOLEAN_t               pusch_sequenceHoppingEnabled[1+MAX_NUM_CCs]; 
  long                    pusch_nDMRS1[1+MAX_NUM_CCs]; 
  long                    phich_duration[1+MAX_NUM_CCs]; 
  long                    phich_resource[1+MAX_NUM_CCs]; 
  BOOLEAN_t               srs_enable[1+MAX_NUM_CCs]; 
  long                    srs_BandwidthConfig[1+MAX_NUM_CCs]; 
  long                    srs_SubframeConfig[1+MAX_NUM_CCs]; 
  BOOLEAN_t               srs_ackNackST[1+MAX_NUM_CCs]; 
  BOOLEAN_t               srs_MaxUpPts[1+MAX_NUM_CCs]; 
  long                    pusch_p0_Nominal[1+MAX_NUM_CCs]; 
  long                    pusch_alpha[1+MAX_NUM_CCs]; 
  long                    pucch_p0_Nominal[1+MAX_NUM_CCs]; 
  long                    msg3_delta_Preamble[1+MAX_NUM_CCs]; 
  long                    ul_CyclicPrefixLength[1+MAX_NUM_CCs];
  e_DeltaFList_PUCCH__deltaF_PUCCH_Format1                    pucch_deltaF_Format1[1+MAX_NUM_CCs]; 
  e_DeltaFList_PUCCH__deltaF_PUCCH_Format1b                   pucch_deltaF_Format1b[1+MAX_NUM_CCs]; 
  e_DeltaFList_PUCCH__deltaF_PUCCH_Format2                    pucch_deltaF_Format2[1+MAX_NUM_CCs]; 
  e_DeltaFList_PUCCH__deltaF_PUCCH_Format2a                   pucch_deltaF_Format2a[1+MAX_NUM_CCs]; 
  e_DeltaFList_PUCCH__deltaF_PUCCH_Format2b                   pucch_deltaF_Format2b[1+MAX_NUM_CCs]; 
  long                    rach_numberOfRA_Preambles[1+MAX_NUM_CCs]; 
  BOOLEAN_t               rach_preamblesGroupAConfig[1+MAX_NUM_CCs];
  long	                  rach_sizeOfRA_PreamblesGroupA[1+MAX_NUM_CCs];
  long	                  rach_messageSizeGroupA[1+MAX_NUM_CCs];
  e_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB	                  rach_messagePowerOffsetGroupB[1+MAX_NUM_CCs];
  long                    rach_powerRampingStep[1+MAX_NUM_CCs]; 
  long                    rach_preambleInitialReceivedTargetPower[1+MAX_NUM_CCs]; 
  long                    rach_preambleTransMax[1+MAX_NUM_CCs]; 
  long                    rach_raResponseWindowSize[1+MAX_NUM_CCs]; 
  long                    rach_macContentionResolutionTimer[1+MAX_NUM_CCs];
  long                    rach_maxHARQ_Msg3Tx[1+MAX_NUM_CCs];
  long                    bcch_modificationPeriodCoeff[1+MAX_NUM_CCs];
  long                    pcch_defaultPagingCycle[1+MAX_NUM_CCs];
  long                    pcch_nB[1+MAX_NUM_CCs];
  long                    ue_TimersAndConstants_t300[1+MAX_NUM_CCs];
  long                    ue_TimersAndConstants_t301[1+MAX_NUM_CCs];
  long                    ue_TimersAndConstants_t310[1+MAX_NUM_CCs];
  long                    ue_TimersAndConstants_t311[1+MAX_NUM_CCs];
  long                    ue_TimersAndConstants_n310[1+MAX_NUM_CCs];
  long                    ue_TimersAndConstants_n311[1+MAX_NUM_CCs];
171
  
172

173
    /* Nb of MME to connect to */
174
  uint8_t             nb_mme;
175
    /* List of MME to connect to */
176
  mme_ip_address_t    mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
gauthier's avatar
gauthier committed
177

178 179
  char               *enb_interface_name_for_S1U;
  in_addr_t           enb_ipv4_address_for_S1U;
180
  tcp_udp_port_t      enb_port_for_S1U;
gauthier's avatar
gauthier committed
181

182 183
  char               *enb_interface_name_for_S1_MME;
  in_addr_t           enb_ipv4_address_for_S1_MME;
gauthier's avatar
gauthier committed
184

185 186 187 188
  // otg config
  /* Nb of OTG elements */
  uint8_t            num_otg_elements;
  /* element config*/
nikaeinn's avatar
nikaeinn committed
189 190 191
  uint16_t          otg_ue_id[NB_MODULES_MAX+1];
  uint8_t          otg_app_type[NB_MODULES_MAX+1];
  uint8_t            otg_bg_traffic[NB_MODULES_MAX+1];
192
   // log config
193 194 195 196 197 198 199 200 201 202 203 204 205 206
  int16_t           glog_level;
  int16_t           glog_verbosity;
  int16_t           hw_log_level;
  int16_t           hw_log_verbosity;
  int16_t           phy_log_level;
  int16_t           phy_log_verbosity;
  int16_t           mac_log_level;
  int16_t           mac_log_verbosity;
  int16_t           rlc_log_level;
  int16_t           rlc_log_verbosity;
  int16_t           pdcp_log_level;
  int16_t           pdcp_log_verbosity;
  int16_t           rrc_log_level;
  int16_t           rrc_log_verbosity;
207 208 209 210
  int16_t           gtpu_log_level;
  int16_t           gtpu_log_verbosity;
  int16_t           udp_log_level;
  int16_t           udp_log_verbosity;
211

212 213
} Enb_properties_t;

214 215 216 217 218 219 220 221
typedef struct Enb_properties_array_s {
    int                  number;
    Enb_properties_t    *properties[MAX_ENB];
} Enb_properties_array_t;

const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP);

const Enb_properties_array_t *enb_config_get(void);
222 223

#endif /* ENB_CONFIG_H_ */