[ Jira id - ODUHIGH-593 ] Pack and unpack function nomenclature correction
[o-du/l2.git] / src / phy_stub / phy_stub.h
index 669eb3e..941a99a 100644 (file)
 #define MAX_SFN_VALUE    1023
 #define NR_PCI            1
 #define SLOT_DELAY       3
-#define NUM_DRB_TO_PUMP_DATA  3
+#define NUM_DRB_TO_PUMP_DATA  2
 #define NUM_UL_PACKETS   1
+
 /*UE Ids for RACH IND*/
 #define UE_IDX_0     0
 #define UE_IDX_1     1
 #define UE_IDX_2     2
 
-bool     slotIndicationStarted;
-uint16_t sfnValue;
-uint16_t slotValue;
+/* Default RA Preamble index to be used when Rach Indication is triggered from
+ * PHY stub */
+#define CB_RA_PREAMBLE_IDX 3  /* For contention based RA */
+#define CF_RA_PREAMBLE_IDX 8  /* For contention free RA */
+
+extern bool     slotIndicationStarted;
+extern uint16_t sfnValue;
+extern uint16_t slotValue;
 
 /*Mapping between LCG ID and BSR Idx*/
 typedef struct lcgBufferSize
@@ -59,13 +65,16 @@ typedef struct ueCb
    uint8_t  ueId;
    uint16_t crnti;
    bool     rachIndSent;
+   bool     isCFRA;
    bool     msg3Sent;
    bool     msg5ShortBsrSent;
    bool     msg5Sent;
    bool     dlDedMsg;
-   bool     msgSecurityModeComp;
-   bool           msgRrcReconfiguration;
-   bool           msgRegistrationComp;
+   bool     msgNasAuthenticationComp;
+   bool     msgNasSecurityModeComp;
+   bool     msgRrcSecurityModeComp;
+   bool     msgRrcReconfigComp;
+   bool     msgRegistrationComp;
    uint8_t  rlcSnForSrb1;           /* Sequence number of PDU at RLC for AM mode */
    uint8_t  pdcpSn;                 /* Sequence number of PDU at PDCP */
 }UeCb;
@@ -91,14 +100,16 @@ typedef struct phyDb
    UeDb    ueDb;
 }PhyDb;
 
-PhyDb phyDb;
+extern PhyDb phyDb;
 
 typedef enum
 {
    MSG_TYPE_MSG3,
    MSG_TYPE_SHORT_BSR,
    MSG_TYPE_MSG5,
-   MSG_TYPE_SECURITY_MODE_COMPLETE,
+   MSG_TYPE_NAS_AUTHENTICATION_COMPLETE,
+   MSG_TYPE_NAS_SECURITY_MODE_COMPLETE,
+   MSG_TYPE_RRC_SECURITY_MODE_COMPLETE,
    MSG_TYPE_REGISTRATION_COMPLETE,
    MSG_TYPE_RRC_RECONFIG_COMPLETE
 }MsgType;
@@ -119,6 +130,8 @@ uint16_t l1BuildAndSendSlotIndication();
 uint16_t l1BuildAndSendStopInd();
 int inet_pton(int af, const char *sourc, void *dst);
 void *establishConnectionWithPeerL1(void *args);
+uint16_t l1BuildAndSendRachInd(uint16_t slot, uint16_t sfn, uint8_t raPreambleIdx);
+
 /**********************************************************************
          End of file
 **********************************************************************/