enb_config.h 6.49 KB
Newer Older
1 2 3 4 5
/*
 * 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
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20
 * 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
 */
21

Lionel Gauthier's avatar
Lionel Gauthier committed
22 23 24
/*
                                enb_config.h
                             -------------------
25
  AUTHOR  : Lionel GAUTHIER, Navid Nikaein, Laurent Winckel
Lionel Gauthier's avatar
Lionel Gauthier committed
26
  COMPANY : EURECOM
27
  EMAIL   : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr
Lionel Gauthier's avatar
Lionel Gauthier committed
28
*/
29 30 31

#ifndef ENB_CONFIG_H_
#define ENB_CONFIG_H_
32 33 34
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
laurent's avatar
laurent committed
35
#include <libconfig.h>
36 37

#include "commonDef.h"
Lionel Gauthier's avatar
 
Lionel Gauthier committed
38
#include "platform_types.h"
Navid Nikaein's avatar
Navid Nikaein committed
39
#include "platform_constants.h"
40
#include "PHY/impl_defs_lte.h"
41
#include "PHY/defs_eNB.h"
42
#include "s1ap_messages_types.h"
43
#include "f1ap_messages_types.h"
44
#include "LTE_SystemInformationBlockType2.h"
laurent's avatar
laurent committed
45
#include "rrc_messages_types.h"
46
#include "RRC/LTE/rrc_defs.h"
laurent's avatar
laurent committed
47
#include <intertask_interface.h>
48
#include "enb_paramdef.h"
49

50

chenhsunyang0922's avatar
chenhsunyang0922 committed
51

Lionel Gauthier's avatar
Lionel 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
/** @defgroup _enb_app ENB APP 
 * @ingroup _oai2
 * @{
 */

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

69 70 71
#define MAX_DU	4
#define CU_BALANCING_ALL		127
#define CU_BALANCING_ROUND_ROBIN	126
72

73
typedef struct mme_ip_address_s {
74 75 76 77 78
  unsigned  ipv4:1;
  unsigned  ipv6:1;
  unsigned  active:1;
  char     *ipv4_address;
  char     *ipv6_address;
79 80
} mme_ip_address_t;

81 82


83 84 85
typedef struct cu_params {
  const char    *local_ipv4_address;
  const uint16_t local_port;
Robert Schmidt's avatar
Robert Schmidt committed
86 87 88
  const char    *remote_ipv4_address;
  const int16_t  remote_port;
} cudu_params_t;
89

90 91 92 93
typedef struct ru_config_s {
  // indicates if local or remote rf is used (1 == LOCAL)
  unsigned  local_rf:1;
  // indicates if UDP socket is used
94
  unsigned  udp:1;
95
  // indicates if RAW socket is used
96
  unsigned  raw:1;
97
  char      *ru_if_name;
98 99 100 101
  char     *local_address;
  char     *remote_address;
  uint16_t  local_port;
  uint16_t  remote_port;
Raymond Knopp's avatar
Raymond Knopp committed
102 103
  uint8_t   udpif4p5;
  uint8_t   rawif4p5;
104
  uint8_t   rawif5_mobipass;
105
  uint8_t   if_compress;
106
} ru_config_t;
Raymond Knopp's avatar
 
Raymond Knopp committed
107

108
extern void RCconfig_RU(void);
109
extern void RCconfig_flexran(void);
110
extern void RCconfig_L1(void);
111
extern void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]);
112
extern void UE_config_stub_pnf(void);
113 114
extern int  RCconfig_gtpu(void );
extern void RCConfig(void);
115

116
  
117
  /////////////////////////////////////////// NB-IoT ///////////////////////////////////////////////////
