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;
360 typedef struct timeDomainAlloc
366 typedef struct freqDomainAlloc
375 uint32_t ssbPbchPwr; /* SSB block power */
376 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
377 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
378 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
379 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
380 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
383 typedef struct bwpCfg
385 uint8_t subcarrierSpacing;
386 uint8_t cyclicPrefix;
387 FreqDomainAlloc freqAlloc;
393 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
396 typedef struct beamformingInfo
400 uint8_t digBfInterfaces;
401 Prg prg[MAX_NUM_PRG];
404 /* SIB1 PDSCH structures */
406 typedef struct codewordinfo
408 uint16_t targetCodeRate;
416 typedef struct dmrsInfo
418 uint16_t dlDmrsSymbPos;
419 uint8_t dmrsConfigType;
420 uint16_t dlDmrsScramblingId;
422 uint8_t numDmrsCdmGrpsNoData;
425 uint8_t nrOfDmrsSymbols;
429 typedef struct pdschFreqAlloc
431 uint8_t resourceAllocType;
432 /* since we are using type-1, hence rbBitmap excluded */
433 FreqDomainAlloc freqAlloc;
434 uint8_t vrbPrbMapping;
437 typedef struct pdschTimeAlloc
440 TimeDomainAlloc timeAlloc;
443 typedef struct txPowerPdschInfo
445 uint8_t powerControlOffset;
446 uint8_t powerControlOffsetSS;
449 typedef struct pdschCfg
454 uint8_t numCodewords;
455 CodewordInfo codeword[MAX_CODEWORDS];
456 uint16_t dataScramblingId;
458 uint8_t transmissionScheme;
461 PdschFreqAlloc pdschFreqAlloc;
462 PdschTimeAlloc pdschTimeAlloc;
463 BeamformingInfo beamPdschInfo;
464 TxPowerPdschInfo txPdschPower;
466 /* SIB1 PDSCH structures end */
468 /* SIB1 interface structure */
470 typedef struct coresetCfg
473 uint8_t startSymbolIndex;
474 uint8_t durationSymbols;
475 uint8_t freqDomainResource[6];
476 uint8_t cceRegMappingType;
477 uint8_t regBundleSize;
478 uint8_t interleaverSize;
481 uint8_t precoderGranularity;
483 uint8_t aggregationLevel;
486 typedef struct txPowerPdcchInfo
489 uint8_t powerControlOffsetSS;
495 uint16_t scramblingId;
496 uint16_t scramblingRnti;
499 BeamformingInfo beamPdcchInfo;
500 TxPowerPdcchInfo txPdcchPower;
504 typedef struct pdcchCfg
506 /* coreset-0 configuration */
507 CoresetCfg coresetCfg;
510 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
512 /* end of SIB1 PDCCH structures */
516 /* parameters recieved from DU-APP */
518 uint16_t sib1NewTxPeriod;
519 uint16_t sib1RepetitionPeriod;
520 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
521 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
524 /* parameters derived in scheduler */
527 PdcchCfg sib1PdcchCfg;
528 PdschCfg sib1PdschCfg;
531 typedef struct schRachCfg
533 uint8_t prachCfgIdx; /* PRACH config idx */
534 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
535 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
536 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
537 uint8_t rootSeqLen; /* root sequence length */
538 uint16_t rootSeqIdx; /* Root sequence index */
539 uint8_t numRootSeq; /* Number of root sequences required for FD */
540 uint16_t k1; /* Frequency Offset for each FD */
541 uint8_t ssbPerRach; /* SSB per RACH occassion */
542 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
543 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
544 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
545 uint8_t raRspWindow; /* RA Response Window */
548 typedef struct schBwpParams
550 FreqDomainAlloc freqAlloc;
552 uint8_t cyclicPrefix;
555 typedef struct schCandidatesInfo
564 typedef struct schSearchSpaceCfg
566 uint8_t searchSpaceId;
568 uint16_t monitoringSlot;
570 uint16_t monitoringSymbol;
571 SchCandidatesInfo candidate;
574 typedef struct schPdcchCfgCmn
576 SchSearchSpaceCfg commonSearchSpace;
577 uint8_t raSearchSpaceId;
580 typedef struct schPdschCfgCmn
585 uint8_t lengthSymbol;
588 typedef struct schPucchCfgCmn
590 uint8_t pucchResourceCommon;
591 uint8_t pucchGroupHopping;
594 typedef struct schPuschCfgCmn
599 uint8_t lengthSymbol;
602 typedef struct schBwpDlCfg
605 SchPdcchCfgCmn pdcchCommon;
606 SchPdschCfgCmn pdschCommon;
609 typedef struct schBwpUlCfg
612 SchPucchCfgCmn pucchCommon;
613 SchPuschCfgCmn puschCommon;
616 typedef struct schCellCfg
618 uint16_t cellId; /* Cell Id */
619 uint16_t phyCellId; /* Physical cell id */
620 uint8_t bandwidth; /* Supported B/W */
621 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
622 SchSsbCfg ssbSchCfg; /* SSB config */
623 SchSib1Cfg sib1SchCfg; /* SIB1 config */
624 SchRachCfg schRachCfg; /* PRACH config */
625 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
626 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
627 uint8_t puschMu; /* PUSCH MU */
630 typedef struct schCellCfgCfm
632 uint16_t cellId; /* Cell Id */
636 typedef struct ssbInfo
638 uint8_t ssbIdx; /* SSB Index */
639 TimeDomainAlloc tdAlloc; /* Time domain allocation */
640 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
643 typedef struct sib1AllocInfo
646 PdcchCfg sib1PdcchCfg;
647 PdschCfg sib1PdschCfg;
650 typedef struct prachSchInfo
652 uint8_t numPrachOcas; /* Num Prach Ocassions */
653 uint8_t prachFormat; /* PRACH Format */
654 uint8_t numRa; /* Freq domain ocassion */
655 uint8_t prachStartSymb; /* Freq domain ocassion */
658 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
659 typedef struct dlBrdcstAlloc
661 /* Ssb transmission is determined as follows:
662 * 0 : No tranamission
663 * 1 : SSB Transmission
664 * 2 : SSB Repetition */
666 uint8_t ssbIdxSupported;
667 SsbInfo ssbInfo[MAX_SSB_IDX];
668 /* Sib1 transmission is determined as follows:
669 * 0 : No tranamission
670 * 1 : SIB1 Transmission
671 * 2 : SIB1 Repetition */
673 Sib1AllocInfo sib1Alloc;
676 typedef struct rarInfo
681 FreqDomainAlloc msg3FreqAlloc;
687 typedef struct rarAlloc
691 PdcchCfg rarPdcchCfg;
692 PdschCfg rarPdschCfg;
695 typedef struct dlMsgInfo
703 uint8_t harqFeedbackInd;
706 uint16_t dlMsgPduLen;
710 typedef struct lcSchInfo
713 uint16_t schBytes; /* Number of scheduled bytes */
716 typedef struct dlMsgAlloc
720 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
722 PdcchCfg dlMsgPdcchCfg;
723 PdschCfg dlMsgPdschCfg;
727 typedef struct schSlotValue
729 SlotIndInfo currentTime;
730 SlotIndInfo broadcastTime;
732 SlotIndInfo dlMsgTime;
733 SlotIndInfo ulDciTime;
736 typedef struct format0_0
738 uint8_t resourceAllocType;
739 /* since we are using type-1, hence rbBitmap excluded */
740 FreqDomainAlloc freqAlloc;
741 TimeDomainAlloc timeAlloc;
744 uint8_t harqProcId; /* HARQ Process ID */
747 uint8_t ndi; /* NDI */
748 uint8_t rv; /* Redundancy Version */
753 typedef struct format0_1
759 typedef struct format1_0
765 typedef struct format1_1
770 typedef struct dciInfo
773 uint16_t crnti; /* CRNI */
774 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
775 BwpCfg bwpCfg; /* BWP Cfg */
776 CoresetCfg coresetCfg; /* Coreset1 Cfg */
777 FormatType formatType; /* DCI Format */
780 Format0_0 format0_0; /* Format 0_0 */
781 Format0_1 format0_1; /* Format 0_1 */
782 Format1_0 format1_0; /* Format 1_0 */
783 Format1_1 format1_1; /* Format 1_1 */
789 typedef struct dlSchedInfo
791 uint16_t cellId; /* Cell Id */
792 SchSlotValue schSlotValue;
794 /* Allocation for broadcast messages */
795 bool isBroadcastPres;
796 DlBrdcstAlloc brdcstAlloc;
798 /* Allocation for RAR message */
802 /* Allocation from MSG4 */
803 //Msg4Alloc *msg4Alloc;
805 /* UL grant in response to BSR */
808 /* Allocation from dedicated DL msg */
809 DlMsgAlloc *dlMsgAlloc;
813 typedef struct tbInfo
815 uint8_t mcs; /* MCS */
816 uint8_t ndi; /* NDI */
817 uint8_t rv; /* Redundancy Version */
818 uint16_t tbSize; /* TB Size */
821 typedef struct schPuschInfo
824 uint8_t harqProcId; /* HARQ Process ID */
825 uint8_t resAllocType; /* Resource allocation type */
826 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
827 TimeDomainAlloc tdAlloc; /* Time domain allocation */
828 TbInfo tbInfo; /* TB info */
829 uint8_t dmrsMappingType;
830 uint8_t nrOfDmrsSymbols;
834 typedef struct schPucchInfo
838 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
839 TimeDomainAlloc tdAlloc; /* Time domain allocation */
847 typedef struct ulSchedInfo
849 uint16_t cellId; /* Cell Id */
850 uint16_t crnti; /* CRNI */
851 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
852 uint8_t dataType; /* Type of info being scheduled */
853 PrachSchInfo prachSchInfo; /* Prach scheduling info */
854 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
855 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
858 typedef struct rachIndInfo
862 SlotIndInfo timingInfo;
871 typedef struct crcIndInfo
875 SlotIndInfo timingInfo;
877 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
880 typedef struct boInfo
886 typedef struct dlRlcBOInfo
894 /* Info of Scheduling Request to Add/Modify */
895 typedef struct schSchedReqInfo
898 SchSrProhibitTimer srProhibitTmr;
899 SchSrTransMax srTransMax;
902 /* Scheduling Request Configuration */
903 typedef struct schSchedReqCfg
905 uint8_t addModListCount;
906 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
907 uint8_t relListCount;
908 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
911 /* Info of Tag to Add/Modify */
912 typedef struct schTagInfo
915 SchTimeAlignmentTimer timeAlignmentTmr;
918 /* Timing Advance Group Configuration */
919 typedef struct schTagCfg
921 uint8_t addModListCount;
922 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
923 uint8_t relListCount;
924 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
927 /* Configuration for Power headroom reporting */
928 typedef struct schPhrCfg
930 SchPhrPeriodicTimer periodicTmr;
931 SchPhrProhibitTimer prohibitTmr;
932 SchPhrTxPwrFactorChange txpowerFactorChange;
936 SchPhrModeOtherCG modeOtherCG;
939 /* MAC cell Group configuration */
940 typedef struct schMacCellGrpCfg
942 SchSchedReqCfg schedReqCfg;
944 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
947 /* Physical Cell Group Configuration */
948 typedef struct schPhyCellGrpCfg
950 SchPdschHarqAckCodebook pdschHarqAckCodebook;
954 /* Control resource set info */
955 typedef struct schControlRsrcSet
957 uint8_t cRSetId; /* Control resource set id */
958 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
960 SchREGMappingType cceRegMappingType;
961 SchPrecoderGranul precoderGranularity;
962 uint16_t dmrsScramblingId;
965 /* Search Space info */
966 typedef struct schSearchSpace
968 uint8_t searchSpaceId;
970 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
971 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
972 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
973 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
974 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
975 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
976 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
977 SchSearchSpaceType searchSpaceType;
978 uint8_t ueSpecificDciFormat;
981 /* PDCCH cofniguration */
982 typedef struct schPdcchConfig
984 uint8_t numCRsetToAddMod;
985 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
986 uint8_t numCRsetToRel;
987 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
988 uint8_t numSearchSpcToAddMod;
989 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
990 uint8_t numSearchSpcToRel;
991 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
994 /* PDSCH time domain resource allocation */
995 typedef struct schPdschTimeDomRsrcAlloc
997 SchTimeDomRsrcAllocMappingType mappingType;
999 uint8_t symbolLength;
1000 }SchPdschTimeDomRsrcAlloc;
1003 typedef struct schPdschBundling
1005 struct schStaticBundling
1007 SchBundlingSizeSet2 size;
1009 struct schDynamicBundling
1011 SchBundlingSizeSet1 sizeSet1;
1012 SchBundlingSizeSet2 sizeSet2;
1013 }SchDynamicBundling;
1016 /* DMRS downlink configuration */
1017 typedef struct schDmrsDlCfg
1019 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1022 /* PDSCH Configuration */
1023 typedef struct schPdschConfig
1025 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
1026 SchResourceAllocType resourceAllocType;
1027 uint8_t numTimeDomRsrcAlloc;
1028 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1030 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
1031 SchBundlingType bundlingType;
1032 SchPdschBundling bundlingInfo;
1035 /* Initial Downlink BWP */
1036 typedef struct schInitalDlBwp
1039 SchPdcchConfig pdcchCfg;
1041 SchPdschConfig pdschCfg;
1044 /* BWP Downlink common */
1045 typedef struct schBwpDlCommon
1049 /* Downlink BWP information */
1050 typedef struct schDlBwpInfo
1055 /* PDCCH Serving Cell configuration */
1056 typedef struct schPdschServCellCfg
1058 uint8_t *maxMimoLayers;
1059 SchNumHarqProcForPdsch numHarqProcForPdsch;
1060 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1061 bool *codeBlkGrpFlushInd;
1062 SchPdschXOverhead *xOverhead;
1063 }SchPdschServCellCfg;
1065 /* PUCCH Configuration */
1066 typedef struct schPucchCfg
1068 /* TODO : Not used currently */
1071 /* Transform precoding disabled */
1072 typedef struct schTransPrecodDisabled
1074 uint16_t scramblingId0;
1075 }SchTransPrecodDisabled;
1077 /* DMRS Uplink configuration */
1078 typedef struct SchDmrsUlCfg
1080 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1081 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1084 /* PUSCH Time Domain Resource Allocation */
1085 typedef struct schPuschTimeDomRsrcAlloc
1088 SchTimeDomRsrcAllocMappingType mappingType;
1089 uint8_t startSymbol;
1090 uint8_t symbolLength;
1091 }SchPuschTimeDomRsrcAlloc;
1093 /* PUSCH Configuration */
1094 typedef struct schPuschCfg
1096 uint8_t dataScramblingId;
1097 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1098 SchResourceAllocType resourceAllocType;
1099 uint8_t numTimeDomRsrcAlloc;
1100 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1101 SchTransformPrecoder transformPrecoder;
1104 /* Initial Uplink BWP */
1105 typedef struct schInitialUlBwp
1108 SchPucchCfg pucchCfg;
1110 SchPuschCfg puschCfg;
1113 /* Uplink BWP information */
1114 typedef struct schUlBwpInfo
1119 /* Serving cell configuration */
1120 typedef struct schServCellCfgInfo
1122 SchInitalDlBwp initDlBwp;
1123 uint8_t numDlBwpToAdd;
1124 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1125 uint8_t firstActvDlBwpId;
1126 uint8_t defaultDlBwpId;
1127 uint8_t *bwpInactivityTmr;
1128 SchPdschServCellCfg pdschServCellCfg;
1129 SchInitialUlBwp initUlBwp;
1130 uint8_t numUlBwpToAdd;
1131 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1132 uint8_t firstActvUlBwpId;
1133 }SchServCellCfgInfo;
1135 typedef struct schNonDynFiveQi
1140 uint16_t maxDataBurstVol;
1143 typedef struct schDynFiveQi
1146 uint16_t packetDelayBudget;
1147 uint8_t packetErrRateScalar;
1148 uint8_t packetErrRateExp;
1150 uint8_t delayCritical;
1152 uint16_t maxDataBurstVol;
1155 typedef struct schNgRanAllocAndRetPri
1157 uint8_t priorityLevel;
1158 uint8_t preEmptionCap;
1159 uint8_t preEmptionVul;
1160 }SchNgRanAllocAndRetPri;
1162 typedef struct schGrbQosFlowInfo
1164 uint32_t maxFlowBitRateDl;
1165 uint32_t maxFlowBitRateUl;
1166 uint32_t guarFlowBitRateDl;
1167 uint32_t guarFlowBitRateUl;
1171 typedef struct schDrbQos
1173 SchQosType fiveQiType; /* Dynamic or non-dynamic */
1176 SchNonDynFiveQi nonDyn5Qi;
1177 SchDynFiveQi dyn5Qi;
1179 SchNgRanAllocAndRetPri ngRanRetPri;
1180 SchGrbQosFlowInfo grbQosFlowInfo;
1181 uint16_t pduSessionId;
1182 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1185 typedef struct schSnssai
1188 uint8_t sd[SD_SIZE];
1191 /* Special cell configuration */
1192 typedef struct schSpCellCfg
1194 uint8_t servCellIdx;
1195 SchServCellCfgInfo servCellCfg;
1198 /* Uplink logical channel configuration */
1199 typedef struct SchUlLcCfg
1204 uint8_t pbr; // prioritisedBitRate
1205 uint8_t bsd; // bucketSizeDuration
1208 /* Downlink logical channel configuration */
1209 typedef struct schDlLcCfg
1211 uint8_t lcp; // logical Channel Prioritization
1214 /* Logical Channel configuration */
1215 typedef struct schLcCfg
1217 ConfigType configType;
1219 SchDrbQosInfo *drbQos;
1225 /* Aggregate max bit rate */
1226 typedef struct schAmbrCfg
1228 uint32_t ulBr; /* Ul BitRate */
1229 uint32_t dlBr; /* Dl BitRate */
1232 /* UE configuration */
1233 typedef struct schUeCfg
1237 SchMacCellGrpCfg macCellGrpCfg;
1238 SchPhyCellGrpCfg phyCellGrpCfg;
1239 SchSpCellCfg spCellCfg;
1240 SchAmbrCfg *ambrCfg;
1242 SchLcCfg schLcCfg[MAX_NUM_LC];
1245 typedef struct schUeCfgRsp
1251 SchFailureCause cause;
1254 typedef struct dataVolInfo
1260 typedef struct ulBufferStatusRptInd
1266 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1267 }UlBufferStatusRptInd;
1269 typedef struct srUciIndInfo
1273 SlotIndInfo slotInd;
1275 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1278 /* function pointers */
1280 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1281 Pst *pst, /* Post Structure */
1282 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1285 typedef uint8_t (*SchCellCfgFunc) ARGS((
1286 Pst *pst, /* Post Structure */
1287 SchCellCfg *schCellCfg /* Cell Cfg */
1290 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1291 Pst *pst, /* Post Structure */
1292 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1295 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1296 Pst *pst, /* Post Structure */
1297 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1300 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1301 Pst *pst, /* Post structure */
1302 RachIndInfo *rachInd)); /* Rach Indication Info */
1304 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1305 Pst *pst, /* Post structure */
1306 CrcIndInfo *crcInd)); /* CRC Info */
1308 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1309 Pst *pst, /* Post structure */
1310 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1312 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1313 Pst *pst, /* Post structure */
1314 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1316 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1317 Pst *pst, /* Post structure */
1318 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1320 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1321 Pst *pst, /* Post structure */
1322 SlotIndInfo *slotInd)); /* Slot Info */
1324 typedef uint8_t (*MacSchBsrFunc) ARGS((
1326 UlBufferStatusRptInd *bsrInd
1329 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1330 Pst *pst, /* Post structure */
1331 SrUciIndInfo *uciInd)); /* UCI IND Info */
1333 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1334 Pst *pst, /* Post structure */
1335 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1337 typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
1338 Pst *pst, /* Post structure */
1339 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1341 /* function declarations */
1342 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1343 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1344 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1345 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1346 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1347 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1348 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1349 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1350 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1351 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1352 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1353 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1354 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1355 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1356 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1357 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1358 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1359 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1360 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1361 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1362 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1363 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1364 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1365 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1366 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1367 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1368 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1369 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1370 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1371 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1372 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1373 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1374 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1376 /**********************************************************************
1378 **********************************************************************/