[Epic-ID: ODUHIGH-516][Task-ID: ODUHIGH-532] RIC Subscription Delete Req/Rsp API...
[o-du/l2.git] / src / 5gnrmac / mac.h
index 6115c67..5a1db5a 100644 (file)
@@ -26,6 +26,7 @@
 #define MAX_ZERO_CORR_CFG_IDX 16 /* max zero correlation config index */
 #define MAC_TQ_SIZE    10        /* Timing Queue Size */
 #define MAX_NUM_TIMER  1         /* MAX number of MAC timers */
+#define MAX_PENDING_STATS_RSP  5      /* Maximum number of statistics request for which response is pending */
 
 #define DEFAULT_CELLS 1
 #define SI_RNTI 0xFFFF
@@ -59,6 +60,7 @@
 #define LC_ID_SIZE 6
 #define TIMING_ADVANCE_SIZE 12
 #define T_CRNTI_SIZE 16
+
 /*  UL Grant is of size = 27 bits. Refer to Spec 38.213, Table 8.2-1 for
  *  contents of UL grant in RAR */
 #define FREQ_HOP_FLAG_SIZE 1
@@ -75,7 +77,7 @@ typedef enum
    CELL_STATE_UP,
    CELL_TO_BE_STOPPED,
    CELL_STOP_IN_PROGRESS,
-}CellState;       
+}MacCellStatus;           
 
 typedef enum
 {
@@ -124,6 +126,7 @@ typedef struct macCbInfo
    uint8_t     *msg4Pdu;    /* storing DL-CCCH Ind Pdu */
    uint16_t    msg4PduLen;  /* storing DL-CCCH Ind Pdu Len */
    DlHarqProcCb msg4HqInfo; /* HARQ process info for msg 4 */
+   bool         *macMsg4Status;
 }MacRaCbInfo;
 
 typedef struct macCe
@@ -228,19 +231,31 @@ typedef struct macUeCb
 
 struct macCellCb
 {
-   uint16_t    cellId;
-   CellState   state;
-   uint16_t    crntiMap;
-   MacRaCbInfo macRaCb[MAX_NUM_UE];
-   MacDlSlot   dlSlot[MAX_SLOTS];
-   MacUlSlot   ulSlot[MAX_SLOTS];
-   uint16_t    numActvUe;
-   MacUeCfg    *ueCfgTmpData[MAX_NUM_UE];
-   MacUeCb     ueCb[MAX_NUM_UE];
-   MacCellCfg  macCellCfg;
-   SlotTimingInfo currTime;
+   uint16_t        cellId;
+   uint16_t        numOfSlots;
+   MacCellStatus   state;
+   uint16_t        crntiMap;
+   MacRaCbInfo     macRaCb[MAX_NUM_UE];
+   MacDlSlot       dlSlot[MAX_SLOTS];
+   MacUlSlot       ulSlot[MAX_SLOTS];
+   uint16_t        numActvUe;
+   MacUeCreateReq  *ueCfgTmpData[MAX_NUM_UE];
+   MacUeRecfg      *ueRecfgTmpData[MAX_NUM_UE];
+   MacUeCb         ueCb[MAX_NUM_UE];
+   MacCellCfg      macCellCfg;
+   uint8_t         numerology;
+   SlotTimingInfo  currTime;
 };
 
+typedef struct macStatistics
+{
+   uint8_t      numPendingStatsRsp;
+   MacStatsRsp  pendingStatsRsp[MAX_PENDING_STATS_RSP];
+
+   /* This structure can be developed in future to add details of
+    * the statistics to be calculated at MAC */
+}MacStatistics;
+
 typedef struct macCb
 {
    Inst        macInst;
@@ -250,28 +265,45 @@ typedef struct macCb
    CmTqType    tmrTq[MAC_TQ_SIZE];        /*!< Timer Task Queue */
    CmTimer     tmrBlk[MAX_NUM_TIMER];     /*!< Timer Block */
    MacCellCb   *macCell[MAX_NUM_CELL];
+   MacStatistics  statistics;
 }MacCb;
 
 /* global variable */
 MacCb macCb;
 
 /* Function declarations */
+uint8_t macActvInit ARGS((Ent entity, Inst inst, Region region, Reason reason));
+uint8_t macActvTsk(Pst *pst, Buffer *mBuf);
 short int macActvTmr(Ent ent,Inst inst);
+
 void fillRarPdu(RarInfo *rarInfo);
 void fillMsg4DlData(MacDlData *dlData, uint16_t msg4PduLen, uint8_t *msg4Pdu);
 void fillMacCe(MacCeInfo  *macCeData, uint8_t *msg3Pdu);
 void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint16_t tbSize);
 uint8_t unpackRxData(uint16_t cellId, SlotTimingInfo slotInfo, RxDataIndPdu *rxDataIndPdu);
-void fillMg4Pdu(DlMsgAlloc *msg4Alloc);
+void fillMg4Pdu(DlMsgSchInfo *msg4Alloc);
 void buildAndSendMuxPdu(SlotTimingInfo currTimingInfo);
 uint8_t macProcUlCcchInd(uint16_t cellId, uint16_t crnti, uint16_t rrcContSize, uint8_t *rrcContainer);
 uint8_t macProcShortBsr(uint16_t cellId, uint16_t crnti, uint8_t lcgId, uint32_t bufferSize);
-uint8_t macProcUlData(uint16_t cellId, uint16_t rnti, SlotTimingInfo slotInfo, \
-   uint8_t lcId, uint16_t pduLen, uint8_t *pdu);
+uint8_t macProcUlData(uint16_t cellId, uint16_t rnti, SlotTimingInfo slotInfo, uint8_t lcId, uint16_t pduLen, uint8_t *pdu);
 uint8_t sendSchedRptToRlc(DlSchedInfo dlInfo, SlotTimingInfo slotInfo, uint8_t ueIdx, uint8_t schInfoIdx);
-uint8_t macProcLongBsr(uint16_t cellId, uint16_t crnti,uint8_t numLcg,\
-                         DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS]);
+uint8_t macProcLongBsr(uint16_t cellId, uint16_t crnti,uint8_t numLcg, DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS]);
 void freeMacSliceCfgReq(MacSliceCfgReq *cfgReq,Pst *pst);
+void deleteMacRaCb(uint16_t cellIdx, MacUeCb *ueCb);
+
+uint8_t MacProcSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *schSliceCfgRsp);
+uint8_t MacProcSchSliceRecfgRsp(Pst *pst, SchSliceRecfgRsp *sliceRecfgrsp);
+uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm  *schCellCfgCfm);
+uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
+uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
+uint8_t MacProcSchRachRsrcRsp(Pst *pst, SchRachRsrcRsp *schRachRsrcRsp);
+uint8_t MacProcDlPageAlloc(Pst *pst, DlPageAlloc *dlPageAlloc);
+uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
+
+uint8_t MacProcSchStatsRsp(Pst *pst, SchStatsRsp *schStatsRsp);
+uint8_t MacProcSchStatsInd(Pst *pst, SchStatsInd *schStatsInd);
+uint8_t MacProcSchStatsDeleteRsp(Pst *pst, SchStatsDeleteRsp *schStatsDeleteRsp);
+
 #endif
 /**********************************************************************
   End of file