[Epic-ID: ODUHIGH-488][Task-ID: ODUHIGH-499] WG8 Alignment | Slice Cfg and Recfg Rsp
[o-du/l2.git] / src / cm / du_app_mac_inf.h
index 8df0b10..998de68 100644 (file)
@@ -90,6 +90,7 @@
 #define BSR_SR_DELAY_TMR_2560 2560
 
 #define PAGING_SCHED_DELTA  4
+#define MAX_PLMN 2
 
 typedef enum
 {
@@ -99,8 +100,10 @@ typedef enum
 
 typedef enum
 {
-   SLICE_PRESENT,
-   SLICE_NOT_PRESENT
+   SLICE_NOT_PRESENT,
+   SLICE_IS_CONFIGURED,
+   SLICE_IS_RECONFIGURED,
+   RESOURCE_DOES_NOT_AVAILABLE
 }RspReason;
 
 typedef enum
@@ -152,7 +155,7 @@ typedef enum
 typedef enum
 {
    BETA_PSS_0DB,
-   BETA_PSS_1DB
+   BETA_PSS_3DB
 }BetaPss;
 
 typedef enum 
@@ -531,28 +534,91 @@ typedef struct 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 enum
+{
+   OP_DISABLED,     
+   OP_ENABLED,     
+}MacOpState;
+
+typedef enum
+{
+   ADMIN_LOCKED,     
+   ADMIN_UNLOCKED,  
+   ADMIN_SHUTTING_DOWN, 
+}MacAdminState;
+
+typedef enum
+{
+   CELL_IDLE,
+   CELL_INACTIVE,
+   CELL_ACTIVE,
+}MacCellState;
+
+typedef struct plmnInfoList
+{
+   Plmn           plmn;
+   uint8_t        numSupportedSlice; /* Total slice supporting */
+   Snssai         **snssai;         /* List of supporting snssai*/
+}PlmnInfoList;
+
+typedef struct schPageCfg
+{
+  uint8_t  numPO;                    /*Derived from Ns*/
+  bool     poPresent;                /*Whether FirstPDCCH-MonitoringPO is present or not*/
+  uint16_t pagingOcc[MAX_PO_PER_PF]; /*FirstPDCCH-Monitoring Paging Occasion*/
+}SchPageCfg;
+
+typedef struct pdcchConfigSib1
+{
+   uint8_t coresetZeroIndex;     /* derived from 4 LSB of pdcchSib1 present in MIB */
+   uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
+}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 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 */
-   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 */
+   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
@@ -561,49 +627,25 @@ typedef struct fdmInfo
    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;
 
 typedef struct prachCfg
 {
-   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 */
+   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 */
-   uint8_t       totalNumRaPreamble;  /* Total number of RA preambles */
+   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 */
-   bool          prachMultCarrBand;   /* Multiple carriers in Band */
-   uint8_t       prachRestrictedSet; /* Support for PRACH restricted set */
+   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 schPageCfg
-{
-  uint8_t  numPO;                    /*Derived from Ns*/
-  bool     poPresent;                /*Whether FirstPDCCH-MonitoringPO is present or not*/
-  uint16_t pagingOcc[MAX_PO_PER_PF]; /*FirstPDCCH-Monitoring Paging Occasion*/
-}SchPageCfg;
-
-typedef struct sib1CellCfg
-{
-   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;
-} Sib1CellCfg; 
-
 typedef struct bwpParams
 {
    uint16_t firstPrb;
@@ -662,11 +704,11 @@ 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;
 
 
@@ -679,26 +721,19 @@ 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
-{
-   Plmn           plmn;
-   uint8_t        numSupportedSlice; /* Total slice supporting */
-   Snssai         **snssai;         /* List of supporting snssai*/
-}PlmnInfoList;
-
 #ifdef NR_DRX
 /* The following list of structures is taken from the DRX-Config section of specification 33.331. */
 typedef struct drxOnDurationTimer
@@ -738,28 +773,41 @@ 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 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 */          
+   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 */ 
+   BwpDlConfig      initialDlBwp;     /* Initial DL BWP */
+   BwpUlConfig      initialUlBwp;     /* Initial UL BWP */
+   PrecodingConf    precodingConf;
+   BeamformingConf  beamCfg;
 }MacCellCfg;
 
 typedef struct macCellCfgCfm
@@ -843,6 +891,7 @@ typedef struct macCellGrpCfg
    bool        phrCfgSetupPres;   /* true/false: phrCfgSetup/phrCfgRelease */
    PhrCfg      phrCfg;
 #ifdef NR_DRX
+   bool        drxCfgPresent;
    DrxCfg      drxCfg;
 #endif
 }MacCellGrpCfg;
@@ -1178,14 +1227,14 @@ typedef struct servCellCfgInfo
 {
    InitialDlBwp       initDlBwp;
    uint8_t            numDlBwpToAdd;
-   DlBwpInfo          DlBwpToAddList[MAX_NUM_BWP];
+   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];
+   UlBwpInfo          ulBwpToAddList[MAX_NUM_BWP];
    uint8_t            firstActvUlBwpId;
 }ServCellCfgInfo;
 
