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_ADD_UE_CONFIG_REQ_TO_SCH 8
28 #define EVENT_UE_CONFIG_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
32 #define EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH 13
33 #define EVENT_UE_RECONFIG_RSP_TO_MAC 14
38 #define SSB_TRANSMISSION 1
40 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
41 #define SCH_SSB_MASK_SIZE 1
44 #define SIB1_TRANSMISSION 1
45 #define SIB1_REPITITION 2
47 #define MAX_NUM_PRG 1 /* max value should be later 275 */
48 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
49 #define MAX_CODEWORDS 1 /* max should be 2 */
50 #define SCH_HARQ_PROC_ID 1 /* harq proc id */
51 #define SCH_ALLOC_TYPE_1 1 /*sch res alloc type */
53 /* Datatype in UL SCH Info */
54 #define SCH_DATATYPE_PUSCH 1
55 #define SCH_DATATYPE_PUSCH_UCI 2
56 #define SCH_DATATYPE_UCI 4
57 #define SCH_DATATYPE_SRS 8
58 #define SCH_DATATYPE_PRACH 16
60 #define MAX_NUMBER_OF_CRC_IND_BITS 1
61 #define MAX_NUMBER_OF_UCI_IND_BITS 1
62 #define MAX_SR_BITS_IN_BYTES 1
63 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8
64 /* can we have a common numslot numscs between mac sch */
67 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */
68 #define MAX_NUM_TAGS 4 /* Max number of timing advance groups */
69 #define MAX_NUM_BWP 4 /* Max number of BWP per serving cell */
70 #define MAX_NUM_CRSET 3 /* Max number of control resource set in add/modify/release list */
71 #define MAX_NUM_SEARCH_SPC 10 /* Max number of search space in add/modify/release list */
72 #define FREQ_DOM_RSRC_SIZE 6 /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
73 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2 /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
74 #define MAX_NUM_DL_ALLOC 16 /* Max number of pdsch time domain downlink allocation */
75 #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */
79 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
81 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
83 toFill.sfn = (crntTime.sfn + 1); \
87 toFill.sfn = crntTime.sfn; \
89 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
90 if (toFill.sfn >= MAX_SFN) \
92 toFill.sfn%=MAX_SFN; \
100 RESOURCE_UNAVAILABLE,
130 TIME_ALIGNMENT_TIMER_MS500,
131 TIME_ALIGNMENT_TIMER_MS750,
132 TIME_ALIGNMENT_TIMER_MS1280,
133 TIME_ALIGNMENT_TIMER_MS1920,
134 TIME_ALIGNMENT_TIMER_MS2560,
135 TIME_ALIGNMENT_TIMER_MS5120,
136 TIME_ALIGNMENT_TIMER_MS10240,
137 TIME_ALIGNMENT_TIMER_INFINITE
138 }SchTimeAlignmentTimer;
142 PHR_PERIODIC_TIMER_SF10,
143 PHR_PERIODIC_TIMER_SF20,
144 PHR_PERIODIC_TIMER_SF50,
145 PHR_PERIODIC_TIMER_SF100,
146 PHR_PERIODIC_TIMER_SF200,
147 PHR_PERIODIC_TIMER_SF500,
148 PHR_PERIODIC_TIMER_SF1000,
149 PHR_PERIODIC_TIMER_INFINITE
150 }SchPhrPeriodicTimer;
154 PHR_PROHIBIT_TIMER_SF0,
155 PHR_PROHIBIT_TIMER_SF10,
156 PHR_PROHIBIT_TIMER_SF20,
157 PHR_PROHIBIT_TIMER_SF50,
158 PHR_PROHIBIT_TIMER_SF100,
159 PHR_PROHIBIT_TIMER_SF200,
160 PHR_PROHIBIT_TIMER_SF500,
161 PHR_PROHIBIT_TIMER_SF1000
162 }SchPhrProhibitTimer;
166 PHR_TX_PWR_FACTOR_CHANGE_DB1,
167 PHR_TX_PWR_FACTOR_CHANGE_DB3,
168 PHR_TX_PWR_FACTOR_CHANGE_DB6,
169 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
170 }SchPhrTxPwrFactorChange;
180 HARQ_ACK_CODEBOOK_SEMISTATIC,
181 HARQ_ACK_CODEBOOK_DYNAMIC
182 }SchPdschHarqAckCodebook;
186 NUM_HARQ_PROC_FOR_PDSCH_N2,
187 NUM_HARQ_PROC_FOR_PDSCH_N4,
188 NUM_HARQ_PROC_FOR_PDSCH_N6,
189 NUM_HARQ_PROC_FOR_PDSCH_N10,
190 NUM_HARQ_PROC_FOR_PDSCH_N16
191 }SchNumHarqProcForPdsch;
195 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
196 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
197 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
198 MAX_CODE_BLOCK_GROUP_PER_TB_N8
199 }SchMaxCodeBlkGrpPerTB;
203 PDSCH_X_OVERHEAD_XOH_6,
204 PDSCH_X_OVERHEAD_XOH_12,
205 PDSCH_X_OVERHEAD_XOH_18
210 DMRS_ADDITIONAL_POS0,
211 DMRS_ADDITIONAL_POS1,
213 }SchDmrsAdditionPosition;
217 RESOURCE_ALLOCTION_TYPE_0,
218 RESOURCE_ALLOCTION_TYPE_1,
219 RESOURCE_ALLOCTION_DYN_SWITCH
220 }SchResourceAllocType;
224 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
225 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
226 }SchTimeDomRsrcAllocMappingType;
230 ENABLED_TRANSFORM_PRECODER,
231 DISABLED_TRANSFORM_PRECODER
232 }SchTransformPrecoder;
236 INTERLEAVED_CCE_REG_MAPPING = 1,
237 NONINTERLEAVED_CCE_REG_MAPPING
242 SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
243 SLOT_PERIODICITY_AND_OFFSET_SL_2,
244 SLOT_PERIODICITY_AND_OFFSET_SL_4,
245 SLOT_PERIODICITY_AND_OFFSET_SL_5,
246 SLOT_PERIODICITY_AND_OFFSET_SL_8,
247 SLOT_PERIODICITY_AND_OFFSET_SL_10,
248 SLOT_PERIODICITY_AND_OFFSET_SL_16,
249 SLOT_PERIODICITY_AND_OFFSET_SL_20,
250 SLOT_PERIODICITY_AND_OFFSET_SL_40,
251 SLOT_PERIODICITY_AND_OFFSET_SL_80,
252 SLOT_PERIODICITY_AND_OFFSET_SL_160,
253 SLOT_PERIODICITY_AND_OFFSET_SL_320,
254 SLOT_PERIODICITY_AND_OFFSET_SL_640,
255 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
256 SLOT_PERIODICITY_AND_OFFSET_SL_2560
257 }SchMSlotPeriodAndOffset;
267 SEARCH_SPACE_TYPE_COMMON = 1,
268 SEARCH_SPACE_TYPE_UE_SPECIFIC
273 SCH_QOS_NON_DYNAMIC = 1,
279 AGGREGATION_LEVEL_N0,
280 AGGREGATION_LEVEL_N1,
281 AGGREGATION_LEVEL_N2,
282 AGGREGATION_LEVEL_N3,
283 AGGREGATION_LEVEL_N4,
284 AGGREGATION_LEVEL_N5,
285 AGGREGATION_LEVEL_N6,
297 CODE_WORDS_SCHED_BY_DCI_N1,
298 CODE_WORDS_SCHED_BY_DCI_N2
299 }SchCodeWordsSchedByDci;
303 STATIC_BUNDLING_TYPE = 1,
304 DYNAMIC_BUNDLING_TYPE
310 SCH_SET1_SIZE_WIDEBAND,
311 SCH_SET1_SIZE_N2_WIDEBAND,
312 SCH_SET1_SIZE_N4_WIDEBAND
313 }SchBundlingSizeSet1;
318 SCH_SET2_SIZE_WIDEBAND
319 }SchBundlingSizeSet2;
361 SCH_MCS_TABLE_QAM_64,
362 SCH_MCS_TABLE_QAM_256,
363 SCH_MCS_TABLE_QAM_64_LOW_SE
367 typedef struct timeDomainAlloc
373 typedef struct freqDomainAlloc
382 uint32_t ssbPbchPwr; /* SSB block power */
383 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
384 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
385 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
386 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
387 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
390 typedef struct bwpCfg
392 uint8_t subcarrierSpacing;
393 uint8_t cyclicPrefix;
394 FreqDomainAlloc freqAlloc;
400 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
403 typedef struct beamformingInfo
407 uint8_t digBfInterfaces;
408 Prg prg[MAX_NUM_PRG];
411 /* SIB1 PDSCH structures */
413 typedef struct codewordinfo
415 uint16_t targetCodeRate;
423 typedef struct dmrsInfo
425 uint16_t dlDmrsSymbPos;
426 uint8_t dmrsConfigType;
427 uint16_t dlDmrsScramblingId;
429 uint8_t numDmrsCdmGrpsNoData;
432 uint8_t nrOfDmrsSymbols;
436 typedef struct pdschFreqAlloc
438 uint8_t resourceAllocType;
439 /* since we are using type-1, hence rbBitmap excluded */
440 FreqDomainAlloc freqAlloc;
441 uint8_t vrbPrbMapping;
444 typedef struct pdschTimeAlloc
447 TimeDomainAlloc timeAlloc;
450 typedef struct txPowerPdschInfo
452 uint8_t powerControlOffset;
453 uint8_t powerControlOffsetSS;
456 typedef struct pdschCfg
461 uint8_t numCodewords;
462 CodewordInfo codeword[MAX_CODEWORDS];
463 uint16_t dataScramblingId;
465 uint8_t transmissionScheme;
468 PdschFreqAlloc pdschFreqAlloc;
469 PdschTimeAlloc pdschTimeAlloc;
470 BeamformingInfo beamPdschInfo;
471 TxPowerPdschInfo txPdschPower;
473 /* SIB1 PDSCH structures end */
475 /* SIB1 interface structure */
477 typedef struct coresetCfg
480 uint8_t startSymbolIndex;
481 uint8_t durationSymbols;
482 uint8_t freqDomainResource[6];
483 uint8_t cceRegMappingType;
484 uint8_t regBundleSize;
485 uint8_t interleaverSize;
488 uint8_t precoderGranularity;
490 uint8_t aggregationLevel;
493 typedef struct txPowerPdcchInfo
496 uint8_t powerControlOffsetSS;
502 uint16_t scramblingId;
503 uint16_t scramblingRnti;
506 BeamformingInfo beamPdcchInfo;
507 TxPowerPdcchInfo txPdcchPower;
511 typedef struct pdcchCfg
513 /* coreset-0 configuration */
514 CoresetCfg coresetCfg;
517 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
519 /* end of SIB1 PDCCH structures */
523 /* parameters recieved from DU-APP */
525 uint16_t sib1NewTxPeriod;
526 uint16_t sib1RepetitionPeriod;
527 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
528 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
531 /* parameters derived in scheduler */
534 PdcchCfg sib1PdcchCfg;
535 PdschCfg sib1PdschCfg;
538 typedef struct schRachCfg
540 uint8_t prachCfgIdx; /* PRACH config idx */
541 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
542 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
543 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
544 uint8_t rootSeqLen; /* root sequence length */
545 uint16_t rootSeqIdx; /* Root sequence index */
546 uint8_t numRootSeq; /* Number of root sequences required for FD */
547 uint16_t k1; /* Frequency Offset for each FD */
548 uint8_t ssbPerRach; /* SSB per RACH occassion */
549 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
550 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
551 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
552 uint8_t raRspWindow; /* RA Response Window */
555 typedef struct schBwpParams
557 FreqDomainAlloc freqAlloc;
559 uint8_t cyclicPrefix;
562 typedef struct schCandidatesInfo
571 typedef struct schSearchSpaceCfg
573 uint8_t searchSpaceId;
575 uint16_t monitoringSlot;
577 uint16_t monitoringSymbol;
578 SchCandidatesInfo candidate;
581 typedef struct schPdcchCfgCmn
583 SchSearchSpaceCfg commonSearchSpace;
584 uint8_t raSearchSpaceId;
587 typedef struct schPdschCfgCmn
592 uint8_t lengthSymbol;
595 typedef struct schPucchCfgCmn
597 uint8_t pucchResourceCommon;
598 uint8_t pucchGroupHopping;
601 typedef struct schPuschCfgCmn
606 uint8_t lengthSymbol;
609 typedef struct schBwpDlCfg
612 SchPdcchCfgCmn pdcchCommon;
613 SchPdschCfgCmn pdschCommon;
616 typedef struct schBwpUlCfg
619 SchPucchCfgCmn pucchCommon;
620 SchPuschCfgCmn puschCommon;
623 typedef struct schCellCfg
625 uint16_t cellId; /* Cell Id */
626 uint16_t phyCellId; /* Physical cell id */
627 uint8_t bandwidth; /* Supported B/W */
628 uint8_t numerology; /* Supported numerology */
629 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
630 SchSsbCfg ssbSchCfg; /* SSB config */
631 SchSib1Cfg sib1SchCfg; /* SIB1 config */
632 SchRachCfg schRachCfg; /* PRACH config */
633 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
634 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
637 typedef struct schCellCfgCfm
639 uint16_t cellId; /* Cell Id */
643 typedef struct ssbInfo
645 uint8_t ssbIdx; /* SSB Index */
646 TimeDomainAlloc tdAlloc; /* Time domain allocation */
647 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
650 typedef struct sib1AllocInfo
653 PdcchCfg sib1PdcchCfg;
654 PdschCfg sib1PdschCfg;
657 typedef struct prachSchInfo
659 uint8_t numPrachOcas; /* Num Prach Ocassions */
660 uint8_t prachFormat; /* PRACH Format */
661 uint8_t numRa; /* Freq domain ocassion */
662 uint8_t prachStartSymb; /* Freq domain ocassion */
665 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
666 typedef struct dlBrdcstAlloc
668 /* Ssb transmission is determined as follows:
669 * 0 : No tranamission
670 * 1 : SSB Transmission
671 * 2 : SSB Repetition */
673 uint8_t ssbIdxSupported;
674 SsbInfo ssbInfo[MAX_SSB_IDX];
675 /* Sib1 transmission is determined as follows:
676 * 0 : No tranamission
677 * 1 : SIB1 Transmission
678 * 2 : SIB1 Repetition */
680 Sib1AllocInfo sib1Alloc;
683 typedef struct rarInfo
688 FreqDomainAlloc msg3FreqAlloc;
694 typedef struct rarAlloc
698 PdcchCfg rarPdcchCfg;
699 PdschCfg rarPdschCfg;
702 typedef struct dlMsgInfo
710 uint8_t harqFeedbackInd;
713 uint16_t dlMsgPduLen;
717 typedef struct lcSchInfo
720 uint16_t schBytes; /* Number of scheduled bytes */
723 typedef struct dlMsgAlloc
727 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
729 PdcchCfg dlMsgPdcchCfg;
730 PdschCfg dlMsgPdschCfg;
734 typedef struct schSlotValue
736 SlotIndInfo currentTime;
737 SlotIndInfo broadcastTime;
739 SlotIndInfo dlMsgTime;
740 SlotIndInfo ulDciTime;
743 typedef struct format0_0
745 uint8_t resourceAllocType;
746 /* since we are using type-1, hence rbBitmap excluded */
747 FreqDomainAlloc freqAlloc;
748 TimeDomainAlloc timeAlloc;
751 uint8_t harqProcId; /* HARQ Process ID */
754 uint8_t ndi; /* NDI */
755 uint8_t rv; /* Redundancy Version */
760 typedef struct format0_1
766 typedef struct format1_0
772 typedef struct format1_1
777 typedef struct dciInfo
780 uint16_t crnti; /* CRNI */
781 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
782 BwpCfg bwpCfg; /* BWP Cfg */
783 CoresetCfg coresetCfg; /* Coreset1 Cfg */
784 FormatType formatType; /* DCI Format */
787 Format0_0 format0_0; /* Format 0_0 */
788 Format0_1 format0_1; /* Format 0_1 */
789 Format1_0 format1_0; /* Format 1_0 */
790 Format1_1 format1_1; /* Format 1_1 */
796 typedef struct dlSchedInfo
798 uint16_t cellId; /* Cell Id */
799 SchSlotValue schSlotValue;
801 /* Allocation for broadcast messages */
802 bool isBroadcastPres;
803 DlBrdcstAlloc brdcstAlloc;
805 /* Allocation for RAR message */
809 /* Allocation from MSG4 */
810 //Msg4Alloc *msg4Alloc;
812 /* UL grant in response to BSR */
815 /* Allocation from dedicated DL msg */
816 DlMsgAlloc *dlMsgAlloc;
820 typedef struct tbInfo
822 uint8_t qamOrder; /* Modulation Order */
823 uint8_t mcs; /* MCS */
824 SchMcsTable mcsTable; /* MCS Table */
825 uint8_t ndi; /* NDI */
826 uint8_t rv; /* Redundancy Version */
827 uint16_t tbSize; /* TB Size */
830 typedef struct schPuschInfo
833 uint8_t harqProcId; /* HARQ Process ID */
834 uint8_t resAllocType; /* Resource allocation type */
835 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
836 TimeDomainAlloc tdAlloc; /* Time domain allocation */
837 TbInfo tbInfo; /* TB info */
838 uint8_t dmrsMappingType;
839 uint8_t nrOfDmrsSymbols;
843 typedef struct schPucchInfo
847 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
848 TimeDomainAlloc tdAlloc; /* Time domain allocation */
856 typedef struct ulSchedInfo
858 uint16_t cellId; /* Cell Id */
859 uint16_t crnti; /* CRNI */
860 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
861 uint8_t dataType; /* Type of info being scheduled */
862 PrachSchInfo prachSchInfo; /* Prach scheduling info */
863 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
864 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
867 typedef struct rachIndInfo
871 SlotIndInfo timingInfo;
880 typedef struct crcIndInfo
884 SlotIndInfo timingInfo;
886 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
889 typedef struct boInfo
895 typedef struct dlRlcBOInfo
903 /* Info of Scheduling Request to Add/Modify */
904 typedef struct schSchedReqInfo
907 SchSrProhibitTimer srProhibitTmr;
908 SchSrTransMax srTransMax;
911 /* Scheduling Request Configuration */
912 typedef struct schSchedReqCfg
914 uint8_t addModListCount;
915 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
916 uint8_t relListCount;
917 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
920 /* Info of Tag to Add/Modify */
921 typedef struct schTagInfo
924 SchTimeAlignmentTimer timeAlignmentTmr;
927 /* Timing Advance Group Configuration */
928 typedef struct schTagCfg
930 uint8_t addModListCount;
931 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
932 uint8_t relListCount;
933 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
936 /* Configuration for Power headroom reporting */
937 typedef struct schPhrCfg
939 SchPhrPeriodicTimer periodicTmr;
940 SchPhrProhibitTimer prohibitTmr;
941 SchPhrTxPwrFactorChange txpowerFactorChange;
945 SchPhrModeOtherCG modeOtherCG;
948 /* MAC cell Group configuration */
949 typedef struct schMacCellGrpCfg
951 SchSchedReqCfg schedReqCfg;
953 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
956 /* Physical Cell Group Configuration */
957 typedef struct schPhyCellGrpCfg
959 SchPdschHarqAckCodebook pdschHarqAckCodebook;
963 /* Control resource set info */
964 typedef struct schControlRsrcSet
966 uint8_t cRSetId; /* Control resource set id */
967 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
969 SchREGMappingType cceRegMappingType;
970 SchPrecoderGranul precoderGranularity;
971 uint16_t dmrsScramblingId;
974 /* Search Space info */
975 typedef struct schSearchSpace
977 uint8_t searchSpaceId;
979 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
980 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
981 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
982 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
983 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
984 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
985 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
986 SchSearchSpaceType searchSpaceType;
987 uint8_t ueSpecificDciFormat;
990 /* PDCCH cofniguration */
991 typedef struct schPdcchConfig
993 uint8_t numCRsetToAddMod;
994 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
995 uint8_t numCRsetToRel;
996 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
997 uint8_t numSearchSpcToAddMod;
998 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
999 uint8_t numSearchSpcToRel;
1000 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
1003 /* PDSCH time domain resource allocation */
1004 typedef struct schPdschTimeDomRsrcAlloc
1006 SchTimeDomRsrcAllocMappingType mappingType;
1007 uint8_t startSymbol;
1008 uint8_t symbolLength;
1009 }SchPdschTimeDomRsrcAlloc;
1012 typedef struct schPdschBundling
1014 struct schStaticBundling
1016 SchBundlingSizeSet2 size;
1018 struct schDynamicBundling
1020 SchBundlingSizeSet1 sizeSet1;
1021 SchBundlingSizeSet2 sizeSet2;
1022 }SchDynamicBundling;
1025 /* DMRS downlink configuration */
1026 typedef struct schDmrsDlCfg
1028 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1031 /* PDSCH Configuration */
1032 typedef struct schPdschConfig
1034 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
1035 SchResourceAllocType resourceAllocType;
1036 uint8_t numTimeDomRsrcAlloc;
1037 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1039 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
1040 SchBundlingType bundlingType;
1041 SchPdschBundling bundlingInfo;
1044 /* Initial Downlink BWP */
1045 typedef struct schInitalDlBwp
1048 SchPdcchConfig pdcchCfg;
1050 SchPdschConfig pdschCfg;
1053 /* BWP Downlink common */
1054 typedef struct schBwpDlCommon
1058 /* Downlink BWP information */
1059 typedef struct schDlBwpInfo
1064 /* PDCCH Serving Cell configuration */
1065 typedef struct schPdschServCellCfg
1067 uint8_t *maxMimoLayers;
1068 SchNumHarqProcForPdsch numHarqProcForPdsch;
1069 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1070 bool *codeBlkGrpFlushInd;
1071 SchPdschXOverhead *xOverhead;
1072 }SchPdschServCellCfg;
1074 /* PUCCH Configuration */
1075 typedef struct schPucchCfg
1077 /* TODO : Not used currently */
1080 /* Transform precoding disabled */
1081 typedef struct schTransPrecodDisabled
1083 uint16_t scramblingId0;
1084 }SchTransPrecodDisabled;
1086 /* DMRS Uplink configuration */
1087 typedef struct SchDmrsUlCfg
1089 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1090 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1093 /* PUSCH Time Domain Resource Allocation */
1094 typedef struct schPuschTimeDomRsrcAlloc
1097 SchTimeDomRsrcAllocMappingType mappingType;
1098 uint8_t startSymbol;
1099 uint8_t symbolLength;
1100 }SchPuschTimeDomRsrcAlloc;
1102 /* PUSCH Configuration */
1103 typedef struct schPuschCfg
1105 uint8_t dataScramblingId;
1106 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1107 SchResourceAllocType resourceAllocType;
1108 uint8_t numTimeDomRsrcAlloc;
1109 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1110 SchTransformPrecoder transformPrecoder;
1113 /* Initial Uplink BWP */
1114 typedef struct schInitialUlBwp
1117 SchPucchCfg pucchCfg;
1119 SchPuschCfg puschCfg;
1122 /* Uplink BWP information */
1123 typedef struct schUlBwpInfo
1128 /* Serving cell configuration */
1129 typedef struct schServCellCfgInfo
1131 SchInitalDlBwp initDlBwp;
1132 uint8_t numDlBwpToAdd;
1133 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1134 uint8_t firstActvDlBwpId;
1135 uint8_t defaultDlBwpId;
1136 uint8_t *bwpInactivityTmr;
1137 SchPdschServCellCfg pdschServCellCfg;
1138 SchInitialUlBwp initUlBwp;
1139 uint8_t numUlBwpToAdd;
1140 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1141 uint8_t firstActvUlBwpId;
1142 }SchServCellCfgInfo;
1144 typedef struct schNonDynFiveQi
1149 uint16_t maxDataBurstVol;
1152 typedef struct schDynFiveQi
1155 uint16_t packetDelayBudget;
1156 uint8_t packetErrRateScalar;
1157 uint8_t packetErrRateExp;
1159 uint8_t delayCritical;
1161 uint16_t maxDataBurstVol;
1164 typedef struct schNgRanAllocAndRetPri
1166 uint8_t priorityLevel;
1167 uint8_t preEmptionCap;
1168 uint8_t preEmptionVul;
1169 }SchNgRanAllocAndRetPri;
1171 typedef struct schGrbQosFlowInfo
1173 uint32_t maxFlowBitRateDl;
1174 uint32_t maxFlowBitRateUl;
1175 uint32_t guarFlowBitRateDl;
1176 uint32_t guarFlowBitRateUl;
1180 typedef struct schDrbQos
1182 SchQosType fiveQiType; /* Dynamic or non-dynamic */
1185 SchNonDynFiveQi nonDyn5Qi;
1186 SchDynFiveQi dyn5Qi;
1188 SchNgRanAllocAndRetPri ngRanRetPri;
1189 SchGrbQosFlowInfo grbQosFlowInfo;
1190 uint16_t pduSessionId;
1191 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1194 typedef struct schSnssai
1197 uint8_t sd[SD_SIZE];
1200 /* Special cell configuration */
1201 typedef struct schSpCellCfg
1203 uint8_t servCellIdx;
1204 SchServCellCfgInfo servCellCfg;
1207 /* Uplink logical channel configuration */
1208 typedef struct SchUlLcCfg
1213 uint8_t pbr; // prioritisedBitRate
1214 uint8_t bsd; // bucketSizeDuration
1217 /* Downlink logical channel configuration */
1218 typedef struct schDlLcCfg
1220 uint8_t lcp; // logical Channel Prioritization
1223 /* Logical Channel configuration */
1224 typedef struct schLcCfg
1226 ConfigType configType;
1228 SchDrbQosInfo *drbQos;
1234 /* Aggregate max bit rate */
1235 typedef struct schAmbrCfg
1237 uint32_t ulBr; /* Ul BitRate */
1238 uint32_t dlBr; /* Dl BitRate */
1241 typedef struct schModulationInfo
1245 SchMcsTable mcsTable;
1248 /* UE configuration */
1249 typedef struct schUeCfg
1253 SchMacCellGrpCfg macCellGrpCfg;
1254 SchPhyCellGrpCfg phyCellGrpCfg;
1255 SchSpCellCfg spCellCfg;
1256 SchAmbrCfg *ambrCfg;
1257 SchModulationInfo dlModInfo;
1258 SchModulationInfo ulModInfo;
1260 SchLcCfg schLcCfg[MAX_NUM_LC];
1263 typedef struct schUeCfgRsp
1269 SchFailureCause cause;
1272 typedef struct dataVolInfo
1278 typedef struct ulBufferStatusRptInd
1284 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1285 }UlBufferStatusRptInd;
1287 typedef struct srUciIndInfo
1291 SlotIndInfo slotInd;
1293 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1296 /* function pointers */
1298 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1299 Pst *pst, /* Post Structure */
1300 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1303 typedef uint8_t (*SchCellCfgFunc) ARGS((
1304 Pst *pst, /* Post Structure */
1305 SchCellCfg *schCellCfg /* Cell Cfg */
1308 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1309 Pst *pst, /* Post Structure */
1310 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1313 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1314 Pst *pst, /* Post Structure */
1315 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1318 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1319 Pst *pst, /* Post structure */
1320 RachIndInfo *rachInd)); /* Rach Indication Info */
1322 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1323 Pst *pst, /* Post structure */
1324 CrcIndInfo *crcInd)); /* CRC Info */
1326 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1327 Pst *pst, /* Post structure */
1328 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1330 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1331 Pst *pst, /* Post structure */
1332 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1334 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1335 Pst *pst, /* Post structure */
1336 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1338 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1339 Pst *pst, /* Post structure */
1340 SlotIndInfo *slotInd)); /* Slot Info */
1342 typedef uint8_t (*MacSchBsrFunc) ARGS((
1344 UlBufferStatusRptInd *bsrInd
1347 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1348 Pst *pst, /* Post structure */
1349 SrUciIndInfo *uciInd)); /* UCI IND Info */
1351 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1352 Pst *pst, /* Post structure */
1353 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1355 typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
1356 Pst *pst, /* Post structure */
1357 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1359 /* function declarations */
1360 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1361 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1362 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1363 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1364 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1365 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1366 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1367 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1368 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1369 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1370 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1371 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1372 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1373 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1374 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1375 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1376 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1377 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1378 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1379 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1380 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1381 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1382 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1383 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1384 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1385 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1386 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1387 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1388 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1389 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1390 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1391 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1392 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1394 /**********************************************************************
1396 **********************************************************************/