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
34 #define EVENT_UE_DELETE_REQ_TO_SCH 15
35 #define EVENT_UE_DELETE_RSP_TO_MAC 16
36 #define EVENT_CELL_DELETE_REQ_TO_SCH 17
37 #define EVENT_CELL_DELETE_RSP_TO_MAC 18
42 #define SSB_TRANSMISSION 1
44 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
45 #define SCH_SSB_MASK_SIZE 1
48 #define SIB1_TRANSMISSION 1
49 #define SIB1_REPITITION 2
51 #define MAX_NUM_PRG 1 /* max value should be later 275 */
52 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
53 #define MAX_CODEWORDS 1 /* max should be 2 */
54 #define SCH_HARQ_PROC_ID 1 /* harq proc id */
55 #define SCH_ALLOC_TYPE_1 1 /*sch res alloc type */
57 /* Datatype in UL SCH Info */
58 #define SCH_DATATYPE_PUSCH 1
59 #define SCH_DATATYPE_PUSCH_UCI 2
60 #define SCH_DATATYPE_UCI 4
61 #define SCH_DATATYPE_SRS 8
62 #define SCH_DATATYPE_PRACH 16
64 #define MAX_NUMBER_OF_CRC_IND_BITS 1
65 #define MAX_NUMBER_OF_UCI_IND_BITS 1
66 #define MAX_SR_BITS_IN_BYTES 1
67 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8
68 /* can we have a common numslot numscs between mac sch */
75 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */
76 #define MAX_NUM_TAGS 4 /* Max number of timing advance groups */
77 #define MAX_NUM_BWP 4 /* Max number of BWP per serving cell */
78 #define MAX_NUM_CRSET 3 /* Max number of control resource set in add/modify/release list */
79 #define MAX_NUM_SEARCH_SPC 10 /* Max number of search space in add/modify/release list */
80 #define FREQ_DOM_RSRC_SIZE 6 /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
81 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2 /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
82 #define MAX_NUM_DL_ALLOC 16 /* Max number of pdsch time domain downlink allocation */
83 #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */
85 /* PUCCH Configuration Macro */
86 #define MAX_NUM_PUCCH_RESRC 128
87 #define MAX_NUM_PUCCH_RESRC_SET 4
88 #define MAX_NUM_PUCCH_PER_RESRC_SET 32
89 #define MAX_NUM_SPATIAL_RELATIONS 8
90 #define MAX_NUM_PUCCH_P0_PER_SET 8
91 #define MAX_NUM_PATH_LOSS_REF_RS 4
92 #define MAX_NUM_DL_DATA_TO_UL_ACK 15
95 #define TX_PAYLOAD_HDR_LEN 32 /* Intel L1 requires adding a 32 byte header to transmitted payload */
97 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
99 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
101 toFill.sfn = (crntTime.sfn + 1); \
105 toFill.sfn = crntTime.sfn; \
107 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
108 if (toFill.sfn >= MAX_SFN) \
110 toFill.sfn%=MAX_SFN; \
118 RESOURCE_UNAVAILABLE,
155 TIME_ALIGNMENT_TIMER_MS500,
156 TIME_ALIGNMENT_TIMER_MS750,
157 TIME_ALIGNMENT_TIMER_MS1280,
158 TIME_ALIGNMENT_TIMER_MS1920,
159 TIME_ALIGNMENT_TIMER_MS2560,
160 TIME_ALIGNMENT_TIMER_MS5120,
161 TIME_ALIGNMENT_TIMER_MS10240,
162 TIME_ALIGNMENT_TIMER_INFINITE
163 }SchTimeAlignmentTimer;
167 PHR_PERIODIC_TIMER_SF10,
168 PHR_PERIODIC_TIMER_SF20,
169 PHR_PERIODIC_TIMER_SF50,
170 PHR_PERIODIC_TIMER_SF100,
171 PHR_PERIODIC_TIMER_SF200,
172 PHR_PERIODIC_TIMER_SF500,
173 PHR_PERIODIC_TIMER_SF1000,
174 PHR_PERIODIC_TIMER_INFINITE
175 }SchPhrPeriodicTimer;
179 PHR_PROHIBIT_TIMER_SF0,
180 PHR_PROHIBIT_TIMER_SF10,
181 PHR_PROHIBIT_TIMER_SF20,
182 PHR_PROHIBIT_TIMER_SF50,
183 PHR_PROHIBIT_TIMER_SF100,
184 PHR_PROHIBIT_TIMER_SF200,
185 PHR_PROHIBIT_TIMER_SF500,
186 PHR_PROHIBIT_TIMER_SF1000
187 }SchPhrProhibitTimer;
191 PHR_TX_PWR_FACTOR_CHANGE_DB1,
192 PHR_TX_PWR_FACTOR_CHANGE_DB3,
193 PHR_TX_PWR_FACTOR_CHANGE_DB6,
194 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
195 }SchPhrTxPwrFactorChange;
205 HARQ_ACK_CODEBOOK_SEMISTATIC,
206 HARQ_ACK_CODEBOOK_DYNAMIC
207 }SchPdschHarqAckCodebook;
211 NUM_HARQ_PROC_FOR_PDSCH_N2,
212 NUM_HARQ_PROC_FOR_PDSCH_N4,
213 NUM_HARQ_PROC_FOR_PDSCH_N6,
214 NUM_HARQ_PROC_FOR_PDSCH_N10,
215 NUM_HARQ_PROC_FOR_PDSCH_N16
216 }SchNumHarqProcForPdsch;
220 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
221 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
222 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
223 MAX_CODE_BLOCK_GROUP_PER_TB_N8
224 }SchMaxCodeBlkGrpPerTB;
228 PDSCH_X_OVERHEAD_XOH_6,
229 PDSCH_X_OVERHEAD_XOH_12,
230 PDSCH_X_OVERHEAD_XOH_18
235 DMRS_ADDITIONAL_POS0,
236 DMRS_ADDITIONAL_POS1,
238 }SchDmrsAdditionPosition;
242 RESOURCE_ALLOCTION_TYPE_0,
243 RESOURCE_ALLOCTION_TYPE_1,
244 RESOURCE_ALLOCTION_DYN_SWITCH
245 }SchResourceAllocType;
249 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
250 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
251 }SchTimeDomRsrcAllocMappingType;
255 ENABLED_TRANSFORM_PRECODER,
256 DISABLED_TRANSFORM_PRECODER
257 }SchTransformPrecoder;
261 INTERLEAVED_CCE_REG_MAPPING = 1,
262 NONINTERLEAVED_CCE_REG_MAPPING
267 SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
268 SLOT_PERIODICITY_AND_OFFSET_SL_2,
269 SLOT_PERIODICITY_AND_OFFSET_SL_4,
270 SLOT_PERIODICITY_AND_OFFSET_SL_5,
271 SLOT_PERIODICITY_AND_OFFSET_SL_8,
272 SLOT_PERIODICITY_AND_OFFSET_SL_10,
273 SLOT_PERIODICITY_AND_OFFSET_SL_16,
274 SLOT_PERIODICITY_AND_OFFSET_SL_20,
275 SLOT_PERIODICITY_AND_OFFSET_SL_40,
276 SLOT_PERIODICITY_AND_OFFSET_SL_80,
277 SLOT_PERIODICITY_AND_OFFSET_SL_160,
278 SLOT_PERIODICITY_AND_OFFSET_SL_320,
279 SLOT_PERIODICITY_AND_OFFSET_SL_640,
280 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
281 SLOT_PERIODICITY_AND_OFFSET_SL_2560
282 }SchMSlotPeriodAndOffset;
292 SEARCH_SPACE_TYPE_COMMON = 1,
293 SEARCH_SPACE_TYPE_UE_SPECIFIC
298 SCH_QOS_NON_DYNAMIC = 1,
304 AGGREGATION_LEVEL_N0,
305 AGGREGATION_LEVEL_N1,
306 AGGREGATION_LEVEL_N2,
307 AGGREGATION_LEVEL_N3,
308 AGGREGATION_LEVEL_N4,
309 AGGREGATION_LEVEL_N5,
310 AGGREGATION_LEVEL_N6,
322 CODE_WORDS_SCHED_BY_DCI_N1,
323 CODE_WORDS_SCHED_BY_DCI_N2
324 }SchCodeWordsSchedByDci;
328 STATIC_BUNDLING_TYPE = 1,
329 DYNAMIC_BUNDLING_TYPE
335 SCH_SET1_SIZE_WIDEBAND,
336 SCH_SET1_SIZE_N2_WIDEBAND,
337 SCH_SET1_SIZE_N4_WIDEBAND
338 }SchBundlingSizeSet1;
343 SCH_SET2_SIZE_WIDEBAND
344 }SchBundlingSizeSet2;
386 SCH_MCS_TABLE_QAM_64,
387 SCH_MCS_TABLE_QAM_256,
388 SCH_MCS_TABLE_QAM_64_LOW_SE
392 typedef struct timeDomainAlloc
398 typedef struct freqDomainAlloc
407 uint32_t ssbPbchPwr; /* SSB block power */
408 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
409 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
410 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
411 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
412 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
415 typedef struct bwpCfg
417 uint8_t subcarrierSpacing;
418 uint8_t cyclicPrefix;
419 FreqDomainAlloc freqAlloc;
425 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
428 typedef struct beamformingInfo
432 uint8_t digBfInterfaces;
433 Prg prg[MAX_NUM_PRG];
436 /* SIB1 PDSCH structures */
438 typedef struct codewordinfo
440 uint16_t targetCodeRate;
448 typedef struct dmrsInfo
450 uint16_t dlDmrsSymbPos;
451 uint8_t dmrsConfigType;
452 uint16_t dlDmrsScramblingId;
454 uint8_t numDmrsCdmGrpsNoData;
457 uint8_t nrOfDmrsSymbols;
461 typedef struct pdschFreqAlloc
463 uint8_t resourceAllocType;
464 /* since we are using type-1, rbBitmap excluded */
465 FreqDomainAlloc freqAlloc;
466 uint8_t vrbPrbMapping;
469 typedef struct pdschTimeAlloc
472 TimeDomainAlloc timeAlloc;
475 typedef struct txPowerPdschInfo
477 uint8_t powerControlOffset;
478 uint8_t powerControlOffsetSS;
481 typedef struct pdschCfg
486 uint8_t numCodewords;
487 CodewordInfo codeword[MAX_CODEWORDS];
488 uint16_t dataScramblingId;
490 uint8_t transmissionScheme;
493 PdschFreqAlloc pdschFreqAlloc;
494 PdschTimeAlloc pdschTimeAlloc;
495 BeamformingInfo beamPdschInfo;
496 TxPowerPdschInfo txPdschPower;
498 /* SIB1 PDSCH structures end */
500 /* SIB1 interface structure */
502 typedef struct coresetCfg
505 uint8_t startSymbolIndex;
506 uint8_t durationSymbols;
507 uint8_t freqDomainResource[6];
508 uint8_t cceRegMappingType;
509 uint8_t regBundleSize;
510 uint8_t interleaverSize;
513 uint8_t precoderGranularity;
515 uint8_t aggregationLevel;
518 typedef struct txPowerPdcchInfo
521 uint8_t powerControlOffsetSS;
527 uint16_t scramblingId;
528 uint16_t scramblingRnti;
531 BeamformingInfo beamPdcchInfo;
532 TxPowerPdcchInfo txPdcchPower;
536 typedef struct pdcchCfg
538 /* coreset-0 configuration */
539 CoresetCfg coresetCfg;
542 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
544 /* end of SIB1 PDCCH structures */
548 /* parameters recieved from DU-APP */
550 uint16_t sib1RepetitionPeriod;
551 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
552 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
555 /* parameters derived in scheduler */
558 PdcchCfg sib1PdcchCfg;
559 PdschCfg sib1PdschCfg;
562 typedef struct schRachCfg
564 uint8_t prachCfgIdx; /* PRACH config idx */
565 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
566 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
567 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
568 uint8_t rootSeqLen; /* root sequence length */
569 uint16_t rootSeqIdx; /* Root sequence index */
570 uint8_t numRootSeq; /* Number of root sequences required for FD */
571 uint16_t k1; /* Frequency Offset for each FD */
572 uint8_t ssbPerRach; /* SSB per RACH occassion */
573 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
574 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
575 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
576 uint8_t raRspWindow; /* RA Response Window */
579 typedef struct schBwpParams
581 FreqDomainAlloc freqAlloc;
583 uint8_t cyclicPrefix;
586 typedef struct schCandidatesInfo
595 typedef struct schSearchSpaceCfg
597 uint8_t searchSpaceId;
599 uint16_t monitoringSlot;
601 uint16_t monitoringSymbol;
602 SchCandidatesInfo candidate;
605 typedef struct schPdcchCfgCmn
607 SchSearchSpaceCfg commonSearchSpace;
608 uint8_t raSearchSpaceId;
611 typedef struct schPdschCfgCmn
616 uint8_t lengthSymbol;
619 typedef struct schPucchCfgCmn
621 uint8_t pucchResourceCommon;
622 uint8_t pucchGroupHopping;
625 typedef struct schPuschCfgCmn
630 uint8_t lengthSymbol;
633 typedef struct schBwpDlCfg
636 SchPdcchCfgCmn pdcchCommon;
637 SchPdschCfgCmn pdschCommon;
640 typedef struct schBwpUlCfg
643 SchPucchCfgCmn pucchCommon;
644 SchPuschCfgCmn puschCommon;
647 typedef struct schCellCfg
649 uint16_t cellId; /* Cell Id */
650 uint16_t phyCellId; /* Physical cell id */
651 uint8_t numerology; /* Supported numerology */
652 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
653 uint8_t bandwidth; /* Supported B/W */
654 uint32_t dlFreq; /* DL Frequency */
655 uint32_t ulFreq; /* UL Frequency */
656 SchSsbCfg ssbSchCfg; /* SSB config */
657 SchSib1Cfg sib1SchCfg; /* SIB1 config */
658 SchRachCfg schRachCfg; /* PRACH config */
659 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
660 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
662 TDDCfg tddCfg; /* TDD Cfg */
666 typedef struct schCellCfgCfm
668 uint16_t cellId; /* Cell Id */
672 typedef struct ssbInfo
674 uint8_t ssbIdx; /* SSB Index */
675 TimeDomainAlloc tdAlloc; /* Time domain allocation */
676 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
679 typedef struct sib1AllocInfo
682 PdcchCfg sib1PdcchCfg;
683 PdschCfg sib1PdschCfg;
686 typedef struct prachSchInfo
688 uint8_t numPrachOcas; /* Num Prach Ocassions */
689 uint8_t prachFormat; /* PRACH Format */
690 uint8_t numRa; /* Freq domain ocassion */
691 uint8_t prachStartSymb; /* Freq domain ocassion */
694 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
695 typedef struct dlBrdcstAlloc
697 /* Ssb transmission is determined as follows:
698 * 0 : No tranamission
699 * 1 : SSB Transmission
700 * 2 : SSB Repetition */
702 uint8_t ssbIdxSupported;
703 SsbInfo ssbInfo[MAX_SSB_IDX];
704 /* Sib1 transmission is determined as follows:
705 * 0 : No tranamission
706 * 1 : SIB1 Transmission
707 * 2 : SIB1 Repetition */
709 Sib1AllocInfo sib1Alloc;
712 typedef struct rarInfo
717 FreqDomainAlloc msg3FreqAlloc;
723 typedef struct rarAlloc
727 PdcchCfg rarPdcchCfg;
728 PdschCfg rarPdschCfg;
731 typedef struct dlMsgInfo
739 uint8_t harqFeedbackInd;
742 uint16_t dlMsgPduLen;
746 typedef struct lcSchInfo
749 uint32_t schBytes; /* Number of scheduled bytes */
752 typedef struct dlMsgAlloc
756 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
758 PdcchCfg dlMsgPdcchCfg;
759 PdschCfg dlMsgPdschCfg;
763 typedef struct schSlotValue
765 SlotIndInfo currentTime;
766 SlotIndInfo broadcastTime;
768 SlotIndInfo dlMsgTime;
769 SlotIndInfo ulDciTime;
772 typedef struct format0_0
774 uint8_t resourceAllocType;
775 /* since we are using type-1, hence rbBitmap excluded */
776 FreqDomainAlloc freqAlloc;
777 TimeDomainAlloc timeAlloc;
780 uint8_t harqProcId; /* HARQ Process ID */
783 uint8_t ndi; /* NDI */
784 uint8_t rv; /* Redundancy Version */
789 typedef struct format0_1
795 typedef struct format1_0
801 typedef struct format1_1
806 typedef struct dciInfo
809 uint16_t crnti; /* CRNI */
810 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
811 BwpCfg bwpCfg; /* BWP Cfg */
812 CoresetCfg coresetCfg; /* Coreset1 Cfg */
813 FormatType formatType; /* DCI Format */
816 Format0_0 format0_0; /* Format 0_0 */
817 Format0_1 format0_1; /* Format 0_1 */
818 Format1_0 format1_0; /* Format 1_0 */
819 Format1_1 format1_1; /* Format 1_1 */
825 typedef struct dlSchedInfo
827 uint16_t cellId; /* Cell Id */
828 SchSlotValue schSlotValue;
830 /* Allocation for broadcast messages */
831 bool isBroadcastPres;
832 DlBrdcstAlloc brdcstAlloc;
834 /* Allocation for RAR message */
838 /* Allocation from MSG4 */
839 //Msg4Alloc *msg4Alloc;
841 /* UL grant in response to BSR */
844 /* Allocation from dedicated DL msg */
845 DlMsgAlloc *dlMsgAlloc;
849 typedef struct tbInfo
851 uint8_t qamOrder; /* Modulation Order */
852 uint8_t mcs; /* MCS */
853 SchMcsTable mcsTable; /* MCS Table */
854 uint8_t ndi; /* NDI */
855 uint8_t rv; /* Redundancy Version */
856 uint16_t tbSize; /* TB Size */
859 typedef struct schPuschInfo
862 uint8_t harqProcId; /* HARQ Process ID */
863 uint8_t resAllocType; /* Resource allocation type */
864 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
865 TimeDomainAlloc tdAlloc; /* Time domain allocation */
866 TbInfo tbInfo; /* TB info */
867 uint8_t dmrsMappingType;
868 uint8_t nrOfDmrsSymbols;
872 typedef struct schPucchFormatCfg
874 uint8_t interSlotFreqHop;
882 typedef struct schPucchInfo
886 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
887 TimeDomainAlloc tdAlloc; /* Time domain allocation */
893 uint8_t intraFreqHop;
894 uint16_t secondPrbHop;
895 uint8_t initialCyclicShift;
899 SchPucchFormatCfg cmnFormatCfg;
902 typedef struct ulSchedInfo
904 uint16_t cellId; /* Cell Id */
905 uint16_t crnti; /* CRNI */
906 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
907 uint8_t dataType; /* Type of info being scheduled */
908 PrachSchInfo prachSchInfo; /* Prach scheduling info */
909 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
910 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
913 typedef struct rachIndInfo
917 SlotIndInfo timingInfo;
926 typedef struct crcIndInfo
930 SlotIndInfo timingInfo;
932 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
935 typedef struct boInfo
941 typedef struct dlRlcBOInfo
949 /* Info of Scheduling Request to Add/Modify */
950 typedef struct schSchedReqInfo
953 SchSrProhibitTimer srProhibitTmr;
954 SchSrTransMax srTransMax;
957 /* Scheduling Request Configuration */
958 typedef struct schSchedReqCfg
960 uint8_t addModListCount;
961 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
962 uint8_t relListCount;
963 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
966 /* Info of Tag to Add/Modify */
967 typedef struct schTagInfo
970 SchTimeAlignmentTimer timeAlignmentTmr;
973 /* Timing Advance Group Configuration */
974 typedef struct schTagCfg
976 uint8_t addModListCount;
977 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
978 uint8_t relListCount;
979 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
982 /* Configuration for Power headroom reporting */
983 typedef struct schPhrCfg
985 SchPhrPeriodicTimer periodicTmr;
986 SchPhrProhibitTimer prohibitTmr;
987 SchPhrTxPwrFactorChange txpowerFactorChange;
991 SchPhrModeOtherCG modeOtherCG;
994 /* MAC cell Group configuration */
995 typedef struct schMacCellGrpCfg
997 SchSchedReqCfg schedReqCfg;
999 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
1002 /* Physical Cell Group Configuration */
1003 typedef struct schPhyCellGrpCfg
1005 SchPdschHarqAckCodebook pdschHarqAckCodebook;
1009 /* Control resource set info */
1010 typedef struct schControlRsrcSet
1012 uint8_t cRSetId; /* Control resource set id */
1013 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
1015 SchREGMappingType cceRegMappingType;
1016 SchPrecoderGranul precoderGranularity;
1017 uint16_t dmrsScramblingId;
1020 /* Search Space info */
1021 typedef struct schSearchSpace
1023 uint8_t searchSpaceId;
1025 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
1026 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
1027 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
1028 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
1029 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
1030 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
1031 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
1032 SchSearchSpaceType searchSpaceType;
1033 uint8_t ueSpecificDciFormat;
1036 /* PDCCH cofniguration */
1037 typedef struct schPdcchConfig
1039 uint8_t numCRsetToAddMod;
1040 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
1041 uint8_t numCRsetToRel;
1042 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
1043 uint8_t numSearchSpcToAddMod;
1044 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
1045 uint8_t numSearchSpcToRel;
1046 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
1049 /* PDSCH time domain resource allocation */
1050 typedef struct schPdschTimeDomRsrcAlloc
1052 SchTimeDomRsrcAllocMappingType mappingType;
1053 uint8_t startSymbol;
1054 uint8_t symbolLength;
1055 }SchPdschTimeDomRsrcAlloc;
1058 typedef struct schPdschBundling
1060 struct schStaticBundling
1062 SchBundlingSizeSet2 size;
1064 struct schDynamicBundling
1066 SchBundlingSizeSet1 sizeSet1;
1067 SchBundlingSizeSet2 sizeSet2;
1068 }SchDynamicBundling;
1071 /* DMRS downlink configuration */
1072 typedef struct schDmrsDlCfg
1074 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1077 /* PDSCH Configuration */
1078 typedef struct schPdschConfig
1080 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
1081 SchResourceAllocType resourceAllocType;
1082 uint8_t numTimeDomRsrcAlloc;
1083 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1085 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
1086 SchBundlingType bundlingType;
1087 SchPdschBundling bundlingInfo;
1090 /* Initial Downlink BWP */
1091 typedef struct schInitalDlBwp
1094 SchPdcchConfig pdcchCfg;
1096 SchPdschConfig pdschCfg;
1099 /* BWP Downlink common */
1100 typedef struct schBwpDlCommon
1104 /* Downlink BWP information */
1105 typedef struct schDlBwpInfo
1110 /* PDCCH Serving Cell configuration */
1111 typedef struct schPdschServCellCfg
1113 uint8_t *maxMimoLayers;
1114 SchNumHarqProcForPdsch numHarqProcForPdsch;
1115 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1116 bool *codeBlkGrpFlushInd;
1117 SchPdschXOverhead *xOverhead;
1118 }SchPdschServCellCfg;
1120 /* PUCCH Configuration */
1121 typedef struct schPucchResrcSetInfo
1124 uint8_t resrcListCount;
1125 uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1126 uint8_t maxPayLoadSize;
1127 }SchPucchResrcSetInfo;
1129 typedef struct schPucchResrcSetCfg
1131 uint8_t resrcSetToAddModListCount;
1132 SchPucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1133 uint8_t resrcSetToRelListCount;
1134 uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1135 }SchPucchResrcSetCfg;
1137 typedef struct schPucchFormat0
1139 uint8_t initialCyclicShift;
1141 uint8_t startSymbolIdx;
1144 typedef struct schPucchFormat1
1146 uint8_t initialCyclicShift;
1148 uint8_t startSymbolIdx;
1152 typedef struct schPucchFormat2_3
1156 uint8_t startSymbolIdx;
1159 typedef struct schPucchFormat4
1164 uint8_t startSymbolIdx;
1167 typedef struct schPucchResrcInfo
1171 uint8_t intraFreqHop;
1172 uint16_t secondPrbHop;
1173 uint8_t pucchFormat;
1175 SchPucchFormat0 *format0;
1176 SchPucchFormat1 *format1;
1177 SchPucchFormat2_3 *format2;
1178 SchPucchFormat2_3 *format3;
1179 SchPucchFormat4 *format4;
1183 typedef struct schPucchResrcCfg
1185 uint8_t resrcToAddModListCount;
1186 SchPucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1187 uint8_t resrcToRelListCount;
1188 uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1192 typedef struct schSchedReqResrcInfo
1196 uint8_t periodicity;
1199 }SchSchedReqResrcInfo;
1201 typedef struct schPucchSchedReqCfg
1203 uint8_t schedAddModListCount;
1204 SchSchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1205 uint8_t schedRelListCount;
1206 uint8_t schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1207 }SchPucchSchedReqCfg;
1209 typedef struct schSpatialRelationInfo
1211 uint8_t spatialRelationId;
1212 uint8_t servCellIdx;
1213 uint8_t pathLossRefRSId;
1215 uint8_t closeLoopIdx;
1216 }SchSpatialRelationInfo;
1218 typedef struct schPucchSpatialCfg
1220 uint8_t spatialAddModListCount;
1221 SchSpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1222 uint8_t spatialRelListCount;
1223 uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1224 }SchPucchSpatialCfg;
1226 typedef struct schP0PucchCfg
1232 typedef struct schPathLossRefRSCfg
1234 uint8_t pathLossRefRSId;
1235 }SchPathLossRefRSCfg;
1237 typedef struct schPucchMultiCsiCfg
1239 uint8_t multiCsiResrcListCount;
1240 uint8_t multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1241 }SchPucchMultiCsiCfg;
1243 typedef struct schPucchDlDataToUlAck
1245 uint8_t dlDataToUlAckListCount;
1246 uint8_t dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1247 }SchPucchDlDataToUlAck;
1249 typedef struct schPucchPowerControl
1257 SchP0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1258 uint8_t pathLossRefRSListCount;
1259 SchPathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1260 }SchPucchPowerControl;
1262 typedef struct schPucchCfg
1264 SchPucchResrcSetCfg *resrcSet;
1265 SchPucchResrcCfg *resrc;
1266 SchPucchFormatCfg *format1;
1267 SchPucchFormatCfg *format2;
1268 SchPucchFormatCfg *format3;
1269 SchPucchFormatCfg *format4;
1270 SchPucchSchedReqCfg *schedReq;
1271 SchPucchMultiCsiCfg *multiCsiCfg;
1272 SchPucchSpatialCfg *spatialInfo;
1273 SchPucchDlDataToUlAck *dlDataToUlAck;
1274 SchPucchPowerControl *powerControl;
1277 /* Transform precoding disabled */
1278 typedef struct schTransPrecodDisabled
1280 uint16_t scramblingId0;
1281 }SchTransPrecodDisabled;
1283 /* DMRS Uplink configuration */
1284 typedef struct SchDmrsUlCfg
1286 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1287 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1290 /* PUSCH Time Domain Resource Allocation */
1291 typedef struct schPuschTimeDomRsrcAlloc
1294 SchTimeDomRsrcAllocMappingType mappingType;
1295 uint8_t startSymbol;
1296 uint8_t symbolLength;
1297 }SchPuschTimeDomRsrcAlloc;
1299 /* PUSCH Configuration */
1300 typedef struct schPuschCfg
1302 uint8_t dataScramblingId;
1303 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1304 SchResourceAllocType resourceAllocType;
1305 uint8_t numTimeDomRsrcAlloc;
1306 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1307 SchTransformPrecoder transformPrecoder;
1310 /* Initial Uplink BWP */
1311 typedef struct schInitialUlBwp
1314 SchPucchCfg pucchCfg;
1316 SchPuschCfg puschCfg;
1319 /* Uplink BWP information */
1320 typedef struct schUlBwpInfo
1325 /* Serving cell configuration */
1326 typedef struct schServCellCfgInfo
1328 SchInitalDlBwp initDlBwp;
1329 uint8_t numDlBwpToAdd;
1330 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1331 uint8_t firstActvDlBwpId;
1332 uint8_t defaultDlBwpId;
1333 uint8_t *bwpInactivityTmr;
1334 SchPdschServCellCfg pdschServCellCfg;
1335 SchInitialUlBwp initUlBwp;
1336 uint8_t numUlBwpToAdd;
1337 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1338 uint8_t firstActvUlBwpId;
1339 }SchServCellCfgInfo;
1341 typedef struct schNonDynFiveQi
1346 uint16_t maxDataBurstVol;
1349 typedef struct schDynFiveQi
1352 uint16_t packetDelayBudget;
1353 uint8_t packetErrRateScalar;
1354 uint8_t packetErrRateExp;
1356 uint8_t delayCritical;
1358 uint16_t maxDataBurstVol;
1361 typedef struct schNgRanAllocAndRetPri
1363 uint8_t priorityLevel;
1364 uint8_t preEmptionCap;
1365 uint8_t preEmptionVul;
1366 }SchNgRanAllocAndRetPri;
1368 typedef struct schGrbQosFlowInfo
1370 uint32_t maxFlowBitRateDl;
1371 uint32_t maxFlowBitRateUl;
1372 uint32_t guarFlowBitRateDl;
1373 uint32_t guarFlowBitRateUl;
1377 typedef struct schDrbQos
1379 SchQosType fiveQiType; /* Dynamic or non-dynamic */
1382 SchNonDynFiveQi nonDyn5Qi;
1383 SchDynFiveQi dyn5Qi;
1385 SchNgRanAllocAndRetPri ngRanRetPri;
1386 SchGrbQosFlowInfo grbQosFlowInfo;
1387 uint16_t pduSessionId;
1388 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1391 typedef struct schSnssai
1394 uint8_t sd[SD_SIZE];
1397 /* Special cell configuration */
1398 typedef struct schSpCellCfg
1400 uint8_t servCellIdx;
1401 SchServCellCfgInfo servCellCfg;
1404 /* Uplink logical channel configuration */
1405 typedef struct SchUlLcCfg
1410 uint8_t pbr; // prioritisedBitRate
1411 uint8_t bsd; // bucketSizeDuration
1414 /* Downlink logical channel configuration */
1415 typedef struct schDlLcCfg
1417 uint8_t lcp; // logical Channel Prioritization
1420 /* Logical Channel configuration */
1421 typedef struct schLcCfg
1423 ConfigType configType;
1425 SchDrbQosInfo *drbQos;
1431 /* Aggregate max bit rate */
1432 typedef struct schAmbrCfg
1434 uint32_t ulBr; /* Ul BitRate */
1437 typedef struct schModulationInfo
1441 SchMcsTable mcsTable;
1444 /* UE configuration */
1445 typedef struct schUeCfg
1449 bool macCellGrpCfgPres;
1450 SchMacCellGrpCfg macCellGrpCfg;
1451 bool phyCellGrpCfgPres;
1452 SchPhyCellGrpCfg phyCellGrpCfg;
1454 SchSpCellCfg spCellCfg;
1455 SchAmbrCfg *ambrCfg;
1456 SchModulationInfo dlModInfo;
1457 SchModulationInfo ulModInfo;
1459 SchLcCfg schLcCfg[MAX_NUM_LC];
1462 typedef struct schUeCfgRsp
1468 SchFailureCause cause;
1471 typedef struct schUeDelete
1477 typedef struct schUeDeleteRsp
1485 typedef struct schCellDelete
1491 typedef struct schCellDeleteRsp
1497 typedef struct dataVolInfo
1503 typedef struct ulBufferStatusRptInd
1509 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1510 }UlBufferStatusRptInd;
1512 typedef struct srUciIndInfo
1516 SlotIndInfo slotInd;
1518 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1521 /* function pointers */
1523 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1524 Pst *pst, /* Post Structure */
1525 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1528 typedef uint8_t (*SchCellCfgFunc) ARGS((
1529 Pst *pst, /* Post Structure */
1530 SchCellCfg *schCellCfg /* Cell Cfg */
1533 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1534 Pst *pst, /* Post Structure */
1535 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1538 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1539 Pst *pst, /* Post Structure */
1540 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1543 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1544 Pst *pst, /* Post structure */
1545 RachIndInfo *rachInd)); /* Rach Indication Info */
1547 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1548 Pst *pst, /* Post structure */
1549 CrcIndInfo *crcInd)); /* CRC Info */
1551 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1552 Pst *pst, /* Post structure */
1553 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1555 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1556 Pst *pst, /* Post structure */
1557 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1559 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1560 Pst *pst, /* Post structure */
1561 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1563 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1564 Pst *pst, /* Post structure */
1565 SlotIndInfo *slotInd)); /* Slot Info */
1567 typedef uint8_t (*MacSchBsrFunc) ARGS((
1569 UlBufferStatusRptInd *bsrInd
1572 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1573 Pst *pst, /* Post structure */
1574 SrUciIndInfo *uciInd)); /* UCI IND Info */
1576 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1577 Pst *pst, /* Post structure */
1578 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1580 typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
1581 Pst *pst, /* Post structure */
1582 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1584 typedef uint8_t (*MacSchUeDeleteReqFunc) ARGS((
1585 Pst *pst, /* Post structure */
1586 SchUeDelete *schUeDel)); /*Scheduler UE Del*/
1588 typedef uint8_t (*SchUeDeleteRspFunc) ARGS((
1589 Pst *pst, /* Post structure */
1590 SchUeDeleteRsp *delRsp)); /* Scheduler UE delete response */
1592 typedef uint8_t (*MacSchCellDeleteReqFunc) ARGS((
1593 Pst *pst, /* Post structure */
1594 SchCellDelete *schCellDelete)); /*Scheduler UE Del*/
1596 typedef uint8_t (*SchCellDeleteRspFunc) ARGS((
1597 Pst *pst, /* Post structure */
1598 SchCellDeleteRsp *schCellDeleteRsp)); /* Scheduler UE delete response */
1600 /* function declarations */
1601 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1602 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1603 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1604 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1605 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1606 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1607 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1608 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1609 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1610 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1611 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1612 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1613 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1614 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1615 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1616 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1617 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1618 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1619 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1620 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1621 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1622 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1623 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1624 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1625 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1626 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1627 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1628 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1629 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1630 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1631 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1632 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1633 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1634 uint8_t packMacSchUeDeleteReq(Pst *pst, SchUeDelete *schUeDel);
1635 uint8_t MacSchUeDeleteReq(Pst *pst, SchUeDelete *ueDelete);
1636 uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *delRsp);
1637 uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp);
1638 uint8_t packMacSchCellDeleteReq(Pst *pst, SchCellDelete *schCellDelete);
1639 uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDelete *schCellDelete);
1640 uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
1641 uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
1643 /**********************************************************************
1645 **********************************************************************/