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
39 #define SSB_TRANSMISSION 1
41 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
42 #define SCH_SSB_MASK_SIZE 1
45 #define SIB1_TRANSMISSION 1
46 #define SIB1_REPITITION 2
48 #define MAX_NUM_PRG 1 /* max value should be later 275 */
49 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
50 #define MAX_CODEWORDS 1 /* max should be 2 */
51 #define SCH_HARQ_PROC_ID 1 /* harq proc id */
52 #define SCH_ALLOC_TYPE_1 1 /*sch res alloc type */
54 /* Datatype in UL SCH Info */
55 #define SCH_DATATYPE_PUSCH 1
56 #define SCH_DATATYPE_PUSCH_UCI 2
57 #define SCH_DATATYPE_UCI 4
58 #define SCH_DATATYPE_SRS 8
59 #define SCH_DATATYPE_PRACH 16
61 #define MAX_NUMBER_OF_CRC_IND_BITS 1
62 #define MAX_NUMBER_OF_UCI_IND_BITS 1
63 #define MAX_SR_BITS_IN_BYTES 1
64 #define MAX_NUM_LOGICAL_CHANNEL_GROUPS 8
65 /* can we have a common numslot numscs between mac sch */
72 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */
73 #define MAX_NUM_TAGS 4 /* Max number of timing advance groups */
74 #define MAX_NUM_BWP 4 /* Max number of BWP per serving cell */
75 #define MAX_NUM_CRSET 3 /* Max number of control resource set in add/modify/release list */
76 #define MAX_NUM_SEARCH_SPC 10 /* Max number of search space in add/modify/release list */
77 #define FREQ_DOM_RSRC_SIZE 6 /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
78 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2 /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
79 #define MAX_NUM_DL_ALLOC 16 /* Max number of pdsch time domain downlink allocation */
80 #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */
82 /* PUCCH Configuration Macro */
83 #define MAX_NUM_PUCCH_RESRC 128
84 #define MAX_NUM_PUCCH_RESRC_SET 4
85 #define MAX_NUM_PUCCH_PER_RESRC_SET 32
86 #define MAX_NUM_SPATIAL_RELATIONS 8
87 #define MAX_NUM_PUCCH_P0_PER_SET 8
88 #define MAX_NUM_PATH_LOSS_REF_RS 4
89 #define MAX_NUM_DL_DATA_TO_UL_ACK 15
92 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
94 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
96 toFill.sfn = (crntTime.sfn + 1); \
100 toFill.sfn = crntTime.sfn; \
102 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
103 if (toFill.sfn >= MAX_SFN) \
105 toFill.sfn%=MAX_SFN; \
113 RESOURCE_UNAVAILABLE,
150 TIME_ALIGNMENT_TIMER_MS500,
151 TIME_ALIGNMENT_TIMER_MS750,
152 TIME_ALIGNMENT_TIMER_MS1280,
153 TIME_ALIGNMENT_TIMER_MS1920,
154 TIME_ALIGNMENT_TIMER_MS2560,
155 TIME_ALIGNMENT_TIMER_MS5120,
156 TIME_ALIGNMENT_TIMER_MS10240,
157 TIME_ALIGNMENT_TIMER_INFINITE
158 }SchTimeAlignmentTimer;
162 PHR_PERIODIC_TIMER_SF10,
163 PHR_PERIODIC_TIMER_SF20,
164 PHR_PERIODIC_TIMER_SF50,
165 PHR_PERIODIC_TIMER_SF100,
166 PHR_PERIODIC_TIMER_SF200,
167 PHR_PERIODIC_TIMER_SF500,
168 PHR_PERIODIC_TIMER_SF1000,
169 PHR_PERIODIC_TIMER_INFINITE
170 }SchPhrPeriodicTimer;
174 PHR_PROHIBIT_TIMER_SF0,
175 PHR_PROHIBIT_TIMER_SF10,
176 PHR_PROHIBIT_TIMER_SF20,
177 PHR_PROHIBIT_TIMER_SF50,
178 PHR_PROHIBIT_TIMER_SF100,
179 PHR_PROHIBIT_TIMER_SF200,
180 PHR_PROHIBIT_TIMER_SF500,
181 PHR_PROHIBIT_TIMER_SF1000
182 }SchPhrProhibitTimer;
186 PHR_TX_PWR_FACTOR_CHANGE_DB1,
187 PHR_TX_PWR_FACTOR_CHANGE_DB3,
188 PHR_TX_PWR_FACTOR_CHANGE_DB6,
189 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
190 }SchPhrTxPwrFactorChange;
200 HARQ_ACK_CODEBOOK_SEMISTATIC,
201 HARQ_ACK_CODEBOOK_DYNAMIC
202 }SchPdschHarqAckCodebook;
206 NUM_HARQ_PROC_FOR_PDSCH_N2,
207 NUM_HARQ_PROC_FOR_PDSCH_N4,
208 NUM_HARQ_PROC_FOR_PDSCH_N6,
209 NUM_HARQ_PROC_FOR_PDSCH_N10,
210 NUM_HARQ_PROC_FOR_PDSCH_N16
211 }SchNumHarqProcForPdsch;
215 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
216 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
217 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
218 MAX_CODE_BLOCK_GROUP_PER_TB_N8
219 }SchMaxCodeBlkGrpPerTB;
223 PDSCH_X_OVERHEAD_XOH_6,
224 PDSCH_X_OVERHEAD_XOH_12,
225 PDSCH_X_OVERHEAD_XOH_18
230 DMRS_ADDITIONAL_POS0,
231 DMRS_ADDITIONAL_POS1,
233 }SchDmrsAdditionPosition;
237 RESOURCE_ALLOCTION_TYPE_0,
238 RESOURCE_ALLOCTION_TYPE_1,
239 RESOURCE_ALLOCTION_DYN_SWITCH
240 }SchResourceAllocType;
244 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
245 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
246 }SchTimeDomRsrcAllocMappingType;
250 ENABLED_TRANSFORM_PRECODER,
251 DISABLED_TRANSFORM_PRECODER
252 }SchTransformPrecoder;
256 INTERLEAVED_CCE_REG_MAPPING = 1,
257 NONINTERLEAVED_CCE_REG_MAPPING
262 SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
263 SLOT_PERIODICITY_AND_OFFSET_SL_2,
264 SLOT_PERIODICITY_AND_OFFSET_SL_4,
265 SLOT_PERIODICITY_AND_OFFSET_SL_5,
266 SLOT_PERIODICITY_AND_OFFSET_SL_8,
267 SLOT_PERIODICITY_AND_OFFSET_SL_10,
268 SLOT_PERIODICITY_AND_OFFSET_SL_16,
269 SLOT_PERIODICITY_AND_OFFSET_SL_20,
270 SLOT_PERIODICITY_AND_OFFSET_SL_40,
271 SLOT_PERIODICITY_AND_OFFSET_SL_80,
272 SLOT_PERIODICITY_AND_OFFSET_SL_160,
273 SLOT_PERIODICITY_AND_OFFSET_SL_320,
274 SLOT_PERIODICITY_AND_OFFSET_SL_640,
275 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
276 SLOT_PERIODICITY_AND_OFFSET_SL_2560
277 }SchMSlotPeriodAndOffset;
287 SEARCH_SPACE_TYPE_COMMON = 1,
288 SEARCH_SPACE_TYPE_UE_SPECIFIC
293 SCH_QOS_NON_DYNAMIC = 1,
299 AGGREGATION_LEVEL_N0,
300 AGGREGATION_LEVEL_N1,
301 AGGREGATION_LEVEL_N2,
302 AGGREGATION_LEVEL_N3,
303 AGGREGATION_LEVEL_N4,
304 AGGREGATION_LEVEL_N5,
305 AGGREGATION_LEVEL_N6,
317 CODE_WORDS_SCHED_BY_DCI_N1,
318 CODE_WORDS_SCHED_BY_DCI_N2
319 }SchCodeWordsSchedByDci;
323 STATIC_BUNDLING_TYPE = 1,
324 DYNAMIC_BUNDLING_TYPE
330 SCH_SET1_SIZE_WIDEBAND,
331 SCH_SET1_SIZE_N2_WIDEBAND,
332 SCH_SET1_SIZE_N4_WIDEBAND
333 }SchBundlingSizeSet1;
338 SCH_SET2_SIZE_WIDEBAND
339 }SchBundlingSizeSet2;
381 SCH_MCS_TABLE_QAM_64,
382 SCH_MCS_TABLE_QAM_256,
383 SCH_MCS_TABLE_QAM_64_LOW_SE
387 typedef struct timeDomainAlloc
393 typedef struct freqDomainAlloc
402 uint32_t ssbPbchPwr; /* SSB block power */
403 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
404 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
405 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
406 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
407 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
410 typedef struct bwpCfg
412 uint8_t subcarrierSpacing;
413 uint8_t cyclicPrefix;
414 FreqDomainAlloc freqAlloc;
420 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
423 typedef struct beamformingInfo
427 uint8_t digBfInterfaces;
428 Prg prg[MAX_NUM_PRG];
431 /* SIB1 PDSCH structures */
433 typedef struct codewordinfo
435 uint16_t targetCodeRate;
443 typedef struct dmrsInfo
445 uint16_t dlDmrsSymbPos;
446 uint8_t dmrsConfigType;
447 uint16_t dlDmrsScramblingId;
449 uint8_t numDmrsCdmGrpsNoData;
452 uint8_t nrOfDmrsSymbols;
456 typedef struct pdschFreqAlloc
458 uint8_t resourceAllocType;
459 /* since we are using type-1, rbBitmap excluded */
460 FreqDomainAlloc freqAlloc;
461 uint8_t vrbPrbMapping;
464 typedef struct pdschTimeAlloc
467 TimeDomainAlloc timeAlloc;
470 typedef struct txPowerPdschInfo
472 uint8_t powerControlOffset;
473 uint8_t powerControlOffsetSS;
476 typedef struct pdschCfg
481 uint8_t numCodewords;
482 CodewordInfo codeword[MAX_CODEWORDS];
483 uint16_t dataScramblingId;
485 uint8_t transmissionScheme;
488 PdschFreqAlloc pdschFreqAlloc;
489 PdschTimeAlloc pdschTimeAlloc;
490 BeamformingInfo beamPdschInfo;
491 TxPowerPdschInfo txPdschPower;
493 /* SIB1 PDSCH structures end */
495 /* SIB1 interface structure */
497 typedef struct coresetCfg
500 uint8_t startSymbolIndex;
501 uint8_t durationSymbols;
502 uint8_t freqDomainResource[6];
503 uint8_t cceRegMappingType;
504 uint8_t regBundleSize;
505 uint8_t interleaverSize;
508 uint8_t precoderGranularity;
510 uint8_t aggregationLevel;
513 typedef struct txPowerPdcchInfo
516 uint8_t powerControlOffsetSS;
522 uint16_t scramblingId;
523 uint16_t scramblingRnti;
526 BeamformingInfo beamPdcchInfo;
527 TxPowerPdcchInfo txPdcchPower;
531 typedef struct pdcchCfg
533 /* coreset-0 configuration */
534 CoresetCfg coresetCfg;
537 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
539 /* end of SIB1 PDCCH structures */
543 /* parameters recieved from DU-APP */
545 uint16_t sib1RepetitionPeriod;
546 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
547 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
550 /* parameters derived in scheduler */
553 PdcchCfg sib1PdcchCfg;
554 PdschCfg sib1PdschCfg;
557 typedef struct schRachCfg
559 uint8_t prachCfgIdx; /* PRACH config idx */
560 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
561 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
562 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
563 uint8_t rootSeqLen; /* root sequence length */
564 uint16_t rootSeqIdx; /* Root sequence index */
565 uint8_t numRootSeq; /* Number of root sequences required for FD */
566 uint16_t k1; /* Frequency Offset for each FD */
567 uint8_t ssbPerRach; /* SSB per RACH occassion */
568 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
569 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
570 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
571 uint8_t raRspWindow; /* RA Response Window */
574 typedef struct schBwpParams
576 FreqDomainAlloc freqAlloc;
578 uint8_t cyclicPrefix;
581 typedef struct schCandidatesInfo
590 typedef struct schSearchSpaceCfg
592 uint8_t searchSpaceId;
594 uint16_t monitoringSlot;
596 uint16_t monitoringSymbol;
597 SchCandidatesInfo candidate;
600 typedef struct schPdcchCfgCmn
602 SchSearchSpaceCfg commonSearchSpace;
603 uint8_t raSearchSpaceId;
606 typedef struct schPdschCfgCmn
611 uint8_t lengthSymbol;
614 typedef struct schPucchCfgCmn
616 uint8_t pucchResourceCommon;
617 uint8_t pucchGroupHopping;
620 typedef struct schPuschCfgCmn
625 uint8_t lengthSymbol;
628 typedef struct schBwpDlCfg
631 SchPdcchCfgCmn pdcchCommon;
632 SchPdschCfgCmn pdschCommon;
635 typedef struct schBwpUlCfg
638 SchPucchCfgCmn pucchCommon;
639 SchPuschCfgCmn puschCommon;
642 typedef struct schCellCfg
644 uint16_t cellId; /* Cell Id */
645 uint16_t phyCellId; /* Physical cell id */
646 uint8_t numerology; /* Supported numerology */
647 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
648 uint8_t bandwidth; /* Supported B/W */
649 uint32_t dlFreq; /* DL Frequency */
650 uint32_t ulFreq; /* UL Frequency */
651 SchSsbCfg ssbSchCfg; /* SSB config */
652 SchSib1Cfg sib1SchCfg; /* SIB1 config */
653 SchRachCfg schRachCfg; /* PRACH config */
654 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
655 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
657 TDDCfg tddCfg; /* TDD Cfg */
661 typedef struct schCellCfgCfm
663 uint16_t cellId; /* Cell Id */
667 typedef struct ssbInfo
669 uint8_t ssbIdx; /* SSB Index */
670 TimeDomainAlloc tdAlloc; /* Time domain allocation */
671 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
674 typedef struct sib1AllocInfo
677 PdcchCfg sib1PdcchCfg;
678 PdschCfg sib1PdschCfg;
681 typedef struct prachSchInfo
683 uint8_t numPrachOcas; /* Num Prach Ocassions */
684 uint8_t prachFormat; /* PRACH Format */
685 uint8_t numRa; /* Freq domain ocassion */
686 uint8_t prachStartSymb; /* Freq domain ocassion */
689 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
690 typedef struct dlBrdcstAlloc
692 /* Ssb transmission is determined as follows:
693 * 0 : No tranamission
694 * 1 : SSB Transmission
695 * 2 : SSB Repetition */
697 uint8_t ssbIdxSupported;
698 SsbInfo ssbInfo[MAX_SSB_IDX];
699 /* Sib1 transmission is determined as follows:
700 * 0 : No tranamission
701 * 1 : SIB1 Transmission
702 * 2 : SIB1 Repetition */
704 Sib1AllocInfo sib1Alloc;
707 typedef struct rarInfo
712 FreqDomainAlloc msg3FreqAlloc;
718 typedef struct rarAlloc
722 PdcchCfg rarPdcchCfg;
723 PdschCfg rarPdschCfg;
726 typedef struct dlMsgInfo
734 uint8_t harqFeedbackInd;
737 uint16_t dlMsgPduLen;
741 typedef struct lcSchInfo
744 uint32_t schBytes; /* Number of scheduled bytes */
747 typedef struct dlMsgAlloc
751 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
753 PdcchCfg dlMsgPdcchCfg;
754 PdschCfg dlMsgPdschCfg;
758 typedef struct schSlotValue
760 SlotIndInfo currentTime;
761 SlotIndInfo broadcastTime;
763 SlotIndInfo dlMsgTime;
764 SlotIndInfo ulDciTime;
767 typedef struct format0_0
769 uint8_t resourceAllocType;
770 /* since we are using type-1, hence rbBitmap excluded */
771 FreqDomainAlloc freqAlloc;
772 TimeDomainAlloc timeAlloc;
775 uint8_t harqProcId; /* HARQ Process ID */
778 uint8_t ndi; /* NDI */
779 uint8_t rv; /* Redundancy Version */
784 typedef struct format0_1
790 typedef struct format1_0
796 typedef struct format1_1
801 typedef struct dciInfo
804 uint16_t crnti; /* CRNI */
805 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
806 BwpCfg bwpCfg; /* BWP Cfg */
807 CoresetCfg coresetCfg; /* Coreset1 Cfg */
808 FormatType formatType; /* DCI Format */
811 Format0_0 format0_0; /* Format 0_0 */
812 Format0_1 format0_1; /* Format 0_1 */
813 Format1_0 format1_0; /* Format 1_0 */
814 Format1_1 format1_1; /* Format 1_1 */
820 typedef struct dlSchedInfo
822 uint16_t cellId; /* Cell Id */
823 SchSlotValue schSlotValue;
825 /* Allocation for broadcast messages */
826 bool isBroadcastPres;
827 DlBrdcstAlloc brdcstAlloc;
829 /* Allocation for RAR message */
833 /* Allocation from MSG4 */
834 //Msg4Alloc *msg4Alloc;
836 /* UL grant in response to BSR */
839 /* Allocation from dedicated DL msg */
840 DlMsgAlloc *dlMsgAlloc;
844 typedef struct tbInfo
846 uint8_t qamOrder; /* Modulation Order */
847 uint8_t mcs; /* MCS */
848 SchMcsTable mcsTable; /* MCS Table */
849 uint8_t ndi; /* NDI */
850 uint8_t rv; /* Redundancy Version */
851 uint16_t tbSize; /* TB Size */
854 typedef struct schPuschInfo
857 uint8_t harqProcId; /* HARQ Process ID */
858 uint8_t resAllocType; /* Resource allocation type */
859 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
860 TimeDomainAlloc tdAlloc; /* Time domain allocation */
861 TbInfo tbInfo; /* TB info */
862 uint8_t dmrsMappingType;
863 uint8_t nrOfDmrsSymbols;
867 typedef struct schPucchFormatCfg
869 uint8_t interSlotFreqHop;
877 typedef struct schPucchInfo
881 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
882 TimeDomainAlloc tdAlloc; /* Time domain allocation */
888 uint8_t intraFreqHop;
889 uint16_t secondPrbHop;
890 uint8_t initialCyclicShift;
894 SchPucchFormatCfg cmnFormatCfg;
897 typedef struct ulSchedInfo
899 uint16_t cellId; /* Cell Id */
900 uint16_t crnti; /* CRNI */
901 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
902 uint8_t dataType; /* Type of info being scheduled */
903 PrachSchInfo prachSchInfo; /* Prach scheduling info */
904 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
905 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
908 typedef struct rachIndInfo
912 SlotIndInfo timingInfo;
921 typedef struct crcIndInfo
925 SlotIndInfo timingInfo;
927 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
930 typedef struct boInfo
936 typedef struct dlRlcBOInfo
944 /* Info of Scheduling Request to Add/Modify */
945 typedef struct schSchedReqInfo
948 SchSrProhibitTimer srProhibitTmr;
949 SchSrTransMax srTransMax;
952 /* Scheduling Request Configuration */
953 typedef struct schSchedReqCfg
955 uint8_t addModListCount;
956 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
957 uint8_t relListCount;
958 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
961 /* Info of Tag to Add/Modify */
962 typedef struct schTagInfo
965 SchTimeAlignmentTimer timeAlignmentTmr;
968 /* Timing Advance Group Configuration */
969 typedef struct schTagCfg
971 uint8_t addModListCount;
972 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
973 uint8_t relListCount;
974 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
977 /* Configuration for Power headroom reporting */
978 typedef struct schPhrCfg
980 SchPhrPeriodicTimer periodicTmr;
981 SchPhrProhibitTimer prohibitTmr;
982 SchPhrTxPwrFactorChange txpowerFactorChange;
986 SchPhrModeOtherCG modeOtherCG;
989 /* MAC cell Group configuration */
990 typedef struct schMacCellGrpCfg
992 SchSchedReqCfg schedReqCfg;
994 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
997 /* Physical Cell Group Configuration */
998 typedef struct schPhyCellGrpCfg
1000 SchPdschHarqAckCodebook pdschHarqAckCodebook;
1004 /* Control resource set info */
1005 typedef struct schControlRsrcSet
1007 uint8_t cRSetId; /* Control resource set id */
1008 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
1010 SchREGMappingType cceRegMappingType;
1011 SchPrecoderGranul precoderGranularity;
1012 uint16_t dmrsScramblingId;
1015 /* Search Space info */
1016 typedef struct schSearchSpace
1018 uint8_t searchSpaceId;
1020 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
1021 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
1022 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
1023 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
1024 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
1025 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
1026 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
1027 SchSearchSpaceType searchSpaceType;
1028 uint8_t ueSpecificDciFormat;
1031 /* PDCCH cofniguration */
1032 typedef struct schPdcchConfig
1034 uint8_t numCRsetToAddMod;
1035 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
1036 uint8_t numCRsetToRel;
1037 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
1038 uint8_t numSearchSpcToAddMod;
1039 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
1040 uint8_t numSearchSpcToRel;
1041 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
1044 /* PDSCH time domain resource allocation */
1045 typedef struct schPdschTimeDomRsrcAlloc
1047 SchTimeDomRsrcAllocMappingType mappingType;
1048 uint8_t startSymbol;
1049 uint8_t symbolLength;
1050 }SchPdschTimeDomRsrcAlloc;
1053 typedef struct schPdschBundling
1055 struct schStaticBundling
1057 SchBundlingSizeSet2 size;
1059 struct schDynamicBundling
1061 SchBundlingSizeSet1 sizeSet1;
1062 SchBundlingSizeSet2 sizeSet2;
1063 }SchDynamicBundling;
1066 /* DMRS downlink configuration */
1067 typedef struct schDmrsDlCfg
1069 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1072 /* PDSCH Configuration */
1073 typedef struct schPdschConfig
1075 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
1076 SchResourceAllocType resourceAllocType;
1077 uint8_t numTimeDomRsrcAlloc;
1078 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1080 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
1081 SchBundlingType bundlingType;
1082 SchPdschBundling bundlingInfo;
1085 /* Initial Downlink BWP */
1086 typedef struct schInitalDlBwp
1089 SchPdcchConfig pdcchCfg;
1091 SchPdschConfig pdschCfg;
1094 /* BWP Downlink common */
1095 typedef struct schBwpDlCommon
1099 /* Downlink BWP information */
1100 typedef struct schDlBwpInfo
1105 /* PDCCH Serving Cell configuration */
1106 typedef struct schPdschServCellCfg
1108 uint8_t *maxMimoLayers;
1109 SchNumHarqProcForPdsch numHarqProcForPdsch;
1110 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1111 bool *codeBlkGrpFlushInd;
1112 SchPdschXOverhead *xOverhead;
1113 }SchPdschServCellCfg;
1115 /* PUCCH Configuration */
1116 typedef struct schPucchResrcSetInfo
1119 uint8_t resrcListCount;
1120 uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1121 uint8_t maxPayLoadSize;
1122 }SchPucchResrcSetInfo;
1124 typedef struct schPucchResrcSetCfg
1126 uint8_t resrcSetToAddModListCount;
1127 SchPucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1128 uint8_t resrcSetToRelListCount;
1129 uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1130 }SchPucchResrcSetCfg;
1132 typedef struct schPucchFormat0
1134 uint8_t initialCyclicShift;
1136 uint8_t startSymbolIdx;
1139 typedef struct schPucchFormat1
1141 uint8_t initialCyclicShift;
1143 uint8_t startSymbolIdx;
1147 typedef struct schPucchFormat2_3
1151 uint8_t startSymbolIdx;
1154 typedef struct schPucchFormat4
1159 uint8_t startSymbolIdx;
1162 typedef struct schPucchResrcInfo
1166 uint8_t intraFreqHop;
1167 uint16_t secondPrbHop;
1168 uint8_t pucchFormat;
1170 SchPucchFormat0 *format0;
1171 SchPucchFormat1 *format1;
1172 SchPucchFormat2_3 *format2;
1173 SchPucchFormat2_3 *format3;
1174 SchPucchFormat4 *format4;
1178 typedef struct schPucchResrcCfg
1180 uint8_t resrcToAddModListCount;
1181 SchPucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1182 uint8_t resrcToRelListCount;
1183 uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1187 typedef struct schSchedReqResrcInfo
1191 uint8_t periodicity;
1194 }SchSchedReqResrcInfo;
1196 typedef struct schPucchSchedReqCfg
1198 uint8_t schedAddModListCount;
1199 SchSchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1200 uint8_t schedRelListCount;
1201 uint8_t schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1202 }SchPucchSchedReqCfg;
1204 typedef struct schSpatialRelationInfo
1206 uint8_t spatialRelationId;
1207 uint8_t servCellIdx;
1208 uint8_t pathLossRefRSId;
1210 uint8_t closeLoopIdx;
1211 }SchSpatialRelationInfo;
1213 typedef struct schPucchSpatialCfg
1215 uint8_t spatialAddModListCount;
1216 SchSpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1217 uint8_t spatialRelListCount;
1218 uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1219 }SchPucchSpatialCfg;
1221 typedef struct schP0PucchCfg
1227 typedef struct schPathLossRefRSCfg
1229 uint8_t pathLossRefRSId;
1230 }SchPathLossRefRSCfg;
1232 typedef struct schPucchMultiCsiCfg
1234 uint8_t multiCsiResrcListCount;
1235 uint8_t multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1236 }SchPucchMultiCsiCfg;
1238 typedef struct schPucchDlDataToUlAck
1240 uint8_t dlDataToUlAckListCount;
1241 uint8_t dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1242 }SchPucchDlDataToUlAck;
1244 typedef struct schPucchPowerControl
1252 SchP0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1253 uint8_t pathLossRefRSListCount;
1254 SchPathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1255 }SchPucchPowerControl;
1257 typedef struct schPucchCfg
1259 SchPucchResrcSetCfg *resrcSet;
1260 SchPucchResrcCfg *resrc;
1261 SchPucchFormatCfg *format1;
1262 SchPucchFormatCfg *format2;
1263 SchPucchFormatCfg *format3;
1264 SchPucchFormatCfg *format4;
1265 SchPucchSchedReqCfg *schedReq;
1266 SchPucchMultiCsiCfg *multiCsiCfg;
1267 SchPucchSpatialCfg *spatialInfo;
1268 SchPucchDlDataToUlAck *dlDataToUlAck;
1269 SchPucchPowerControl *powerControl;
1272 /* Transform precoding disabled */
1273 typedef struct schTransPrecodDisabled
1275 uint16_t scramblingId0;
1276 }SchTransPrecodDisabled;
1278 /* DMRS Uplink configuration */
1279 typedef struct SchDmrsUlCfg
1281 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1282 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1285 /* PUSCH Time Domain Resource Allocation */
1286 typedef struct schPuschTimeDomRsrcAlloc
1289 SchTimeDomRsrcAllocMappingType mappingType;
1290 uint8_t startSymbol;
1291 uint8_t symbolLength;
1292 }SchPuschTimeDomRsrcAlloc;
1294 /* PUSCH Configuration */
1295 typedef struct schPuschCfg
1297 uint8_t dataScramblingId;
1298 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1299 SchResourceAllocType resourceAllocType;
1300 uint8_t numTimeDomRsrcAlloc;
1301 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1302 SchTransformPrecoder transformPrecoder;
1305 /* Initial Uplink BWP */
1306 typedef struct schInitialUlBwp
1309 SchPucchCfg pucchCfg;
1311 SchPuschCfg puschCfg;
1314 /* Uplink BWP information */
1315 typedef struct schUlBwpInfo
1320 /* Serving cell configuration */
1321 typedef struct schServCellCfgInfo
1323 SchInitalDlBwp initDlBwp;
1324 uint8_t numDlBwpToAdd;
1325 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1326 uint8_t firstActvDlBwpId;
1327 uint8_t defaultDlBwpId;
1328 uint8_t *bwpInactivityTmr;
1329 SchPdschServCellCfg pdschServCellCfg;
1330 SchInitialUlBwp initUlBwp;
1331 uint8_t numUlBwpToAdd;
1332 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1333 uint8_t firstActvUlBwpId;
1334 }SchServCellCfgInfo;
1336 typedef struct schNonDynFiveQi
1341 uint16_t maxDataBurstVol;
1344 typedef struct schDynFiveQi
1347 uint16_t packetDelayBudget;
1348 uint8_t packetErrRateScalar;
1349 uint8_t packetErrRateExp;
1351 uint8_t delayCritical;
1353 uint16_t maxDataBurstVol;
1356 typedef struct schNgRanAllocAndRetPri
1358 uint8_t priorityLevel;
1359 uint8_t preEmptionCap;
1360 uint8_t preEmptionVul;
1361 }SchNgRanAllocAndRetPri;
1363 typedef struct schGrbQosFlowInfo
1365 uint32_t maxFlowBitRateDl;
1366 uint32_t maxFlowBitRateUl;
1367 uint32_t guarFlowBitRateDl;
1368 uint32_t guarFlowBitRateUl;
1372 typedef struct schDrbQos
1374 SchQosType fiveQiType; /* Dynamic or non-dynamic */
1377 SchNonDynFiveQi nonDyn5Qi;
1378 SchDynFiveQi dyn5Qi;
1380 SchNgRanAllocAndRetPri ngRanRetPri;
1381 SchGrbQosFlowInfo grbQosFlowInfo;
1382 uint16_t pduSessionId;
1383 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1386 typedef struct schSnssai
1389 uint8_t sd[SD_SIZE];
1392 /* Special cell configuration */
1393 typedef struct schSpCellCfg
1395 uint8_t servCellIdx;
1396 SchServCellCfgInfo servCellCfg;
1399 /* Uplink logical channel configuration */
1400 typedef struct SchUlLcCfg
1405 uint8_t pbr; // prioritisedBitRate
1406 uint8_t bsd; // bucketSizeDuration
1409 /* Downlink logical channel configuration */
1410 typedef struct schDlLcCfg
1412 uint8_t lcp; // logical Channel Prioritization
1415 /* Logical Channel configuration */
1416 typedef struct schLcCfg
1418 ConfigType configType;
1420 SchDrbQosInfo *drbQos;
1426 /* Aggregate max bit rate */
1427 typedef struct schAmbrCfg
1429 uint32_t ulBr; /* Ul BitRate */
1432 typedef struct schModulationInfo
1436 SchMcsTable mcsTable;
1439 /* UE configuration */
1440 typedef struct schUeCfg
1444 bool macCellGrpCfgPres;
1445 SchMacCellGrpCfg macCellGrpCfg;
1446 bool phyCellGrpCfgPres;
1447 SchPhyCellGrpCfg phyCellGrpCfg;
1449 SchSpCellCfg spCellCfg;
1450 SchAmbrCfg *ambrCfg;
1451 SchModulationInfo dlModInfo;
1452 SchModulationInfo ulModInfo;
1454 SchLcCfg schLcCfg[MAX_NUM_LC];
1457 typedef struct schUeCfgRsp
1463 SchFailureCause cause;
1466 typedef struct schUeDelete
1472 typedef struct schUeDeleteRsp
1481 typedef struct dataVolInfo
1487 typedef struct ulBufferStatusRptInd
1493 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1494 }UlBufferStatusRptInd;
1496 typedef struct srUciIndInfo
1500 SlotIndInfo slotInd;
1502 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1505 /* function pointers */
1507 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1508 Pst *pst, /* Post Structure */
1509 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1512 typedef uint8_t (*SchCellCfgFunc) ARGS((
1513 Pst *pst, /* Post Structure */
1514 SchCellCfg *schCellCfg /* Cell Cfg */
1517 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1518 Pst *pst, /* Post Structure */
1519 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1522 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1523 Pst *pst, /* Post Structure */
1524 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1527 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1528 Pst *pst, /* Post structure */
1529 RachIndInfo *rachInd)); /* Rach Indication Info */
1531 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1532 Pst *pst, /* Post structure */
1533 CrcIndInfo *crcInd)); /* CRC Info */
1535 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1536 Pst *pst, /* Post structure */
1537 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1539 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1540 Pst *pst, /* Post structure */
1541 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1543 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1544 Pst *pst, /* Post structure */
1545 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1547 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1548 Pst *pst, /* Post structure */
1549 SlotIndInfo *slotInd)); /* Slot Info */
1551 typedef uint8_t (*MacSchBsrFunc) ARGS((
1553 UlBufferStatusRptInd *bsrInd
1556 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1557 Pst *pst, /* Post structure */
1558 SrUciIndInfo *uciInd)); /* UCI IND Info */
1560 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1561 Pst *pst, /* Post structure */
1562 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1564 typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
1565 Pst *pst, /* Post structure */
1566 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1567 typedef uint8_t (*MacSchUeDeleteReqFunc) ARGS((
1568 Pst *pst, /* Post structure */
1569 SchUeDelete *schUeDel)); /*Scheduler UE Del*/
1571 typedef uint8_t (*SchUeDeleteRspFunc) ARGS((
1572 Pst *pst, /* Post structure */
1573 SchUeDeleteRsp *delRsp)); /* Scheduler UE delete response */
1575 /* function declarations */
1576 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1577 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1578 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1579 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1580 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1581 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1582 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1583 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1584 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1585 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1586 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1587 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1588 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1589 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1590 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1591 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1592 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1593 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1594 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1595 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1596 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1597 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1598 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1599 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1600 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1601 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1602 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1603 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1604 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1605 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1606 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1607 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1608 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1609 uint8_t packMacSchUeDeleteReq(Pst *pst, SchUeDelete *schUeDel);
1610 uint8_t MacSchUeDeleteReq(Pst *pst, SchUeDelete *ueDelete);
1611 uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *delRsp);
1612 uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp);
1614 /**********************************************************************
1616 **********************************************************************/