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 EVENT_SCH_CELL_CFG 1
21 #define EVENT_SCH_CELL_CFG_CFM 2
22 #define EVENT_DL_ALLOC 3
23 #define EVENT_UL_SCH_INFO 4
24 #define EVENT_RACH_IND_TO_SCH 5
25 #define EVENT_CRC_IND_TO_SCH 6
26 #define EVENT_DL_RLC_BO_INFO_TO_SCH 7
27 #define EVENT_UE_CREATE_REQ_TO_SCH 8
28 #define EVENT_UE_CREATE_RSP_TO_MAC 9
29 #define EVENT_SLOT_IND_TO_SCH 10
30 #define EVENT_SHORT_BSR 11
31 #define EVENT_UCI_IND_TO_SCH 12
35 #define SSB_TRANSMISSION 1
37 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
38 #define SCH_SSB_MASK_SIZE 1
41 #define SIB1_TRANSMISSION 1
42 #define SIB1_REPITITION 2
44 #define MAX_NUM_PRG 1 /* max value should be later 275 */
45 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
46 #define MAX_CODEWORDS 1 /* max should be 2 */
47 #define SCH_HARQ_PROC_ID 1 /* harq proc id */
48 #define SCH_ALLOC_TYPE_1 1 /*sch res alloc type */
50 /* Datatype in UL SCH Info */
51 #define SCH_DATATYPE_PUSCH 1
52 #define SCH_DATATYPE_PUSCH_UCI 2
53 #define SCH_DATATYPE_UCI 4
54 #define SCH_DATATYPE_SRS 8
55 #define SCH_DATATYPE_PRACH 16
57 #define MAX_NUMBER_OF_CRC_IND_BITS 1
58 #define MAX_NUMBER_OF_UCI_IND_BITS 1
59 #define MAX_SR_BITS_IN_BYTES 1
60 #define MAX_NUM_LOGICAL_CHANNELS 11
61 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8
62 /* can we have a common numslot numscs between mac sch */
65 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */
66 #define MAX_NUM_TAGS 4 /* Max number of timing advance groups */
67 #define MAX_NUM_BWP 4 /* Max number of BWP per serving cell */
68 #define MAX_NUM_CRSET 3 /* Max number of control resource set in add/modify/release list */
69 #define MAX_NUM_SEARCH_SPC 10 /* Max number of search space in add/modify/release list */
70 #define FREQ_DOM_RSRC_SIZE 6 /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
71 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2 /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
72 #define MAX_NUM_DL_ALLOC 16 /* Max number of pdsch time domain downlink allocation */
73 #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */
80 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
82 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
84 toFill.sfn = (crntTime.sfn + 1); \
88 toFill.sfn = crntTime.sfn; \
90 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
91 if (toFill.sfn >= MAX_SFN) \
93 toFill.sfn%=MAX_SFN; \
101 RESOURCE_UNAVAILABLE,
131 TIME_ALIGNMENT_TIMER_MS500,
132 TIME_ALIGNMENT_TIMER_MS750,
133 TIME_ALIGNMENT_TIMER_MS1280,
134 TIME_ALIGNMENT_TIMER_MS1920,
135 TIME_ALIGNMENT_TIMER_MS2560,
136 TIME_ALIGNMENT_TIMER_MS5120,
137 TIME_ALIGNMENT_TIMER_MS10240,
138 TIME_ALIGNMENT_TIMER_INFINITE
139 }SchTimeAlignmentTimer;
143 PHR_PERIODIC_TIMER_SF10,
144 PHR_PERIODIC_TIMER_SF20,
145 PHR_PERIODIC_TIMER_SF50,
146 PHR_PERIODIC_TIMER_SF100,
147 PHR_PERIODIC_TIMER_SF200,
148 PHR_PERIODIC_TIMER_SF500,
149 PHR_PERIODIC_TIMER_SF1000,
150 PHR_PERIODIC_TIMER_INFINITE
151 }SchPhrPeriodicTimer;
155 PHR_PROHIBIT_TIMER_SF0,
156 PHR_PROHIBIT_TIMER_SF10,
157 PHR_PROHIBIT_TIMER_SF20,
158 PHR_PROHIBIT_TIMER_SF50,
159 PHR_PROHIBIT_TIMER_SF100,
160 PHR_PROHIBIT_TIMER_SF200,
161 PHR_PROHIBIT_TIMER_SF500,
162 PHR_PROHIBIT_TIMER_SF1000
163 }SchPhrProhibitTimer;
167 PHR_TX_PWR_FACTOR_CHANGE_DB1,
168 PHR_TX_PWR_FACTOR_CHANGE_DB3,
169 PHR_TX_PWR_FACTOR_CHANGE_DB6,
170 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
171 }SchPhrTxPwrFactorChange;
181 HARQ_ACK_CODEBOOK_SEMISTATIC,
182 HARQ_ACK_CODEBOOK_DYNAMIC
183 }SchPdschHarqAckCodebook;
187 NUM_HARQ_PROC_FOR_PDSCH_N2,
188 NUM_HARQ_PROC_FOR_PDSCH_N4,
189 NUM_HARQ_PROC_FOR_PDSCH_N6,
190 NUM_HARQ_PROC_FOR_PDSCH_N10,
191 NUM_HARQ_PROC_FOR_PDSCH_N16
192 }SchNumHarqProcForPdsch;
196 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
197 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
198 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
199 MAX_CODE_BLOCK_GROUP_PER_TB_N8
200 }SchMaxCodeBlkGrpPerTB;
204 PDSCH_X_OVERHEAD_XOH_6,
205 PDSCH_X_OVERHEAD_XOH_12,
206 PDSCH_X_OVERHEAD_XOH_18
211 DMRS_ADDITIONAL_POS0,
212 DMRS_ADDITIONAL_POS1,
214 }SchDmrsAdditionPosition;
218 RESOURCE_ALLOCTION_TYPE_0,
219 RESOURCE_ALLOCTION_TYPE_1,
220 RESOURCE_ALLOCTION_DYN_SWITCH
221 }SchResourceAllocType;
225 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
226 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
227 }SchTimeDomRsrcAllocMappingType;
231 ENABLED_TRANSFORM_PRECODER,
232 DISABLED_TRANSFORM_PRECODER
233 }SchTransformPrecoder;
237 INTERLEAVED_CCE_REG_MAPPING,
238 NONINTERLEAVED_CCE_REG_MAPPING
243 SLOT_PERIODICITY_AND_OFFSET_SL_1,
244 SLOT_PERIODICITY_AND_OFFSET_SL_2,
245 SLOT_PERIODICITY_AND_OFFSET_SL_4,
246 SLOT_PERIODICITY_AND_OFFSET_SL_5,
247 SLOT_PERIODICITY_AND_OFFSET_SL_8,
248 SLOT_PERIODICITY_AND_OFFSET_SL_10,
249 SLOT_PERIODICITY_AND_OFFSET_SL_16,
250 SLOT_PERIODICITY_AND_OFFSET_SL_20,
251 SLOT_PERIODICITY_AND_OFFSET_SL_40,
252 SLOT_PERIODICITY_AND_OFFSET_SL_80,
253 SLOT_PERIODICITY_AND_OFFSET_SL_160,
254 SLOT_PERIODICITY_AND_OFFSET_SL_320,
255 SLOT_PERIODICITY_AND_OFFSET_SL_640,
256 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
257 SLOT_PERIODICITY_AND_OFFSET_SL_2560
258 }SchMSlotPeriodAndOffset;
268 SEARCH_SPACE_TYPE_COMMON,
269 SEARCH_SPACE_TYPE_UE_SPECIFIC
274 AGGREGATION_LEVEL_N0,
275 AGGREGATION_LEVEL_N1,
276 AGGREGATION_LEVEL_N2,
277 AGGREGATION_LEVEL_N3,
278 AGGREGATION_LEVEL_N4,
279 AGGREGATION_LEVEL_N5,
280 AGGREGATION_LEVEL_N6,
292 CODE_WORDS_SCHED_BY_DCI_N1,
293 CODE_WORDS_SCHED_BY_DCI_N2
294 }SchCodeWordsSchedByDci;
298 STATIC_BUNDLING_TYPE,
299 DYNAMIC_BUNDLING_TYPE
341 typedef struct timeDomainAlloc
347 typedef struct freqDomainAlloc
356 uint32_t ssbPbchPwr; /* SSB block power */
357 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
358 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
359 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
360 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
361 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
364 typedef struct bwpCfg
366 uint8_t subcarrierSpacing;
367 uint8_t cyclicPrefix;
368 FreqDomainAlloc freqAlloc;
374 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
377 typedef struct beamformingInfo
381 uint8_t digBfInterfaces;
382 Prg prg[MAX_NUM_PRG];
385 /* SIB1 PDSCH structures */
387 typedef struct codewordinfo
389 uint16_t targetCodeRate;
397 typedef struct dmrsInfo
399 uint16_t dlDmrsSymbPos;
400 uint8_t dmrsConfigType;
401 uint16_t dlDmrsScramblingId;
403 uint8_t numDmrsCdmGrpsNoData;
406 uint8_t nrOfDmrsSymbols;
410 typedef struct pdschFreqAlloc
412 uint8_t resourceAllocType;
413 /* since we are using type-1, hence rbBitmap excluded */
414 FreqDomainAlloc freqAlloc;
415 uint8_t vrbPrbMapping;
418 typedef struct pdschTimeAlloc
421 TimeDomainAlloc timeAlloc;
424 typedef struct txPowerPdschInfo
426 uint8_t powerControlOffset;
427 uint8_t powerControlOffsetSS;
430 typedef struct pdschCfg
435 uint8_t numCodewords;
436 CodewordInfo codeword[MAX_CODEWORDS];
437 uint16_t dataScramblingId;
439 uint8_t transmissionScheme;
442 PdschFreqAlloc pdschFreqAlloc;
443 PdschTimeAlloc pdschTimeAlloc;
444 BeamformingInfo beamPdschInfo;
445 TxPowerPdschInfo txPdschPower;
447 /* SIB1 PDSCH structures end */
449 /* SIB1 interface structure */
451 typedef struct coresetCfg
454 uint8_t startSymbolIndex;
455 uint8_t durationSymbols;
456 uint8_t freqDomainResource[6];
457 uint8_t cceRegMappingType;
458 uint8_t regBundleSize;
459 uint8_t interleaverSize;
462 uint8_t precoderGranularity;
464 uint8_t aggregationLevel;
467 typedef struct txPowerPdcchInfo
470 uint8_t powerControlOffsetSS;
476 uint16_t scramblingId;
477 uint16_t scramblingRnti;
480 BeamformingInfo beamPdcchInfo;
481 TxPowerPdcchInfo txPdcchPower;
485 typedef struct pdcchCfg
487 /* coreset-0 configuration */
488 CoresetCfg coreset0Cfg;
491 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
493 /* end of SIB1 PDCCH structures */
497 /* parameters recieved from DU-APP */
499 uint16_t sib1NewTxPeriod;
500 uint16_t sib1RepetitionPeriod;
501 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
502 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
505 /* parameters derived in scheduler */
508 PdcchCfg sib1PdcchCfg;
509 PdschCfg sib1PdschCfg;
512 typedef struct schRachCfg
514 uint8_t prachCfgIdx; /* PRACH config idx */
515 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
516 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
517 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
518 uint8_t rootSeqLen; /* root sequence length */
519 uint16_t rootSeqIdx; /* Root sequence index */
520 uint8_t numRootSeq; /* Number of root sequences required for FD */
521 uint16_t k1; /* Frequency Offset for each FD */
522 uint8_t ssbPerRach; /* SSB per RACH occassion */
523 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
524 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
525 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
526 uint8_t raRspWindow; /* RA Response Window */
529 typedef struct schBwpParams
531 FreqDomainAlloc freqAlloc;
533 uint8_t cyclicPrefix;
536 typedef struct schCandidatesInfo
545 typedef struct schSearchSpaceCfg
547 uint8_t searchSpaceId;
549 uint16_t monitoringSlot;
551 uint16_t monitoringSymbol;
552 SchCandidatesInfo candidate;
555 typedef struct schPdcchCfgCmn
557 SchSearchSpaceCfg commonSearchSpace;
558 uint8_t raSearchSpaceId;
561 typedef struct schPdschCfgCmn
566 uint8_t lengthSymbol;
569 typedef struct schPucchCfgCmn
571 uint8_t pucchResourceCommon;
572 uint8_t pucchGroupHopping;
575 typedef struct schPuschCfgCmn
580 uint8_t lengthSymbol;
583 typedef struct schBwpDlCfg
586 SchPdcchCfgCmn pdcchCommon;
587 SchPdschCfgCmn pdschCommon;
590 typedef struct schBwpUlCfg
593 SchPucchCfgCmn pucchCommon;
594 SchPuschCfgCmn puschCommon;
597 typedef struct schCellCfg
599 uint16_t cellId; /* Cell Id */
600 uint16_t phyCellId; /* Physical cell id */
601 uint8_t bandwidth; /* Supported B/W */
602 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
603 SchSsbCfg ssbSchCfg; /* SSB config */
604 SchSib1Cfg sib1SchCfg; /* SIB1 config */
605 SchRachCfg schRachCfg; /* PRACH config */
606 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
607 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
608 uint8_t puschMu; /* PUSCH MU */
611 typedef struct schCellCfgCfm
613 U16 cellId; /* Cell Id */
617 typedef struct ssbInfo
619 uint8_t ssbIdx; /* SSB Index */
620 TimeDomainAlloc tdAlloc; /* Time domain allocation */
621 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
624 typedef struct sib1AllocInfo
627 PdcchCfg sib1PdcchCfg;
628 PdschCfg sib1PdschCfg;
631 typedef struct prachSchInfo
633 uint8_t numPrachOcas; /* Num Prach Ocassions */
634 uint8_t prachFormat; /* PRACH Format */
635 uint8_t numRa; /* Freq domain ocassion */
636 uint8_t prachStartSymb; /* Freq domain ocassion */
639 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
640 typedef struct dlBrdcstAlloc
642 /* Ssb transmission is determined as follows:
643 * 0 : No tranamission
644 * 1 : SSB Transmission
645 * 2 : SSB Repetition */
647 uint8_t ssbIdxSupported;
648 SsbInfo ssbInfo[MAX_SSB_IDX];
649 /* Sib1 transmission is determined as follows:
650 * 0 : No tranamission
651 * 1 : SIB1 Transmission
652 * 2 : SIB1 Repetition */
654 Sib1AllocInfo sib1Alloc;
657 typedef struct rarInfo
662 FreqDomainAlloc msg3FreqAlloc;
668 typedef struct rarAlloc
672 PdcchCfg rarPdcchCfg;
673 PdschCfg rarPdschCfg;
676 typedef struct msg4Info
684 uint8_t harqFeedbackInd;
690 typedef struct msg4Alloc
694 PdcchCfg msg4PdcchCfg;
695 PdschCfg msg4PdschCfg;
698 typedef struct schSlotValue
700 SlotIndInfo currentTime;
701 SlotIndInfo broadcastTime;
703 SlotIndInfo msg4Time;
704 SlotIndInfo dlMsgTime;
705 SlotIndInfo ulDciTime;
708 typedef struct format0_0
710 uint8_t resourceAllocType;
711 /* since we are using type-1, hence rbBitmap excluded */
712 FreqDomainAlloc freqAlloc;
713 TimeDomainAlloc timeAlloc;
716 uint8_t harqProcId; /* HARQ Process ID */
719 uint8_t ndi; /* NDI */
720 uint8_t rv; /* Redundancy Version */
725 typedef struct format0_1
731 typedef struct format1_0
737 typedef struct format1_1
742 typedef struct dciInfo
745 uint16_t crnti; /* CRNI */
746 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
747 BwpCfg bwpCfg; /* BWP Cfg */
748 CoresetCfg coresetCfg; /* Coreset1 Cfg */
749 FormatType formatType; /* DCI Format */
752 Format0_0 format0_0; /* Format 0_0 */
753 Format0_1 format0_1; /* Format 0_1 */
754 Format1_0 format1_0; /* Format 1_0 */
755 Format1_1 format1_1; /* Format 1_1 */
761 typedef struct dlSchedInfo
763 uint16_t cellId; /* Cell Id */
764 SchSlotValue schSlotValue;
766 /* Allocation for broadcast messages */
767 bool isBroadcastPres;
768 DlBrdcstAlloc brdcstAlloc;
770 /* Allocation for RAR message */
774 /* Allocation from MSG4 */
775 Msg4Alloc *msg4Alloc;
777 /* UL grant in response to BSR */
782 typedef struct tbInfo
784 uint8_t mcs; /* MCS */
785 uint8_t ndi; /* NDI */
786 uint8_t rv; /* Redundancy Version */
787 uint16_t tbSize; /* TB Size */
790 typedef struct schPuschInfo
792 uint8_t harqProcId; /* HARQ Process ID */
793 uint8_t resAllocType; /* Resource allocation type */
794 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
795 TimeDomainAlloc tdAlloc; /* Time domain allocation */
796 TbInfo tbInfo; /* TB info */
797 uint8_t dmrsMappingType;
798 uint8_t nrOfDmrsSymbols;
802 typedef struct schPucchInfo
806 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
807 TimeDomainAlloc tdAlloc; /* Time domain allocation */
815 typedef struct ulSchedInfo
817 uint16_t cellId; /* Cell Id */
818 uint16_t crnti; /* CRNI */
819 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
820 uint8_t dataType; /* Type of info being scheduled */
821 PrachSchInfo prachSchInfo; /* Prach scheduling info */
822 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
823 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
826 typedef struct rachIndInfo
830 SlotIndInfo timingInfo;
839 typedef struct crcIndInfo
843 SlotIndInfo timingInfo;
845 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
848 typedef struct boInfo
854 typedef struct dlRlcBOInfo
859 BOInfo boInfo[MAX_NUM_LOGICAL_CHANNELS];
862 /* Info of Scheduling Request to Add/Modify */
863 typedef struct schSchedReqInfo
866 SchSrProhibitTimer srProhibitTmr;
867 SchSrTransMax srTransMax;
870 /* Scheduling Request Configuration */
871 typedef struct schSchedReqCfg
873 uint8_t addModListCount;
874 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
875 uint8_t relListCount;
876 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
879 /* Info of Tag to Add/Modify */
880 typedef struct schTagInfo
883 SchTimeAlignmentTimer timeAlignmentTmr;
886 /* Timing Advance Group Configuration */
887 typedef struct schTagCfg
889 uint8_t addModListCount;
890 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
891 uint8_t relListCount;
892 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
895 /* Configuration for Power headroom reporting */
896 typedef struct schPhrCfg
898 SchPhrPeriodicTimer periodicTmr;
899 SchPhrProhibitTimer prohibitTmr;
900 SchPhrTxPwrFactorChange txpowerFactorChange;
904 SchPhrModeOtherCG modeOtherCG;
907 /* MAC cell Group configuration */
908 typedef struct schMacCellGrpCfg
910 SchSchedReqCfg schedReqCfg;
912 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
915 /* Physical Cell Group Configuration */
916 typedef struct schPhyCellGrpCfg
918 SchPdschHarqAckCodebook pdschHarqAckCodebook;
922 /* Control resource set info */
923 typedef struct schControlRsrcSet
925 uint8_t cRSetId; /* Control resource set id */
926 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
928 SchREGMappingType cceRegMappingType;
929 SchPrecoderGranul precoderGranularity;
930 uint16_t dmrsScramblingId;
933 /* Search Space info */
934 typedef struct schSearchSpace
936 uint8_t searchSpaceId;
938 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
939 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
940 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
941 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
942 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
943 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
944 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
945 SchSearchSpaceType searchSpaceType;
946 uint8_t ueSpecificDciFormat;
949 /* PDCCH cofniguration */
950 typedef struct schPdcchConfig
952 uint8_t numCRsetToAddMod;
953 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
954 uint8_t numCRsetToRel;
955 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
956 uint8_t numSearchSpcToAddMod;
957 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
958 uint8_t numSearchSpcToRel;
959 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
962 /* PDSCH time domain resource allocation */
963 typedef struct schPdschTimeDomRsrcAlloc
965 SchTimeDomRsrcAllocMappingType mappingType;
967 uint8_t symbolLength;
968 }SchPdschTimeDomRsrcAlloc;
970 /* DMRS downlink configuration */
971 typedef struct schDmrsDlCfg
973 SchDmrsAdditionPosition addPos; /* DMRS additional position */
976 /* PDSCH Configuration */
977 typedef struct schPdschConfig
979 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
980 SchResourceAllocType resourceAllocType;
981 uint8_t numTimeDomRsrcAlloc;
982 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
984 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
985 SchBundlingType bundlingType;
988 /* Initial Downlink BWP */
989 typedef struct schInitalDlBwp
992 SchPdcchConfig pdcchCfg;
994 SchPdschConfig pdschCfg;
997 /* BWP Downlink common */
998 typedef struct schBwpDlCommon
1002 /* Downlink BWP information */
1003 typedef struct schDlBwpInfo
1008 /* PDCCH Serving Cell configuration */
1009 typedef struct schPdschServCellCfg
1011 uint8_t *maxMimoLayers;
1012 SchNumHarqProcForPdsch numHarqProcForPdsch;
1013 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1014 bool *codeBlkGrpFlushInd;
1015 SchPdschXOverhead *xOverhead;
1016 }SchPdschServCellCfg;
1018 /* PUCCH Configuration */
1019 typedef struct schPucchCfg
1021 /* TODO : Not used currently */
1024 /* Transform precoding disabled */
1025 typedef struct schTransPrecodDisabled
1027 uint16_t scramblingId0;
1028 }SchTransPrecodDisabled;
1030 /* DMRS Uplink configuration */
1031 typedef struct SchDmrsUlCfg
1033 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1034 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1037 /* PUSCH Time Domain Resource Allocation */
1038 typedef struct schPuschTimeDomRsrcAlloc
1041 SchTimeDomRsrcAllocMappingType mappingType;
1042 uint8_t startSymbol;
1043 uint8_t symbolLength;
1044 }SchPuschTimeDomRsrcAlloc;
1046 /* PUSCH Configuration */
1047 typedef struct schPuschCfg
1049 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1050 SchResourceAllocType resourceAllocType;
1051 uint8_t numTimeDomRsrcAlloc;
1052 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1053 SchTransformPrecoder transformPrecoder;
1056 /* Initial Uplink BWP */
1057 typedef struct schInitialUlBwp
1060 SchPucchCfg pucchCfg;
1062 SchPuschCfg puschCfg;
1065 /* Uplink BWP information */
1066 typedef struct schUlBwpInfo
1071 /* Serving cell configuration */
1072 typedef struct schServCellCfgInfo
1074 SchInitalDlBwp initDlBwp;
1075 uint8_t numDlBwpToAdd;
1076 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1077 uint8_t firstActvDlBwpId;
1078 uint8_t defaultDlBwpId;
1079 uint8_t *bwpInactivityTmr;
1080 SchPdschServCellCfg pdschServCellCfg;
1081 SchInitialUlBwp initUlBwp;
1082 uint8_t numUlBwpToAdd;
1083 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1084 uint8_t firstActvUlBwpId;
1085 }SchServCellCfgInfo;
1087 typedef struct schNonDynFiveQi
1092 uint16_t maxDataBurstVol;
1095 typedef struct schDynFiveQi
1098 uint16_t packetDelayBudget;
1099 uint8_t packetErrRateScalar;
1100 uint8_t packetErrRateExp;
1102 uint8_t delayCritical;
1104 uint16_t maxDataBurstVol;
1107 typedef struct schNgRanAllocAndRetPri
1109 uint8_t priorityLevel;
1110 uint8_t preEmptionCap;
1111 uint8_t preEmptionVul;
1112 }SchNgRanAllocAndRetPri;
1114 typedef struct schGrbQosFlowInfo
1116 uint32_t maxFlowBitRateDl;
1117 uint32_t maxFlowBitRateUl;
1118 uint32_t guarFlowBitRateDl;
1119 uint32_t guarFlowBitRateUl;
1123 typedef struct schDrbQos
1125 uint8_t fiveQiType; /* Dynamic or non-dynamic */
1128 SchNonDynFiveQi nonDyn5Qi;
1129 SchDynFiveQi dyn5Qi;
1131 SchNgRanAllocAndRetPri ngRanRetPri;
1132 SchGrbQosFlowInfo grbQosFlowInfo;
1133 uint16_t pduSessionId;
1134 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1137 typedef struct schSnssai
1140 uint8_t sd[SD_SIZE];
1143 /* Special cell configuration */
1144 typedef struct schSpCellCfg
1146 uint8_t servCellIdx;
1147 SchServCellCfgInfo servCellCfg;
1150 /* Uplink logical channel configuration */
1151 typedef struct SchUlLcCfg
1156 uint8_t pbr; // prioritisedBitRate
1157 uint8_t bsd; // bucketSizeDuration
1160 /* Downlink logical channel configuration */
1161 typedef struct schDlLcCfg
1163 uint8_t lcp; // logical Channel Prioritization
1166 /* Logical Channel configuration */
1167 typedef struct schLcCfg
1170 SchDrbQosInfo *drbQos;
1173 SchUlLcCfg *ulLcCfg;
1176 /* Aggregate max bit rate */
1177 typedef struct aggrMaxBitRate
1183 /* UE configuration */
1184 typedef struct schUeCfg
1188 SchMacCellGrpCfg macCellGrpCfg;
1189 SchPhyCellGrpCfg phyCellGrpCfg;
1190 SchSpCellCfg spCellCfg;
1191 SchAggrMaxBitRate *aggrMaxBitRate;
1193 SchLcCfg lcCfgList[MAX_NUM_LOGICAL_CHANNELS];
1196 typedef struct schUeCfgRsp
1202 SchFailureCause cause;
1205 typedef struct dataVolInfo
1211 typedef struct ulBufferStatusRptInd
1217 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1218 }UlBufferStatusRptInd;
1220 typedef struct srUciIndInfo
1224 SlotIndInfo slotInd;
1226 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1229 /* function pointers */
1231 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1232 Pst *pst, /* Post Structure */
1233 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1236 typedef uint8_t (*SchCellCfgFunc) ARGS((
1237 Pst *pst, /* Post Structure */
1238 SchCellCfg *schCellCfg /* Cell Cfg */
1241 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1242 Pst *pst, /* Post Structure */
1243 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1246 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1247 Pst *pst, /* Post Structure */
1248 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1251 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1252 Pst *pst, /* Post structure */
1253 RachIndInfo *rachInd)); /* Rach Indication Info */
1255 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1256 Pst *pst, /* Post structure */
1257 CrcIndInfo *crcInd)); /* CRC Info */
1259 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1260 Pst *pst, /* Post structure */
1261 DlRlcBOInfo *dlBoInfo)); /* DL BO Info */
1263 typedef uint8_t (*MacSchUeCreateReqFunc) ARGS((
1264 Pst *pst, /* Post structure */
1265 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1267 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1268 Pst *pst, /* Post structure */
1269 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1271 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1272 Pst *pst, /* Post structure */
1273 SlotIndInfo *slotInd)); /* Slot Info */
1275 typedef uint8_t (*MacSchBsrFunc) ARGS((
1277 UlBufferStatusRptInd *bsrInd
1280 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1281 Pst *pst, /* Post structure */
1282 SrUciIndInfo *uciInd)); /* UCI IND Info */
1285 /* function declarations */
1286 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1287 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1288 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1289 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1290 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1291 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1292 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1293 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1294 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1295 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1296 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1297 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1298 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1299 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1300 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1301 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1302 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo);
1303 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo);
1304 uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
1305 uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
1306 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1307 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1308 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1309 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1310 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1311 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1312 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1313 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1314 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1316 /**********************************************************************
1318 **********************************************************************/