platform_constants.h 4.64 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 21
 * 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
 */

22 23 24
/*
                                 platform_constants.h
                             -------------------
25
  AUTHOR  : Lionel GAUTHIER and Navid Nikaein
26 27 28 29 30
  COMPANY : EURECOM
  EMAIL   : Lionel.Gauthier@eurecom.fr

 ***************************************************************************/

31
#include "LTE_asn_constant.h"
32 33 34 35

#ifndef __PLATFORM_CONSTANTS_H__
#    define __PLATFORM_CONSTANTS_H__

36
#ifdef JUMBO_FRAME
37
#define NL_MAX_PAYLOAD 18000  /* this should cover the max mtu size*/
38
#else
39
#define NL_MAX_PAYLOAD 9000  /* this should cover the max mtu size*/
40
#endif
41 42

#ifdef LARGE_SCALE
43 44 45 46 47
#    define NB_MODULES_MAX 128
#    define NB_NODE_MAX    128
#else
#    define NB_MODULES_MAX 32
#    define NB_NODE_MAX    32
48
#endif
49 50

#ifdef JUMBO_FRAME
51
#    define MAX_IP_PACKET_SIZE         10000 // 9000
52
#else
53 54
# if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
/* SR: When using ethernet network driver the packet size is 1512 :
55
 * 1500 bytes IP packet + 14 bytes ethernet header
56
 */
57
#   define MAX_IP_PACKET_SIZE          1514
58
# else
59
#   define MAX_IP_PACKET_SIZE          1500 // 3000
60
# endif
61
#endif
62
// overwrite the previous deinitions
63 64 65

#    define MAX_MODULES                NB_MODULES_MAX

66
#ifndef UE_EXPANSION
67 68 69 70 71 72 73 74 75 76
// TODO:L2 FAPI simulator.
// UESIM_EXPANSION is used to be same value of MAX_MOBILES_PER_ENB
// in eNB and UE.
// now , if we use --mu option in UE, compiling error will occur.
// This problem will be fixed in the future.
# ifdef UESIM_EXPANSION
#    define MAX_MOBILES_PER_ENB         256
#    define MAX_MOBILES_PER_ENB_NB_IoT  256
#    define MAX_eNB                      2
# else
77
# ifdef LARGE_SCALE
78
#    define MAX_MOBILES_PER_ENB         128
79
#    define MAX_MOBILES_PER_ENB_NB_IoT  128
80
#    define MAX_eNB                      2
81
# else
82
#    define MAX_MOBILES_PER_ENB         16
83
#    define MAX_MOBILES_PER_ENB_NB_IoT  16
84
#    define MAX_eNB                      2
85
# endif
86
#endif
87 88 89 90
#else
#    define MAX_MOBILES_PER_ENB 256
#    define MAX_MOBILES_PER_ENB_NB_IoT 256
#    define MAX_eNB                      2
91 92
#endif

93

94
#define MAX_MANAGED_ENB_PER_MOBILE  2
95

oai's avatar
oai committed
96
///NB-IOT
97
#define NB_RB_MAX_NB_IOT  (LTE_maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5
oai's avatar
oai committed
98 99


100
#define DEFAULT_RAB_ID 1
101

102 103 104
#define NB_RB_MAX      (LTE_maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
#define NB_RB_MBMS_MAX (LTE_maxSessionPerPMCH*LTE_maxServiceCount)
105 106 107 108
#else
// Do not allocate unused memory
#define NB_RB_MBMS_MAX 1
#endif
109
#define NB_RAB_MAX     LTE_maxDRB       /* was 8, now 11 */
110 111
#define RAB_SHIFT1     9
#define RAB_SHIFT2     3
112 113
//#define RAB_OFFSET     0x0007
#define RAB_OFFSET     0x000F
114 115 116 117 118 119
#define RAB_OFFSET1    0x7E00
#define RAB_OFFSET2    0x01F8
#define DIR_OFFSET     0x8000
#define DIR_SHIFT      15
#define CH_OFFSET      0x0004
#define CH_SHIFT       2
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

// RLC_AM_SEND_MRW
#        define SEND_MRW_OFF    15
#        define SEND_MRW_ON     240

// RLC_SEGMENTATION_INDICATION
#        define SEGMENTATION_NOT_ALLOWED  0
#        define SEGMENTATION_ALLOWED      1

// RLC_DELIVERY_OF_ERRONEOUS_SDU
#        define DELIVERY_OF_ERRONEOUS_SDU_NO           0
#        define DELIVERY_OF_ERRONEOUS_SDU_YES          1
#        define DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT    2


135
// CBA constant
136 137 138 139 140 141 142 143 144 145 146
#define NUM_MAX_CBA_GROUP 4

#    ifndef __cplusplus
#        ifndef NULL
#            define NULL 0
#        endif
#        ifndef null
#            define null 0
#        endif
#    endif

Lionel Gauthier's avatar
Lionel Gauthier committed
147 148
#define  UNUSED_PARAM_MBMS_SESSION_ID  0
#define  UNUSED_PARAM_MBMS_SERVICE_ID  0
149 150 151

#define printk printf

152 153 154
#define UNUSED_VARIABLE(vARIABLE)   (void)(vARIABLE)

#endif /* __PLATFORM_CONSTANTS_H__ */