@@ -1196,6 +1245,33 @@ typedef struct spCellCfg
    ServCellCfgInfo   servCellCfg;
 }SpCellCfg;
 
+/* Serving cell Re-configuration */
+typedef struct servCellRecfgInfo
+{
+   InitialDlBwp       initDlBwp;
+   uint8_t            numDlBwpToAddOrMod;
+   DlBwpInfo          dlBwpToAddOrModList[MAX_NUM_BWP];
+   uint8_t            numDlBwpToRel;
+   DlBwpInfo          dlBwpToRelList[MAX_NUM_BWP];
+   uint8_t            firstActvDlBwpId;
+   uint8_t            defaultDlBwpId;
+   uint8_t            *bwpInactivityTmr;
+   PdschServCellCfg   pdschServCellCfg;
+   InitialUlBwp       initUlBwp;
+   uint8_t            numUlBwpToAddOrMod;
+   UlBwpInfo          ulBwpToAddOrModList[MAX_NUM_BWP];
+   uint8_t            numUlBwpToRel;
+   UlBwpInfo          ulBwpToRelList[MAX_NUM_BWP];
+   uint8_t            firstActvUlBwpId;
+}ServCellRecfgInfo;
+
+/* Special cell Re-configuration */
+typedef struct spCellRecfg 
+{
+   uint8_t             servCellIdx;
+   ServCellRecfgInfo   servCellCfg;
+}SpCellRecfg;
+
 typedef struct ambrCfg
 {
    uint32_t ulBr;   /* UL Bit rate */
@@ -1259,17 +1335,16 @@ typedef struct ulLcCfg
    BucketSizeDur bsd;        // bucketSizeDuration
 }UlLcCfg;
 