118 119 120 121 122 123 124 125 126 127
  //
  long              rach_raResponseWindowSize_NB[1+MAX_NUM_CCs];
  long              rach_macContentionResolutionTimer_NB[1+MAX_NUM_CCs];
  long              rach_powerRampingStep_NB[1+MAX_NUM_CCs];
  long              rach_preambleInitialReceivedTargetPower_NB[1+MAX_NUM_CCs];
  long              rach_preambleTransMax_CE_NB[1+MAX_NUM_CCs];
  long              bcch_modificationPeriodCoeff_NB[1+MAX_NUM_CCs];
  long              pcch_defaultPagingCycle_NB[1+MAX_NUM_CCs];
  long              nprach_CP_Length[1+MAX_NUM_CCs];
  long              nprach_rsrp_range[1+MAX_NUM_CCs];
128
  long             nprach_SubcarrierMSG3_RangeStart[1+MAX_NUM_CCs];
129 130 131 132 133 134 135 136 137 138
  long              maxNumPreambleAttemptCE_NB[1+MAX_NUM_CCs];
  long              npdsch_nrs_Power[1+MAX_NUM_CCs];
  long              npusch_ack_nack_numRepetitions_NB[1+MAX_NUM_CCs];
  long              npusch_srs_SubframeConfig_NB[1+MAX_NUM_CCs];
  long              npusch_threeTone_CyclicShift_r13[1+MAX_NUM_CCs];
  long              npusch_sixTone_CyclicShift_r13[1+MAX_NUM_CCs];
  BOOLEAN_t         npusch_groupHoppingEnabled[1+MAX_NUM_CCs];
  long              npusch_groupAssignmentNPUSCH_r13[1+MAX_NUM_CCs];
  long              dl_GapThreshold_NB[1+MAX_NUM_CCs];
  long              dl_GapPeriodicity_NB[1+MAX_NUM_CCs];
139
  long       dl_GapDurationCoeff_NB[1+MAX_NUM_CCs];
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
  long              npusch_p0_NominalNPUSCH[1+MAX_NUM_CCs];
  long              npusch_alpha[1+MAX_NUM_CCs];
  long              deltaPreambleMsg3[1+MAX_NUM_CCs];

  long              ue_TimersAndConstants_t300_NB[1+MAX_NUM_CCs];
  long              ue_TimersAndConstants_t301_NB[1+MAX_NUM_CCs];
  long              ue_TimersAndConstants_t310_NB[1+MAX_NUM_CCs];
  long              ue_TimersAndConstants_t311_NB[1+MAX_NUM_CCs];
  long              ue_TimersAndConstants_n310_NB[1+MAX_NUM_CCs];
  long              ue_TimersAndConstants_n311_NB[1+MAX_NUM_CCs];

  long              nprach_Periodicity[1+MAX_NUM_CCs];
  long              nprach_StartTime[1+MAX_NUM_CCs];
  long              nprach_SubcarrierOffset[1+MAX_NUM_CCs];
  long              nprach_NumSubcarriers[1+MAX_NUM_CCs];
  long              numRepetitionsPerPreambleAttempt[1+MAX_NUM_CCs];
  long              npdcch_NumRepetitions_RA[1+MAX_NUM_CCs];
  long              npdcch_StartSF_CSS_RA[1+MAX_NUM_CCs];
158
  long             npdcch_Offset_RA[1+MAX_NUM_CCs];
159

160
  /////////////////////////////////////////////END/////////////////////////////////////////////
161
  
162
void                          enb_config_display(void);
163
void                          ru_config_display(void);
164

165
int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1);
Cedric Roux's avatar
Cedric Roux committed
166
int RCconfig_S1(MessageDef *msg_p, uint32_t i);
167

168
void read_config_and_init(void);
169
int RCconfig_X2(MessageDef *msg_p, uint32_t i);
170

171 172
void fill_SL_configuration(MessageDef *msg_p,  ccparams_sidelink_t *SLconfig,int cell_idx,int cc_idx,char *config_fname);
void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, int cell_idx,int cc_idx,char *config_fname,char *brparamspath);
Robert Schmidt's avatar
Robert Schmidt committed
173 174
int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i);
void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
175

176
#endif