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 */
77 /* PUCCH Configuration Macro */
78 #define MAX_NUM_PUCCH_RESRC 128
79 #define MAX_NUM_PUCCH_RESRC_SET 4
80 #define MAX_NUM_PUCCH_PER_RESRC_SET 32
81 #define MAX_NUM_SPATIAL_RELATIONS 8
82 #define MAX_NUM_PUCCH_P0_PER_SET 8
83 #define MAX_NUM_PATH_LOSS_REF_RS 4
84 #define MAX_NUM_DL_DATA_TO_UL_ACK 15
87 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
89 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
91 toFill.sfn = (crntTime.sfn + 1); \
95 toFill.sfn = crntTime.sfn; \
97 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
98 if (toFill.sfn >= MAX_SFN) \
100 toFill.sfn%=MAX_SFN; \
108 RESOURCE_UNAVAILABLE,
138 TIME_ALIGNMENT_TIMER_MS500,
139 TIME_ALIGNMENT_TIMER_MS750,
140 TIME_ALIGNMENT_TIMER_MS1280,
141 TIME_ALIGNMENT_TIMER_MS1920,
142 TIME_ALIGNMENT_TIMER_MS2560,
143 TIME_ALIGNMENT_TIMER_MS5120,
144 TIME_ALIGNMENT_TIMER_MS10240,
145 TIME_ALIGNMENT_TIMER_INFINITE
146 }SchTimeAlignmentTimer;
150 PHR_PERIODIC_TIMER_SF10,
151 PHR_PERIODIC_TIMER_SF20,
152 PHR_PERIODIC_TIMER_SF50,
153 PHR_PERIODIC_TIMER_SF100,
154 PHR_PERIODIC_TIMER_SF200,
155 PHR_PERIODIC_TIMER_SF500,
156 PHR_PERIODIC_TIMER_SF1000,
157 PHR_PERIODIC_TIMER_INFINITE
158 }SchPhrPeriodicTimer;
162 PHR_PROHIBIT_TIMER_SF0,
163 PHR_PROHIBIT_TIMER_SF10,
164 PHR_PROHIBIT_TIMER_SF20,
165 PHR_PROHIBIT_TIMER_SF50,
166 PHR_PROHIBIT_TIMER_SF100,
167 PHR_PROHIBIT_TIMER_SF200,
168 PHR_PROHIBIT_TIMER_SF500,
169 PHR_PROHIBIT_TIMER_SF1000
170 }SchPhrProhibitTimer;
174 PHR_TX_PWR_FACTOR_CHANGE_DB1,
175 PHR_TX_PWR_FACTOR_CHANGE_DB3,
176 PHR_TX_PWR_FACTOR_CHANGE_DB6,
177 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
178 }SchPhrTxPwrFactorChange;
188 HARQ_ACK_CODEBOOK_SEMISTATIC,
189 HARQ_ACK_CODEBOOK_DYNAMIC
190 }SchPdschHarqAckCodebook;
194 NUM_HARQ_PROC_FOR_PDSCH_N2,
195 NUM_HARQ_PROC_FOR_PDSCH_N4,
196 NUM_HARQ_PROC_FOR_PDSCH_N6,
197 NUM_HARQ_PROC_FOR_PDSCH_N10,
198 NUM_HARQ_PROC_FOR_PDSCH_N16
199 }SchNumHarqProcForPdsch;
203 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
204 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
205 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
206 MAX_CODE_BLOCK_GROUP_PER_TB_N8
207 }SchMaxCodeBlkGrpPerTB;
211 PDSCH_X_OVERHEAD_XOH_6,
212 PDSCH_X_OVERHEAD_XOH_12,
213 PDSCH_X_OVERHEAD_XOH_18
218 DMRS_ADDITIONAL_POS0,
219 DMRS_ADDITIONAL_POS1,
221 }SchDmrsAdditionPosition;
225 RESOURCE_ALLOCTION_TYPE_0,
226 RESOURCE_ALLOCTION_TYPE_1,
227 RESOURCE_ALLOCTION_DYN_SWITCH
228 }SchResourceAllocType;
232 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
233 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
234 }SchTimeDomRsrcAllocMappingType;
238 ENABLED_TRANSFORM_PRECODER,
239 DISABLED_TRANSFORM_PRECODER
240 }SchTransformPrecoder;
244 INTERLEAVED_CCE_REG_MAPPING = 1,
245 NONINTERLEAVED_CCE_REG_MAPPING
250 SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
251 SLOT_PERIODICITY_AND_OFFSET_SL_2,
252 SLOT_PERIODICITY_AND_OFFSET_SL_4,
253 SLOT_PERIODICITY_AND_OFFSET_SL_5,
254 SLOT_PERIODICITY_AND_OFFSET_SL_8,
255 SLOT_PERIODICITY_AND_OFFSET_SL_10,
256 SLOT_PERIODICITY_AND_OFFSET_SL_16,
257 SLOT_PERIODICITY_AND_OFFSET_SL_20,
258 SLOT_PERIODICITY_AND_OFFSET_SL_40,
259 SLOT_PERIODICITY_AND_OFFSET_SL_80,
260 SLOT_PERIODICITY_AND_OFFSET_SL_160,
261 SLOT_PERIODICITY_AND_OFFSET_SL_320,
262 SLOT_PERIODICITY_AND_OFFSET_SL_640,
263 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
264 SLOT_PERIODICITY_AND_OFFSET_SL_2560
265 }SchMSlotPeriodAndOffset;
275 SEARCH_SPACE_TYPE_COMMON = 1,
276 SEARCH_SPACE_TYPE_UE_SPECIFIC
281 SCH_QOS_NON_DYNAMIC = 1,
287 AGGREGATION_LEVEL_N0,
288 AGGREGATION_LEVEL_N1,
289 AGGREGATION_LEVEL_N2,
290 AGGREGATION_LEVEL_N3,
291 AGGREGATION_LEVEL_N4,
292 AGGREGATION_LEVEL_N5,
293 AGGREGATION_LEVEL_N6,
305 CODE_WORDS_SCHED_BY_DCI_N1,
306 CODE_WORDS_SCHED_BY_DCI_N2
307 }SchCodeWordsSchedByDci;
311 STATIC_BUNDLING_TYPE = 1,
312 DYNAMIC_BUNDLING_TYPE
318 SCH_SET1_SIZE_WIDEBAND,
319 SCH_SET1_SIZE_N2_WIDEBAND,
320 SCH_SET1_SIZE_N4_WIDEBAND
321 }SchBundlingSizeSet1;
326 SCH_SET2_SIZE_WIDEBAND
327 }SchBundlingSizeSet2;
369 SCH_MCS_TABLE_QAM_64,
370 SCH_MCS_TABLE_QAM_256,
371 SCH_MCS_TABLE_QAM_64_LOW_SE
375 typedef struct timeDomainAlloc
381 typedef struct freqDomainAlloc
390 uint32_t ssbPbchPwr; /* SSB block power */
391 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
392 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
393 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
394 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
395 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
398 typedef struct bwpCfg
400 uint8_t subcarrierSpacing;
401 uint8_t cyclicPrefix;
402 FreqDomainAlloc freqAlloc;
408 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
411 typedef struct beamformingInfo
415 uint8_t digBfInterfaces;
416 Prg prg[MAX_NUM_PRG];
419 /* SIB1 PDSCH structures */
421 typedef struct codewordinfo
423 uint16_t targetCodeRate;
431 typedef struct dmrsInfo
433 uint16_t dlDmrsSymbPos;
434 uint8_t dmrsConfigType;
435 uint16_t dlDmrsScramblingId;
437 uint8_t numDmrsCdmGrpsNoData;
440 uint8_t nrOfDmrsSymbols;
444 typedef struct pdschFreqAlloc
446 uint8_t resourceAllocType;
447 /* since we are using type-1, hence rbBitmap excluded */
448 FreqDomainAlloc freqAlloc;
449 uint8_t vrbPrbMapping;
452 typedef struct pdschTimeAlloc
455 TimeDomainAlloc timeAlloc;
458 typedef struct txPowerPdschInfo
460 uint8_t powerControlOffset;
461 uint8_t powerControlOffsetSS;
464 typedef struct pdschCfg
469 uint8_t numCodewords;
470 CodewordInfo codeword[MAX_CODEWORDS];
471 uint16_t dataScramblingId;
473 uint8_t transmissionScheme;
476 PdschFreqAlloc pdschFreqAlloc;
477 PdschTimeAlloc pdschTimeAlloc;
478 BeamformingInfo beamPdschInfo;
479 TxPowerPdschInfo txPdschPower;
481 /* SIB1 PDSCH structures end */
483 /* SIB1 interface structure */
485 typedef struct coresetCfg
488 uint8_t startSymbolIndex;
489 uint8_t durationSymbols;
490 uint8_t freqDomainResource[6];
491 uint8_t cceRegMappingType;
492 uint8_t regBundleSize;
493 uint8_t interleaverSize;
496 uint8_t precoderGranularity;
498 uint8_t aggregationLevel;
501 typedef struct txPowerPdcchInfo
504 uint8_t powerControlOffsetSS;
510 uint16_t scramblingId;
511 uint16_t scramblingRnti;
514 BeamformingInfo beamPdcchInfo;
515 TxPowerPdcchInfo txPdcchPower;
519 typedef struct pdcchCfg
521 /* coreset-0 configuration */
522 CoresetCfg coresetCfg;
525 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
527 /* end of SIB1 PDCCH structures */
531 /* parameters recieved from DU-APP */
533 uint16_t sib1NewTxPeriod;
534 uint16_t sib1RepetitionPeriod;
535 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
536 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
539 /* parameters derived in scheduler */
542 PdcchCfg sib1PdcchCfg;
543 PdschCfg sib1PdschCfg;
546 typedef struct schRachCfg
548 uint8_t prachCfgIdx; /* PRACH config idx */
549 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
550 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
551 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
552 uint8_t rootSeqLen; /* root sequence length */
553 uint16_t rootSeqIdx; /* Root sequence index */
554 uint8_t numRootSeq; /* Number of root sequences required for FD */
555 uint16_t k1; /* Frequency Offset for each FD */
556 uint8_t ssbPerRach; /* SSB per RACH occassion */
557 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
558 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
559 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
560 uint8_t raRspWindow; /* RA Response Window */
563 typedef struct schBwpParams
565 FreqDomainAlloc freqAlloc;
567 uint8_t cyclicPrefix;
570 typedef struct schCandidatesInfo
579 typedef struct schSearchSpaceCfg
581 uint8_t searchSpaceId;
583 uint16_t monitoringSlot;
585 uint16_t monitoringSymbol;
586 SchCandidatesInfo candidate;
589 typedef struct schPdcchCfgCmn
591 SchSearchSpaceCfg commonSearchSpace;
592 uint8_t raSearchSpaceId;
595 typedef struct schPdschCfgCmn
600 uint8_t lengthSymbol;
603 typedef struct schPucchCfgCmn
605 uint8_t pucchResourceCommon;
606 uint8_t pucchGroupHopping;
609 typedef struct schPuschCfgCmn
614 uint8_t lengthSymbol;
617 typedef struct schBwpDlCfg
620 SchPdcchCfgCmn pdcchCommon;
621 SchPdschCfgCmn pdschCommon;
624 typedef struct schBwpUlCfg
627 SchPucchCfgCmn pucchCommon;
628 SchPuschCfgCmn puschCommon;
631 typedef struct schCellCfg
633 uint16_t cellId; /* Cell Id */
634 uint16_t phyCellId; /* Physical cell id */
635 uint8_t bandwidth; /* Supported B/W */
636 uint8_t numerology; /* Supported numerology */
637 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
638 SchSsbCfg ssbSchCfg; /* SSB config */
639 SchSib1Cfg sib1SchCfg; /* SIB1 config */
640 SchRachCfg schRachCfg; /* PRACH config */
641 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
642 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
644 TDDCfg tddCfg; /* TDD Cfg */
648 typedef struct schCellCfgCfm
650 uint16_t cellId; /* Cell Id */
654 typedef struct ssbInfo
656 uint8_t ssbIdx; /* SSB Index */
657 TimeDomainAlloc tdAlloc; /* Time domain allocation */
658 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
661 typedef struct sib1AllocInfo
664 PdcchCfg sib1PdcchCfg;
665 PdschCfg sib1PdschCfg;
668 typedef struct prachSchInfo
670 uint8_t numPrachOcas; /* Num Prach Ocassions */
671 uint8_t prachFormat; /* PRACH Format */
672 uint8_t numRa; /* Freq domain ocassion */
673 uint8_t prachStartSymb; /* Freq domain ocassion */
676 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
677 typedef struct dlBrdcstAlloc
679 /* Ssb transmission is determined as follows:
680 * 0 : No tranamission
681 * 1 : SSB Transmission
682 * 2 : SSB Repetition */
684 uint8_t ssbIdxSupported;
685 SsbInfo ssbInfo[MAX_SSB_IDX];
686 /* Sib1 transmission is determined as follows:
687 * 0 : No tranamission
688 * 1 : SIB1 Transmission
689 * 2 : SIB1 Repetition */
691 Sib1AllocInfo sib1Alloc;
694 typedef struct rarInfo
699 FreqDomainAlloc msg3FreqAlloc;
705 typedef struct rarAlloc
709 PdcchCfg rarPdcchCfg;
710 PdschCfg rarPdschCfg;
713 typedef struct dlMsgInfo
721 uint8_t harqFeedbackInd;
724 uint16_t dlMsgPduLen;
728 typedef struct lcSchInfo
731 uint16_t schBytes; /* Number of scheduled bytes */
734 typedef struct dlMsgAlloc
738 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
740 PdcchCfg dlMsgPdcchCfg;
741 PdschCfg dlMsgPdschCfg;
745 typedef struct schSlotValue
747 SlotIndInfo currentTime;
748 SlotIndInfo broadcastTime;
750 SlotIndInfo dlMsgTime;
751 SlotIndInfo ulDciTime;
754 typedef struct format0_0
756 uint8_t resourceAllocType;
757 /* since we are using type-1, hence rbBitmap excluded */
758 FreqDomainAlloc freqAlloc;
759 TimeDomainAlloc timeAlloc;
762 uint8_t harqProcId; /* HARQ Process ID */
765 uint8_t ndi; /* NDI */
766 uint8_t rv; /* Redundancy Version */
771 typedef struct format0_1
777 typedef struct format1_0
783 typedef struct format1_1
788 typedef struct dciInfo
791 uint16_t crnti; /* CRNI */
792 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
793 BwpCfg bwpCfg; /* BWP Cfg */
794 CoresetCfg coresetCfg; /* Coreset1 Cfg */
795 FormatType formatType; /* DCI Format */
798 Format0_0 format0_0; /* Format 0_0 */
799 Format0_1 format0_1; /* Format 0_1 */
800 Format1_0 format1_0; /* Format 1_0 */
801 Format1_1 format1_1; /* Format 1_1 */
807 typedef struct dlSchedInfo
809 uint16_t cellId; /* Cell Id */
810 SchSlotValue schSlotValue;
812 /* Allocation for broadcast messages */
813 bool isBroadcastPres;
814 DlBrdcstAlloc brdcstAlloc;
816 /* Allocation for RAR message */
820 /* Allocation from MSG4 */
821 //Msg4Alloc *msg4Alloc;
823 /* UL grant in response to BSR */
826 /* Allocation from dedicated DL msg */
827 DlMsgAlloc *dlMsgAlloc;
831 typedef struct tbInfo
833 uint8_t qamOrder; /* Modulation Order */
834 uint8_t mcs; /* MCS */
835 SchMcsTable mcsTable; /* MCS Table */
836 uint8_t ndi; /* NDI */
837 uint8_t rv; /* Redundancy Version */
838 uint16_t tbSize; /* TB Size */
841 typedef struct schPuschInfo
844 uint8_t harqProcId; /* HARQ Process ID */
845 uint8_t resAllocType; /* Resource allocation type */
846 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
847 TimeDomainAlloc tdAlloc; /* Time domain allocation */
848 TbInfo tbInfo; /* TB info */
849 uint8_t dmrsMappingType;
850 uint8_t nrOfDmrsSymbols;
854 typedef struct schPucchFormatCfg
856 uint8_t interSlotFreqHop;
864 typedef struct schPucchInfo
868 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
869 TimeDomainAlloc tdAlloc; /* Time domain allocation */
875 uint8_t intraFreqHop;
876 uint16_t secondPrbHop;
877 uint8_t initialCyclicShift;
881 SchPucchFormatCfg cmnFormatCfg;
884 typedef struct ulSchedInfo
886 uint16_t cellId; /* Cell Id */
887 uint16_t crnti; /* CRNI */
888 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
889 uint8_t dataType; /* Type of info being scheduled */
890 PrachSchInfo prachSchInfo; /* Prach scheduling info */
891 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
892 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
895 typedef struct rachIndInfo
899 SlotIndInfo timingInfo;
908 typedef struct crcIndInfo
912 SlotIndInfo timingInfo;
914 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
917 typedef struct boInfo
923 typedef struct dlRlcBOInfo
931 /* Info of Scheduling Request to Add/Modify */
932 typedef struct schSchedReqInfo
935 SchSrProhibitTimer srProhibitTmr;
936 SchSrTransMax srTransMax;
939 /* Scheduling Request Configuration */
940 typedef struct schSchedReqCfg
942 uint8_t addModListCount;
943 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
944 uint8_t relListCount;
945 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
948 /* Info of Tag to Add/Modify */
949 typedef struct schTagInfo
952 SchTimeAlignmentTimer timeAlignmentTmr;
955 /* Timing Advance Group Configuration */
956 typedef struct schTagCfg
958 uint8_t addModListCount;
959 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
960 uint8_t relListCount;
961 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
964 /* Configuration for Power headroom reporting */
965 typedef struct schPhrCfg
967 SchPhrPeriodicTimer periodicTmr;
968 SchPhrProhibitTimer prohibitTmr;
969 SchPhrTxPwrFactorChange txpowerFactorChange;
973 SchPhrModeOtherCG modeOtherCG;
976 /* MAC cell Group configuration */
977 typedef struct schMacCellGrpCfg
979 SchSchedReqCfg schedReqCfg;
981 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
984 /* Physical Cell Group Configuration */
985 typedef struct schPhyCellGrpCfg
987 SchPdschHarqAckCodebook pdschHarqAckCodebook;
991 /* Control resource set info */
992 typedef struct schControlRsrcSet
994 uint8_t cRSetId; /* Control resource set id */
995 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
997 SchREGMappingType cceRegMappingType;
998 SchPrecoderGranul precoderGranularity;
999 uint16_t dmrsScramblingId;
1002 /* Search Space info */
1003 typedef struct schSearchSpace
1005 uint8_t searchSpaceId;
1007 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
1008 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
1009 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
1010 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
1011 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
1012 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
1013 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
1014 SchSearchSpaceType searchSpaceType;
1015 uint8_t ueSpecificDciFormat;
1018 /* PDCCH cofniguration */
1019 typedef struct schPdcchConfig
1021 uint8_t numCRsetToAddMod;
1022 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
1023 uint8_t numCRsetToRel;
1024 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
1025 uint8_t numSearchSpcToAddMod;
1026 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
1027 uint8_t numSearchSpcToRel;
1028 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
1031 /* PDSCH time domain resource allocation */
1032 typedef struct schPdschTimeDomRsrcAlloc
1034 SchTimeDomRsrcAllocMappingType mappingType;
1035 uint8_t startSymbol;
1036 uint8_t symbolLength;
1037 }SchPdschTimeDomRsrcAlloc;
1040 typedef struct schPdschBundling
1042 struct schStaticBundling
1044 SchBundlingSizeSet2 size;
1046 struct schDynamicBundling
1048 SchBundlingSizeSet1 sizeSet1;
1049 SchBundlingSizeSet2 sizeSet2;
1050 }SchDynamicBundling;
1053 /* DMRS downlink configuration */
1054 typedef struct schDmrsDlCfg
1056 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1059 /* PDSCH Configuration */
1060 typedef struct schPdschConfig
1062 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
1063 SchResourceAllocType resourceAllocType;
1064 uint8_t numTimeDomRsrcAlloc;
1065 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1067 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
1068 SchBundlingType bundlingType;
1069 SchPdschBundling bundlingInfo;
1072 /* Initial Downlink BWP */
1073 typedef struct schInitalDlBwp
1076 SchPdcchConfig pdcchCfg;
1078 SchPdschConfig pdschCfg;
1081 /* BWP Downlink common */
1082 typedef struct schBwpDlCommon
1086 /* Downlink BWP information */
1087 typedef struct schDlBwpInfo
1092 /* PDCCH Serving Cell configuration */
1093 typedef struct schPdschServCellCfg
1095 uint8_t *maxMimoLayers;
1096 SchNumHarqProcForPdsch numHarqProcForPdsch;
1097 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1098 bool *codeBlkGrpFlushInd;
1099 SchPdschXOverhead *xOverhead;
1100 }SchPdschServCellCfg;
1102 /* PUCCH Configuration */
1103 typedef struct schPucchResrcSetInfo
1106 uint8_t resrcListCount;
1107 uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1108 uint8_t maxPayLoadSize;
1109 }SchPucchResrcSetInfo;
1111 typedef struct schPucchResrcSetCfg
1113 uint8_t resrcSetToAddModListCount;
1114 SchPucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1115 uint8_t resrcSetToRelListCount;
1116 uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1117 }SchPucchResrcSetCfg;
1119 typedef struct schPucchFormat0
1121 uint8_t initialCyclicShift;
1123 uint8_t startSymbolIdx;
1126 typedef struct schPucchFormat1
1128 uint8_t initialCyclicShift;
1130 uint8_t startSymbolIdx;
1134 typedef struct schPucchFormat2_3
1138 uint8_t startSymbolIdx;
1141 typedef struct schPucchFormat4
1146 uint8_t startSymbolIdx;
1149 typedef struct schPucchResrcInfo
1153 uint8_t intraFreqHop;
1154 uint16_t secondPrbHop;
1155 uint8_t pucchFormat;
1157 SchPucchFormat0 *format0;
1158 SchPucchFormat1 *format1;
1159 SchPucchFormat2_3 *format2;
1160 SchPucchFormat2_3 *format3;
1161 SchPucchFormat4 *format4;
1165 typedef struct schPucchResrcCfg
1167 uint8_t resrcToAddModListCount;
1168 SchPucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1169 uint8_t resrcToRelListCount;
1170 uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1174 typedef struct schSchedReqResrcInfo
1178 uint8_t periodicity;
1181 }SchSchedReqResrcInfo;
1183 typedef struct schPucchSchedReqCfg
1185 uint8_t schedAddModListCount;
1186 SchSchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1187 uint8_t schedRelListCount;
1188 uint8_t schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1189 }SchPucchSchedReqCfg;
1191 typedef struct schSpatialRelationInfo
1193 uint8_t spatialRelationId;
1194 uint8_t servCellIdx;
1195 uint8_t pathLossRefRSId;
1197 uint8_t closeLoopIdx;
1198 }SchSpatialRelationInfo;
1200 typedef struct schPucchSpatialCfg
1202 uint8_t spatialAddModListCount;
1203 SchSpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1204 uint8_t spatialRelListCount;
1205 uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1206 }SchPucchSpatialCfg;
1208 typedef struct schP0PucchCfg
1214 typedef struct schPathLossRefRSCfg
1216 uint8_t pathLossRefRSId;
1217 }SchPathLossRefRSCfg;
1219 typedef struct schPucchMultiCsiCfg
1221 uint8_t multiCsiResrcListCount;
1222 uint8_t multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1223 }SchPucchMultiCsiCfg;
1225 typedef struct schPucchDlDataToUlAck
1227 uint8_t dlDataToUlAckListCount;
1228 uint8_t dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1229 }SchPucchDlDataToUlAck;
1231 typedef struct schPucchPowerControl
1239 SchP0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1240 uint8_t pathLossRefRSListCount;
1241 SchPathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1242 }SchPucchPowerControl;
1244 typedef struct schPucchCfg
1246 SchPucchResrcSetCfg *resrcSet;
1247 SchPucchResrcCfg *resrc;
1248 SchPucchFormatCfg *format1;
1249 SchPucchFormatCfg *format2;
1250 SchPucchFormatCfg *format3;
1251 SchPucchFormatCfg *format4;
1252 SchPucchSchedReqCfg *schedReq;
1253 SchPucchMultiCsiCfg *multiCsiCfg;
1254 SchPucchSpatialCfg *spatialInfo;
1255 SchPucchDlDataToUlAck *dlDataToUlAck;
1256 SchPucchPowerControl *powerControl;
1259 /* Transform precoding disabled */
1260 typedef struct schTransPrecodDisabled
1262 uint16_t scramblingId0;
1263 }SchTransPrecodDisabled;
1265 /* DMRS Uplink configuration */
1266 typedef struct SchDmrsUlCfg
1268 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1269 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1272 /* PUSCH Time Domain Resource Allocation */
1273 typedef struct schPuschTimeDomRsrcAlloc
1276 SchTimeDomRsrcAllocMappingType mappingType;
1277 uint8_t startSymbol;
1278 uint8_t symbolLength;
1279 }SchPuschTimeDomRsrcAlloc;
1281 /* PUSCH Configuration */
1282 typedef struct schPuschCfg
1284 uint8_t dataScramblingId;
1285 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1286 SchResourceAllocType resourceAllocType;
1287 uint8_t numTimeDomRsrcAlloc;
1288 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1289 SchTransformPrecoder transformPrecoder;
1292 /* Initial Uplink BWP */
1293 typedef struct schInitialUlBwp
1296 SchPucchCfg pucchCfg;
1298 SchPuschCfg puschCfg;
1301 /* Uplink BWP information */
1302 typedef struct schUlBwpInfo
1307 /* Serving cell configuration */
1308 typedef struct schServCellCfgInfo
1310 SchInitalDlBwp initDlBwp;
1311 uint8_t numDlBwpToAdd;
1312 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1313 uint8_t firstActvDlBwpId;
1314 uint8_t defaultDlBwpId;
1315 uint8_t *bwpInactivityTmr;
1316 SchPdschServCellCfg pdschServCellCfg;
1317 SchInitialUlBwp initUlBwp;
1318 uint8_t numUlBwpToAdd;
1319 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1320 uint8_t firstActvUlBwpId;
1321 }SchServCellCfgInfo;
1323 typedef struct schNonDynFiveQi
1328 uint16_t maxDataBurstVol;
1331 typedef struct schDynFiveQi
1334 uint16_t packetDelayBudget;
1335 uint8_t packetErrRateScalar;
1336 uint8_t packetErrRateExp;
1338 uint8_t delayCritical;
1340 uint16_t maxDataBurstVol;
1343 typedef struct schNgRanAllocAndRetPri
1345 uint8_t priorityLevel;
1346 uint8_t preEmptionCap;
1347 uint8_t preEmptionVul;
1348 }SchNgRanAllocAndRetPri;
1350 typedef struct schGrbQosFlowInfo
1352 uint32_t maxFlowBitRateDl;
1353 uint32_t maxFlowBitRateUl;
1354 uint32_t guarFlowBitRateDl;
1355 uint32_t guarFlowBitRateUl;
1359 typedef struct schDrbQos
1361 SchQosType fiveQiType; /* Dynamic or non-dynamic */
1364 SchNonDynFiveQi nonDyn5Qi;
1365 SchDynFiveQi dyn5Qi;
1367 SchNgRanAllocAndRetPri ngRanRetPri;
1368 SchGrbQosFlowInfo grbQosFlowInfo;
1369 uint16_t pduSessionId;
1370 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1373 typedef struct schSnssai
1376 uint8_t sd[SD_SIZE];
1379 /* Special cell configuration */
1380 typedef struct schSpCellCfg
1382 uint8_t servCellIdx;
1383 SchServCellCfgInfo servCellCfg;
1386 /* Uplink logical channel configuration */
1387 typedef struct SchUlLcCfg
1392 uint8_t pbr; // prioritisedBitRate
1393 uint8_t bsd; // bucketSizeDuration
1396 /* Downlink logical channel configuration */
1397 typedef struct schDlLcCfg
1399 uint8_t lcp; // logical Channel Prioritization
1402 /* Logical Channel configuration */
1403 typedef struct schLcCfg
1405 ConfigType configType;
1407 SchDrbQosInfo *drbQos;
1413 /* Aggregate max bit rate */
1414 typedef struct schAmbrCfg
1416 uint32_t ulBr; /* Ul BitRate */
1417 uint32_t dlBr; /* Dl BitRate */
1420 typedef struct schModulationInfo
1424 SchMcsTable mcsTable;
1427 /* UE configuration */
1428 typedef struct schUeCfg
1432 SchMacCellGrpCfg macCellGrpCfg;
1433 SchPhyCellGrpCfg phyCellGrpCfg;
1434 SchSpCellCfg spCellCfg;
1435 SchAmbrCfg *ambrCfg;
1436 SchModulationInfo dlModInfo;
1437 SchModulationInfo ulModInfo;
1439 SchLcCfg schLcCfg[MAX_NUM_LC];
1442 typedef struct schUeCfgRsp
1448 SchFailureCause cause;
1451 typedef struct dataVolInfo
1457 typedef struct ulBufferStatusRptInd
1463 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1464 }UlBufferStatusRptInd;
1466 typedef struct srUciIndInfo
1470 SlotIndInfo slotInd;
1472 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1475 /* function pointers */
1477 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1478 Pst *pst, /* Post Structure */
1479 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1482 typedef uint8_t (*SchCellCfgFunc) ARGS((
1483 Pst *pst, /* Post Structure */
1484 SchCellCfg *schCellCfg /* Cell Cfg */
1487 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1488 Pst *pst, /* Post Structure */
1489 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1492 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1493 Pst *pst, /* Post Structure */
1494 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1497 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1498 Pst *pst, /* Post structure */
1499 RachIndInfo *rachInd)); /* Rach Indication Info */
1501 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1502 Pst *pst, /* Post structure */
1503 CrcIndInfo *crcInd)); /* CRC Info */
1505 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1506 Pst *pst, /* Post structure */
1507 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1509 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1510 Pst *pst, /* Post structure */
1511 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1513 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1514 Pst *pst, /* Post structure */
1515 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1517 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1518 Pst *pst, /* Post structure */
1519 SlotIndInfo *slotInd)); /* Slot Info */
1521 typedef uint8_t (*MacSchBsrFunc) ARGS((
1523 UlBufferStatusRptInd *bsrInd
1526 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1527 Pst *pst, /* Post structure */
1528 SrUciIndInfo *uciInd)); /* UCI IND Info */
1530 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1531 Pst *pst, /* Post structure */
1532 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1534 typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
1535 Pst *pst, /* Post structure */
1536 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1538 /* function declarations */
1539 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1540 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1541 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1542 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1543 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1544 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1545 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1546 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1547 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1548 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1549 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1550 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1551 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1552 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1553 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1554 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1555 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1556 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1557 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1558 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1559 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1560 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1561 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1562 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1563 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1564 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1565 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1566 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1567 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1568 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1569 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1570 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1571 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1573 /**********************************************************************
1575 **********************************************************************/