Merge "[Epic-ID: ODUHIGH-488][Task-ID: ODUHIGH-501] Ue Create and Rsp correction...
authorSangeeta Vaidhyanathan <svaidhya@radisys.com>
Tue, 28 Mar 2023 05:06:30 +0000 (05:06 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Tue, 28 Mar 2023 05:06:30 +0000 (05:06 +0000)
1  2 
src/cm/du_app_mac_inf.c
src/cm/du_app_mac_inf.h
src/du_app/du_f1ap_msg_hdl.c

diff --combined src/cm/du_app_mac_inf.c
@@@ -687,12 -687,12 +687,12 @@@ uint8_t unpackMacDlCcchInd(DuMacDlCcchI
   *
   *
   * @params[in] Post structure pointer
-  *             MacUeCfg pointer              
+  *             MacUeCreateReq pointer              
   * @return ROK     - success
   *         RFAILED - failure
   *
   * ****************************************************************/
- uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg)
+ uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg)
  {
     Buffer *mBuf = NULLP;
  
@@@ -737,7 -737,7 +737,7 @@@ uint8_t unpackMacUeCreateReq(DuMacUeCre
  {
     if(pst->selector == ODU_SELECTOR_LWLC)
     {
-       MacUeCfg *ueCfg;
+       MacUeCreateReq *ueCfg;
  
        /* unpack the address of the structure */
        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf);
  
  /*******************************************************************
   *
-  * @brief Pack and send UE config response from MAC to DU APP
+  * @brief Pack and send UE create response from MAC to DU APP
   *
   * @details
   *
-  *    Function : packDuMacUeCfgRsp
+  *    Function : packDuMacUeCreateRsp
   *
   *    Functionality:
-  *       Pack and send UE config response from MAC to DU APP
+  *       Pack and send UE create response from MAC to DU APP
   *
   * @params[in] 
   * @return ROK     - success
   *         RFAILED - failure
   *
   * ****************************************************************/
- uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
+ uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp)
  {
     Buffer *mBuf = NULLP;
  
     {
        if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
        {
-        DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeCfgRsp");
+        DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeCreateRsp");
         return RFAILED;
        }
        /* pack the address of the structure */
     }
     else
     {
-       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeCfgRsp");
+       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeCreateRsp");
        return RFAILED;
     }
  
  }
  /*******************************************************************
   *
-  * @brief Unpack UE Config Response from MAC to DU APP
+  * @brief Unpack UE Create Response from MAC to DU APP
   *
   * @details
   *
-  *    Function :unpackDuMacUeCfgRsp 
+  *    Function :unpackDuMacUeCreateRsp 
   *
-  *    Functionality: Unpack UE Config Response from MAC to DU APP
+  *    Functionality: Unpack UE Create Response from MAC to DU APP
   *
   * @params[in] 
   * @return ROK     - success
   *         RFAILED - failure
   *
   * ****************************************************************/
- uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf)
+ uint8_t unpackDuMacUeCreateRsp(MacDuUeCreateRspFunc func, Pst *pst, Buffer *mBuf)
  {
     if(pst->selector == ODU_SELECTOR_LWLC)
     {
-       MacUeCfgRsp *cfgRsp = NULLP;
+       MacUeCreateRsp *cfgRsp = NULLP;
  
        /* unpack the address of the structure */
        CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
   *
   *
   * @params[in] Post structure pointer
-  *             MacUeCfg pointer              
+  *             MacUeRecfg pointer              
   * @return ROK     - success
   *         RFAILED - failure
   *
@@@ -2178,84 -2178,6 +2178,84 @@@ uint8_t unpackDuMacUeSyncStatusInd(MacD
      return RFAILED;
  }
  
 +/*******************************************************************
 +*
 +* @brief Packs and Sends Dl Broadcast Request from DUAPP to MAC
 +*
 +* @details
 +*
 +*    Function : packDuMacDlBroadcastReq
 +*
 +*    Functionality:
 +*       Packs and Sends Dl Broadcast Request from DUAPP to MAC
 +*
 +*
 +* @params[in] Post structure pointer
 +*             MacDlBroadcastReq pointer
 +* @return ROK     - success
 +*         RFAILED - failure
 +*
 +* ****************************************************************/
 +uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *ueDel)
 +{
 +    Buffer *mBuf = NULLP;
 +
 +    if(pst->selector == ODU_SELECTOR_LWLC)
 +    {
 +       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
 +       {
 +          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacDlBroadcastReq");
 +          return RFAILED;
 +       }
 +       /* pack the address of the structure */
 +       CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
 +    }
 +    else
 +    {
 +       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacDlBroadcastReq");
 +       return RFAILED;
 +    }
 +    return ODU_POST_TASK(pst,mBuf);
 +}
 +
 +/*******************************************************************
 +*
 +* @brief Unpacks Dl Broadcast Request received from DU APP
 +*
 +* @details
 +*
 +*    Function : unpackMacDlBroadcastReq 
 +*
 +*    Functionality:
 +*         Unpacks Dl Broadcast Request received from DU APP
 +*
 +* @params[in] Pointer to Handler
 +*             Post structure pointer
 +*             Message Buffer
 +* @return ROK     - success
 +*         RFAILED - failure
 +*
 +* ****************************************************************/
 +uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf)
 +{
 +    if(pst->selector == ODU_SELECTOR_LWLC)
 +    {
 +       MacDlBroadcastReq *dlBroadcast;
 +
 +       /* unpack the address of the structure */
 +       CMCHKUNPK(oduUnpackPointer, (PTR *)&dlBroadcast, mBuf);
 +       ODU_PUT_MSG_BUF(mBuf);
 +       return (*func)(pst, dlBroadcast);
 +    }
 +    else
 +    {
 +       /* Nothing to do for other selectors */
 +       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for Dl Broadcast Request ");
 +       ODU_PUT_MSG_BUF(mBuf);
 +    }
 +
 +    return RFAILED;
 +}
  /*******************************************************************
   *
   * @brief Searches for first unset bit in ueBitMap
diff --combined src/cm/du_app_mac_inf.h
@@@ -21,8 -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
@@@ -88,7 -87,6 +88,7 @@@
  #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 BSR_PERIODIC_TIMER_SF_10 10
  #define BSR_RETX_TIMER_SF_320 320
  #define PAGING_SCHED_DELTA  4
  #define MAX_PLMN 2
  
 +typedef enum
 +{
 +   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
 +{
 +   RF8,
 +   RF16,
 +   RF32,
 +   RF64,
 +   RF128,
 +   RF256,
 +   RF512
 +}SiPeriodicity;
 +
 +typedef enum
 +{
 +   S5,
 +   S10,
 +   S20, 
 +   S40, 
 +   S80, 
 +   S160, 
 +   S320, 
 +   S640, 
 +   S1280
 +}SiWindowLength;
 +
 +typedef enum
 +{
 +   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,
@@@ -1527,7 -1458,7 +1527,7 @@@ typedef struct modulationInf
     McsTable    mcsTable;    /* MCS table */
  }ModulationInfo;
  
