X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_mac_inf.h;h=c0cb0dc80c3aa42d286378940695d02ec3b8d9cc;hb=a14bf79bbc001990f96e01ada0dd291bcc9ddcad;hp=56bb461083293c62e1db6853699927c39f6289d9;hpb=c9eb909f64c6b5607428cd187f2b1ce8a63cd437;p=o-du%2Fl2.git diff --git a/src/cm/du_app_mac_inf.h b/src/cm/du_app_mac_inf.h index 56bb46108..c0cb0dc80 100644 --- a/src/cm/du_app_mac_inf.h +++ b/src/cm/du_app_mac_inf.h @@ -89,6 +89,8 @@ #define EVENT_MAC_UE_RESET_RSP 226 #define EVENT_MAC_UE_SYNC_STATUS_IND 227 #define EVENT_MAC_DL_BROADCAST_REQ 228 +#define EVENT_MAC_STATISTICS_REQ 229 +#define EVENT_MAC_STATISTICS_RSP 230 #define BSR_PERIODIC_TIMER_SF_10 10 #define BSR_RETX_TIMER_SF_320 320 @@ -97,6 +99,10 @@ #define PAGING_SCHED_DELTA 4 #define MAX_PLMN 2 +/********************* Global Variable ********************/ +uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */ + +/********************* Interface structure definition ********************/ typedef enum { SIB_TYPE2, @@ -578,6 +584,13 @@ typedef enum RESTART_TRANSMISSION }DataTransmissionAction; +/* Performance measurements from 3GPP TS 28.552 Release 15 */ +typedef enum +{ + MAC_DL_TOTAL_PRB_USAGE, + MAC_UL_TOTAL_PRB_USAGE +}MacMeasurementType; + typedef struct failureCause { CauseGrp type; @@ -656,62 +669,6 @@ typedef struct sib1CellCfg SchPageCfg pagingCfg; } Sib1CellCfg; - -typedef struct cellCfg -{ - MacOpState opState; - MacAdminState adminState; - MacCellState cellState; - PlmnInfoList plmnInfoList[MAX_PLMN]; /* Consits of PlmnId and Snssai list */ - uint32_t phyCellId; /* Physical cell id */ - uint32_t tac; - uint32_t ssbFreq; - uint16_t subCarrSpacing; - DuplexMode dupType; /* Duplex type: TDD/FDD */ - uint8_t numerology; /* Supported numerology */ - Sib1CellCfg sib1Cfg; /* SIB1 config */ -}CellCfg; - -typedef struct ssbCfg -{ - uint32_t ssbPbchPwr; /* SSB block power */ - uint8_t scsCmn; /* subcarrier spacing for common */ - uint16_t ssbOffsetPointA; /* SSB subcarrier offset from point A */ - SSBPeriod ssbPeriod; /* SSB Periodicity in msec */ - uint8_t ssbScOffset; /* Subcarrier Offset */ - uint32_t ssbMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */ - uint8_t beamId[NUM_SSB]; - BetaPss betaPss; - BchPduOpt bchPayloadFlag; /* Options for generation of payload */ - uint8_t mibPdu[3]; /* MIB payload */ - uint8_t dmrsTypeAPos; /* DMRS Type A position */ -}SsbCfg; - -typedef struct fdmInfo -{ - uint16_t rootSeqIdx; /* Root sequence index */ - uint8_t numRootSeq; /* Number of root sequences required for FD */ - uint16_t k1; /* Frequency Offset for each FD */ - uint8_t zeroCorrZoneCfg; /* Zero correlation zone cofig */ -}PrachFdmInfo; - -typedef struct prachCfg -{ - PrachSeqLen prachSeqLen; /* RACH Sequence length: Long/short */ - uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */ - uint8_t msg1Fdm; /* Number of RACH frequency domain occasions/ PRACH FDM (1,2,4,8) */ - uint8_t prachCfgIdx; /* PRACH Cfg Index */ - PrachFdmInfo fdm[8]; /* FDM info */ - RstSetCfg prachRstSetCfg; /* PRACH restricted set config */ - uint8_t ssbPerRach; /* SSB per RACH occassion */ - uint8_t totalNumRaPreamble; /* Total number of RA preambles */ - uint8_t numCbPreamblePerSsb; /* Number of CB preamble per SSB */ - uint16_t msg1FreqStart; /* Msg1-FrequencyStart */ - uint8_t raContResTmr; /* RA Contention Resoultion Timer */ - uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */ - uint8_t raRspWindow; /* RA Response Window */ -}PrachCfg; - typedef struct bwpParams { uint16_t firstPrb; @@ -777,7 +734,6 @@ typedef struct puschTimeDomRsrcAlloc uint8_t startSymbolAndLength; }PuschTimeDomRsrcAlloc; - typedef struct puschConfigCommon { /* PUSCH-TimeDomainResourceAllocation info */ @@ -800,6 +756,63 @@ typedef struct bwpUlConfig PuschConfigCommon puschCommon; }BwpUlConfig; + +typedef struct cellCfg +{ + MacOpState opState; + MacAdminState adminState; + MacCellState cellState; + PlmnInfoList plmnInfoList[MAX_PLMN]; /* Consits of PlmnId and Snssai list */ + uint32_t phyCellId; /* Physical cell id */ + uint32_t tac; + uint32_t ssbFreq; + uint16_t subCarrSpacing; + DuplexMode dupType; /* Duplex type: TDD/FDD */ + Sib1CellCfg sib1Cfg; /* SIB1 config */ + BwpDlConfig initialDlBwp; /* Initial DL BWP */ + BwpUlConfig initialUlBwp; /* Initial UL BWP */ +}CellCfg; + +typedef struct ssbCfg +{ + uint32_t ssbPbchPwr; /* SSB block power */ + uint8_t scsCmn; /* subcarrier spacing for common */ + uint16_t ssbOffsetPointA; /* SSB subcarrier offset from point A */ + SSBPeriod ssbPeriod; /* SSB Periodicity in msec */ + uint8_t ssbScOffset; /* Subcarrier Offset */ + uint32_t ssbMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */ + uint8_t beamId[NUM_SSB]; + BetaPss betaPss; + BchPduOpt bchPayloadFlag; /* Options for generation of payload */ + uint8_t mibPdu[3]; /* MIB payload */ + uint8_t dmrsTypeAPos; /* DMRS Type A position */ +}SsbCfg; + +typedef struct fdmInfo +{ + uint16_t rootSeqIdx; /* Root sequence index */ + uint8_t numRootSeq; /* Number of root sequences required for FD */ + uint16_t k1; /* Frequency Offset for each FD */ + uint8_t zeroCorrZoneCfg; /* Zero correlation zone cofig */ +}PrachFdmInfo; + +typedef struct prachCfg +{ + PrachSeqLen prachSeqLen; /* RACH Sequence length: Long/short */ + uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */ + uint8_t msg1Fdm; /* Number of RACH frequency domain occasions/ PRACH FDM (1,2,4,8) */ + uint8_t prachCfgIdx; /* PRACH Cfg Index */ + PrachFdmInfo fdm[8]; /* FDM info */ + RstSetCfg prachRstSetCfg; /* PRACH restricted set config */ + uint8_t ssbPerRach; /* SSB per RACH occassion */ + uint8_t totalNumRaPreamble; /* Total number of RA preambles */ + uint8_t numCbPreamblePerSsb; /* Number of CB preamble per SSB */ + uint16_t msg1FreqStart; /* Msg1-FrequencyStart */ + uint8_t raContResTmr; /* RA Contention Resoultion Timer */ + uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */ + uint8_t raRspWindow; /* RA Response Window */ +}PrachCfg; + #ifdef NR_DRX /* The following list of structures is taken from the DRX-Config section of specification 33.331. */ typedef struct drxOnDurationTimer @@ -860,18 +873,31 @@ typedef struct beamformingConf uint32_t digitalAzimuth; }BeamformingConf; +typedef struct csiRsCfg +{ + uint8_t *csiFreqDomainAlloc; + uint8_t csiNrofPorts; + uint8_t csirsfirstOFDMSymbolInTimeDomain; + uint8_t csirsfirstOFDMSymbolInTimeDomain2; + uint8_t csirscdmType; + uint8_t csirsdensity; + uint8_t csirsdensitydot5; + uint8_t powerControlOffset; + uint8_t powerControlOffsetSS; + uint16_t periodicityAndOffset; +}CsiRsCfg; + typedef struct macCellCfg { uint16_t cellId; /* Cell Id */ CarrierCfg carrCfg; /* Carrier configuration */ CellCfg cellCfg; /* Cell Configuration*/ SsbCfg ssbCfg; /* SSB configuration */ + CsiRsCfg csiRsCfg; /*Reference: 38.331 CSI-MeasConfig*/ PrachCfg prachCfg; /* PRACH Configuration */ #ifdef NR_TDD TDDCfg tddCfg; /* TDD periodicity and slot configuration */ #endif - BwpDlConfig initialDlBwp; /* Initial DL BWP */ - BwpUlConfig initialUlBwp; /* Initial UL BWP */ PrecodingConf precodingConf; BeamformingConf beamCfg; }MacCellCfg; @@ -1531,7 +1557,7 @@ typedef struct macUeCreateReq { uint16_t cellId; uint8_t ueId; - uint8_t beamIdx; + uint8_t beamIdx; uint16_t crnti; bool macCellGrpCfgPres; MacCellGrpCfg macCellGrpCfg; @@ -1828,6 +1854,26 @@ typedef struct macDlBroadcastReq SiSchedulingInfo **siSchedulingInfo; }MacDlBroadcastReq; +typedef struct macStatsInfo +{ + MacMeasurementType type; + uint16_t periodicity; /* In milliseconds */ +}MacStatsInfo; + +typedef struct macStatsReq +{ + uint8_t numStats; + MacStatsInfo statsList[MAX_NUM_STATS]; +}MacStatsReq; + +typedef struct macStatsRsp +{ + MacRsp rsp; + CauseOfResult cause; +}MacStatsRsp; + +/****************** FUNCTION POINTERS ********************************/ + /* DL broadcast req from DU APP to MAC*/ typedef uint8_t (*DuMacDlBroadcastReq) ARGS(( Pst *pst, @@ -1980,98 +2026,145 @@ typedef uint8_t (*MacDuUeSyncStatusIndFunc) ARGS(( Pst *pst, MacUeSyncStatusInd *syncStatusInd)); -uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */ +/* Statitics Request from DU APP to MAC */ +typedef uint8_t (*DuMacStatsReqFunc) ARGS(( + Pst *pst, + MacStatsReq *statsReq)); +/* Statistics Response from MAC to DU APP */ +typedef uint8_t (*MacDuStatsRspFunc) ARGS(( + Pst *pst, + MacStatsRsp *statsRsp)); + +/******************** FUNCTION DECLARATIONS ********************************/ uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId); uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf); uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId); + uint8_t packMacCellStart(Pst *pst, CellStartInfo *cellStartInfo); uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf); uint8_t MacProcCellStart(Pst *pst, CellStartInfo *cellStartInfo); + uint8_t packMacCellStop(Pst *pst, CellStopInfo *cellStopInfo); uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf); uint8_t MacProcCellStop(Pst *pst, CellStopInfo *cellStopInfo); + uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg); uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf); uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg); + uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm); uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf); uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm); + uint8_t packMacStopInd(Pst *pst, OduCellId *cellId); uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf); uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId); +uint8_t sendStopIndMacToDuApp(uint16_t cellId); + uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo); uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf); uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo); + uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo); uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf); uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo); + uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg); uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf); uint8_t MacProcUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg); -uint8_t sendStopIndMacToDuApp(uint16_t cellId); + uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp); uint8_t unpackDuMacUeCreateRsp(MacDuUeCreateRspFunc func, Pst *pst, Buffer *mBuf); uint8_t DuProcMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp); + uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg); uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf); uint8_t MacProcUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg); + uint8_t packDuMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *recfgRsp); uint8_t unpackDuMacUeRecfgRsp(MacDuUeRecfgRspFunc func, Pst *pst, Buffer *mBuf); uint8_t DuProcMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *recfgRsp); + uint8_t packDuMacRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq); uint8_t unpackMacRachRsrcReq(DuMacRachRsrcReq func, Pst *pst, Buffer *mBuf); uint8_t MacProcRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq); + uint8_t packDuMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp); uint8_t unpackDuMacRachRsrcRsp(MacDuRachRsrcRspFunc func, Pst *pst, Buffer *mBuf); uint8_t DuProcMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp); + uint8_t packDuMacRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel); uint8_t unpackMacRachRsrcRel(DuMacRachRsrcRel func, Pst *pst, Buffer *mBuf); uint8_t MacProcRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel); + uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDelete); uint8_t MacProcUeDeleteReq(Pst *pst, MacUeDelete *ueDelete); uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp); uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp); uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete); uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete); uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp); uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp); uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq); uint8_t MacProcSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq); uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf); + uint8_t DuProcMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp); uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp); uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq); uint8_t MacProcSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq); uint8_t unpackMacSliceRecfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf); + uint8_t DuProcMacSliceRecfgRsp(Pst *pst, MacSliceRecfgRsp *sliceRecfgRsp); uint8_t packDuMacSliceRecfgRsp(Pst *pst, MacSliceRecfgRsp *sliceRecfgRsp); uint8_t unpackDuMacSliceRecfgRsp(MacDuSliceRecfgRspFunc func, Pst *pst, Buffer *mBuf); + uint8_t duHandleSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo); uint8_t packMacSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo); uint8_t unpackDuMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacDlPcchInd(Pst *pst, DlPcchInd *pcchInd); uint8_t MacProcDlPcchInd(Pst *pst, DlPcchInd *pcchInd); uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf); + int8_t getFreeBitFromUeBitMap(uint16_t cellId); void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos); + uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueReset); uint8_t MacProcUeResetReq(Pst *pst, MacUeResetReq *ueReset); uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp); uint8_t DuProcMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp); uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd); uint8_t DuProcMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *ueSyncStatusInd); uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf); + uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq); uint8_t MacProcDlBroadcastReq(Pst *pst, MacDlBroadcastReq *dlBroadcastReq); uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf); + +uint8_t packDuMacStatsReq(Pst *pst, MacStatsReq *statsReq); +uint8_t MacProcStatsReq(Pst *pst, MacStatsReq *statsReq); +uint8_t unpackMacStatsReq(DuMacStatsReqFunc func, Pst *pst, Buffer *mBuf); + +uint8_t packDuMacStatsRsp(Pst *pst, MacStatsRsp *statsRsp); +uint8_t DuProcMacStatsRsp(Pst *pst, MacStatsRsp *statsRsp); +uint8_t unpackDuMacStatsRsp(MacDuStatsRspFunc func, Pst *pst, Buffer *mBuf); + #endif