/******************************************************************************* ################################################################################ # Copyright (c) [2017-2019] [Radisys] # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # # You may obtain a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an "AS IS" BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ *******************************************************************************/ /********************************************************************** Name: LTE MAC layer Type: X include file Desc: Defines required by LTE MAC File: rg.x **********************************************************************/ /** @file rg.x @brief This file contains basic data structures for the Mac. */ #ifndef __RGX__ #define __RGX__ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifdef EMTC_ENABLE #include "rg_emtc.x" /* typedefs for MAC */ #endif /** @brief Logical Channel Id */ typedef RgPrgLteLcgId LteLcgId; typedef RguDDatReqInfo RgRguDedDatReq; typedef RguCDatReqInfo RgRguCmnDatReq; typedef RguDStaRspInfo RgRguDedStaRsp; typedef RguCStaRspInfo RgRguCmnStaRsp; typedef RguDStaIndInfo RgRguDedStaInd; typedef RguCStaIndInfo RgRguCmnStaInd; typedef RguDDatIndInfo RgRguDedDatInd; typedef RguCDatIndInfo RgRguCmnDatInd; typedef RguLchStaInd RgRguLcStaInd; typedef TfuPdschDciInfo RgTfuPdschDciInfo; typedef TfuDatReqInfo RgTfuDatReqInfo; typedef TfuDatReqPduInfo RgTfuDatReqPduInfo; typedef RguDDatReqPerUe RgRguDDatReqPerUe; #ifdef L2_OPTMZ typedef TfuDatReqTbInfo RgTfuDatReqTbInfo; #endif #ifdef LTE_L2_MEAS typedef struct rgL2MeasCb RgL2MeasCb; typedef struct rgQciCb RgQciCb; typedef RguL2MUlThrpMeasReqInfo RgRguL2MUlThrpMeasReq; #endif /* LTE_L2_MEAS */ /* Forward declarations for some structures */ typedef struct rgUeCb RgUeCb; typedef struct rgErrInfo RgErrInfo; typedef struct rgCellCb RgCellCb; typedef struct rgUlHqProcCb RgUlHqProcCb; typedef struct rgDlHqProcCb RgDlHqProcCb; typedef struct rgLcgCb RgLcgCb; typedef struct rgDlHqEnt RgDlHqEnt; typedef struct _rgCb RgCb; typedef RgPrgUlLcInfo RgUlLcCb; typedef RgPrgDlLcInfo RgDlLcCb; #ifdef LTE_L2_MEAS /* @brief UE Specific Uplink allocation info needed for measurements */ typedef struct rgUeUlAlloc { CmLteRnti rnti; /*!< Ue Id */ U8 numPrb; /*!< Number of total PRB's allocated for this UE */ } RgUeUlAlloc; /** * @brief Structure hold uplink allocation information for sub frames. * */ typedef struct rgUlSf { CmLteTimingInfo schdTime; /*!< scheduled frame and subframe number */ U8 numUe; /*!< Number of UE's allocated in this uplink subframe */ RgUeUlAlloc *ueUlAllocInfo; /*!< Uplink alloc infor for this subframe */ } RgUlSf; /** @brief * L2 measurement control block. * */ struct rgL2MeasCb { CmLList measLnk; /*!< MeasCb node */ RgInfL2MeasReq measReq; /*!< Request received for measurement */ CmLteTimingInfo startTime; /*!< Time at which measurement started */ U32 sfnCycle; /*!< Count of Num of SFN wraps */ }; /** @brief * Control block to store Logical Channels with Qci. * */ struct rgQciCb { U8 qci; /*< QCI for measurement */ U32 prbCount; /*!< Cummulative PRB count */ U8 mask; /*!< Measurement Active or Not*/ CmLteTimingInfo startTime;/*!< Time at which measurement started */ }; #endif /* LTE_L2_MEAS */ /** * @brief * Information about one PDCCH. */ typedef struct rgPdcch { CmLteRnti rnti; /*!< RNTI to who the PDCCH is allocated */ RgTfuPdschDciInfo dci; /*!< PDCCH format */ } RgPdcch; typedef struct rgBcchTb { RgPdcch pdcch; Buffer *tb; U16 txPwrOffset; /*!< PDSCH Tx Pwr offset */ } RgBcchTb; typedef struct rgPcchTb { RgPdcch pdcch; Buffer *tb; U16 txPwrOffset; /*!< PDSCH Tx Pwr offset */ } RgPcchTb; typedef struct rgRaRspAlloc { RgPdcch pdcch; /*!< NULLP if no Rsp allocation done for raRnti*/ Buffer *rar; U16 txPwrOffset; /*!< PDSCH Tx Pwr offset */ }RgRaRspAlloc; typedef struct rgBchTb { Buffer *tb; /*!< BCH data for this frame */ }RgBchTb; typedef struct rgDlSf { CmLteTimingInfo schdTime; /*!< scheduled frame and subframe number */ Bool txDone; /*!< Flag to indicate transmission done */ /* ADD Changes for Downlink UE Timing Optimization */ #ifdef LTEMAC_DLUE_TMGOPTMZ U8 remDatReqCnt; /*!< Counter to maintain count of Ded data received.*/ /* Fix [ccpu00126310]: Tracks Data Requests from RLC for both loosely and tight coupled RLC-MAC */ Bool statIndDone; /*!< Marks sending of all status indication done */ #endif RgBchTb bch; /*!< BCH data for this frame */ RgBcchTb bcch; /*!< BCCH allocation for this frame */ #ifdef EMTC_ENABLE RgEmtcBcchTb emtcBcch; /*!< EMTC BCCH allocation for this frame */ #endif RgPcchTb pcch; /*!< PCCH allocation for this frame */ CmLListCp tbs; /*!< TBs or DL HARQ processes */ U8 numRaRsp; /*!< No.of RaRsp */ RgRaRspAlloc raRsp[RG_MAX_RA_RNTI]; /* Array of list of Ra Rsp Allocations for each rarnti */ U8 numTbReqsSent; /*!< Number of TB requests sent towards SMAC. Total numTbReqsSent will be equal to maximum secondary cells */ } RgDlSf; /** * @brief * Logical channel control block for BCCH and PCCH channels. */ typedef struct rgBcchDlschLcCb { CmLteLcId lcId; /*!< Logical channel ID */ Buffer *tb; } RgBcchDlschLcCb; typedef struct rgBcchBchLcCb { CmLteLcId lcId; /*!< Logical channel ID */ } RgBcchBchLcCb; typedef struct rgPcchLcCb { CmLteLcId lcId; /*!< Logical channel ID */ } RgPcchLcCb; /** * @brief * Random access information per cell. */ typedef struct rgRaInfoCb { CmLListCp ueRachLst; /*!< List of RaCbs */ } RgRaInfoCb; typedef struct rgSchInstMap { S16 cellSapId; /*!< SAP ID of the cell in scheduler instance */ Inst schInst; /*!< Scheduler instance that is serving this cell*/ } RgSchInstMap; /** * @brief * Configuration Information for Upper SAPs at RGU,CRG and RGR interfaces. */ typedef struct rgUpSapCfgInfo { Pst sapPst; /*!< Post information associated with SAP */ SpId spId; /*!< SpId associated with SAP */ SuId suId; /*!< SuId associated with SAP */ }RgUpSapCfgInfo; /** * @brief * Configuration Information for Lower SAP at TFU interface */ typedef struct rgLowSapCfgInfo { Pst sapPst; /*!< Post information associated with SAP */ SpId spId; /*!< SpId associated with SAP */ SuId suId; /*!< SuId associated with SAP */ TmrCfg bndTmr; /*!< Bind Timer Value */ }RgLowSapCfgInfo; /** * @brief * Control Block structure for Upper SAPs at RGU,CRG and RGR interfaces. */ typedef struct rgUpSapCb { RgUpSapCfgInfo sapCfg; /*!< Configuration information */ RgSapSts sapSts; /*!< Statistics related to SAP */ RgSapSta sapSta; /*!< SAP Status */ }RgUpSapCb; /** * @brief * Control Block structure for Lower SAP at TFU interface. */ typedef struct rgLowSapCb { RgLowSapCfgInfo sapCfg; /*!< SAP configuration information */ RgSapSts sapSts; /*!< Statistics related to SAP */ RgSapSta sapSta; /*!< SAP Status */ U8 numBndRetries; /*!< Number of Bind Retries */ }RgLowSapCb; /** * @brief * MAC sub-header control block for 5G-NR MAC * sub-hdr for fixed size MAC CE - 1 octat(R/R/LCID) * sub-hdr for variable size MAC CE or MAC SDU -2/3 octat(R/F/LCID/L(8/16 bits)) * */ typedef struct RgMUXSubHdr { U8 shLen; U8 shData[RG_MAX_SDU_SUB_HDR_LEN]; /* RRLCID/RFLCID + F-L (O) + L (O) */ } RgMUXSubHdr; /** * @brief * Cell Control block per cell */ struct rgCellCb { CmHashListEnt cellLstEnt; /*!< Hash list Entity for cell list */ RgSchInstMap schInstMap; /*!< Sch Inst Info */ CmLteCellId cellId; /*!< Cell ID */ CmLteTimingInfo crntTime; U8 maxDlHqProcPerUe; /*!< Store based on FDD/TDD(UL/DL Index) */ CrgBwCfg bwCfg; /*!< Bandwidth Configuration */ CrgRachCfg rachCfg; /*!< RACH Configuration */ RgUpSapCb *rguDlSap; /*!< RGU SAP Control Block for RLC DL */ RgUpSapCb *rguUlSap; /*!< RGU SAP Control Block for RLC UL*/ Inst macInst; /*!< MAC Instance id for this cell */ U8 cellActvState; /*!< Bitmask indicating if cell is active: Cell is active only after BCCH, PCCH, DL CCCH, UL CCCH and scheduler config */ CmLteLcId ulCcchId; /*!< LcId for uplink CCCH */ CmLteLcId dlCcchId; /*!< LcId for downlink CCCH */ RgBcchBchLcCb bcchBchInfo; /*!< BCCH mapped on BCH logical channel control block */ RgPcchLcCb pcchInfo; /*!< PCCH logical channel control block */ U8 numBcchDlschInfo; RgBcchDlschLcCb bcchDlschInfo[RG_MAX_BCCH_DLSCH]; /*!< BCCH mapped on DLSCH logical channel control block */ CmHashListCp ueLst; /*!< Hash list of UE control blocks: RgUeCb */ /*Added support for SPS*/ #ifdef LTEMAC_SPS CmHashListCp spsUeLst; /*!< Hash list of UECbs with SPS-Rnti : Element is RgUeCb */ #endif RgRaInfoCb raInfo; /*!< Random access related information for cell */ RgDlSf subFrms[RG_NUM_SUB_FRAMES]; #ifdef LTE_L2_MEAS CmLListCp l2mList; /*!< List of all L2M requests rgSchL2MeasCb */ RgQciCb qciArray[LRG_MAX_QCI]; /*!< List of all qci's configured rgQciCb */ RgUlSf ulSf[RG_NUM_UL_SUB_FRAMES]; /*!< UL Sub frame */ Bool sndL2Meas; /*!< Send L2 Meas when No L2 Measuremnt timer is running*/ U32 ttiCycle; /*!< Count of Number of 10240 Cycles completed */ #endif /* LTE_L2_MEAS */ RguFlowCntrlInd *flowCntrlInd; /*!