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=24bbacbc0da3f75313df91bc4899000c2396e8b8;hpb=ca0353e5cb5699aecb6840efe9572934a1150e2b;p=o-du%2Fl2.git diff --git a/src/cm/du_app_mac_inf.h b/src/cm/du_app_mac_inf.h index 24bbacbc0..c0cb0dc80 100644 --- a/src/cm/du_app_mac_inf.h +++ b/src/cm/du_app_mac_inf.h @@ -21,7 +21,8 @@ #define __MACINT_H__ #define NUM_NUMEROLOGY 5 /* Number of numerology */ - +#define MAX_SI_MESSAGE 32 /* As per 138 331 V15.3, RRC Multiplicity and type constraint definitions maxSI-Message = 32 */ +#define NUM_SIB 32 /* As per 138 331 V15.3, RRC Multiplicity and type constraint definitions maxSIB = 32 */ #define NUM_SSB 1 /* max value is 64 */ #define SSB_MASK_SIZE 1 /* SSB mask size is 32bit for sub6 */ #define SIB1_REPETITION_PERIOD 20 @@ -84,37 +85,103 @@ #define EVENT_MAC_RACH_RESOURCE_RSP 222 #define EVENT_MAC_RACH_RESOURCE_REL 223 #define EVENT_MAC_DL_PCCH_IND 224 +#define EVENT_MAC_UE_RESET_REQ 225 +#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 #define BSR_SR_DELAY_TMR_2560 2560 #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 { - MAC_DU_APP_RSP_NOK, - MAC_DU_APP_RSP_OK -}MacRsp; + SIB_TYPE2, + SIB_TYPE3, + SIB_TYPE4, + SIB_TYPE5, + SIB_TYPE6, + SIB_TYPE7, + SIB_TYPE8, + SIB_TYPE9, + SPARE +}SibType; + +typedef enum +{ + SSB_PER_RACH_OCCASION_ONE_EIGHTH, + SSB_PER_RACH_OCCASION_ONE_FOURTH, + SSB_PER_RACH_OCCASION_ONE_HALF, + SSB_PER_RACH_OCCASION_ONE, + SSB_PER_RACH_OCCASION_TWO, + SSB_PER_RACH_OCCASION_FOUR, + SSB_PER_RACH_OCCASION_EIGHT, + SSB_PER_RACH_OCCASION_SIXTEEN +}SsbPerRachOccasion; + +typedef enum +{ + BROADCASTING, + NOTBROADCASTING, +}SiBroadcastStatus; typedef enum { - SLICE_PRESENT, - SLICE_NOT_PRESENT -}RspReason; + RF8, + RF16, + RF32, + RF64, + RF128, + RF256, + RF512 +}SiPeriodicity; typedef enum { - DEL_SUCCESSFUL, - CELLID_INVALID, - UEID_INVALID -}UeDeleteStatus; + S5, + S10, + S20, + S40, + S80, + S160, + S320, + S640, + S1280 +}SiWindowLength; typedef enum { - SUCCESSFUL_RSP, - CELL_ID_INVALID -}CellDeleteStatus; + SI_REQ_PERIOD_1, + SI_REQ_PERIOD_2, + SI_REQ_PERIOD_4, + SI_REQ_PERIOD_6, + SI_REQ_PERIOD_8, + SI_REQ_PERIOD_10, + SI_REQ_PERIOD_12, + SI_REQ_PERIOD_16 +}SiRequestPeriod; + +typedef enum +{ + MAC_DU_APP_RSP_NOK, + MAC_DU_APP_RSP_OK +}MacRsp; + +typedef enum +{ + IN_SYNC, + OUT_OF_SYNC, + OUT_OF_SUNC_MAX_RETRIES +}SyncStatus; typedef enum { @@ -152,7 +219,7 @@ typedef enum typedef enum { BETA_PSS_0DB, - BETA_PSS_1DB + BETA_PSS_3DB }BetaPss; typedef enum @@ -517,74 +584,69 @@ typedef enum RESTART_TRANSMISSION }DataTransmissionAction; -typedef struct failureCause +/* 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; union { - RadioNwLyrCause radioNwCause; - TransLyrCause transportCause; - ProtCause protcolCause; - MiscFailCause miscCause; + RadioNwLyrCause radioNwResult; + TransLyrCause transportResult; + ProtCause protcolResult; + MiscFailCause miscResult; }u; }FailureCause; typedef struct carrierCfg { - bool pres; - uint32_t bw; /* DL/UL bandwidth */ - uint32_t freq; /* Absolute frequency of DL/UL point A in KHz */ - uint16_t k0[NUM_NUMEROLOGY]; /* K0 for DL/UL */ - uint16_t gridSize[NUM_NUMEROLOGY]; /* DL/UL Grid size for each numerologies */ - uint16_t numAnt; /* Number of Tx/Rx antennas */ + uint32_t dlBw; /* DL bandwidth */ + uint32_t dlFreq; /* Absolute frequency of DL point A in KHz */ + uint32_t ulBw; /* UL bandwidth */ + uint32_t ulFreq; /* Absolute frequency of UL point A in KHz */ + uint16_t numTxAnt; /* Number of Tx antennas */ + uint16_t numRxAnt; /* Number of Rx antennas */ }CarrierCfg; -typedef struct ssbCfg +typedef enum { - uint32_t ssbPbchPwr; /* SSB block power */ - BchPduOpt bchPayloadFlag; /* Options for generation of payload */ - uint8_t scsCmn; /* subcarrier spacing for common */ - uint16_t ssbOffsetPointA; /* SSB subcarrier offset from point A */ - BetaPss betaPss; - SSBPeriod ssbPeriod; /* SSB Periodicity in msec */ - uint8_t ssbScOffset; /* Subcarrier Offset */ - uint8_t mibPdu[3]; /* MIB payload */ - uint32_t ssbMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */ - uint8_t beamId[NUM_SSB]; - bool multCarrBand; /* Multiple carriers in a band */ - bool multCellCarr; /* Multiple cells in single carrier */ -}SsbCfg; + OP_DISABLED, + OP_ENABLED, +}MacOpState; -typedef struct fdmInfo +typedef enum { - 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 */ - uint8_t numUnusedRootSeq; /* Number of unused root sequence */ - uint8_t *unsuedRootSeq; /* Unused root sequence per FD */ -}PrachFdmInfo; + ADMIN_LOCKED, + ADMIN_UNLOCKED, + ADMIN_SHUTTING_DOWN, +}MacAdminState; -typedef struct prachCfg +typedef enum { - bool pres; - uint8_t prachCfgIdx; /* PRACH Cfg Index */ - PrachSeqLen prachSeqLen; /* RACH Sequence length: Long/short */ - uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */ - RstSetCfg prachRstSetCfg; /* PRACH restricted set config */ - uint16_t msg1FreqStart; /* Msg1-FrequencyStart */ - uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */ - uint8_t rootSeqLen; /* Root sequence length */ - PrachFdmInfo fdm[8]; /* FDM info */ - uint8_t totalNumRaPreamble; /* Total number of RA preambles */ - uint8_t ssbPerRach; /* SSB per RACH occassion */ - uint8_t numCbPreamblePerSsb; /* Number of CB preamble per SSB */ - bool prachMultCarrBand; /* Multiple carriers in Band */ - uint8_t prachRestrictedSet; /* Support for PRACH restricted set */ - uint8_t raContResTmr; /* RA Contention Resoultion Timer */ - uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */ - uint8_t raRspWindow; /* RA Response Window */ -}PrachCfg; + CELL_IDLE, + CELL_INACTIVE, + CELL_ACTIVE, +}MacCellState; + +/*Spec Ref: 38.331: RadioLinkMonitoringConfig*/ +typedef enum +{ + BeamFailure, + Rlf, + Both +}PurposeOfFailureDet; + +typedef struct plmnInfoList +{ + Plmn plmn; + uint8_t numSupportedSlice; /* Total slice supporting */ + Snssai **snssai; /* List of supporting snssai*/ +}PlmnInfoList; typedef struct schPageCfg { @@ -593,15 +655,18 @@ typedef struct schPageCfg uint16_t pagingOcc[MAX_PO_PER_PF]; /*FirstPDCCH-Monitoring Paging Occasion*/ }SchPageCfg; -typedef struct sib1CellCfg +typedef struct pdcchConfigSib1 { - uint8_t *sib1Pdu; - uint16_t sib1PduLen; - uint16_t sib1RepetitionPeriod; uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */ uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */ - uint16_t sib1Mcs; - SchPageCfg pagingCfg; +}PdcchConfigSib1; + +typedef struct sib1CellCfg +{ + PdcchConfigSib1 pdcchCfgSib1; /*Freq pos where UE may find SS/PBCH block with SIB1*/ + uint8_t *sib1Pdu; + uint16_t sib1PduLen; + SchPageCfg pagingCfg; } Sib1CellCfg; typedef struct bwpParams @@ -662,14 +727,13 @@ typedef struct pucchConfigCommon /* PUSCH Time Domain Resource Allocation */ typedef struct puschTimeDomRsrcAlloc { - uint8_t k2; + uint8_t k2; CommonMappingType mappingType; - uint8_t startSymbol; - uint8_t symbolLength; - uint8_t startSymbolAndLength; + uint8_t startSymbol; + uint8_t symbolLength; + uint8_t startSymbolAndLength; }PuschTimeDomRsrcAlloc; - typedef struct puschConfigCommon { /* PUSCH-TimeDomainResourceAllocation info */ @@ -679,25 +743,75 @@ typedef struct puschConfigCommon typedef struct bwpDlConfig { - BwpParams bwp; + BwpParams bwp; PdcchConfigCommon pdcchCommon; PdschConfigCommon pdschCommon; }BwpDlConfig; typedef struct bwpUlConfig { - BwpParams bwp; + BwpParams bwp; // rach config common sent in PrachCfg PucchConfigCommon pucchCommon; PuschConfigCommon puschCommon; }BwpUlConfig; -typedef struct plmnInfoList + +typedef struct cellCfg { - Plmn plmn; - uint8_t numSupportedSlice; /* Total slice supporting */ - Snssai **snssai; /* List of supporting snssai*/ -}PlmnInfoList; + 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. */ @@ -738,28 +852,54 @@ typedef struct drxCfg }DrxCfg; #endif +typedef struct precodingConf +{ + uint16_t numLayers; + uint16_t numAntPorts; +}PrecodingConf; + +typedef struct beamformingConf +{ + uint16_t numOfBeams; + uint16_t numTxRUs; + uint16_t beamIdx; + uint16_t beamType; + uint32_t beamAzimuth; + uint32_t beamTilt; + uint32_t beamHorizWidth; + uint32_t beamVertWidth; + uint32_t coverageShape; + uint32_t digitalTilt; + 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 */ - uint8_t carrierId; /* Carrired Index */ - uint16_t phyCellId; /* Physical cell id */ - uint8_t numerology; /* Supported numerology */ - DuplexMode dupType; /* Duplex type: TDD/FDD */ - CarrierCfg dlCarrCfg; /* DL Carrier configuration */ - CarrierCfg ulCarrCfg; /* UL Carrier configuration */ - bool freqShft; /* Indicates presence of 7.5kHz frequency shift */ - SsbCfg ssbCfg; /* SSB configuration */ - PrachCfg prachCfg; /* PRACH Configuration */ + 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 */ + TDDCfg tddCfg; /* TDD periodicity and slot configuration */ #endif - RSSIMeasUnit rssiUnit; /* RSSI measurement unit */ - Sib1CellCfg sib1Cfg; /* SIB1 config */ - BwpDlConfig initialDlBwp; /* Initial DL BWP */ - BwpUlConfig initialUlBwp; /* Initial UL BWP */ - uint8_t dmrsTypeAPos; /* DMRS Type A position */ - PlmnInfoList plmnInfoList; /* Consits of PlmnId and Snssai list */ - //RrmPolicy *rrmPolicy; /* RRM policy details */ + PrecodingConf precodingConf; + BeamformingConf beamCfg; }MacCellCfg; typedef struct macCellCfgCfm @@ -946,15 +1086,51 @@ typedef struct initialDlBwp PdschConfig pdschCfg; }InitialDlBwp; -/* BWP Downlink common */ -typedef struct bwpDlCommon +/*Spec 38.331 "SPS-Config'*/ +typedef struct spsConfig +{ + uint16_t periodicity; + uint8_t numOfHqProcess; + uint8_t n1PucchAN; + McsTable mcsTable; +}SpsConfig; + +typedef uint8_t RadioLinkMonitoringRsId; + +typedef struct radioLinkMonRS +{ + RadioLinkMonitoringRsId radioLinkMonitoringRsId; + PurposeOfFailureDet purpose; + union + { + uint8_t ssbIndx; + uint8_t nzpCsiRsResId; + }detectionRes; +}RadioLinkMonRS; + +typedef struct radioLinkConfig +{ + RadioLinkMonRS failurDetResAddModList[1]; + RadioLinkMonitoringRsId failurDetResRelList[1]; + uint8_t beamFailureInstanceMaxCount; + uint8_t beamFailureDetectionTimer; +}RadioLinkConfig; + +/* Spec 38.331, 'BWP-DownlinkDedicated'*/ +typedef struct bwpDlCfgDed { -}BwpDlCommon; + PdcchConfig pdcchCfgDed; + PdschConfig pdschCfgDed; + SpsConfig spsCfgDed; + RadioLinkConfig radioLnkMonCfgDed; +}BwpDlCfgDed; /* Downlink BWP information */ typedef struct dlBwpInfo { uint8_t bwpId; + BwpDlConfig bwpCommon; + BwpDlCfgDed bwpDedicated; }DlBwpInfo; /* PDCCH Serving Cell configuration */ @@ -1168,26 +1344,88 @@ typedef struct initialUlBwp PuschCfg puschCfg; }InitialUlBwp; +typedef struct bwpUlCfgDed +{ + PucchCfg pucchCfg; + PuschCfg puschCfg; +}BwpUlCfgDed; + /* Uplink BWP information */ typedef struct ulBwpInfo { - uint8_t bwpId; + uint8_t bwpId; + BwpUlConfig bwpCommon; + BwpUlCfgDed bwpDed; }UlBwpInfo; +typedef struct rachCfgGeneric +{ + uint8_t prachCfgIdx; /* PRACH config idx */ + uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */ + uint16_t msg1FreqStart; /* Msg1-FrequencyStart */ + uint8_t zeroCorrZoneCfg; /* Zero correlation zone cofig */ + int16_t preambleRcvdTargetPower; /*Prach Target power received*/ + uint8_t preambleTransMax; /*Preamble Transmission Max power*/ + uint8_t pwrRampingStep; /*Power Ramping Step*/ + uint8_t raRspWindow; /* RA Response Window */ +}RachCfgGeneric; + +typedef struct raPrioritization +{ + uint8_t powerRampingStepHighPriority; + uint8_t scalingFactorBI; +}RaPrioritization; + +typedef struct bfrCsiRsRes +{ + uint8_t csrRsIndex; + uint8_t raOccList; + uint8_t raPreambleIndex; +}BfrCsiRsRes; + +typedef struct bfrSsbRes +{ + uint16_t ssbIndex; + uint8_t raPreambleIndex; +}BfrSsbRes; + +typedef struct prachResDedBfr +{ + BfrSsbRes ssb; + BfrCsiRsRes csiRs; +}PrachResDedBfr; + +/*Spec 38.331 'BeamFailureRecoveryConfig' */ +typedef struct beamFailRecoveryCfg +{ + uint8_t rootSeqIndexBfr; + RachCfgGeneric rachCfgBfr; + uint8_t rsrpThreshSsbBfr; + PrachResDedBfr candidteBeamRSList; + uint8_t ssbPerachBfr; + uint8_t raSsbOccMaskIndex; + uint8_t recoverySearchSpaceId; + RaPrioritization raPrioBfr; + uint16_t bfrTimer; + uint8_t msg1SubcSpacing; +}BeamFailRecoveryCfg; + /* Serving cell configuration */ typedef struct servCellCfgInfo { - InitialDlBwp initDlBwp; - uint8_t numDlBwpToAdd; - DlBwpInfo dlBwpToAddList[MAX_NUM_BWP]; - uint8_t firstActvDlBwpId; - uint8_t defaultDlBwpId; - uint8_t *bwpInactivityTmr; - PdschServCellCfg pdschServCellCfg; - InitialUlBwp initUlBwp; - uint8_t numUlBwpToAdd; - UlBwpInfo ulBwpToAddList[MAX_NUM_BWP]; - uint8_t firstActvUlBwpId; + InitialDlBwp initDlBwp; + RadioLinkConfig radioLinkMonConfig; + uint8_t numDlBwpToAdd; + DlBwpInfo dlBwpToAddList[MAX_NUM_BWP]; + uint8_t firstActvDlBwpId; + uint8_t defaultDlBwpId; + uint8_t *bwpInactivityTmr; + PdschServCellCfg pdschServCellCfg; + InitialUlBwp initUlBwp; + BeamFailRecoveryCfg beamFailureRecoveryCfg; + uint8_t numUlBwpToAdd; + UlBwpInfo ulBwpToAddList[MAX_NUM_BWP]; + uint8_t firstActvUlBwpId; }ServCellCfgInfo; /* Special cell configuration */ @@ -1197,14 +1435,20 @@ typedef struct spCellCfg ServCellCfgInfo servCellCfg; }SpCellCfg; +typedef struct bwpRelInfo +{ + uint8_t bwpId; +}BwpRelInfo; + /* Serving cell Re-configuration */ typedef struct servCellRecfgInfo { InitialDlBwp initDlBwp; + RadioLinkConfig radioLinkMonConfig; uint8_t numDlBwpToAddOrMod; DlBwpInfo dlBwpToAddOrModList[MAX_NUM_BWP]; uint8_t numDlBwpToRel; - DlBwpInfo dlBwpToRelList[MAX_NUM_BWP]; + BwpRelInfo dlBwpToRelList[MAX_NUM_BWP]; uint8_t firstActvDlBwpId; uint8_t defaultDlBwpId; uint8_t *bwpInactivityTmr; @@ -1213,7 +1457,7 @@ typedef struct servCellRecfgInfo uint8_t numUlBwpToAddOrMod; UlBwpInfo ulBwpToAddOrModList[MAX_NUM_BWP]; uint8_t numUlBwpToRel; - UlBwpInfo ulBwpToRelList[MAX_NUM_BWP]; + BwpRelInfo ulBwpToRelList[MAX_NUM_BWP]; uint8_t firstActvUlBwpId; }ServCellRecfgInfo; @@ -1309,10 +1553,11 @@ typedef struct modulationInfo McsTable mcsTable; /* MCS table */ }ModulationInfo; -typedef struct macUeCfg +typedef struct macUeCreateReq { uint16_t cellId; uint8_t ueId; + uint8_t beamIdx; uint16_t crnti; bool macCellGrpCfgPres; MacCellGrpCfg macCellGrpCfg; @@ -1325,7 +1570,7 @@ typedef struct macUeCfg ModulationInfo ulModInfo; /* UL modulation info */ uint8_t numLcs; LcCfg lcCfgList[MAX_NUM_LC]; -}MacUeCfg; +}MacUeCreateReq; /* UE Re-configuration */ typedef struct macUeRecfg @@ -1379,7 +1624,7 @@ typedef struct sCellFailInfo FailureCause cause; }SCellFailInfo; -typedef struct ueCfgRsp +typedef struct macUeCreateRsp { uint16_t cellId; uint16_t ueId; @@ -1392,9 +1637,9 @@ typedef struct ueCfgRsp SCellFailInfo *failedSCellList; uint8_t numDRBModFailed; /* valid values : 0 to MAX_NUM_DRB */ DRBFailInfo *failedDRBModlist; -}MacUeCfgRsp; +}MacUeCreateRsp; -typedef struct ueCfgRsp MacUeRecfgRsp; +typedef struct macUeCreateRsp MacUeRecfgRsp; typedef struct rachRsrcReq { @@ -1443,7 +1688,7 @@ typedef struct ueDeleteRsp { uint16_t cellId; uint8_t ueId; - UeDeleteStatus result; + CauseOfResult status; }MacUeDeleteRsp; typedef struct macCellDeleteReq @@ -1454,45 +1699,48 @@ typedef struct macCellDeleteReq typedef struct macCellDeleteRsp { uint16_t cellId; - CellDeleteStatus result; + CauseOfResult status; }MacCellDeleteRsp; -typedef struct macSliceRsp +typedef struct macSliceCfgRsp { Snssai snssai; MacRsp rsp; - RspReason cause; -}MacSliceRsp; + CauseOfResult cause; +}MacSliceCfgRsp; typedef struct rrmPolicyRatio { - uint8_t policyMaxRatio; - uint8_t policyMinRatio; - uint8_t policyDedicatedRatio; + uint8_t maxRatio; + uint8_t minRatio; + uint8_t dedicatedRatio; }RrmPolicyRatio; -typedef struct macSliceRrmPolicy +typedef struct rrmPolicyMemberList { + Plmn plmn; Snssai snssai; - RrmPolicyRatio *rrmPolicyRatio; +}RrmPolicyMemberList; + +typedef struct macSliceRrmPolicy +{ + ResourceType resourceType; + uint8_t numOfRrmPolicyMem; + RrmPolicyMemberList **rRMPolicyMemberList; + RrmPolicyRatio policyRatio; }MacSliceRrmPolicy; typedef struct macSliceCfgReq { - uint8_t numOfConfiguredSlice; - MacSliceRrmPolicy **listOfSliceCfg; + uint8_t numOfRrmPolicy; + MacSliceRrmPolicy **listOfRrmPolicy; }MacSliceCfgReq; -typedef struct macSliceCfgRsp -{ - uint8_t numSliceCfgRsp; - MacSliceRsp **listOfSliceCfgRsp; -}MacSliceCfgRsp; - /*As per ORAN-WG8, Slice Cfg and ReCfg are same structures*/ typedef struct macSliceCfgReq MacSliceRecfgReq; typedef struct macSliceCfgRsp MacSliceRecfgRsp; +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.17 DL PCCH Indication */ typedef struct dlPcchInd { uint16_t cellId; @@ -1502,6 +1750,8 @@ typedef struct dlPcchInd uint8_t *pcchPdu; }DlPcchInd; + +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.1 Cell Start */ typedef struct cellInfo { SlotTimingInfo slotInfo; @@ -1511,6 +1761,124 @@ typedef struct cellInfo typedef struct cellInfo CellStartInfo; typedef struct cellInfo CellStopInfo; +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.12 UE Reset Request */ +typedef struct ueReset +{ + uint16_t cellId; + uint8_t ueId; +}MacUeResetReq; + +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.13 UE Reset Response */ +typedef struct ueResetRsp +{ + uint16_t cellId; + uint8_t ueId; + CauseOfResult status; +}MacUeResetRsp; + +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.14 UE Sync Status Indication */ +typedef struct ueSyncStatusInd +{ + uint16_t cellId; + uint8_t ueId; + SyncStatus status; +}MacUeSyncStatusInd; + +/* The following list of structures is taken from the SI-SchedulingInfo section of specification 33.331. */ +typedef struct sibTypeInfo +{ + SibType sibType; + uint8_t valueTag; + bool areaScope; +}SibTypeInfo; + +typedef struct sibMappingInfo +{ + uint8_t numSibTypeInfo; + SibTypeInfo sibTypeInfo[NUM_SIB]; +}SibMappingInfo; + +typedef struct schedulingInfo +{ + SiBroadcastStatus siBroadcastStatus; + SiPeriodicity siPeriodicity; + SibMappingInfo sibMappingInfo; +}SchedulingInfo; + +typedef struct rachOccasionsSi +{ + RachCfgGeneric rachConfigSi; + SsbPerRachOccasion ssbPerRachOccasion; +}RachOccasionsSi; + +typedef struct siReqRsrc +{ + uint8_t raPreambleStartIndex; + uint8_t raAssociationPeriodIndex; + uint8_t raSsbOccasionMaskIndex; +}SiReqRsrc; + +typedef struct siRequestResource +{ + uint8_t numOfSiReqRsrc; + SiReqRsrc siReqRsrc[MAX_SI_MESSAGE]; +}SiRequestResource; + +typedef struct siRequestConfig +{ + RachOccasionsSi rachOccasionsSi; + SiRequestPeriod siRequestPeriod; + SiRequestResource siRequestResource; +}SiRequestConfig; + +typedef struct schedulingInfoList +{ + uint8_t numSchInfo; + SchedulingInfo schedulingInfo[MAX_SI_MESSAGE]; +}SchedulingInfoList; + +typedef struct siSchedulingInfo +{ + SchedulingInfoList schInfoList; + SiWindowLength siWindowLength; + SiRequestConfig siRequestConfig; + SiRequestConfig siRequestConfigSUL; + uint8_t *siAreaID; +}SiSchedulingInfo; + +/* Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.18 DL Broadcast Request */ +typedef struct macDlBroadcastReq +{ + uint16_t cellId; + uint8_t numSiBlock; + 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, + MacDlBroadcastReq *dlBroadcast)); + /* Functions for CellUp Ind from MAC to DU APP*/ typedef uint8_t (*DuMacCellUpInd) ARGS(( Pst *pst, @@ -1566,12 +1934,12 @@ typedef uint8_t (*DuMacDlCcchInd) ARGS(( /* UE create Request from DU APP to MAC*/ typedef uint8_t (*DuMacUeCreateReq) ARGS(( Pst *pst, - MacUeCfg *ueCfg )); + MacUeCreateReq *ueCfg )); /* UE create Response from MAC to DU APP */ -typedef uint8_t (*MacDuUeCfgRspFunc) ARGS(( +typedef uint8_t (*MacDuUeCreateRspFunc) ARGS(( Pst *pst, - MacUeCfgRsp *cfgRsp)); + MacUeCreateRsp *cfgRsp)); /* UE Reconfig Request from DU APP to MAC */ typedef uint8_t (*DuMacUeReconfigReq) ARGS(( @@ -1643,86 +2011,160 @@ typedef uint8_t (*DuMacDlPcchInd) ARGS(( Pst *pst, DlPcchInd *pcchInd)); -uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */ +/* UE Reset Request from DU APP to MAC*/ +typedef uint8_t (*DuMacUeResetReq) ARGS(( + Pst *pst, + MacUeResetReq *ueReset )); + +/* UE Reset Response from MAC to DU APP*/ +typedef uint8_t (*MacDuUeResetRspFunc) ARGS(( + Pst *pst, + MacUeResetRsp *resetRsp)); +/* UE sync status indication from MAC to DU APP*/ +typedef uint8_t (*MacDuUeSyncStatusIndFunc) ARGS(( + Pst *pst, + MacUeSyncStatusInd *syncStatusInd)); + +/* 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, MacUeCfg *ueCfg); + +uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg); uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf); -uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg); -uint8_t sendStopIndMacToDuApp(uint16_t cellId); -uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp); -uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf); -uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp); +uint8_t MacProcUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg); + +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