- typedef struct macUeCfg
+ typedef struct macUeCreateReq
  {
     uint16_t               cellId;
     uint8_t                ueId;
     ModulationInfo         ulModInfo;    /* UL modulation info */
     uint8_t                numLcs;
     LcCfg                  lcCfgList[MAX_NUM_LC];
- }MacUeCfg;
+ }MacUeCreateReq;
  
  /* UE Re-configuration */
  typedef struct macUeRecfg
@@@ -1598,7 -1529,7 +1598,7 @@@ typedef struct sCellFailInf
     FailureCause  cause;
  }SCellFailInfo;
  
- typedef struct ueCfgRsp
+ typedef struct macUeCreateRsp
  {
     uint16_t       cellId;
     uint16_t       ueId;
     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
  {
@@@ -1714,7 -1645,6 +1714,7 @@@ typedef struct macSliceCfgRe
  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;
     uint8_t  *pcchPdu;
  }DlPcchInd;
  
 +
 +/*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.1 Cell Start */
  typedef struct cellInfo
  {
      SlotTimingInfo slotInfo;
  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;
     CauseOfResult  status;
  }MacUeResetRsp;
  
 +/*  Ref: ORAN_WG8.V7.0.0 Sec 1.1.1.14 UE Sync Status Indication */
  typedef struct ueSyncStatusInd
  {
     uint16_t   cellId;
     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;
 +
 +/* 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,
@@@ -1888,12 -1738,12 +1888,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((
@@@ -2006,13 -1856,13 +2006,13 @@@ uint8_t duHandleUlCcchInd(Pst *pst, UlC
  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 MacProcUeCreateReq(Pst *pst, MacUeCreateReq *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 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);
@@@ -2069,9 -1919,6 +2069,9 @@@ uint8_t unpackDuMacUeResetRsp(MacDuUeRe
  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);
  #endif
  
  
@@@ -13081,7 -13081,7 +13081,7 @@@ uint8_t extractSrbListToSetup(SRBs_ToBe
   *
   * @params[in] DRBs_ToBeSetup_Item_t , DRBs_ToBeSetupMod_Item_t,
   *             DRBs_ToBeModified_Item_t , lcId, DuLcCfg pointer,
-  *             RlcBearerCfg , UpTnlCfg, RlcUeCfg
+  *             RlcBearerCfg , UpTnlCfg, DuRlcUeCfg
   * @return void
   *
   * ****************************************************************/
@@@ -15291,9 -15291,9 +15291,9 @@@ uint8_t procF1SetupRsp(F1AP_PDU_t *f1ap
            DU_LOG("\nERROR  -->  DU_APP : Invalid IE received in F1SetupRsp:%ld",
                  f1SetRspMsg->protocolIEs.list.array[idx]->id);
        }
 -      duProcF1SetupRsp();
     }
     
 +   duProcF1SetupRsp();
     freeAperDecodeF1SetupRsp(f1SetRspMsg);
  
     duCb.f1SetupReqAndRspMsg.f1MsgRspBufSize = recvBufLen;