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_CHANNEL_GROUPS 8
61 /* can we have a common numslot numscs between mac sch */
64 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */
65 #define MAX_NUM_TAGS 4 /* Max number of timing advance groups */
66 #define MAX_NUM_BWP 4 /* Max number of BWP per serving cell */
67 #define MAX_NUM_CRSET 3 /* Max number of control resource set in add/modify/release list */
68 #define MAX_NUM_SEARCH_SPC 10 /* Max number of search space in add/modify/release list */
69 #define FREQ_DOM_RSRC_SIZE 6 /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
70 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2 /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
71 #define MAX_NUM_DL_ALLOC 16 /* Max number of pdsch time domain downlink allocation */
72 #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */
76 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
78 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
80 toFill.sfn = (crntTime.sfn + 1); \
84 toFill.sfn = crntTime.sfn; \
86 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
87 if (toFill.sfn >= MAX_SFN) \
89 toFill.sfn%=MAX_SFN; \
127 TIME_ALIGNMENT_TIMER_MS500,
128 TIME_ALIGNMENT_TIMER_MS750,
129 TIME_ALIGNMENT_TIMER_MS1280,
130 TIME_ALIGNMENT_TIMER_MS1920,
131 TIME_ALIGNMENT_TIMER_MS2560,
132 TIME_ALIGNMENT_TIMER_MS5120,
133 TIME_ALIGNMENT_TIMER_MS10240,
134 TIME_ALIGNMENT_TIMER_INFINITE
135 }SchTimeAlignmentTimer;
139 PHR_PERIODIC_TIMER_SF10,
140 PHR_PERIODIC_TIMER_SF20,
141 PHR_PERIODIC_TIMER_SF50,
142 PHR_PERIODIC_TIMER_SF100,
143 PHR_PERIODIC_TIMER_SF200,
144 PHR_PERIODIC_TIMER_SF500,
145 PHR_PERIODIC_TIMER_SF1000,
146 PHR_PERIODIC_TIMER_INFINITE
147 }SchPhrPeriodicTimer;
151 PHR_PROHIBIT_TIMER_SF0,
152 PHR_PROHIBIT_TIMER_SF10,
153 PHR_PROHIBIT_TIMER_SF20,
154 PHR_PROHIBIT_TIMER_SF50,
155 PHR_PROHIBIT_TIMER_SF100,
156 PHR_PROHIBIT_TIMER_SF200,
157 PHR_PROHIBIT_TIMER_SF500,
158 PHR_PROHIBIT_TIMER_SF1000
159 }SchPhrProhibitTimer;
163 PHR_TX_PWR_FACTOR_CHANGE_DB1,
164 PHR_TX_PWR_FACTOR_CHANGE_DB3,
165 PHR_TX_PWR_FACTOR_CHANGE_DB6,
166 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
167 }SchPhrTxPwrFactorChange;
177 HARQ_ACK_CODEBOOK_SEMISTATIC,
178 HARQ_ACK_CODEBOOK_DYNAMIC
179 }SchPdschHarqAckCodebook;
183 NUM_HARQ_PROC_FOR_PDSCH_N2,
184 NUM_HARQ_PROC_FOR_PDSCH_N4,
185 NUM_HARQ_PROC_FOR_PDSCH_N6,
186 NUM_HARQ_PROC_FOR_PDSCH_N10,
187 NUM_HARQ_PROC_FOR_PDSCH_N16
188 }SchNumHarqProcForPdsch;
192 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
193 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
194 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
195 MAX_CODE_BLOCK_GROUP_PER_TB_N8
196 }SchMaxCodeBlkGrpPerTB;
200 PDSCH_X_OVERHEAD_XOH_6,
201 PDSCH_X_OVERHEAD_XOH_12,
202 PDSCH_X_OVERHEAD_XOH_18
207 DMRS_ADDITIONAL_POS0,
208 DMRS_ADDITIONAL_POS1,
210 }SchDmrsAdditionPosition;
214 RESOURCE_ALLOCTION_TYPE_0,
215 RESOURCE_ALLOCTION_TYPE_1,
216 RESOURCE_ALLOCTION_DYN_SWITCH
217 }SchResourceAllocType;
221 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
222 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
223 }SchTimeDomRsrcAllocMappingType;
227 ENABLED_TRANSFORM_PRECODER,
228 DISABLED_TRANSFORM_PRECODER
229 }SchTransformPrecoder;
233 INTERLEAVED_CCE_REG_MAPPING,
234 NONINTERLEAVED_CCE_REG_MAPPING
239 SLOT_PERIODICITY_AND_OFFSET_SL_1,
240 SLOT_PERIODICITY_AND_OFFSET_SL_2,
241 SLOT_PERIODICITY_AND_OFFSET_SL_4,
242 SLOT_PERIODICITY_AND_OFFSET_SL_5,
243 SLOT_PERIODICITY_AND_OFFSET_SL_8,
244 SLOT_PERIODICITY_AND_OFFSET_SL_10,
245 SLOT_PERIODICITY_AND_OFFSET_SL_16,
246 SLOT_PERIODICITY_AND_OFFSET_SL_20,
247 SLOT_PERIODICITY_AND_OFFSET_SL_40,
248 SLOT_PERIODICITY_AND_OFFSET_SL_80,
249 SLOT_PERIODICITY_AND_OFFSET_SL_160,
250 SLOT_PERIODICITY_AND_OFFSET_SL_320,
251 SLOT_PERIODICITY_AND_OFFSET_SL_640,
252 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
253 SLOT_PERIODICITY_AND_OFFSET_SL_2560
254 }SchMSlotPeriodAndOffset;
264 SEARCH_SPACE_TYPE_COMMON,
265 SEARCH_SPACE_TYPE_UE_SPECIFIC
270 AGGREGATION_LEVEL_N0,
271 AGGREGATION_LEVEL_N1,
272 AGGREGATION_LEVEL_N2,
273 AGGREGATION_LEVEL_N3,
274 AGGREGATION_LEVEL_N4,
275 AGGREGATION_LEVEL_N5,
276 AGGREGATION_LEVEL_N6,
288 CODE_WORDS_SCHED_BY_DCI_N1,
289 CODE_WORDS_SCHED_BY_DCI_N2
290 }SchCodeWordsSchedByDci;
294 STATIC_BUNDLING_TYPE,
295 DYNAMIC_BUNDLING_TYPE
337 typedef struct timeDomainAlloc
343 typedef struct freqDomainAlloc
352 uint32_t ssbPbchPwr; /* SSB block power */
353 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
354 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
355 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
356 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
357 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
360 typedef struct bwpCfg
362 uint8_t subcarrierSpacing;
363 uint8_t cyclicPrefix;
364 FreqDomainAlloc freqAlloc;
370 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
373 typedef struct beamformingInfo
377 uint8_t digBfInterfaces;
378 Prg prg[MAX_NUM_PRG];
381 /* SIB1 PDSCH structures */
383 typedef struct codewordinfo
385 uint16_t targetCodeRate;
393 typedef struct dmrsInfo
395 uint16_t dlDmrsSymbPos;
396 uint8_t dmrsConfigType;
397 uint16_t dlDmrsScramblingId;
399 uint8_t numDmrsCdmGrpsNoData;
402 uint8_t nrOfDmrsSymbols;
406 typedef struct pdschFreqAlloc
408 uint8_t resourceAllocType;
409 /* since we are using type-1, hence rbBitmap excluded */
410 FreqDomainAlloc freqAlloc;
411 uint8_t vrbPrbMapping;
414 typedef struct pdschTimeAlloc
417 TimeDomainAlloc timeAlloc;
420 typedef struct txPowerPdschInfo
422 uint8_t powerControlOffset;
423 uint8_t powerControlOffsetSS;
426 typedef struct pdschCfg
431 uint8_t numCodewords;
432 CodewordInfo codeword[MAX_CODEWORDS];
433 uint16_t dataScramblingId;
435 uint8_t transmissionScheme;
438 PdschFreqAlloc pdschFreqAlloc;
439 PdschTimeAlloc pdschTimeAlloc;
440 BeamformingInfo beamPdschInfo;
441 TxPowerPdschInfo txPdschPower;
443 /* SIB1 PDSCH structures end */
445 /* SIB1 interface structure */
447 typedef struct coresetCfg
450 uint8_t startSymbolIndex;
451 uint8_t durationSymbols;
452 uint8_t freqDomainResource[6];
453 uint8_t cceRegMappingType;
454 uint8_t regBundleSize;
455 uint8_t interleaverSize;
458 uint8_t precoderGranularity;
460 uint8_t aggregationLevel;
463 typedef struct txPowerPdcchInfo
466 uint8_t powerControlOffsetSS;
472 uint16_t scramblingId;
473 uint16_t scramblingRnti;
476 BeamformingInfo beamPdcchInfo;
477 TxPowerPdcchInfo txPdcchPower;
481 typedef struct pdcchCfg
483 /* coreset-0 configuration */
484 CoresetCfg coresetCfg;
487 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
489 /* end of SIB1 PDCCH structures */
493 /* parameters recieved from DU-APP */
495 uint16_t sib1NewTxPeriod;
496 uint16_t sib1RepetitionPeriod;
497 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
498 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
501 /* parameters derived in scheduler */
504 PdcchCfg sib1PdcchCfg;
505 PdschCfg sib1PdschCfg;
508 typedef struct schRachCfg
510 uint8_t prachCfgIdx; /* PRACH config idx */
511 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
512 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
513 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
514 uint8_t rootSeqLen; /* root sequence length */
515 uint16_t rootSeqIdx; /* Root sequence index */
516 uint8_t numRootSeq; /* Number of root sequences required for FD */
517 uint16_t k1; /* Frequency Offset for each FD */
518 uint8_t ssbPerRach; /* SSB per RACH occassion */
519 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
520 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
521 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
522 uint8_t raRspWindow; /* RA Response Window */
525 typedef struct schBwpParams
527 FreqDomainAlloc freqAlloc;
529 uint8_t cyclicPrefix;
532 typedef struct schCandidatesInfo
541 typedef struct schSearchSpaceCfg
543 uint8_t searchSpaceId;
545 uint16_t monitoringSlot;
547 uint16_t monitoringSymbol;
548 SchCandidatesInfo candidate;
551 typedef struct schPdcchCfgCmn
553 SchSearchSpaceCfg commonSearchSpace;
554 uint8_t raSearchSpaceId;
557 typedef struct schPdschCfgCmn
562 uint8_t lengthSymbol;
565 typedef struct schPucchCfgCmn
567 uint8_t pucchResourceCommon;
568 uint8_t pucchGroupHopping;
571 typedef struct schPuschCfgCmn
576 uint8_t lengthSymbol;
579 typedef struct schBwpDlCfg
582 SchPdcchCfgCmn pdcchCommon;
583 SchPdschCfgCmn pdschCommon;
586 typedef struct schBwpUlCfg
589 SchPucchCfgCmn pucchCommon;
590 SchPuschCfgCmn puschCommon;
593 typedef struct schCellCfg
595 uint16_t cellId; /* Cell Id */
596 uint16_t phyCellId; /* Physical cell id */
597 uint8_t bandwidth; /* Supported B/W */
598 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
599 SchSsbCfg ssbSchCfg; /* SSB config */
600 SchSib1Cfg sib1SchCfg; /* SIB1 config */
601 SchRachCfg schRachCfg; /* PRACH config */
602 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
603 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
604 uint8_t puschMu; /* PUSCH MU */
607 typedef struct schCellCfgCfm
609 uint16_t cellId; /* Cell Id */
613 typedef struct ssbInfo
615 uint8_t ssbIdx; /* SSB Index */
616 TimeDomainAlloc tdAlloc; /* Time domain allocation */
617 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
620 typedef struct sib1AllocInfo
623 PdcchCfg sib1PdcchCfg;
624 PdschCfg sib1PdschCfg;
627 typedef struct prachSchInfo
629 uint8_t numPrachOcas; /* Num Prach Ocassions */
630 uint8_t prachFormat; /* PRACH Format */
631 uint8_t numRa; /* Freq domain ocassion */
632 uint8_t prachStartSymb; /* Freq domain ocassion */
635 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
636 typedef struct dlBrdcstAlloc
638 /* Ssb transmission is determined as follows:
639 * 0 : No tranamission
640 * 1 : SSB Transmission
641 * 2 : SSB Repetition */
643 uint8_t ssbIdxSupported;
644 SsbInfo ssbInfo[MAX_SSB_IDX];
645 /* Sib1 transmission is determined as follows:
646 * 0 : No tranamission
647 * 1 : SIB1 Transmission
648 * 2 : SIB1 Repetition */
650 Sib1AllocInfo sib1Alloc;
653 typedef struct rarInfo
658 FreqDomainAlloc msg3FreqAlloc;
664 typedef struct rarAlloc
668 PdcchCfg rarPdcchCfg;
669 PdschCfg rarPdschCfg;
672 typedef struct dlMsgInfo
680 uint8_t harqFeedbackInd;
683 uint16_t dlMsgPduLen;
687 typedef struct lcSchInfo
690 uint16_t schBytes; /* Number of scheduled bytes */
693 typedef struct dlMsgAlloc
697 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
699 PdcchCfg dlMsgPdcchCfg;
700 PdschCfg dlMsgPdschCfg;
704 typedef struct schSlotValue
706 SlotIndInfo currentTime;
707 SlotIndInfo broadcastTime;
709 SlotIndInfo dlMsgTime;
710 SlotIndInfo ulDciTime;
713 typedef struct format0_0
715 uint8_t resourceAllocType;
716 /* since we are using type-1, hence rbBitmap excluded */
717 FreqDomainAlloc freqAlloc;
718 TimeDomainAlloc timeAlloc;
721 uint8_t harqProcId; /* HARQ Process ID */
724 uint8_t ndi; /* NDI */
725 uint8_t rv; /* Redundancy Version */
730 typedef struct format0_1
736 typedef struct format1_0
742 typedef struct format1_1
747 typedef struct dciInfo
750 uint16_t crnti; /* CRNI */
751 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
752 BwpCfg bwpCfg; /* BWP Cfg */
753 CoresetCfg coresetCfg; /* Coreset1 Cfg */
754 FormatType formatType; /* DCI Format */
757 Format0_0 format0_0; /* Format 0_0 */
758 Format0_1 format0_1; /* Format 0_1 */
759 Format1_0 format1_0; /* Format 1_0 */
760 Format1_1 format1_1; /* Format 1_1 */
766 typedef struct dlSchedInfo
768 uint16_t cellId; /* Cell Id */
769 SchSlotValue schSlotValue;
771 /* Allocation for broadcast messages */
772 bool isBroadcastPres;
773 DlBrdcstAlloc brdcstAlloc;
775 /* Allocation for RAR message */
779 /* Allocation from MSG4 */
780 //Msg4Alloc *msg4Alloc;
782 /* UL grant in response to BSR */
785 /* Allocation from dedicated DL msg */
786 DlMsgAlloc *dlMsgAlloc;
790 typedef struct tbInfo
792 uint8_t mcs; /* MCS */
793 uint8_t ndi; /* NDI */
794 uint8_t rv; /* Redundancy Version */
795 uint16_t tbSize; /* TB Size */
798 typedef struct schPuschInfo
801 uint8_t harqProcId; /* HARQ Process ID */
802 uint8_t resAllocType; /* Resource allocation type */
803 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
804 TimeDomainAlloc tdAlloc; /* Time domain allocation */
805 TbInfo tbInfo; /* TB info */
806 uint8_t dmrsMappingType;
807 uint8_t nrOfDmrsSymbols;
811 typedef struct schPucchInfo
815 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
816 TimeDomainAlloc tdAlloc; /* Time domain allocation */
824 typedef struct ulSchedInfo
826 uint16_t cellId; /* Cell Id */
827 uint16_t crnti; /* CRNI */
828 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
829 uint8_t dataType; /* Type of info being scheduled */
830 PrachSchInfo prachSchInfo; /* Prach scheduling info */
831 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
832 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
835 typedef struct rachIndInfo
839 SlotIndInfo timingInfo;
848 typedef struct crcIndInfo
852 SlotIndInfo timingInfo;
854 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
857 typedef struct boInfo
863 typedef struct dlRlcBOInfo
871 /* Info of Scheduling Request to Add/Modify */
872 typedef struct schSchedReqInfo
875 SchSrProhibitTimer srProhibitTmr;
876 SchSrTransMax srTransMax;
879 /* Scheduling Request Configuration */
880 typedef struct schSchedReqCfg
882 uint8_t addModListCount;
883 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
884 uint8_t relListCount;
885 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
888 /* Info of Tag to Add/Modify */
889 typedef struct schTagInfo
892 SchTimeAlignmentTimer timeAlignmentTmr;
895 /* Timing Advance Group Configuration */
896 typedef struct schTagCfg
898 uint8_t addModListCount;
899 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
900 uint8_t relListCount;
901 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
904 /* Configuration for Power headroom reporting */
905 typedef struct schPhrCfg
907 SchPhrPeriodicTimer periodicTmr;
908 SchPhrProhibitTimer prohibitTmr;
909 SchPhrTxPwrFactorChange txpowerFactorChange;
913 SchPhrModeOtherCG modeOtherCG;
916 /* MAC cell Group configuration */
917 typedef struct schMacCellGrpCfg
919 SchSchedReqCfg schedReqCfg;
921 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
924 /* Physical Cell Group Configuration */
925 typedef struct schPhyCellGrpCfg
927 SchPdschHarqAckCodebook pdschHarqAckCodebook;
931 /* Control resource set info */
932 typedef struct schControlRsrcSet
934 uint8_t cRSetId; /* Control resource set id */
935 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
937 SchREGMappingType cceRegMappingType;
938 SchPrecoderGranul precoderGranularity;
939 uint16_t dmrsScramblingId;
942 /* Search Space info */
943 typedef struct schSearchSpace
945 uint8_t searchSpaceId;
947 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
948 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
949 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
950 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
951 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
952 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
953 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
954 SchSearchSpaceType searchSpaceType;
955 uint8_t ueSpecificDciFormat;
958 /* PDCCH cofniguration */
959 typedef struct schPdcchConfig
961 uint8_t numCRsetToAddMod;
962 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
963 uint8_t numCRsetToRel;
964 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
965 uint8_t numSearchSpcToAddMod;
966 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
967 uint8_t numSearchSpcToRel;
968 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
971 /* PDSCH time domain resource allocation */
972 typedef struct schPdschTimeDomRsrcAlloc
974 SchTimeDomRsrcAllocMappingType mappingType;
976 uint8_t symbolLength;
977 }SchPdschTimeDomRsrcAlloc;
979 /* DMRS downlink configuration */
980 typedef struct schDmrsDlCfg
982 SchDmrsAdditionPosition addPos; /* DMRS additional position */
985 /* PDSCH Configuration */
986 typedef struct schPdschConfig
988 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
989 SchResourceAllocType resourceAllocType;
990 uint8_t numTimeDomRsrcAlloc;
991 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
993 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
994 SchBundlingType bundlingType;
997 /* Initial Downlink BWP */
998 typedef struct schInitalDlBwp
1001 SchPdcchConfig pdcchCfg;
1003 SchPdschConfig pdschCfg;
1006 /* BWP Downlink common */
1007 typedef struct schBwpDlCommon
1011 /* Downlink BWP information */
1012 typedef struct schDlBwpInfo
1017 /* PDCCH Serving Cell configuration */
1018 typedef struct schPdschServCellCfg
1020 uint8_t *maxMimoLayers;
1021 SchNumHarqProcForPdsch numHarqProcForPdsch;
1022 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1023 bool *codeBlkGrpFlushInd;
1024 SchPdschXOverhead *xOverhead;
1025 }SchPdschServCellCfg;
1027 /* PUCCH Configuration */
1028 typedef struct schPucchCfg
1030 /* TODO : Not used currently */
1033 /* Transform precoding disabled */
1034 typedef struct schTransPrecodDisabled
1036 uint16_t scramblingId0;
1037 }SchTransPrecodDisabled;
1039 /* DMRS Uplink configuration */
1040 typedef struct SchDmrsUlCfg
1042 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1043 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1046 /* PUSCH Time Domain Resource Allocation */
1047 typedef struct schPuschTimeDomRsrcAlloc
1050 SchTimeDomRsrcAllocMappingType mappingType;
1051 uint8_t startSymbol;
1052 uint8_t symbolLength;
1053 }SchPuschTimeDomRsrcAlloc;
1055 /* PUSCH Configuration */
1056 typedef struct schPuschCfg
1058 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1059 SchResourceAllocType resourceAllocType;
1060 uint8_t numTimeDomRsrcAlloc;
1061 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1062 SchTransformPrecoder transformPrecoder;
1065 /* Initial Uplink BWP */
1066 typedef struct schInitialUlBwp
1069 SchPucchCfg pucchCfg;
1071 SchPuschCfg puschCfg;
1074 /* Uplink BWP information */
1075 typedef struct schUlBwpInfo
1080 /* Serving cell configuration */
1081 typedef struct schServCellCfgInfo
1083 SchInitalDlBwp initDlBwp;
1084 uint8_t numDlBwpToAdd;
1085 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1086 uint8_t firstActvDlBwpId;
1087 uint8_t defaultDlBwpId;
1088 uint8_t *bwpInactivityTmr;
1089 SchPdschServCellCfg pdschServCellCfg;
1090 SchInitialUlBwp initUlBwp;
1091 uint8_t numUlBwpToAdd;
1092 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1093 uint8_t firstActvUlBwpId;
1094 }SchServCellCfgInfo;
1096 typedef struct schNonDynFiveQi
1101 uint16_t maxDataBurstVol;
1104 typedef struct schDynFiveQi
1107 uint16_t packetDelayBudget;
1108 uint8_t packetErrRateScalar;
1109 uint8_t packetErrRateExp;
1111 uint8_t delayCritical;
1113 uint16_t maxDataBurstVol;
1116 typedef struct schNgRanAllocAndRetPri
1118 uint8_t priorityLevel;
1119 uint8_t preEmptionCap;
1120 uint8_t preEmptionVul;
1121 }SchNgRanAllocAndRetPri;
1123 typedef struct schGrbQosFlowInfo
1125 uint32_t maxFlowBitRateDl;
1126 uint32_t maxFlowBitRateUl;
1127 uint32_t guarFlowBitRateDl;
1128 uint32_t guarFlowBitRateUl;
1132 typedef struct schDrbQos
1134 uint8_t fiveQiType; /* Dynamic or non-dynamic */
1137 SchNonDynFiveQi nonDyn5Qi;
1138 SchDynFiveQi dyn5Qi;
1140 SchNgRanAllocAndRetPri ngRanRetPri;
1141 SchGrbQosFlowInfo grbQosFlowInfo;
1142 uint16_t pduSessionId;
1143 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1146 typedef struct schSnssai
1149 uint8_t sd[SD_SIZE];
1152 /* Special cell configuration */
1153 typedef struct schSpCellCfg
1155 uint8_t servCellIdx;
1156 SchServCellCfgInfo servCellCfg;
1159 /* Uplink logical channel configuration */
1160 typedef struct SchUlLcCfg
1165 uint8_t pbr; // prioritisedBitRate
1166 uint8_t bsd; // bucketSizeDuration
1169 /* Downlink logical channel configuration */
1170 typedef struct schDlLcCfg
1172 uint8_t lcp; // logical Channel Prioritization
1175 /* Logical Channel configuration */
1176 typedef struct schLcCfg
1179 SchDrbQosInfo *drbQos;
1182 SchUlLcCfg *ulLcCfg;
1185 /* Aggregate max bit rate */
1186 typedef struct aggrMaxBitRate
1192 /* UE configuration */
1193 typedef struct schUeCfg
1197 SchMacCellGrpCfg macCellGrpCfg;
1198 SchPhyCellGrpCfg phyCellGrpCfg;
1199 SchSpCellCfg spCellCfg;
1200 SchAggrMaxBitRate *aggrMaxBitRate;
1202 SchLcCfg lcCfgList[MAX_NUM_LC];
1205 typedef struct schUeCfgRsp
1211 SchFailureCause cause;
1214 typedef struct dataVolInfo
1220 typedef struct ulBufferStatusRptInd
1226 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1227 }UlBufferStatusRptInd;
1229 typedef struct srUciIndInfo
1233 SlotIndInfo slotInd;
1235 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1238 /* function pointers */
1240 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1241 Pst *pst, /* Post Structure */
1242 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1245 typedef uint8_t (*SchCellCfgFunc) ARGS((
1246 Pst *pst, /* Post Structure */
1247 SchCellCfg *schCellCfg /* Cell Cfg */
1250 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1251 Pst *pst, /* Post Structure */
1252 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1255 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1256 Pst *pst, /* Post Structure */
1257 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1260 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1261 Pst *pst, /* Post structure */
1262 RachIndInfo *rachInd)); /* Rach Indication Info */
1264 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1265 Pst *pst, /* Post structure */
1266 CrcIndInfo *crcInd)); /* CRC Info */
1268 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1269 Pst *pst, /* Post structure */
1270 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1272 typedef uint8_t (*MacSchUeCreateReqFunc) ARGS((
1273 Pst *pst, /* Post structure */
1274 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1276 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1277 Pst *pst, /* Post structure */
1278 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1280 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1281 Pst *pst, /* Post structure */
1282 SlotIndInfo *slotInd)); /* Slot Info */
1284 typedef uint8_t (*MacSchBsrFunc) ARGS((
1286 UlBufferStatusRptInd *bsrInd
1289 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1290 Pst *pst, /* Post structure */
1291 SrUciIndInfo *uciInd)); /* UCI IND Info */
1294 /* function declarations */
1295 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1296 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1297 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1298 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1299 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1300 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1301 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1302 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1303 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1304 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1305 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1306 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1307 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1308 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1309 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1310 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1311 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1312 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1313 uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
1314 uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
1315 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1316 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1317 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1318 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1319 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1320 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1321 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1322 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1323 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1325 /**********************************************************************
1327 **********************************************************************/