platform_constants.h 4.23 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
                                 platform_constants.h
                             -------------------
  AUTHOR  : Lionel GAUTHIER
  COMPANY : EURECOM
  EMAIL   : Lionel.Gauthier@eurecom.fr

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

#include "RRC/LITE/MESSAGES/asn1_constants.h"

#ifndef __PLATFORM_CONSTANTS_H__
#    define __PLATFORM_CONSTANTS_H__

15 16
#define NL_MAX_PAYLOAD 4096  /* this should cover the max mtu size*/

17
#ifdef USER_MODE
18
#ifdef LARGE_SCALE
19 20 21 22 23
#    define NB_MODULES_MAX 128
#    define NB_NODE_MAX    128
#else
#    define NB_MODULES_MAX 32
#    define NB_NODE_MAX    32
24
#endif
25 26 27 28 29 30 31 32 33
#else
#    define NB_MODULES_MAX 1
#    define NB_NODE_MAX    1
#endif //PHY_EMUL


#ifdef JUMBO_FRAME
#    define MAX_IP_PACKET_SIZE         9000
#else
34 35 36 37 38 39
# if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
/* SR: When using ethernet network driver the packet size is 1512 :
 * 1500 bytes IP packet + 12 bytes ethernet header
 */
#   define MAX_IP_PACKET_SIZE          1512
# else
40
#   define MAX_IP_PACKET_SIZE          1500 // 3000
41
# endif
42
#endif
43
// overwrite the previous deinitions
44 45 46

#    define MAX_MODULES                NB_MODULES_MAX

47
#ifdef LARGE_SCALE
48 49
#    define MAX_MOBILES_PER_RG         128
#    define MAX_RG                     2
50
#else
51 52 53 54
#    define MAX_MOBILES_PER_RG         16
#    define MAX_RG                     2
#endif

55 56 57
#define MAX_MANAGED_RG_PER_MOBILE  2

#define DEFAULT_RAB_ID 3
gauthier's avatar
gauthier committed
58 59
#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 */
#define NB_RAB_MAX     maxDRB       /* was 8, now 11 */
60 61 62 63 64 65 66 67 68
#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
69 70 71

#ifdef MESH

gauthier's avatar
gauthier committed
72 73 74 75 76 77
//#    define MAX_RB_MOBILE              NB_RB_MAX  * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
//#    define MAX_RAB_MOBILE             NB_RAB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
//#    define MAX_RB_RG                  MAX_RB_MOBILE //NB_RB_MAX  *  MAX_MOBILES_PER_RG
//#    define MAX_RAB_RG                 (NB_RB_MAX+1) * (MAX_MOBILES_PER_RG + 1)
//#    define MAX_RAB                    MAX_RAB_RG
//#    define MAX_RB                     MAX_RB_RG
78 79
#else

gauthier's avatar
gauthier committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93
//#    define MAX_RB_MOBILE              NB_RB_MAX * MAX_MANAGED_RG_PER_MOBILE
//#    define MAX_RAB_MOBILE             NB_RAB_MAX * MAX_MANAGED_RG_PER_MOBILE
//#    define MAX_RB_RG                  NB_RB_MAX * MAX_MOBILES_PER_RG
//#    define MAX_RAB_RG                 NB_RB_MAX * MAX_MOBILES_PER_RG
//#    ifdef NODE_RG
//#        define MAX_RAB                MAX_RAB_RG
//#        define MAX_RB                 MAX_RB_RG
//#    else
//#      //  ifdef NODE_MT
//#        //    define MAX_RAB            MAX_RAB_MOBILE
//#          //  define MAX_RB             MAX_RB_MOBILE
//#        //else
//#          //error NODE_RG or NODE_MT must be defined
//#        //endif
94 95 96 97
//#    endif
#endif //MESH

// RLC_MODE
gauthier's avatar
gauthier committed
98 99 100 101
#        define RLC_NONE     (rlc_mode_t)0
#        define RLC_MODE_AM  (rlc_mode_t)1
#        define RLC_MODE_TM  (rlc_mode_t)2
#        define RLC_MODE_UM  (rlc_mode_t)3
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124

//E_R
#        define E_R_RLC_ER_RELEASE          1
#        define E_R_RLC_ER_MODIFICATION     2
#        define E_R_RLC_ER_RE_ESTABLISHMENT 4
#        define E_R_RLC_ER_STOP             8
#        define E_R_RLC_ER_CONTINUE         16
#        define E_R_RLC_ER_NONE             0

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


125
// CBA constant
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
#define NUM_MAX_CBA_GROUP 4

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



#ifdef USER_MODE
#define printk printf
#endif

143 144 145
#define UNUSED_VARIABLE(vARIABLE)   (void)(vARIABLE)

#endif /* __PLATFORM_CONSTANTS_H__ */