1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
20 #define SCH_INST_START 1
21 #define SCH_MAX_CELLS 1
22 #define SCH_MAX_INST 1
23 #define SCH_NUM_SLOTS 10 /*forcing this to 10 */
24 #define MAX_NUM_RB 106 /* value for numerology 0 15Khz */
25 #define SCH_MIB_TRANS 80
26 #define SCH_NUM_SC_PRB 12 /* number of SCs in a PRB */
27 #define SCH_MAX_SSB_BEAM 4 /* since we are supporting only SCS=15KHz */
28 #define SCH_SCS_15KHZ 15
29 #define SCH_SYMBOL_PER_SLOT 14
30 #define SCH_SSB_SYMB_DURATION 4
31 #define SCH_SSB_PRB_DURATION 20
32 #define SCH_MEM_REGION 4
35 /* allocate and zero out a static buffer */
36 #define SCH_ALLOC(_datPtr, _size) \
39 _ret = SGetSBuf(SCH_MEM_REGION, SCH_POOL, \
40 (Data **)&_datPtr, _size); \
42 cmMemset((U8*)_datPtr, 0, _size); \
47 /* free a static buffer */
48 #define SCH_FREE(_datPtr, _size) \
50 SPutSBuf(SCH_MEM_REGION, SCH_POOL, \
51 (Data *)_datPtr, _size);
54 #define SCH_FILL_RSP_PST(_rspPst, _inst)\
56 _rspPst.srcProcId = SFndProcId(); \
57 _rspPst.dstProcId = SFndProcId();\
58 _rspPst.srcEnt = ENTRG;\
59 _rspPst.dstEnt = ENTRG;\
62 _rspPst.selector = MAC_SELECTOR_TC;\
67 * Structure holding LTE MAC's General Configuration information.
69 typedef struct schGenCb
71 uint8_t tmrRes; /*!< Timer resolution */
72 uint8_t startCellId; /*!< Starting Cell Id */
74 bool forceCntrlSrbBoOnPCel; /*!< value 1 means force scheduling
75 of RLC control BO and SRB BO on
76 PCell. val 0 means don't force*/
77 bool isSCellActDeactAlgoEnable; /*!< TRUE will enable activation/deactivation algo at Schd */
83 * scheduler allocationsfor DL per cell.
85 typedef struct schDlAlloc
87 uint16_t totalPrb; /*!< Number of RBs in the cell */
88 uint16_t assignedPrb[SCH_SYMBOL_PER_SLOT]; /*!< Num RBs and corresponding symbols allocated */
89 bool ssbPres; /*!< Flag to determine if SSB is present in this slot */
90 uint8_t ssbIdxSupported; /*!< Max SSB index */
91 SsbInfo ssbInfo[MAX_SSB_IDX]; /*!< SSB info */
96 * Cell Control block per cell.
98 typedef struct schCellCb
100 uint16_t cellId; /*!< Cell ID */
101 Inst instIdx; /*!< Index of the scheduler instance */
102 Inst macInst; /*!< Index of the MAC instance */
103 uint8_t numSlots; /*!< Number of slots in current frame */
104 SlotIndInfo slotInfo; /*!< SFN, Slot info being processed*/
105 SchDlAlloc *dlAlloc[SCH_NUM_SLOTS]; /*!< SCH resource allocations in DL */
106 SchCellCfg cellCfg; /*!< Cell ocnfiguration */
111 * Control block for sch
115 TskInit schInit; /*!< Task Init info */
116 SchGenCb genCfg; /*!< General Config info */
117 SchCellCb *cells[SCH_MAX_CELLS]; /* Array to store cellCb ptr */
120 /* Declaration for scheduler control blocks */
121 SchCb schCb[SCH_MAX_INST];
123 /* function declarations */
124 uint8_t schCmnDlAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc);
125 uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst inst);
129 /**********************************************************************
131 **********************************************************************/