1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
20 /* Changes the IP information
21 * At DU1, SOURCE_DU_IPV4_ADDR = 192.168.130.81 and DESTINATION_DU_IPV4_ADDR = 192.168.130.83
22 * At DU2, SOURCE_DU_IPV4_ADDR = 192.168.130.83 and DESTINATION_DU_IPV4_ADDR = 192.168.130.81 */
23 #define SOURCE_DU_IPV4_ADDR "192.168.130.81"
24 #define DESTINATION_DU_IPV4_ADDR "192.168.130.83"
25 #define PORT_NUMBER 8080
29 #define MAX_SLOT_VALUE 19
31 #define MAX_SLOT_VALUE 9
33 #define MAX_SFN_VALUE 1023
36 #define NUM_DRB_TO_PUMP_DATA 2
37 #define NUM_UL_PACKETS 1
39 /*UE Ids for RACH IND*/
44 /* Default RA Preamble index to be used when Rach Indication is triggered from
46 #define CB_RA_PREAMBLE_IDX 3 /* For contention based RA */
47 #define CF_RA_PREAMBLE_IDX 8 /* For contention free RA */
49 extern bool slotIndicationStarted;
50 extern uint16_t sfnValue;
51 extern uint16_t slotValue;
53 /*Mapping between LCG ID and BSR Idx*/
54 typedef struct lcgBufferSize
56 uint8_t lcgId; /*LCG ID for which BSR will be requested*/
57 /*BufferStatus Index. This is as per Spec 38.321, BSR will be reported as Index
58 * Refer table Table 6.1.3.1-1:Short_BSR and Table 6.1.3.1-2:Long_BSR*/
62 /* UE specific information */
70 bool msg5ShortBsrSent;
73 bool msgNasAuthenticationComp;
74 bool msgNasSecurityModeComp;
75 bool msgRrcSecurityModeComp;
76 bool msgRrcReconfigComp;
77 bool msgRegistrationComp;
78 uint8_t rlcSnForSrb1; /* Sequence number of PDU at RLC for AM mode */
79 uint8_t pdcpSn; /* Sequence number of PDU at PDCP */
82 /* Database to store information for all UE */
86 UeCb ueCb[MAX_NUM_UE];
92 uint32_t destinationDu;
110 MSG_TYPE_NAS_AUTHENTICATION_COMPLETE,
111 MSG_TYPE_NAS_SECURITY_MODE_COMPLETE,
112 MSG_TYPE_RRC_SECURITY_MODE_COMPLETE,
113 MSG_TYPE_REGISTRATION_COMPLETE,
114 MSG_TYPE_RRC_RECONFIG_COMPLETE
117 void phyToMac ARGS((uint16_t msgType, uint32_t msgLen,void *msg));
119 void fillTlvs ARGS((fapi_uint16_tlv_t *tlv, uint16_t tag, uint16_t
120 length, uint16_t value, uint32_t *msgLen));
121 void fillMsgHeader ARGS((fapi_msg_t *hdr, uint16_t msgType, uint16_t msgLen));
123 void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
124 void l1StartConsoleHandler();
125 void l1HdlSlotIndicaion(bool);
126 void GenerateTicks();
127 uint8_t l1SendUlUserData(uint8_t drbId, uint8_t ueIdx);
128 uint8_t l1SendStatusPdu();
129 uint16_t l1BuildAndSendSlotIndication();
130 uint16_t l1BuildAndSendStopInd();
131 int inet_pton(int af, const char *sourc, void *dst);
132 void *establishConnectionWithPeerL1(void *args);
133 uint16_t l1BuildAndSendRachInd(uint16_t slot, uint16_t sfn, uint8_t raPreambleIdx);
135 /**********************************************************************
137 **********************************************************************/