-typedef struct duLcCfg
+typedef struct dlLcCfg
 {
    LcPriority lcp;      // logical Channel Prioritization
 }DlLcCfg;
 
 typedef struct lcCfg
 {
-   ConfigType configType;
    uint8_t lcId;
-   DrbQosInfo *drbQos; 
    Snssai  *snssai;
+   DrbQosInfo *drbQos; 
    bool ulLcCfgPres;
    UlLcCfg ulLcCfg;
    DlLcCfg dlLcCfg;
@@ -1284,24 +1359,50 @@ typedef struct modulationInfo
 
 typedef struct macUeCfg
 {
-   uint16_t cellId;
-   uint8_t  ueId;
-   uint16_t crnti;
-   bool macCellGrpCfgPres;
-   MacCellGrpCfg macCellGrpCfg;
-   bool phyCellGrpCfgPres;
-   PhyCellGrpCfg phyCellGrpCfg;
-   bool spCellCfgPres;
-   SpCellCfg spCellCfg;
-   AmbrCfg   *ambrCfg;
-   ModulationInfo dlModInfo;    /* DL modulation info */
-   ModulationInfo ulModInfo;    /* UL modulation info */
-   uint8_t numLcs;
-   LcCfg lcCfgList[MAX_NUM_LC];
-   UeCfgState macUeCfgState;    /* InActive / Completed */
-   DataTransmissionAction transmissionAction;
+   uint16_t               cellId;
+   uint8_t                ueId;
+   uint16_t               crnti;
+   bool                   macCellGrpCfgPres;
+   MacCellGrpCfg          macCellGrpCfg;
+   bool                   phyCellGrpCfgPres;
+   PhyCellGrpCfg          phyCellGrpCfg;
+   bool                   spCellCfgPres;
+   SpCellCfg              spCellCfg;
+   AmbrCfg                *ambrCfg;
+   ModulationInfo         dlModInfo;    /* DL modulation info */ 
+   ModulationInfo         ulModInfo;    /* UL modulation info */
+   uint8_t                numLcs;
+   LcCfg                  lcCfgList[MAX_NUM_LC];
 }MacUeCfg;
 
+/* UE Re-configuration */
+typedef struct macUeRecfg
+{
+   uint16_t        cellId;
+   uint8_t         ueId;
+   uint8_t         beamIdx;
+   uint16_t        crnti;
+   bool            macCellGrpRecfgPres;
+   MacCellGrpCfg   macCellGrpRecfg;
+   bool            phyCellGrpRecfgPres;
+   PhyCellGrpCfg   phyCellGrpRecfg;
+   bool            spCellRecfgPres;
+   SpCellRecfg     spCellRecfg;
+   AmbrCfg         *ambrRecfg;
+   ModulationInfo  dlModInfo;
+   ModulationInfo  ulModInfo;
+   uint8_t         numLcsToAdd;
+   LcCfg           lcCfgAdd[MAX_NUM_LC];
+   uint8_t         numLcsToDel;
+   uint8_t         lcIdToDel[MAX_NUM_LC];
+   uint8_t         numLcsToMod;
+   LcCfg           lcCfgMod[MAX_NUM_LC];
+   DataTransmissionAction transmissionAction;
+#ifdef NR_DRX   
+   bool            drxConfigIndicatorRelease;
+#endif
+}MacUeRecfg;
+
 typedef struct nrcgi
 {
    Plmn      plmn;
@@ -1337,8 +1438,12 @@ typedef struct ueCfgRsp
    DRBFailInfo    *failedDRBlist;
    uint8_t        numSCellFailed; /* valid values : 0 to MAX_NUM_SCELL */
    SCellFailInfo  *failedSCellList;
+   uint8_t        numDRBModFailed;   /* valid values : 0 to MAX_NUM_DRB */
+   DRBFailInfo    *failedDRBModlist;
 }MacUeCfgRsp;
 
+typedef struct ueCfgRsp MacUeRecfgRsp;
+
 typedef struct rachRsrcReq
 {
    uint16_t cellId;
@@ -1400,38 +1505,40 @@ typedef struct macCellDeleteRsp
    CellDeleteStatus result;
 }MacCellDeleteRsp;
 
-typedef struct macSliceRsp
+typedef struct macSliceCfgRsp 
 {
    Snssai     snssai;
    MacRsp     rsp;
    RspReason  cause;  
-}MacSliceRsp;
+}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;
@@ -1519,7 +1626,12 @@ typedef uint8_t (*MacDuUeCfgRspFunc) ARGS((
 /* UE Reconfig Request from DU APP to MAC */
 typedef uint8_t (*DuMacUeReconfigReq) ARGS((
         Pst           *pst,
-        MacUeCfg      *ueCfg ));
+        MacUeRecfg      *ueCfg ));
+
+/* UE Reconfig Response from MAC to DU APP */
+typedef uint8_t (*MacDuUeRecfgRspFunc) ARGS((
+        Pst           *pst, 
+        MacUeRecfgRsp   *cfgRsp));
 
 /* RACH Resource Request from DU APP to MAC */
 typedef uint8_t (*DuMacRachRsrcReq) ARGS((
@@ -1614,9 +1726,12 @@ 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 packDuMacUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
+uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeRecfg *ueRecfg);
 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf);
-uint8_t MacProcUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
+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);