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 */
71 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */
72 #define MAX_NUM_TAGS 4 /* Max number of timing advance groups */
73 #define MAX_NUM_BWP 4 /* Max number of BWP per serving cell */
74 #define MAX_NUM_CRSET 3 /* Max number of control resource set in add/modify/release list */
75 #define MAX_NUM_SEARCH_SPC 10 /* Max number of search space in add/modify/release list */
76 #define FREQ_DOM_RSRC_SIZE 6 /* i.e. 6 bytes because Size of frequency domain resource is 45 bits */
77 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2 /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
78 #define MAX_NUM_DL_ALLOC 16 /* Max number of pdsch time domain downlink allocation */
79 #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */
81 /* PUCCH Configuration Macro */
82 #define MAX_NUM_PUCCH_RESRC 128
83 #define MAX_NUM_PUCCH_RESRC_SET 4
84 #define MAX_NUM_PUCCH_PER_RESRC_SET 32
85 #define MAX_NUM_SPATIAL_RELATIONS 8
86 #define MAX_NUM_PUCCH_P0_PER_SET 8
87 #define MAX_NUM_PATH_LOSS_REF_RS 4
88 #define MAX_NUM_DL_DATA_TO_UL_ACK 15
91 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
93 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
95 toFill.sfn = (crntTime.sfn + 1); \
99 toFill.sfn = crntTime.sfn; \
101 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
102 if (toFill.sfn >= MAX_SFN) \
104 toFill.sfn%=MAX_SFN; \
112 RESOURCE_UNAVAILABLE,
142 TIME_ALIGNMENT_TIMER_MS500,
143 TIME_ALIGNMENT_TIMER_MS750,
144 TIME_ALIGNMENT_TIMER_MS1280,
145 TIME_ALIGNMENT_TIMER_MS1920,
146 TIME_ALIGNMENT_TIMER_MS2560,
147 TIME_ALIGNMENT_TIMER_MS5120,
148 TIME_ALIGNMENT_TIMER_MS10240,
149 TIME_ALIGNMENT_TIMER_INFINITE
150 }SchTimeAlignmentTimer;
154 PHR_PERIODIC_TIMER_SF10,
155 PHR_PERIODIC_TIMER_SF20,
156 PHR_PERIODIC_TIMER_SF50,
157 PHR_PERIODIC_TIMER_SF100,
158 PHR_PERIODIC_TIMER_SF200,
159 PHR_PERIODIC_TIMER_SF500,
160 PHR_PERIODIC_TIMER_SF1000,
161 PHR_PERIODIC_TIMER_INFINITE
162 }SchPhrPeriodicTimer;
166 PHR_PROHIBIT_TIMER_SF0,
167 PHR_PROHIBIT_TIMER_SF10,
168 PHR_PROHIBIT_TIMER_SF20,
169 PHR_PROHIBIT_TIMER_SF50,
170 PHR_PROHIBIT_TIMER_SF100,
171 PHR_PROHIBIT_TIMER_SF200,
172 PHR_PROHIBIT_TIMER_SF500,
173 PHR_PROHIBIT_TIMER_SF1000
174 }SchPhrProhibitTimer;
178 PHR_TX_PWR_FACTOR_CHANGE_DB1,
179 PHR_TX_PWR_FACTOR_CHANGE_DB3,
180 PHR_TX_PWR_FACTOR_CHANGE_DB6,
181 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
182 }SchPhrTxPwrFactorChange;
192 HARQ_ACK_CODEBOOK_SEMISTATIC,
193 HARQ_ACK_CODEBOOK_DYNAMIC
194 }SchPdschHarqAckCodebook;
198 NUM_HARQ_PROC_FOR_PDSCH_N2,
199 NUM_HARQ_PROC_FOR_PDSCH_N4,
200 NUM_HARQ_PROC_FOR_PDSCH_N6,
201 NUM_HARQ_PROC_FOR_PDSCH_N10,
202 NUM_HARQ_PROC_FOR_PDSCH_N16
203 }SchNumHarqProcForPdsch;
207 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
208 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
209 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
210 MAX_CODE_BLOCK_GROUP_PER_TB_N8
211 }SchMaxCodeBlkGrpPerTB;
215 PDSCH_X_OVERHEAD_XOH_6,
216 PDSCH_X_OVERHEAD_XOH_12,
217 PDSCH_X_OVERHEAD_XOH_18
222 DMRS_ADDITIONAL_POS0,
223 DMRS_ADDITIONAL_POS1,
225 }SchDmrsAdditionPosition;
229 RESOURCE_ALLOCTION_TYPE_0,
230 RESOURCE_ALLOCTION_TYPE_1,
231 RESOURCE_ALLOCTION_DYN_SWITCH
232 }SchResourceAllocType;
236 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
237 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
238 }SchTimeDomRsrcAllocMappingType;
242 ENABLED_TRANSFORM_PRECODER,
243 DISABLED_TRANSFORM_PRECODER
244 }SchTransformPrecoder;
248 INTERLEAVED_CCE_REG_MAPPING = 1,
249 NONINTERLEAVED_CCE_REG_MAPPING
254 SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
255 SLOT_PERIODICITY_AND_OFFSET_SL_2,
256 SLOT_PERIODICITY_AND_OFFSET_SL_4,
257 SLOT_PERIODICITY_AND_OFFSET_SL_5,
258 SLOT_PERIODICITY_AND_OFFSET_SL_8,
259 SLOT_PERIODICITY_AND_OFFSET_SL_10,
260 SLOT_PERIODICITY_AND_OFFSET_SL_16,
261 SLOT_PERIODICITY_AND_OFFSET_SL_20,
262 SLOT_PERIODICITY_AND_OFFSET_SL_40,
263 SLOT_PERIODICITY_AND_OFFSET_SL_80,
264 SLOT_PERIODICITY_AND_OFFSET_SL_160,
265 SLOT_PERIODICITY_AND_OFFSET_SL_320,
266 SLOT_PERIODICITY_AND_OFFSET_SL_640,
267 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
268 SLOT_PERIODICITY_AND_OFFSET_SL_2560
269 }SchMSlotPeriodAndOffset;
279 SEARCH_SPACE_TYPE_COMMON = 1,
280 SEARCH_SPACE_TYPE_UE_SPECIFIC
285 SCH_QOS_NON_DYNAMIC = 1,
291 AGGREGATION_LEVEL_N0,
292 AGGREGATION_LEVEL_N1,
293 AGGREGATION_LEVEL_N2,
294 AGGREGATION_LEVEL_N3,
295 AGGREGATION_LEVEL_N4,
296 AGGREGATION_LEVEL_N5,
297 AGGREGATION_LEVEL_N6,
309 CODE_WORDS_SCHED_BY_DCI_N1,
310 CODE_WORDS_SCHED_BY_DCI_N2
311 }SchCodeWordsSchedByDci;
315 STATIC_BUNDLING_TYPE = 1,
316 DYNAMIC_BUNDLING_TYPE
322 SCH_SET1_SIZE_WIDEBAND,
323 SCH_SET1_SIZE_N2_WIDEBAND,
324 SCH_SET1_SIZE_N4_WIDEBAND
325 }SchBundlingSizeSet1;
330 SCH_SET2_SIZE_WIDEBAND
331 }SchBundlingSizeSet2;
373 SCH_MCS_TABLE_QAM_64,
374 SCH_MCS_TABLE_QAM_256,
375 SCH_MCS_TABLE_QAM_64_LOW_SE
379 typedef struct timeDomainAlloc
385 typedef struct freqDomainAlloc
394 uint32_t ssbPbchPwr; /* SSB block power */
395 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
396 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
397 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
398 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
399 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
402 typedef struct bwpCfg
404 uint8_t subcarrierSpacing;
405 uint8_t cyclicPrefix;
406 FreqDomainAlloc freqAlloc;
412 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
415 typedef struct beamformingInfo
419 uint8_t digBfInterfaces;
420 Prg prg[MAX_NUM_PRG];
423 /* SIB1 PDSCH structures */
425 typedef struct codewordinfo
427 uint16_t targetCodeRate;
435 typedef struct dmrsInfo
437 uint16_t dlDmrsSymbPos;
438 uint8_t dmrsConfigType;
439 uint16_t dlDmrsScramblingId;
441 uint8_t numDmrsCdmGrpsNoData;
444 uint8_t nrOfDmrsSymbols;
448 typedef struct pdschFreqAlloc
450 uint8_t resourceAllocType;
451 /* since we are using type-1, rbBitmap excluded */
452 FreqDomainAlloc freqAlloc;
453 uint8_t vrbPrbMapping;
456 typedef struct pdschTimeAlloc
459 TimeDomainAlloc timeAlloc;
462 typedef struct txPowerPdschInfo
464 uint8_t powerControlOffset;
465 uint8_t powerControlOffsetSS;
468 typedef struct pdschCfg
473 uint8_t numCodewords;
474 CodewordInfo codeword[MAX_CODEWORDS];
475 uint16_t dataScramblingId;
477 uint8_t transmissionScheme;
480 PdschFreqAlloc pdschFreqAlloc;
481 PdschTimeAlloc pdschTimeAlloc;
482 BeamformingInfo beamPdschInfo;
483 TxPowerPdschInfo txPdschPower;
485 /* SIB1 PDSCH structures end */
487 /* SIB1 interface structure */
489 typedef struct coresetCfg
492 uint8_t startSymbolIndex;
493 uint8_t durationSymbols;
494 uint8_t freqDomainResource[6];
495 uint8_t cceRegMappingType;
496 uint8_t regBundleSize;
497 uint8_t interleaverSize;
500 uint8_t precoderGranularity;
502 uint8_t aggregationLevel;
505 typedef struct txPowerPdcchInfo
508 uint8_t powerControlOffsetSS;
514 uint16_t scramblingId;
515 uint16_t scramblingRnti;
518 BeamformingInfo beamPdcchInfo;
519 TxPowerPdcchInfo txPdcchPower;
523 typedef struct pdcchCfg
525 /* coreset-0 configuration */
526 CoresetCfg coresetCfg;
529 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
531 /* end of SIB1 PDCCH structures */
535 /* parameters recieved from DU-APP */
537 uint16_t sib1RepetitionPeriod;
538 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
539 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
542 /* parameters derived in scheduler */
545 PdcchCfg sib1PdcchCfg;
546 PdschCfg sib1PdschCfg;
549 typedef struct schRachCfg
551 uint8_t prachCfgIdx; /* PRACH config idx */
552 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
553 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
554 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
555 uint8_t rootSeqLen; /* root sequence length */
556 uint16_t rootSeqIdx; /* Root sequence index */
557 uint8_t numRootSeq; /* Number of root sequences required for FD */
558 uint16_t k1; /* Frequency Offset for each FD */
559 uint8_t ssbPerRach; /* SSB per RACH occassion */
560 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
561 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
562 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
563 uint8_t raRspWindow; /* RA Response Window */
566 typedef struct schBwpParams
568 FreqDomainAlloc freqAlloc;
570 uint8_t cyclicPrefix;
573 typedef struct schCandidatesInfo
582 typedef struct schSearchSpaceCfg
584 uint8_t searchSpaceId;
586 uint16_t monitoringSlot;
588 uint16_t monitoringSymbol;
589 SchCandidatesInfo candidate;
592 typedef struct schPdcchCfgCmn
594 SchSearchSpaceCfg commonSearchSpace;
595 uint8_t raSearchSpaceId;
598 typedef struct schPdschCfgCmn
603 uint8_t lengthSymbol;
606 typedef struct schPucchCfgCmn
608 uint8_t pucchResourceCommon;
609 uint8_t pucchGroupHopping;
612 typedef struct schPuschCfgCmn
617 uint8_t lengthSymbol;
620 typedef struct schBwpDlCfg
623 SchPdcchCfgCmn pdcchCommon;
624 SchPdschCfgCmn pdschCommon;
627 typedef struct schBwpUlCfg
630 SchPucchCfgCmn pucchCommon;
631 SchPuschCfgCmn puschCommon;
634 typedef struct schCellCfg
636 uint16_t cellId; /* Cell Id */
637 uint16_t phyCellId; /* Physical cell id */
638 uint8_t numerology; /* Supported numerology */
639 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
640 uint8_t bandwidth; /* Supported B/W */
641 uint32_t dlFreq; /* DL Frequency */
642 uint32_t ulFreq; /* UL Frequency */
643 SchSsbCfg ssbSchCfg; /* SSB config */
644 SchSib1Cfg sib1SchCfg; /* SIB1 config */
645 SchRachCfg schRachCfg; /* PRACH config */
646 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
647 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
649 TDDCfg tddCfg; /* TDD Cfg */
653 typedef struct schCellCfgCfm
655 uint16_t cellId; /* Cell Id */
659 typedef struct ssbInfo
661 uint8_t ssbIdx; /* SSB Index */
662 TimeDomainAlloc tdAlloc; /* Time domain allocation */
663 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
666 typedef struct sib1AllocInfo
669 PdcchCfg sib1PdcchCfg;
670 PdschCfg sib1PdschCfg;
673 typedef struct prachSchInfo
675 uint8_t numPrachOcas; /* Num Prach Ocassions */
676 uint8_t prachFormat; /* PRACH Format */
677 uint8_t numRa; /* Freq domain ocassion */
678 uint8_t prachStartSymb; /* Freq domain ocassion */
681 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
682 typedef struct dlBrdcstAlloc
684 /* Ssb transmission is determined as follows:
685 * 0 : No tranamission
686 * 1 : SSB Transmission
687 * 2 : SSB Repetition */
689 uint8_t ssbIdxSupported;
690 SsbInfo ssbInfo[MAX_SSB_IDX];
691 /* Sib1 transmission is determined as follows:
692 * 0 : No tranamission
693 * 1 : SIB1 Transmission
694 * 2 : SIB1 Repetition */
696 Sib1AllocInfo sib1Alloc;
699 typedef struct rarInfo
704 FreqDomainAlloc msg3FreqAlloc;
710 typedef struct rarAlloc
714 PdcchCfg rarPdcchCfg;
715 PdschCfg rarPdschCfg;
718 typedef struct dlMsgInfo
726 uint8_t harqFeedbackInd;
729 uint16_t dlMsgPduLen;
733 typedef struct lcSchInfo
736 uint32_t schBytes; /* Number of scheduled bytes */
739 typedef struct dlMsgAlloc
743 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
745 PdcchCfg dlMsgPdcchCfg;
746 PdschCfg dlMsgPdschCfg;
750 typedef struct schSlotValue
752 SlotIndInfo currentTime;
753 SlotIndInfo broadcastTime;
755 SlotIndInfo dlMsgTime;
756 SlotIndInfo ulDciTime;
759 typedef struct format0_0
761 uint8_t resourceAllocType;
762 /* since we are using type-1, hence rbBitmap excluded */
763 FreqDomainAlloc freqAlloc;
764 TimeDomainAlloc timeAlloc;
767 uint8_t harqProcId; /* HARQ Process ID */
770 uint8_t ndi; /* NDI */
771 uint8_t rv; /* Redundancy Version */
776 typedef struct format0_1
782 typedef struct format1_0
788 typedef struct format1_1
793 typedef struct dciInfo
796 uint16_t crnti; /* CRNI */
797 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
798 BwpCfg bwpCfg; /* BWP Cfg */
799 CoresetCfg coresetCfg; /* Coreset1 Cfg */
800 FormatType formatType; /* DCI Format */
803 Format0_0 format0_0; /* Format 0_0 */
804 Format0_1 format0_1; /* Format 0_1 */
805 Format1_0 format1_0; /* Format 1_0 */
806 Format1_1 format1_1; /* Format 1_1 */
812 typedef struct dlSchedInfo
814 uint16_t cellId; /* Cell Id */
815 SchSlotValue schSlotValue;
817 /* Allocation for broadcast messages */
818 bool isBroadcastPres;
819 DlBrdcstAlloc brdcstAlloc;
821 /* Allocation for RAR message */
825 /* Allocation from MSG4 */
826 //Msg4Alloc *msg4Alloc;
828 /* UL grant in response to BSR */
831 /* Allocation from dedicated DL msg */
832 DlMsgAlloc *dlMsgAlloc;
836 typedef struct tbInfo
838 uint8_t qamOrder; /* Modulation Order */
839 uint8_t mcs; /* MCS */
840 SchMcsTable mcsTable; /* MCS Table */
841 uint8_t ndi; /* NDI */
842 uint8_t rv; /* Redundancy Version */
843 uint16_t tbSize; /* TB Size */
846 typedef struct schPuschInfo
849 uint8_t harqProcId; /* HARQ Process ID */
850 uint8_t resAllocType; /* Resource allocation type */
851 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
852 TimeDomainAlloc tdAlloc; /* Time domain allocation */
853 TbInfo tbInfo; /* TB info */
854 uint8_t dmrsMappingType;
855 uint8_t nrOfDmrsSymbols;
859 typedef struct schPucchFormatCfg
861 uint8_t interSlotFreqHop;
869 typedef struct schPucchInfo
873 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
874 TimeDomainAlloc tdAlloc; /* Time domain allocation */
880 uint8_t intraFreqHop;
881 uint16_t secondPrbHop;
882 uint8_t initialCyclicShift;
886 SchPucchFormatCfg cmnFormatCfg;
889 typedef struct ulSchedInfo
891 uint16_t cellId; /* Cell Id */
892 uint16_t crnti; /* CRNI */
893 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
894 uint8_t dataType; /* Type of info being scheduled */
895 PrachSchInfo prachSchInfo; /* Prach scheduling info */
896 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
897 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
900 typedef struct rachIndInfo
904 SlotIndInfo timingInfo;
913 typedef struct crcIndInfo
917 SlotIndInfo timingInfo;
919 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
922 typedef struct boInfo
928 typedef struct dlRlcBOInfo
936 /* Info of Scheduling Request to Add/Modify */
937 typedef struct schSchedReqInfo
940 SchSrProhibitTimer srProhibitTmr;
941 SchSrTransMax srTransMax;
944 /* Scheduling Request Configuration */
945 typedef struct schSchedReqCfg
947 uint8_t addModListCount;
948 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
949 uint8_t relListCount;
950 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
953 /* Info of Tag to Add/Modify */
954 typedef struct schTagInfo
957 SchTimeAlignmentTimer timeAlignmentTmr;
960 /* Timing Advance Group Configuration */
961 typedef struct schTagCfg
963 uint8_t addModListCount;
964 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
965 uint8_t relListCount;
966 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
969 /* Configuration for Power headroom reporting */
970 typedef struct schPhrCfg
972 SchPhrPeriodicTimer periodicTmr;
973 SchPhrProhibitTimer prohibitTmr;
974 SchPhrTxPwrFactorChange txpowerFactorChange;
978 SchPhrModeOtherCG modeOtherCG;
981 /* MAC cell Group configuration */
982 typedef struct schMacCellGrpCfg
984 SchSchedReqCfg schedReqCfg;
986 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
989 /* Physical Cell Group Configuration */
990 typedef struct schPhyCellGrpCfg
992 SchPdschHarqAckCodebook pdschHarqAckCodebook;
996 /* Control resource set info */
997 typedef struct schControlRsrcSet
999 uint8_t cRSetId; /* Control resource set id */
1000 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
1002 SchREGMappingType cceRegMappingType;
1003 SchPrecoderGranul precoderGranularity;
1004 uint16_t dmrsScramblingId;
1007 /* Search Space info */
1008 typedef struct schSearchSpace
1010 uint8_t searchSpaceId;
1012 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
1013 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
1014 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
1015 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
1016 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
1017 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
1018 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
1019 SchSearchSpaceType searchSpaceType;
1020 uint8_t ueSpecificDciFormat;
1023 /* PDCCH cofniguration */
1024 typedef struct schPdcchConfig
1026 uint8_t numCRsetToAddMod;
1027 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
1028 uint8_t numCRsetToRel;
1029 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
1030 uint8_t numSearchSpcToAddMod;
1031 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
1032 uint8_t numSearchSpcToRel;
1033 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
1036 /* PDSCH time domain resource allocation */
1037 typedef struct schPdschTimeDomRsrcAlloc
1039 SchTimeDomRsrcAllocMappingType mappingType;
1040 uint8_t startSymbol;
1041 uint8_t symbolLength;
1042 }SchPdschTimeDomRsrcAlloc;
1045 typedef struct schPdschBundling
1047 struct schStaticBundling
1049 SchBundlingSizeSet2 size;
1051 struct schDynamicBundling
1053 SchBundlingSizeSet1 sizeSet1;
1054 SchBundlingSizeSet2 sizeSet2;
1055 }SchDynamicBundling;
1058 /* DMRS downlink configuration */
1059 typedef struct schDmrsDlCfg
1061 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1064 /* PDSCH Configuration */
1065 typedef struct schPdschConfig
1067 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
1068 SchResourceAllocType resourceAllocType;
1069 uint8_t numTimeDomRsrcAlloc;
1070 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1072 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
1073 SchBundlingType bundlingType;
1074 SchPdschBundling bundlingInfo;
1077 /* Initial Downlink BWP */
1078 typedef struct schInitalDlBwp
1081 SchPdcchConfig pdcchCfg;
1083 SchPdschConfig pdschCfg;
1086 /* BWP Downlink common */
1087 typedef struct schBwpDlCommon
1091 /* Downlink BWP information */
1092 typedef struct schDlBwpInfo
1097 /* PDCCH Serving Cell configuration */
1098 typedef struct schPdschServCellCfg
1100 uint8_t *maxMimoLayers;
1101 SchNumHarqProcForPdsch numHarqProcForPdsch;
1102 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1103 bool *codeBlkGrpFlushInd;
1104 SchPdschXOverhead *xOverhead;
1105 }SchPdschServCellCfg;
1107 /* PUCCH Configuration */
1108 typedef struct schPucchResrcSetInfo
1111 uint8_t resrcListCount;
1112 uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1113 uint8_t maxPayLoadSize;
1114 }SchPucchResrcSetInfo;
1116 typedef struct schPucchResrcSetCfg
1118 uint8_t resrcSetToAddModListCount;
1119 SchPucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1120 uint8_t resrcSetToRelListCount;
1121 uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1122 }SchPucchResrcSetCfg;
1124 typedef struct schPucchFormat0
1126 uint8_t initialCyclicShift;
1128 uint8_t startSymbolIdx;
1131 typedef struct schPucchFormat1
1133 uint8_t initialCyclicShift;
1135 uint8_t startSymbolIdx;
1139 typedef struct schPucchFormat2_3
1143 uint8_t startSymbolIdx;
1146 typedef struct schPucchFormat4
1151 uint8_t startSymbolIdx;
1154 typedef struct schPucchResrcInfo
1158 uint8_t intraFreqHop;
1159 uint16_t secondPrbHop;
1160 uint8_t pucchFormat;
1162 SchPucchFormat0 *format0;
1163 SchPucchFormat1 *format1;
1164 SchPucchFormat2_3 *format2;
1165 SchPucchFormat2_3 *format3;
1166 SchPucchFormat4 *format4;
1170 typedef struct schPucchResrcCfg
1172 uint8_t resrcToAddModListCount;
1173 SchPucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1174 uint8_t resrcToRelListCount;
1175 uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1179 typedef struct schSchedReqResrcInfo
1183 uint8_t periodicity;
1186 }SchSchedReqResrcInfo;
1188 typedef struct schPucchSchedReqCfg
1190 uint8_t schedAddModListCount;
1191 SchSchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1192 uint8_t schedRelListCount;
1193 uint8_t schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1194 }SchPucchSchedReqCfg;
1196 typedef struct schSpatialRelationInfo
1198 uint8_t spatialRelationId;
1199 uint8_t servCellIdx;
1200 uint8_t pathLossRefRSId;
1202 uint8_t closeLoopIdx;
1203 }SchSpatialRelationInfo;
1205 typedef struct schPucchSpatialCfg
1207 uint8_t spatialAddModListCount;
1208 SchSpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1209 uint8_t spatialRelListCount;
1210 uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1211 }SchPucchSpatialCfg;
1213 typedef struct schP0PucchCfg
1219 typedef struct schPathLossRefRSCfg
1221 uint8_t pathLossRefRSId;
1222 }SchPathLossRefRSCfg;
1224 typedef struct schPucchMultiCsiCfg
1226 uint8_t multiCsiResrcListCount;
1227 uint8_t multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1228 }SchPucchMultiCsiCfg;
1230 typedef struct schPucchDlDataToUlAck
1232 uint8_t dlDataToUlAckListCount;
1233 uint8_t dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1234 }SchPucchDlDataToUlAck;
1236 typedef struct schPucchPowerControl
1244 SchP0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1245 uint8_t pathLossRefRSListCount;
1246 SchPathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1247 }SchPucchPowerControl;
1249 typedef struct schPucchCfg
1251 SchPucchResrcSetCfg *resrcSet;
1252 SchPucchResrcCfg *resrc;
1253 SchPucchFormatCfg *format1;
1254 SchPucchFormatCfg *format2;
1255 SchPucchFormatCfg *format3;
1256 SchPucchFormatCfg *format4;
1257 SchPucchSchedReqCfg *schedReq;
1258 SchPucchMultiCsiCfg *multiCsiCfg;
1259 SchPucchSpatialCfg *spatialInfo;
1260 SchPucchDlDataToUlAck *dlDataToUlAck;
1261 SchPucchPowerControl *powerControl;
1264 /* Transform precoding disabled */
1265 typedef struct schTransPrecodDisabled
1267 uint16_t scramblingId0;
1268 }SchTransPrecodDisabled;
1270 /* DMRS Uplink configuration */
1271 typedef struct SchDmrsUlCfg
1273 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1274 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1277 /* PUSCH Time Domain Resource Allocation */
1278 typedef struct schPuschTimeDomRsrcAlloc
1281 SchTimeDomRsrcAllocMappingType mappingType;
1282 uint8_t startSymbol;
1283 uint8_t symbolLength;
1284 }SchPuschTimeDomRsrcAlloc;
1286 /* PUSCH Configuration */
1287 typedef struct schPuschCfg
1289 uint8_t dataScramblingId;
1290 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1291 SchResourceAllocType resourceAllocType;
1292 uint8_t numTimeDomRsrcAlloc;
1293 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1294 SchTransformPrecoder transformPrecoder;
1297 /* Initial Uplink BWP */
1298 typedef struct schInitialUlBwp
1301 SchPucchCfg pucchCfg;
1303 SchPuschCfg puschCfg;
1306 /* Uplink BWP information */
1307 typedef struct schUlBwpInfo
1312 /* Serving cell configuration */
1313 typedef struct schServCellCfgInfo
1315 SchInitalDlBwp initDlBwp;
1316 uint8_t numDlBwpToAdd;
1317 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1318 uint8_t firstActvDlBwpId;
1319 uint8_t defaultDlBwpId;
1320 uint8_t *bwpInactivityTmr;
1321 SchPdschServCellCfg pdschServCellCfg;
1322 SchInitialUlBwp initUlBwp;
1323 uint8_t numUlBwpToAdd;
1324 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1325 uint8_t firstActvUlBwpId;
1326 }SchServCellCfgInfo;
1328 typedef struct schNonDynFiveQi
1333 uint16_t maxDataBurstVol;
1336 typedef struct schDynFiveQi
1339 uint16_t packetDelayBudget;
1340 uint8_t packetErrRateScalar;
1341 uint8_t packetErrRateExp;
1343 uint8_t delayCritical;
1345 uint16_t maxDataBurstVol;
1348 typedef struct schNgRanAllocAndRetPri
1350 uint8_t priorityLevel;
1351 uint8_t preEmptionCap;
1352 uint8_t preEmptionVul;
1353 }SchNgRanAllocAndRetPri;
1355 typedef struct schGrbQosFlowInfo
1357 uint32_t maxFlowBitRateDl;
1358 uint32_t maxFlowBitRateUl;
1359 uint32_t guarFlowBitRateDl;
1360 uint32_t guarFlowBitRateUl;
1364 typedef struct schDrbQos
1366 SchQosType fiveQiType; /* Dynamic or non-dynamic */
1369 SchNonDynFiveQi nonDyn5Qi;
1370 SchDynFiveQi dyn5Qi;
1372 SchNgRanAllocAndRetPri ngRanRetPri;
1373 SchGrbQosFlowInfo grbQosFlowInfo;
1374 uint16_t pduSessionId;
1375 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1378 typedef struct schSnssai
1381 uint8_t sd[SD_SIZE];
1384 /* Special cell configuration */
1385 typedef struct schSpCellCfg
1387 uint8_t servCellIdx;
1388 SchServCellCfgInfo servCellCfg;
1391 /* Uplink logical channel configuration */
1392 typedef struct SchUlLcCfg
1397 uint8_t pbr; // prioritisedBitRate
1398 uint8_t bsd; // bucketSizeDuration
1401 /* Downlink logical channel configuration */
1402 typedef struct schDlLcCfg
1404 uint8_t lcp; // logical Channel Prioritization
1407 /* Logical Channel configuration */
1408 typedef struct schLcCfg
1410 ConfigType configType;
1412 SchDrbQosInfo *drbQos;
1418 /* Aggregate max bit rate */
1419 typedef struct schAmbrCfg
1421 uint32_t ulBr; /* Ul BitRate */
1424 typedef struct schModulationInfo
1428 SchMcsTable mcsTable;
1431 /* UE configuration */
1432 typedef struct schUeCfg
1436 bool macCellGrpCfgPres;
1437 SchMacCellGrpCfg macCellGrpCfg;
1438 bool phyCellGrpCfgPres;
1439 SchPhyCellGrpCfg phyCellGrpCfg;
1441 SchSpCellCfg spCellCfg;
1442 SchAmbrCfg *ambrCfg;
1443 SchModulationInfo dlModInfo;
1444 SchModulationInfo ulModInfo;
1446 SchLcCfg schLcCfg[MAX_NUM_LC];
1449 typedef struct schUeCfgRsp
1455 SchFailureCause cause;
1458 typedef struct dataVolInfo
1464 typedef struct ulBufferStatusRptInd
1470 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1471 }UlBufferStatusRptInd;
1473 typedef struct srUciIndInfo
1477 SlotIndInfo slotInd;
1479 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1482 /* function pointers */
1484 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1485 Pst *pst, /* Post Structure */
1486 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1489 typedef uint8_t (*SchCellCfgFunc) ARGS((
1490 Pst *pst, /* Post Structure */
1491 SchCellCfg *schCellCfg /* Cell Cfg */
1494 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1495 Pst *pst, /* Post Structure */
1496 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1499 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1500 Pst *pst, /* Post Structure */
1501 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1504 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1505 Pst *pst, /* Post structure */
1506 RachIndInfo *rachInd)); /* Rach Indication Info */
1508 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1509 Pst *pst, /* Post structure */
1510 CrcIndInfo *crcInd)); /* CRC Info */
1512 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1513 Pst *pst, /* Post structure */
1514 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1516 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1517 Pst *pst, /* Post structure */
1518 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1520 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1521 Pst *pst, /* Post structure */
1522 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1524 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1525 Pst *pst, /* Post structure */
1526 SlotIndInfo *slotInd)); /* Slot Info */
1528 typedef uint8_t (*MacSchBsrFunc) ARGS((
1530 UlBufferStatusRptInd *bsrInd
1533 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1534 Pst *pst, /* Post structure */
1535 SrUciIndInfo *uciInd)); /* UCI IND Info */
1537 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1538 Pst *pst, /* Post structure */
1539 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1541 typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
1542 Pst *pst, /* Post structure */
1543 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1545 /* function declarations */
1546 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1547 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1548 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1549 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1550 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1551 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1552 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1553 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1554 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1555 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1556 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1557 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1558 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1559 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1560 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1561 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1562 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1563 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1564 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1565 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1566 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1567 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1568 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1569 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1570 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1571 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1572 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1573 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1574 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1575 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1576 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1577 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1578 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1580 /**********************************************************************
1582 **********************************************************************/