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
33 #define SSB_TRANSMISSION 1
35 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
38 #define SIB1_TRANSMISSION 1
39 #define SIB1_REPITITION 2
41 #define MAX_NUM_PRG 1 /* max value should be later 275 */
42 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
43 #define MAX_CODEWORDS 1 /* max should be 2 */
44 #define SCH_HARQ_PROC_ID 1 /* harq proc id */
45 #define SCH_ALLOC_TYPE_1 1 /*sch res alloc type */
47 /* Datatype in UL SCH Info */
48 #define SCH_DATATYPE_PUSCH 1
49 #define SCH_DATATYPE_PUSCH_UCI 2
50 #define SCH_DATATYPE_UCI 4
51 #define SCH_DATATYPE_SRS 8
52 #define SCH_DATATYPE_PRACH 16
54 #define MAX_NUMBER_OF_CRC_IND_BITS 1
55 #define MAX_NUM_LOGICAL_CHANNELS 11
56 /* can we have a common numslot numscs between mac sch */
59 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */
60 #define MAX_NUM_TAGS 4 /* Max number of timing advance groups */
61 #define MAX_NUM_BWP 4 /* Max number of BWP per serving cell */
62 #define MAX_NUM_CRSET 3 /* Max number of control resource set in add/modify/release list */
63 #define MAX_NUM_SEARCH_SPC 10 /* Max number of search space in add/modify/release list */
64 #define FREQ_DOM_RSRC_SIZE 6 /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
65 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2 /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
66 #define MAX_NUM_DL_ALLOC 16 /* Max number of pdsch time domain downlink allocation */
67 #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */
72 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
74 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
76 toFill.sfn = (crntTime.sfn + 1); \
80 toFill.sfn = crntTime.sfn; \
82 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
83 if (toFill.sfn >= MAX_SFN) \
85 toFill.sfn%=MAX_SFN; \
124 TIME_ALIGNMENT_TIMER_MS500,
125 TIME_ALIGNMENT_TIMER_MS750,
126 TIME_ALIGNMENT_TIMER_MS1280,
127 TIME_ALIGNMENT_TIMER_MS1920,
128 TIME_ALIGNMENT_TIMER_MS2560,
129 TIME_ALIGNMENT_TIMER_MS5120,
130 TIME_ALIGNMENT_TIMER_MS10240,
131 TIME_ALIGNMENT_TIMER_INFINITE
132 }SchTimeAlignmentTimer;
136 PHR_PERIODIC_TIMER_SF10,
137 PHR_PERIODIC_TIMER_SF20,
138 PHR_PERIODIC_TIMER_SF50,
139 PHR_PERIODIC_TIMER_SF100,
140 PHR_PERIODIC_TIMER_SF200,
141 PHR_PERIODIC_TIMER_SF500,
142 PHR_PERIODIC_TIMER_SF1000,
143 PHR_PERIODIC_TIMER_INFINITE
144 }SchPhrPeriodicTimer;
148 PHR_PROHIBIT_TIMER_SF0,
149 PHR_PROHIBIT_TIMER_SF10,
150 PHR_PROHIBIT_TIMER_SF20,
151 PHR_PROHIBIT_TIMER_SF50,
152 PHR_PROHIBIT_TIMER_SF100,
153 PHR_PROHIBIT_TIMER_SF200,
154 PHR_PROHIBIT_TIMER_SF500,
155 PHR_PROHIBIT_TIMER_SF1000
156 }SchPhrProhibitTimer;
160 PHR_TX_PWR_FACTOR_CHANGE_DB1,
161 PHR_TX_PWR_FACTOR_CHANGE_DB3,
162 PHR_TX_PWR_FACTOR_CHANGE_DB6,
163 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
164 }SchPhrTxPwrFactorChange;
174 HARQ_ACK_CODEBOOK_SEMISTATIC,
175 HARQ_ACK_CODEBOOK_DYNAMIC
176 }SchPdschHarqAckCodebook;
180 NUM_HARQ_PROC_FOR_PDSCH_N2,
181 NUM_HARQ_PROC_FOR_PDSCH_N4,
182 NUM_HARQ_PROC_FOR_PDSCH_N6,
183 NUM_HARQ_PROC_FOR_PDSCH_N10,
184 NUM_HARQ_PROC_FOR_PDSCH_N16
185 }SchNumHarqProcForPdsch;
189 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
190 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
191 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
192 MAX_CODE_BLOCK_GROUP_PER_TB_N8
193 }SchMaxCodeBlkGrpPerTB;
197 PDSCH_X_OVERHEAD_XOH_6,
198 PDSCH_X_OVERHEAD_XOH_12,
199 PDSCH_X_OVERHEAD_XOH_18
204 DMRS_ADDITIONAL_POS0,
205 DMRS_ADDITIONAL_POS1,
207 }SchDmrsAdditionPosition;
211 RESOURCE_ALLOCTION_TYPE_0,
212 RESOURCE_ALLOCTION_TYPE_1,
213 RESOURCE_ALLOCTION_DYN_SWITCH
214 }SchResourceAllocType;
218 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
219 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
220 }SchTimeDomRsrcAllocMappingType;
224 ENABLED_TRANSFORM_PRECODER,
225 DISABLED_TRANSFORM_PRECODER
226 }SchTransformPrecoder;
230 INTERLEAVED_CCE_REG_MAPPING,
231 NONINTERLEAVED_CCE_REG_MAPPING
236 SLOT_PERIODICITY_AND_OFFSET_SL_1,
237 SLOT_PERIODICITY_AND_OFFSET_SL_2,
238 SLOT_PERIODICITY_AND_OFFSET_SL_4,
239 SLOT_PERIODICITY_AND_OFFSET_SL_5,
240 SLOT_PERIODICITY_AND_OFFSET_SL_8,
241 SLOT_PERIODICITY_AND_OFFSET_SL_10,
242 SLOT_PERIODICITY_AND_OFFSET_SL_16,
243 SLOT_PERIODICITY_AND_OFFSET_SL_20,
244 SLOT_PERIODICITY_AND_OFFSET_SL_40,
245 SLOT_PERIODICITY_AND_OFFSET_SL_80,
246 SLOT_PERIODICITY_AND_OFFSET_SL_160,
247 SLOT_PERIODICITY_AND_OFFSET_SL_320,
248 SLOT_PERIODICITY_AND_OFFSET_SL_640,
249 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
250 SLOT_PERIODICITY_AND_OFFSET_SL_2560
251 }SchMSlotPeriodAndOffset;
261 SEARCH_SPACE_TYPE_COMMON,
262 SEARCH_SPACE_TYPE_UE_SPECIFIC
267 AGGREGATION_LEVEL_N0,
268 AGGREGATION_LEVEL_N1,
269 AGGREGATION_LEVEL_N2,
270 AGGREGATION_LEVEL_N3,
271 AGGREGATION_LEVEL_N4,
272 AGGREGATION_LEVEL_N5,
273 AGGREGATION_LEVEL_N6,
285 CODE_WORDS_SCHED_BY_DCI_N1,
286 CODE_WORDS_SCHED_BY_DCI_N2
287 }SchCodeWordsSchedByDci;
291 STATIC_BUNDLING_TYPE,
292 DYNAMIC_BUNDLING_TYPE
301 typedef struct timeDomainAlloc
307 typedef struct freqDomainAlloc
316 uint32_t ssbPbchPwr; /* SSB block power */
317 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
318 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
319 SSBPeriod ssbPeriod; /* SSB Periodicity in msec */
320 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
321 uint32_t nSSBMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
324 typedef struct bwpCfg
326 uint8_t subcarrierSpacing;
327 uint8_t cyclicPrefix;
328 FreqDomainAlloc freqAlloc;
334 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
337 typedef struct beamformingInfo
341 uint8_t digBfInterfaces;
342 Prg prg[MAX_NUM_PRG];
345 /* SIB1 PDSCH structures */
347 typedef struct codewordinfo
349 uint16_t targetCodeRate;
357 typedef struct dmrsInfo
359 uint16_t dlDmrsSymbPos;
360 uint8_t dmrsConfigType;
361 uint16_t dlDmrsScramblingId;
363 uint8_t numDmrsCdmGrpsNoData;
366 uint8_t nrOfDmrsSymbols;
370 typedef struct pdschFreqAlloc
372 uint8_t resourceAllocType;
373 /* since we are using type-1, hence rbBitmap excluded */
374 FreqDomainAlloc freqAlloc;
375 uint8_t vrbPrbMapping;
378 typedef struct pdschTimeAlloc
381 TimeDomainAlloc timeAlloc;
384 typedef struct txPowerPdschInfo
386 uint8_t powerControlOffset;
387 uint8_t powerControlOffsetSS;
390 typedef struct pdschCfg
395 uint8_t numCodewords;
396 CodewordInfo codeword[MAX_CODEWORDS];
397 uint16_t dataScramblingId;
399 uint8_t transmissionScheme;
402 PdschFreqAlloc pdschFreqAlloc;
403 PdschTimeAlloc pdschTimeAlloc;
404 BeamformingInfo beamPdschInfo;
405 TxPowerPdschInfo txPdschPower;
407 /* SIB1 PDSCH structures end */
409 /* SIB1 interface structure */
411 typedef struct coresetCfg
413 uint8_t coreSet0Size;
414 uint8_t startSymbolIndex;
415 uint8_t durationSymbols;
416 uint8_t freqDomainResource[6];
417 uint8_t cceRegMappingType;
418 uint8_t regBundleSize;
419 uint8_t interleaverSize;
422 uint8_t precoderGranularity;
424 uint8_t aggregationLevel;
427 typedef struct txPowerPdcchInfo
430 uint8_t powerControlOffsetSS;
436 uint16_t scramblingId;
437 uint16_t scramblingRnti;
440 BeamformingInfo beamPdcchInfo;
441 TxPowerPdcchInfo txPdcchPower;
445 typedef struct pdcchCfg
447 /* coreset-0 configuration */
448 CoresetCfg coreset0Cfg;
451 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
453 /* end of SIB1 PDCCH structures */
457 /* parameters recieved from DU-APP */
459 uint16_t sib1NewTxPeriod;
460 uint16_t sib1RepetitionPeriod;
461 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
462 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
465 /* parameters derived in scheduler */
468 PdcchCfg sib1PdcchCfg;
469 PdschCfg sib1PdschCfg;
472 typedef struct schRachCfg
474 uint8_t prachCfgIdx; /* PRACH config idx */
475 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
476 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
477 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
478 uint8_t rootSeqLen; /* root sequence length */
479 uint16_t rootSeqIdx; /* Root sequence index */
480 uint8_t numRootSeq; /* Number of root sequences required for FD */
481 uint16_t k1; /* Frequency Offset for each FD */
482 uint8_t ssbPerRach; /* SSB per RACH occassion */
483 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
484 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
485 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
486 uint8_t raRspWindow; /* RA Response Window */
489 typedef struct schBwpParams
491 FreqDomainAlloc freqAlloc;
493 uint8_t cyclicPrefix;
496 typedef struct schCandidatesInfo
505 typedef struct schSearchSpaceCfg
507 uint8_t searchSpaceId;
509 uint16_t monitoringSlot;
511 uint16_t monitoringSymbol;
512 SchCandidatesInfo candidate;
515 typedef struct schPdcchCfgCmn
517 SchSearchSpaceCfg commonSearchSpace;
518 uint8_t raSearchSpaceId;
521 typedef struct schPdschCfgCmn
526 uint8_t lengthSymbol;
529 typedef struct schPucchCfgCmn
531 uint8_t pucchResourceCommon;
532 uint8_t pucchGroupHopping;
535 typedef struct schPuschCfgCmn
540 uint8_t lengthSymbol;
543 typedef struct schBwpDlCfg
546 SchPdcchCfgCmn pdcchCommon;
547 SchPdschCfgCmn pdschCommon;
550 typedef struct schBwpUlCfg
553 SchPucchCfgCmn pucchCommon;
554 SchPuschCfgCmn puschCommon;
557 typedef struct schCellCfg
559 uint16_t cellId; /* Cell Id */
560 uint16_t phyCellId; /* Physical cell id */
561 uint8_t bandwidth; /* Supported B/W */
562 DuplexMode dupMode; /* Duplex type: TDD/FDD */
563 SchSsbCfg ssbSchCfg; /* SSB config */
564 SchSib1Cfg sib1SchCfg; /* SIB1 config */
565 SchRachCfg schRachCfg; /* PRACH config */
566 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
567 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
568 uint8_t puschMu; /* PUSCH MU */
571 typedef struct schCellCfgCfm
573 U16 cellId; /* Cell Id */
577 typedef struct ssbInfo
579 uint8_t ssbIdx; /* SSB Index */
580 TimeDomainAlloc tdAlloc; /* Time domain allocation */
581 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
584 typedef struct sib1AllocInfo
587 PdcchCfg sib1PdcchCfg;
588 PdschCfg sib1PdschCfg;
591 typedef struct prachSchInfo
593 uint8_t numPrachOcas; /* Num Prach Ocassions */
594 uint8_t prachFormat; /* PRACH Format */
595 uint8_t numRa; /* Freq domain ocassion */
596 uint8_t prachStartSymb; /* Freq domain ocassion */
599 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
600 typedef struct dlBrdcstAlloc
602 /* Ssb transmission is determined as follows:
603 * 0 : No tranamission
604 * 1 : SSB Transmission
605 * 2 : SSB Repetition */
607 uint8_t ssbIdxSupported;
608 SsbInfo ssbInfo[MAX_SSB_IDX];
609 /* Sib1 transmission is determined as follows:
610 * 0 : No tranamission
611 * 1 : SIB1 Transmission
612 * 2 : SIB1 Repetition */
614 Sib1AllocInfo sib1Alloc;
617 typedef struct rarInfo
622 FreqDomainAlloc msg3FreqAlloc;
628 typedef struct rarAlloc
632 PdcchCfg rarPdcchCfg;
633 PdschCfg rarPdschCfg;
636 typedef struct msg4Info
644 uint8_t harqFeedbackInd;
650 typedef struct msg4Alloc
654 PdcchCfg msg4PdcchCfg;
655 PdschCfg msg4PdschCfg;
658 typedef struct schSlotValue
660 SlotIndInfo currentTime;
661 SlotIndInfo broadcastTime;
663 SlotIndInfo msg4Time;
664 SlotIndInfo dlMsgTime;
667 typedef struct dlSchedInfo
669 uint16_t cellId; /* Cell Id */
670 SchSlotValue schSlotValue;
672 /* Allocation for broadcast messages */
673 bool isBroadcastPres;
674 DlBrdcstAlloc brdcstAlloc;
676 /* Allocation for RAR message */
680 /* Allocation from MSG4 */
681 Msg4Alloc *msg4Alloc;
684 typedef struct tbInfo
686 uint8_t mcs; /* MCS */
687 uint8_t ndi; /* NDI */
688 uint8_t rv; /* Redundancy Version */
689 uint16_t tbSize; /* TB Size */
692 typedef struct schPuschInfo
694 uint8_t harqProcId; /* HARQ Process ID */
695 uint8_t resAllocType; /* Resource allocation type */
696 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
697 TimeDomainAlloc tdAlloc; /* Time domain allocation */
698 TbInfo tbInfo; /* TB info */
699 uint8_t dmrsMappingType;
700 uint8_t nrOfDmrsSymbols;
704 typedef struct schPucchInfo
708 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
709 TimeDomainAlloc tdAlloc; /* Time domain allocation */
717 typedef struct ulSchedInfo
719 uint16_t cellId; /* Cell Id */
720 uint16_t crnti; /* CRNI */
721 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
722 uint8_t dataType; /* Type of info being scheduled */
723 PrachSchInfo prachSchInfo; /* Prach scheduling info */
724 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
725 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
728 typedef struct rachIndInfo
732 SlotIndInfo timingInfo;
741 typedef struct crcIndInfo
745 SlotIndInfo timingInfo;
747 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
750 typedef struct boInfo
756 typedef struct dlRlcBOInfo
761 BOInfo boInfo[MAX_NUM_LOGICAL_CHANNELS];
764 /* Info of Scheduling Request to Add/Modify */
765 typedef struct schSchedReqInfo
768 SrProhibitTimer srProhibitTmr;
769 SrTransMax srTransMax;
772 /* Scheduling Request Configuration */
773 typedef struct schSchedReqCfg
775 uint8_t addModListCount;
776 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
777 uint8_t relListCount;
778 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
781 /* Info of Tag to Add/Modify */
782 typedef struct schTagInfo
785 SchTimeAlignmentTimer timeAlignmentTmr;
788 /* Timing Advance Group Configuration */
789 typedef struct schTagCfg
791 uint8_t addModListCount;
792 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
793 uint8_t relListCount;
794 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
797 /* Configuration for Power headroom reporting */
798 typedef struct schPhrCfg
800 SchPhrPeriodicTimer periodicTmr;
801 SchPhrProhibitTimer prohibitTmr;
802 SchPhrTxPwrFactorChange txpowerFactorChange;
806 SchPhrModeOtherCG modeOtherCG;
809 /* MAC cell Group configuration */
810 typedef struct schMacCellGrpCfg
812 SchSchedReqCfg schedReqCfg;
814 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
817 /* Physical Cell Group Configuration */
818 typedef struct schPhyCellGrpCfg
820 SchPdschHarqAckCodebook pdschHarqAckCodebook;
824 /* Control resource set info */
825 typedef struct schControlRsrcSet
827 uint8_t cRSetId; /* Control resource set id */
828 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
830 SchREGMappingType cceRegMappingType;
831 SchPrecoderGranul precoderGranularity;
832 uint16_t dmrsScramblingId;
835 /* Search Space info */
836 typedef struct schSearchSpace
838 uint8_t searchSpaceId;
840 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
841 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
842 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
843 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
844 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
845 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
846 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
847 SchSearchSpaceType searchSpaceType;
848 uint8_t ueSpecificDciFormat;
851 /* PDCCH cofniguration */
852 typedef struct schPdcchConfig
854 uint8_t numCRsetToAddMod;
855 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
856 uint8_t numCRsetToRel;
857 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
858 uint8_t numSearchSpcToAddMod;
859 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
860 uint8_t numSearchSpcToRel;
861 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
864 /* PDSCH time domain resource allocation */
865 typedef struct schPdschTimeDomRsrcAlloc
867 SchTimeDomRsrcAllocMappingType mappingType;
869 uint8_t symbolLength;
870 }SchPdschTimeDomRsrcAlloc;
872 /* DMRS downlink configuration */
873 typedef struct schDmrsDlCfg
875 SchDmrsAdditionPosition addPos; /* DMRS additional position */
878 /* PDSCH Configuration */
879 typedef struct schPdschConfig
881 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
882 SchResourceAllocType resourceAllocType;
883 uint8_t numTimeDomRsrcAlloc;
884 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
886 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
887 SchBundlingType bundlingType;
890 /* Initial Downlink BWP */
891 typedef struct schInitalDlBwp
894 SchPdcchConfig pdcchCfg;
896 SchPdschConfig pdschCfg;
899 /* BWP Downlink common */
900 typedef struct schBwpDlCommon
904 /* Downlink BWP information */
905 typedef struct schDlBwpInfo
910 /* PDCCH Serving Cell configuration */
911 typedef struct schPdschServCellCfg
913 uint8_t *maxMimoLayers;
914 SchNumHarqProcForPdsch numHarqProcForPdsch;
915 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
916 bool *codeBlkGrpFlushInd;
917 SchPdschXOverhead *xOverhead;
918 }SchPdschServCellCfg;
920 /* PUCCH Configuration */
921 typedef struct schPucchCfg
923 /* TODO : Not used currently */
926 /* Transform precoding disabled */
927 typedef struct schTransPrecodDisabled
929 uint16_t scramblingId0;
930 }SchTransPrecodDisabled;
932 /* DMRS Uplink configuration */
933 typedef struct SchDmrsUlCfg
935 SchDmrsAdditionPosition addPos; /* DMRS additional position */
936 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
939 /* PUSCH Time Domain Resource Allocation */
940 typedef struct schPuschTimeDomRsrcAlloc
943 SchTimeDomRsrcAllocMappingType mappingType;
945 uint8_t symbolLength;
946 }SchPuschTimeDomRsrcAlloc;
948 /* PUSCH Configuration */
949 typedef struct schPuschCfg
951 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
952 SchResourceAllocType resourceAllocType;
953 uint8_t numTimeDomRsrcAlloc;
954 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
955 SchTransformPrecoder transformPrecoder;
958 /* Initial Uplink BWP */
959 typedef struct schInitialUlBwp
962 SchPucchCfg pucchCfg;
964 SchPuschCfg puschCfg;
967 /* Uplink BWP information */
968 typedef struct schUlBwpInfo
973 /* Serving cell configuration */
974 typedef struct schServCellCfgInfo
976 SchInitalDlBwp initDlBwp;
977 uint8_t numDlBwpToAdd;
978 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
979 uint8_t firstActvDlBwpId;
980 uint8_t defaultDlBwpId;
981 uint8_t *bwpInactivityTmr;
982 SchPdschServCellCfg pdschServCellCfg;
983 SchInitialUlBwp initUlBwp;
984 uint8_t numUlBwpToAdd;
985 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
986 uint8_t firstActvUlBwpId;
989 typedef struct schNonDynFiveQi
994 uint16_t maxDataBurstVol;
997 typedef struct schDynFiveQi
1000 uint16_t packetDelayBudget;
1001 uint8_t packetErrRateScalar;
1002 uint8_t packetErrRateExp;
1004 uint8_t delayCritical;
1006 uint16_t maxDataBurstVol;
1009 typedef struct schNgRanAllocAndRetPri
1011 uint8_t priorityLevel;
1012 uint8_t preEmptionCap;
1013 uint8_t preEmptionVul;
1014 }SchNgRanAllocAndRetPri;
1016 typedef struct schGrbQosFlowInfo
1018 uint32_t maxFlowBitRateDl;
1019 uint32_t maxFlowBitRateUl;
1020 uint32_t guarFlowBitRateDl;
1021 uint32_t guarFlowBitRateUl;
1025 typedef struct schDrbQos
1027 uint8_t fiveQiType; /* Dynamic or non-dynamic */
1030 SchNonDynFiveQi nonDyn5Qi;
1031 SchDynFiveQi dyn5Qi;
1033 SchNgRanAllocAndRetPri ngRanRetPri;
1034 SchGrbQosFlowInfo grbQosFlowInfo;
1035 uint16_t pduSessionId;
1036 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1039 typedef struct schSnssai
1042 uint8_t sd[SD_SIZE];
1045 /* Special cell configuration */
1046 typedef struct schSpCellCfg
1048 uint8_t servCellIdx;
1049 SchServCellCfgInfo servCellCfg;
1052 /* Uplink logical channel configuration */
1053 typedef struct SchUlLcCfg
1058 uint8_t pbr; // prioritisedBitRate
1059 uint8_t bsd; // bucketSizeDuration
1062 /* Downlink logical channel configuration */
1063 typedef struct schDlLcCfg
1065 uint8_t lcp; // logical Channel Prioritization
1068 /* Logical Channel configuration */
1069 typedef struct schLcCfg
1072 SchDrbQosInfo *drbQos;
1075 SchUlLcCfg *ulLcCfg;
1078 /* Aggregate max bit rate */
1079 typedef struct aggrMaxBitRate
1085 /* UE configuration */
1086 typedef struct schUeCfg
1090 SchMacCellGrpCfg macCellGrpCfg;
1091 SchPhyCellGrpCfg phyCellGrpCfg;
1092 SchSpCellCfg spCellCfg;
1093 SchAggrMaxBitRate *aggrMaxBitRate;
1095 SchLcCfg lcCfgList[MAX_NUM_LOGICAL_CHANNELS];
1098 typedef struct schUeCfgRsp
1104 SchFailureCause cause;
1107 /* function pointers */
1109 typedef int (*SchCellCfgCfmFunc) ARGS((
1110 Pst *pst, /* Post Structure */
1111 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1114 typedef int (*SchCellCfgFunc) ARGS((
1115 Pst *pst, /* Post Structure */
1116 SchCellCfg *schCellCfg /* Cell Cfg */
1119 typedef int (*SchMacDlAllocFunc) ARGS((
1120 Pst *pst, /* Post Structure */
1121 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1124 typedef int (*SchMacUlSchInfoFunc) ARGS((
1125 Pst *pst, /* Post Structure */
1126 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1129 typedef int (*MacSchRachIndFunc) ARGS((
1130 Pst *pst, /* Post structure */
1131 RachIndInfo *rachInd)); /* Rach Indication Info */
1133 typedef int (*MacSchCrcIndFunc) ARGS((
1134 Pst *pst, /* Post structure */
1135 CrcIndInfo *crcInd)); /* CRC Info */
1137 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1138 Pst *pst, /* Post structure */
1139 DlRlcBOInfo *dlBoInfo)); /* DL BO Info */
1141 typedef uint8_t (*MacSchUeCreateReqFunc) ARGS((
1142 Pst *pst, /* Post structure */
1143 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1145 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1146 Pst *pst, /* Post structure */
1147 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1149 /* function declarations */
1150 int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1151 int packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1152 int packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1153 EXTERN int packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1154 EXTERN int packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1156 EXTERN int MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1157 EXTERN int MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1158 EXTERN int MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1159 EXTERN int SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1160 EXTERN int schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1161 EXTERN S16 SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1162 EXTERN int MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1163 int packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1164 int macSchRachInd(Pst *pst, RachIndInfo *rachInd);
1165 int packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1166 int macSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1167 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo);
1168 uint8_t macSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo);
1169 uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
1170 uint8_t macSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
1171 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1172 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1175 /**********************************************************************
1177 **********************************************************************/