platform_constants.h 4.26 KB
Newer Older
1 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
27 28 29

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

30 31 32
/*
                                 platform_constants.h
                             -------------------
33
  AUTHOR  : Lionel GAUTHIER and Navid Nikaein
34 35 36 37 38
  COMPANY : EURECOM
  EMAIL   : Lionel.Gauthier@eurecom.fr

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

39 40 41
#ifdef CMAKER
#include "asn1_constants.h"
#else
42
#include "RRC/LITE/MESSAGES/asn1_constants.h"
43
#endif
44 45 46 47

#ifndef __PLATFORM_CONSTANTS_H__
#    define __PLATFORM_CONSTANTS_H__

48
#ifdef JUMBO_FRAME
49
#define NL_MAX_PAYLOAD 18000  /* this should cover the max mtu size*/
50
#else
51
#define NL_MAX_PAYLOAD 9000  /* this should cover the max mtu size*/
52
#endif
53

54
#ifdef USER_MODE
55
#ifdef LARGE_SCALE
56 57 58 59 60
#    define NB_MODULES_MAX 128
#    define NB_NODE_MAX    128
#else
#    define NB_MODULES_MAX 32
#    define NB_NODE_MAX    32
61
#endif
62 63 64 65 66 67 68
#else
#    define NB_MODULES_MAX 1
#    define NB_NODE_MAX    1
#endif //PHY_EMUL


#ifdef JUMBO_FRAME
69
#    define MAX_IP_PACKET_SIZE         10000 // 9000
70
#else
71 72
# if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
/* SR: When using ethernet network driver the packet size is 1512 :
73
 * 1500 bytes IP packet + 14 bytes ethernet header
74
 */
75
#   define MAX_IP_PACKET_SIZE          1514
76
# else
77
#   define MAX_IP_PACKET_SIZE          1500 // 3000
78
# endif
79
#endif
80
// overwrite the previous deinitions
81 82 83

#    define MAX_MODULES                NB_MODULES_MAX

84
#ifdef LARGE_SCALE
85 86
#    define MAX_MOBILES_PER_ENB         128
//#    define MAX_RG                      2
87
#else
88 89
#    define MAX_MOBILES_PER_ENB         16
//#    define MAX_RG                      2
90 91
#endif

92
#define MAX_MANAGED_ENB_PER_MOBILE  2
93

94
#define DEFAULT_RAB_ID 1
95

96
#define NB_RB_MAX      (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 */
97 98 99 100 101 102
#if defined(Rel10)
#define NB_RB_MBMS_MAX (maxSessionPerPMCH*maxServiceCount)
#else
// Do not allocate unused memory
#define NB_RB_MBMS_MAX 1
#endif
103
#define NB_RAB_MAX     maxDRB       /* was 8, now 11 */
104 105 106 107 108 109 110 111 112
#define RAB_SHIFT1     9
#define RAB_SHIFT2     3
#define RAB_OFFSET     0x0007
#define RAB_OFFSET1    0x7E00
#define RAB_OFFSET2    0x01F8
#define DIR_OFFSET     0x8000
#define DIR_SHIFT      15
#define CH_OFFSET      0x0004
#define CH_SHIFT       2
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127

// 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


128
// CBA constant
129 130 131 132 133 134 135 136 137 138 139
#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
140 141
#define  UNUSED_PARAM_MBMS_SESSION_ID  0
#define  UNUSED_PARAM_MBMS_SERVICE_ID  0
142 143 144 145 146

#ifdef USER_MODE
#define printk printf
#endif

147 148 149
#define UNUSED_VARIABLE(vARIABLE)   (void)(vARIABLE)

#endif /* __PLATFORM_CONSTANTS_H__ */