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 ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
97 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
99 toFill.sfn = (crntTime.sfn + 1); \
103 toFill.sfn = crntTime.sfn; \
105 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
106 if (toFill.sfn >= MAX_SFN) \
108 toFill.sfn%=MAX_SFN; \
116 RESOURCE_UNAVAILABLE,
153 TIME_ALIGNMENT_TIMER_MS500,
154 TIME_ALIGNMENT_TIMER_MS750,
155 TIME_ALIGNMENT_TIMER_MS1280,
156 TIME_ALIGNMENT_TIMER_MS1920,
157 TIME_ALIGNMENT_TIMER_MS2560,
158 TIME_ALIGNMENT_TIMER_MS5120,
159 TIME_ALIGNMENT_TIMER_MS10240,
160 TIME_ALIGNMENT_TIMER_INFINITE
161 }SchTimeAlignmentTimer;
165 PHR_PERIODIC_TIMER_SF10,
166 PHR_PERIODIC_TIMER_SF20,
167 PHR_PERIODIC_TIMER_SF50,
168 PHR_PERIODIC_TIMER_SF100,
169 PHR_PERIODIC_TIMER_SF200,
170 PHR_PERIODIC_TIMER_SF500,
171 PHR_PERIODIC_TIMER_SF1000,
172 PHR_PERIODIC_TIMER_INFINITE
173 }SchPhrPeriodicTimer;
177 PHR_PROHIBIT_TIMER_SF0,
178 PHR_PROHIBIT_TIMER_SF10,
179 PHR_PROHIBIT_TIMER_SF20,
180 PHR_PROHIBIT_TIMER_SF50,
181 PHR_PROHIBIT_TIMER_SF100,
182 PHR_PROHIBIT_TIMER_SF200,
183 PHR_PROHIBIT_TIMER_SF500,
184 PHR_PROHIBIT_TIMER_SF1000
185 }SchPhrProhibitTimer;
189 PHR_TX_PWR_FACTOR_CHANGE_DB1,
190 PHR_TX_PWR_FACTOR_CHANGE_DB3,
191 PHR_TX_PWR_FACTOR_CHANGE_DB6,
192 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
193 }SchPhrTxPwrFactorChange;
203 HARQ_ACK_CODEBOOK_SEMISTATIC,
204 HARQ_ACK_CODEBOOK_DYNAMIC
205 }SchPdschHarqAckCodebook;
209 NUM_HARQ_PROC_FOR_PDSCH_N2,
210 NUM_HARQ_PROC_FOR_PDSCH_N4,
211 NUM_HARQ_PROC_FOR_PDSCH_N6,
212 NUM_HARQ_PROC_FOR_PDSCH_N10,
213 NUM_HARQ_PROC_FOR_PDSCH_N16
214 }SchNumHarqProcForPdsch;
218 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
219 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
220 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
221 MAX_CODE_BLOCK_GROUP_PER_TB_N8
222 }SchMaxCodeBlkGrpPerTB;
226 PDSCH_X_OVERHEAD_XOH_6,
227 PDSCH_X_OVERHEAD_XOH_12,
228 PDSCH_X_OVERHEAD_XOH_18
233 DMRS_ADDITIONAL_POS0,
234 DMRS_ADDITIONAL_POS1,
236 }SchDmrsAdditionPosition;
240 RESOURCE_ALLOCTION_TYPE_0,
241 RESOURCE_ALLOCTION_TYPE_1,
242 RESOURCE_ALLOCTION_DYN_SWITCH
243 }SchResourceAllocType;
247 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
248 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
249 }SchTimeDomRsrcAllocMappingType;
253 ENABLED_TRANSFORM_PRECODER,
254 DISABLED_TRANSFORM_PRECODER
255 }SchTransformPrecoder;
259 INTERLEAVED_CCE_REG_MAPPING = 1,
260 NONINTERLEAVED_CCE_REG_MAPPING
265 SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
266 SLOT_PERIODICITY_AND_OFFSET_SL_2,
267 SLOT_PERIODICITY_AND_OFFSET_SL_4,
268 SLOT_PERIODICITY_AND_OFFSET_SL_5,
269 SLOT_PERIODICITY_AND_OFFSET_SL_8,
270 SLOT_PERIODICITY_AND_OFFSET_SL_10,
271 SLOT_PERIODICITY_AND_OFFSET_SL_16,
272 SLOT_PERIODICITY_AND_OFFSET_SL_20,
273 SLOT_PERIODICITY_AND_OFFSET_SL_40,
274 SLOT_PERIODICITY_AND_OFFSET_SL_80,
275 SLOT_PERIODICITY_AND_OFFSET_SL_160,
276 SLOT_PERIODICITY_AND_OFFSET_SL_320,
277 SLOT_PERIODICITY_AND_OFFSET_SL_640,
278 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
279 SLOT_PERIODICITY_AND_OFFSET_SL_2560
280 }SchMSlotPeriodAndOffset;
290 SEARCH_SPACE_TYPE_COMMON = 1,
291 SEARCH_SPACE_TYPE_UE_SPECIFIC
296 SCH_QOS_NON_DYNAMIC = 1,
302 AGGREGATION_LEVEL_N0,
303 AGGREGATION_LEVEL_N1,
304 AGGREGATION_LEVEL_N2,
305 AGGREGATION_LEVEL_N3,
306 AGGREGATION_LEVEL_N4,
307 AGGREGATION_LEVEL_N5,
308 AGGREGATION_LEVEL_N6,
320 CODE_WORDS_SCHED_BY_DCI_N1,
321 CODE_WORDS_SCHED_BY_DCI_N2
322 }SchCodeWordsSchedByDci;
326 STATIC_BUNDLING_TYPE = 1,
327 DYNAMIC_BUNDLING_TYPE
333 SCH_SET1_SIZE_WIDEBAND,
334 SCH_SET1_SIZE_N2_WIDEBAND,
335 SCH_SET1_SIZE_N4_WIDEBAND
336 }SchBundlingSizeSet1;
341 SCH_SET2_SIZE_WIDEBAND
342 }SchBundlingSizeSet2;
384 SCH_MCS_TABLE_QAM_64,
385 SCH_MCS_TABLE_QAM_256,
386 SCH_MCS_TABLE_QAM_64_LOW_SE
390 typedef struct timeDomainAlloc
396 typedef struct freqDomainAlloc
405 uint32_t ssbPbchPwr; /* SSB block power */
406 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
407 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
408 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
409 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
410 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
413 typedef struct bwpCfg
415 uint8_t subcarrierSpacing;
416 uint8_t cyclicPrefix;
417 FreqDomainAlloc freqAlloc;
423 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
426 typedef struct beamformingInfo
430 uint8_t digBfInterfaces;
431 Prg prg[MAX_NUM_PRG];
434 /* SIB1 PDSCH structures */
436 typedef struct codewordinfo
438 uint16_t targetCodeRate;
446 typedef struct dmrsInfo
448 uint16_t dlDmrsSymbPos;
449 uint8_t dmrsConfigType;
450 uint16_t dlDmrsScramblingId;
452 uint8_t numDmrsCdmGrpsNoData;
455 uint8_t nrOfDmrsSymbols;
459 typedef struct pdschFreqAlloc
461 uint8_t resourceAllocType;
462 /* since we are using type-1, rbBitmap excluded */
463 FreqDomainAlloc freqAlloc;
464 uint8_t vrbPrbMapping;
467 typedef struct pdschTimeAlloc
470 TimeDomainAlloc timeAlloc;
473 typedef struct txPowerPdschInfo
475 uint8_t powerControlOffset;
476 uint8_t powerControlOffsetSS;
479 typedef struct pdschCfg
484 uint8_t numCodewords;
485 CodewordInfo codeword[MAX_CODEWORDS];
486 uint16_t dataScramblingId;
488 uint8_t transmissionScheme;
491 PdschFreqAlloc pdschFreqAlloc;
492 PdschTimeAlloc pdschTimeAlloc;
493 BeamformingInfo beamPdschInfo;
494 TxPowerPdschInfo txPdschPower;
496 /* SIB1 PDSCH structures end */
498 /* SIB1 interface structure */
500 typedef struct coresetCfg
503 uint8_t startSymbolIndex;
504 uint8_t durationSymbols;
505 uint8_t freqDomainResource[6];
506 uint8_t cceRegMappingType;
507 uint8_t regBundleSize;
508 uint8_t interleaverSize;
511 uint8_t precoderGranularity;
513 uint8_t aggregationLevel;
516 typedef struct txPowerPdcchInfo
519 uint8_t powerControlOffsetSS;
525 uint16_t scramblingId;
526 uint16_t scramblingRnti;
529 BeamformingInfo beamPdcchInfo;
530 TxPowerPdcchInfo txPdcchPower;
534 typedef struct pdcchCfg
536 /* coreset-0 configuration */
537 CoresetCfg coresetCfg;
540 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
542 /* end of SIB1 PDCCH structures */
546 /* parameters recieved from DU-APP */
548 uint16_t sib1RepetitionPeriod;
549 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
550 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
553 /* parameters derived in scheduler */
556 PdcchCfg sib1PdcchCfg;
557 PdschCfg sib1PdschCfg;
560 typedef struct schRachCfg
562 uint8_t prachCfgIdx; /* PRACH config idx */
563 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
564 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
565 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
566 uint8_t rootSeqLen; /* root sequence length */
567 uint16_t rootSeqIdx; /* Root sequence index */
568 uint8_t numRootSeq; /* Number of root sequences required for FD */
569 uint16_t k1; /* Frequency Offset for each FD */
570 uint8_t ssbPerRach; /* SSB per RACH occassion */
571 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
572 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
573 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
574 uint8_t raRspWindow; /* RA Response Window */
577 typedef struct schBwpParams
579 FreqDomainAlloc freqAlloc;
581 uint8_t cyclicPrefix;
584 typedef struct schCandidatesInfo
593 typedef struct schSearchSpaceCfg
595 uint8_t searchSpaceId;
597 uint16_t monitoringSlot;
599 uint16_t monitoringSymbol;
600 SchCandidatesInfo candidate;
603 typedef struct schPdcchCfgCmn
605 SchSearchSpaceCfg commonSearchSpace;
606 uint8_t raSearchSpaceId;
609 typedef struct schPdschCfgCmn
614 uint8_t lengthSymbol;
617 typedef struct schPucchCfgCmn
619 uint8_t pucchResourceCommon;
620 uint8_t pucchGroupHopping;
623 typedef struct schPuschCfgCmn
628 uint8_t lengthSymbol;
631 typedef struct schBwpDlCfg
634 SchPdcchCfgCmn pdcchCommon;
635 SchPdschCfgCmn pdschCommon;
638 typedef struct schBwpUlCfg
641 SchPucchCfgCmn pucchCommon;
642 SchPuschCfgCmn puschCommon;
645 typedef struct schCellCfg
647 uint16_t cellId; /* Cell Id */
648 uint16_t phyCellId; /* Physical cell id */
649 uint8_t numerology; /* Supported numerology */
650 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
651 uint8_t bandwidth; /* Supported B/W */
652 uint32_t dlFreq; /* DL Frequency */
653 uint32_t ulFreq; /* UL Frequency */
654 SchSsbCfg ssbSchCfg; /* SSB config */
655 SchSib1Cfg sib1SchCfg; /* SIB1 config */
656 SchRachCfg schRachCfg; /* PRACH config */
657 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
658 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
660 TDDCfg tddCfg; /* TDD Cfg */
664 typedef struct schCellCfgCfm
666 uint16_t cellId; /* Cell Id */
670 typedef struct ssbInfo
672 uint8_t ssbIdx; /* SSB Index */
673 TimeDomainAlloc tdAlloc; /* Time domain allocation */
674 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
677 typedef struct sib1AllocInfo
680 PdcchCfg sib1PdcchCfg;
681 PdschCfg sib1PdschCfg;
684 typedef struct prachSchInfo
686 uint8_t numPrachOcas; /* Num Prach Ocassions */
687 uint8_t prachFormat; /* PRACH Format */
688 uint8_t numRa; /* Freq domain ocassion */
689 uint8_t prachStartSymb; /* Freq domain ocassion */
692 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
693 typedef struct dlBrdcstAlloc
695 /* Ssb transmission is determined as follows:
696 * 0 : No tranamission
697 * 1 : SSB Transmission
698 * 2 : SSB Repetition */
700 uint8_t ssbIdxSupported;
701 SsbInfo ssbInfo[MAX_SSB_IDX];
702 /* Sib1 transmission is determined as follows:
703 * 0 : No tranamission
704 * 1 : SIB1 Transmission
705 * 2 : SIB1 Repetition */
707 Sib1AllocInfo sib1Alloc;
710 typedef struct rarInfo
715 FreqDomainAlloc msg3FreqAlloc;
721 typedef struct rarAlloc
725 PdcchCfg rarPdcchCfg;
726 PdschCfg rarPdschCfg;
729 typedef struct dlMsgInfo
737 uint8_t harqFeedbackInd;
740 uint16_t dlMsgPduLen;
744 typedef struct lcSchInfo
747 uint32_t schBytes; /* Number of scheduled bytes */
750 typedef struct dlMsgAlloc
754 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
756 PdcchCfg dlMsgPdcchCfg;
757 PdschCfg dlMsgPdschCfg;
761 typedef struct schSlotValue
763 SlotIndInfo currentTime;
764 SlotIndInfo broadcastTime;
766 SlotIndInfo dlMsgTime;
767 SlotIndInfo ulDciTime;
770 typedef struct format0_0
772 uint8_t resourceAllocType;
773 /* since we are using type-1, hence rbBitmap excluded */
774 FreqDomainAlloc freqAlloc;
775 TimeDomainAlloc timeAlloc;
778 uint8_t harqProcId; /* HARQ Process ID */
781 uint8_t ndi; /* NDI */
782 uint8_t rv; /* Redundancy Version */
787 typedef struct format0_1
793 typedef struct format1_0
799 typedef struct format1_1
804 typedef struct dciInfo
807 uint16_t crnti; /* CRNI */
808 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
809 BwpCfg bwpCfg; /* BWP Cfg */
810 CoresetCfg coresetCfg; /* Coreset1 Cfg */
811 FormatType formatType; /* DCI Format */
814 Format0_0 format0_0; /* Format 0_0 */
815 Format0_1 format0_1; /* Format 0_1 */
816 Format1_0 format1_0; /* Format 1_0 */
817 Format1_1 format1_1; /* Format 1_1 */
823 typedef struct dlSchedInfo
825 uint16_t cellId; /* Cell Id */
826 SchSlotValue schSlotValue;
828 /* Allocation for broadcast messages */
829 bool isBroadcastPres;
830 DlBrdcstAlloc brdcstAlloc;
832 /* Allocation for RAR message */
836 /* Allocation from MSG4 */
837 //Msg4Alloc *msg4Alloc;
839 /* UL grant in response to BSR */
842 /* Allocation from dedicated DL msg */
843 DlMsgAlloc *dlMsgAlloc;
847 typedef struct tbInfo
849 uint8_t qamOrder; /* Modulation Order */
850 uint8_t mcs; /* MCS */
851 SchMcsTable mcsTable; /* MCS Table */
852 uint8_t ndi; /* NDI */
853 uint8_t rv; /* Redundancy Version */
854 uint16_t tbSize; /* TB Size */
857 typedef struct schPuschInfo
860 uint8_t harqProcId; /* HARQ Process ID */
861 uint8_t resAllocType; /* Resource allocation type */
862 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
863 TimeDomainAlloc tdAlloc; /* Time domain allocation */
864 TbInfo tbInfo; /* TB info */
865 uint8_t dmrsMappingType;
866 uint8_t nrOfDmrsSymbols;
870 typedef struct schPucchFormatCfg
872 uint8_t interSlotFreqHop;
880 typedef struct schPucchInfo
884 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
885 TimeDomainAlloc tdAlloc; /* Time domain allocation */
891 uint8_t intraFreqHop;
892 uint16_t secondPrbHop;
893 uint8_t initialCyclicShift;
897 SchPucchFormatCfg cmnFormatCfg;
900 typedef struct ulSchedInfo
902 uint16_t cellId; /* Cell Id */
903 uint16_t crnti; /* CRNI */
904 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
905 uint8_t dataType; /* Type of info being scheduled */
906 PrachSchInfo prachSchInfo; /* Prach scheduling info */
907 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
908 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
911 typedef struct rachIndInfo
915 SlotIndInfo timingInfo;
924 typedef struct crcIndInfo
928 SlotIndInfo timingInfo;
930 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
933 typedef struct boInfo
939 typedef struct dlRlcBOInfo
947 /* Info of Scheduling Request to Add/Modify */
948 typedef struct schSchedReqInfo
951 SchSrProhibitTimer srProhibitTmr;
952 SchSrTransMax srTransMax;
955 /* Scheduling Request Configuration */
956 typedef struct schSchedReqCfg
958 uint8_t addModListCount;
959 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
960 uint8_t relListCount;
961 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
964 /* Info of Tag to Add/Modify */
965 typedef struct schTagInfo
968 SchTimeAlignmentTimer timeAlignmentTmr;
971 /* Timing Advance Group Configuration */
972 typedef struct schTagCfg
974 uint8_t addModListCount;
975 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
976 uint8_t relListCount;
977 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
980 /* Configuration for Power headroom reporting */
981 typedef struct schPhrCfg
983 SchPhrPeriodicTimer periodicTmr;
984 SchPhrProhibitTimer prohibitTmr;
985 SchPhrTxPwrFactorChange txpowerFactorChange;
989 SchPhrModeOtherCG modeOtherCG;
992 /* MAC cell Group configuration */
993 typedef struct schMacCellGrpCfg
995 SchSchedReqCfg schedReqCfg;
997 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
1000 /* Physical Cell Group Configuration */
1001 typedef struct schPhyCellGrpCfg
1003 SchPdschHarqAckCodebook pdschHarqAckCodebook;
1007 /* Control resource set info */
1008 typedef struct schControlRsrcSet
1010 uint8_t cRSetId; /* Control resource set id */
1011 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
1013 SchREGMappingType cceRegMappingType;
1014 SchPrecoderGranul precoderGranularity;
1015 uint16_t dmrsScramblingId;
1018 /* Search Space info */
1019 typedef struct schSearchSpace
1021 uint8_t searchSpaceId;
1023 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
1024 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
1025 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
1026 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
1027 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
1028 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
1029 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
1030 SchSearchSpaceType searchSpaceType;
1031 uint8_t ueSpecificDciFormat;
1034 /* PDCCH cofniguration */
1035 typedef struct schPdcchConfig
1037 uint8_t numCRsetToAddMod;
1038 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
1039 uint8_t numCRsetToRel;
1040 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
1041 uint8_t numSearchSpcToAddMod;
1042 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
1043 uint8_t numSearchSpcToRel;
1044 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
1047 /* PDSCH time domain resource allocation */
1048 typedef struct schPdschTimeDomRsrcAlloc
1050 SchTimeDomRsrcAllocMappingType mappingType;
1051 uint8_t startSymbol;
1052 uint8_t symbolLength;
1053 }SchPdschTimeDomRsrcAlloc;
1056 typedef struct schPdschBundling
1058 struct schStaticBundling
1060 SchBundlingSizeSet2 size;
1062 struct schDynamicBundling
1064 SchBundlingSizeSet1 sizeSet1;
1065 SchBundlingSizeSet2 sizeSet2;
1066 }SchDynamicBundling;
1069 /* DMRS downlink configuration */
1070 typedef struct schDmrsDlCfg
1072 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1075 /* PDSCH Configuration */
1076 typedef struct schPdschConfig
1078 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
1079 SchResourceAllocType resourceAllocType;
1080 uint8_t numTimeDomRsrcAlloc;
1081 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1083 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
1084 SchBundlingType bundlingType;
1085 SchPdschBundling bundlingInfo;
1088 /* Initial Downlink BWP */
1089 typedef struct schInitalDlBwp
1092 SchPdcchConfig pdcchCfg;
1094 SchPdschConfig pdschCfg;
1097 /* BWP Downlink common */
1098 typedef struct schBwpDlCommon
1102 /* Downlink BWP information */
1103 typedef struct schDlBwpInfo
1108 /* PDCCH Serving Cell configuration */
1109 typedef struct schPdschServCellCfg
1111 uint8_t *maxMimoLayers;
1112 SchNumHarqProcForPdsch numHarqProcForPdsch;
1113 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1114 bool *codeBlkGrpFlushInd;
1115 SchPdschXOverhead *xOverhead;
1116 }SchPdschServCellCfg;
1118 /* PUCCH Configuration */
1119 typedef struct schPucchResrcSetInfo
1122 uint8_t resrcListCount;
1123 uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1124 uint8_t maxPayLoadSize;
1125 }SchPucchResrcSetInfo;
1127 typedef struct schPucchResrcSetCfg
1129 uint8_t resrcSetToAddModListCount;
1130 SchPucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1131 uint8_t resrcSetToRelListCount;
1132 uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1133 }SchPucchResrcSetCfg;
1135 typedef struct schPucchFormat0
1137 uint8_t initialCyclicShift;
1139 uint8_t startSymbolIdx;
1142 typedef struct schPucchFormat1
1144 uint8_t initialCyclicShift;
1146 uint8_t startSymbolIdx;
1150 typedef struct schPucchFormat2_3
1154 uint8_t startSymbolIdx;
1157 typedef struct schPucchFormat4
1162 uint8_t startSymbolIdx;
1165 typedef struct schPucchResrcInfo
1169 uint8_t intraFreqHop;
1170 uint16_t secondPrbHop;
1171 uint8_t pucchFormat;
1173 SchPucchFormat0 *format0;
1174 SchPucchFormat1 *format1;
1175 SchPucchFormat2_3 *format2;
1176 SchPucchFormat2_3 *format3;
1177 SchPucchFormat4 *format4;
1181 typedef struct schPucchResrcCfg
1183 uint8_t resrcToAddModListCount;
1184 SchPucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1185 uint8_t resrcToRelListCount;
1186 uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1190 typedef struct schSchedReqResrcInfo
1194 uint8_t periodicity;
1197 }SchSchedReqResrcInfo;
1199 typedef struct schPucchSchedReqCfg
1201 uint8_t schedAddModListCount;
1202 SchSchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1203 uint8_t schedRelListCount;
1204 uint8_t schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1205 }SchPucchSchedReqCfg;
1207 typedef struct schSpatialRelationInfo
1209 uint8_t spatialRelationId;
1210 uint8_t servCellIdx;
1211 uint8_t pathLossRefRSId;
1213 uint8_t closeLoopIdx;
1214 }SchSpatialRelationInfo;
1216 typedef struct schPucchSpatialCfg
1218 uint8_t spatialAddModListCount;
1219 SchSpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1220 uint8_t spatialRelListCount;
1221 uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1222 }SchPucchSpatialCfg;
1224 typedef struct schP0PucchCfg
1230 typedef struct schPathLossRefRSCfg
1232 uint8_t pathLossRefRSId;
1233 }SchPathLossRefRSCfg;
1235 typedef struct schPucchMultiCsiCfg
1237 uint8_t multiCsiResrcListCount;
1238 uint8_t multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1239 }SchPucchMultiCsiCfg;
1241 typedef struct schPucchDlDataToUlAck
1243 uint8_t dlDataToUlAckListCount;
1244 uint8_t dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1245 }SchPucchDlDataToUlAck;
1247 typedef struct schPucchPowerControl
1255 SchP0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1256 uint8_t pathLossRefRSListCount;
1257 SchPathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1258 }SchPucchPowerControl;
1260 typedef struct schPucchCfg
1262 SchPucchResrcSetCfg *resrcSet;
1263 SchPucchResrcCfg *resrc;
1264 SchPucchFormatCfg *format1;
1265 SchPucchFormatCfg *format2;
1266 SchPucchFormatCfg *format3;
1267 SchPucchFormatCfg *format4;
1268 SchPucchSchedReqCfg *schedReq;
1269 SchPucchMultiCsiCfg *multiCsiCfg;
1270 SchPucchSpatialCfg *spatialInfo;
1271 SchPucchDlDataToUlAck *dlDataToUlAck;
1272 SchPucchPowerControl *powerControl;
1275 /* Transform precoding disabled */
1276 typedef struct schTransPrecodDisabled
1278 uint16_t scramblingId0;
1279 }SchTransPrecodDisabled;
1281 /* DMRS Uplink configuration */
1282 typedef struct SchDmrsUlCfg
1284 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1285 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1288 /* PUSCH Time Domain Resource Allocation */
1289 typedef struct schPuschTimeDomRsrcAlloc
1292 SchTimeDomRsrcAllocMappingType mappingType;
1293 uint8_t startSymbol;
1294 uint8_t symbolLength;
1295 }SchPuschTimeDomRsrcAlloc;
1297 /* PUSCH Configuration */
1298 typedef struct schPuschCfg
1300 uint8_t dataScramblingId;
1301 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1302 SchResourceAllocType resourceAllocType;
1303 uint8_t numTimeDomRsrcAlloc;
1304 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1305 SchTransformPrecoder transformPrecoder;
1308 /* Initial Uplink BWP */
1309 typedef struct schInitialUlBwp
1312 SchPucchCfg pucchCfg;
1314 SchPuschCfg puschCfg;
1317 /* Uplink BWP information */
1318 typedef struct schUlBwpInfo
1323 /* Serving cell configuration */
1324 typedef struct schServCellCfgInfo
1326 SchInitalDlBwp initDlBwp;
1327 uint8_t numDlBwpToAdd;
1328 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1329 uint8_t firstActvDlBwpId;
1330 uint8_t defaultDlBwpId;
1331 uint8_t *bwpInactivityTmr;
1332 SchPdschServCellCfg pdschServCellCfg;
1333 SchInitialUlBwp initUlBwp;
1334 uint8_t numUlBwpToAdd;
1335 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1336 uint8_t firstActvUlBwpId;
1337 }SchServCellCfgInfo;
1339 typedef struct schNonDynFiveQi
1344 uint16_t maxDataBurstVol;
1347 typedef struct schDynFiveQi
1350 uint16_t packetDelayBudget;
1351 uint8_t packetErrRateScalar;
1352 uint8_t packetErrRateExp;
1354 uint8_t delayCritical;
1356 uint16_t maxDataBurstVol;
1359 typedef struct schNgRanAllocAndRetPri
1361 uint8_t priorityLevel;
1362 uint8_t preEmptionCap;
1363 uint8_t preEmptionVul;
1364 }SchNgRanAllocAndRetPri;
1366 typedef struct schGrbQosFlowInfo
1368 uint32_t maxFlowBitRateDl;
1369 uint32_t maxFlowBitRateUl;
1370 uint32_t guarFlowBitRateDl;
1371 uint32_t guarFlowBitRateUl;
1375 typedef struct schDrbQos
1377 SchQosType fiveQiType; /* Dynamic or non-dynamic */
1380 SchNonDynFiveQi nonDyn5Qi;
1381 SchDynFiveQi dyn5Qi;
1383 SchNgRanAllocAndRetPri ngRanRetPri;
1384 SchGrbQosFlowInfo grbQosFlowInfo;
1385 uint16_t pduSessionId;
1386 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1389 typedef struct schSnssai
1392 uint8_t sd[SD_SIZE];
1395 /* Special cell configuration */
1396 typedef struct schSpCellCfg
1398 uint8_t servCellIdx;
1399 SchServCellCfgInfo servCellCfg;
1402 /* Uplink logical channel configuration */
1403 typedef struct SchUlLcCfg
1408 uint8_t pbr; // prioritisedBitRate
1409 uint8_t bsd; // bucketSizeDuration
1412 /* Downlink logical channel configuration */
1413 typedef struct schDlLcCfg
1415 uint8_t lcp; // logical Channel Prioritization
1418 /* Logical Channel configuration */
1419 typedef struct schLcCfg
1421 ConfigType configType;
1423 SchDrbQosInfo *drbQos;
1429 /* Aggregate max bit rate */
1430 typedef struct schAmbrCfg
1432 uint32_t ulBr; /* Ul BitRate */
1435 typedef struct schModulationInfo
1439 SchMcsTable mcsTable;
1442 /* UE configuration */
1443 typedef struct schUeCfg
1447 bool macCellGrpCfgPres;
1448 SchMacCellGrpCfg macCellGrpCfg;
1449 bool phyCellGrpCfgPres;
1450 SchPhyCellGrpCfg phyCellGrpCfg;
1452 SchSpCellCfg spCellCfg;
1453 SchAmbrCfg *ambrCfg;
1454 SchModulationInfo dlModInfo;
1455 SchModulationInfo ulModInfo;
1457 SchLcCfg schLcCfg[MAX_NUM_LC];
1460 typedef struct schUeCfgRsp
1466 SchFailureCause cause;
1469 typedef struct schUeDelete
1475 typedef struct schUeDeleteRsp
1483 typedef struct schCellDelete
1489 typedef struct schCellDeleteRsp
1495 typedef struct dataVolInfo
1501 typedef struct ulBufferStatusRptInd
1507 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1508 }UlBufferStatusRptInd;
1510 typedef struct srUciIndInfo
1514 SlotIndInfo slotInd;
1516 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1519 /* function pointers */
1521 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1522 Pst *pst, /* Post Structure */
1523 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1526 typedef uint8_t (*SchCellCfgFunc) ARGS((
1527 Pst *pst, /* Post Structure */
1528 SchCellCfg *schCellCfg /* Cell Cfg */
1531 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1532 Pst *pst, /* Post Structure */
1533 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1536 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1537 Pst *pst, /* Post Structure */
1538 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1541 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1542 Pst *pst, /* Post structure */
1543 RachIndInfo *rachInd)); /* Rach Indication Info */
1545 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1546 Pst *pst, /* Post structure */
1547 CrcIndInfo *crcInd)); /* CRC Info */
1549 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1550 Pst *pst, /* Post structure */
1551 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1553 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1554 Pst *pst, /* Post structure */
1555 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1557 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1558 Pst *pst, /* Post structure */
1559 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1561 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1562 Pst *pst, /* Post structure */
1563 SlotIndInfo *slotInd)); /* Slot Info */
1565 typedef uint8_t (*MacSchBsrFunc) ARGS((
1567 UlBufferStatusRptInd *bsrInd
1570 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1571 Pst *pst, /* Post structure */
1572 SrUciIndInfo *uciInd)); /* UCI IND Info */
1574 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1575 Pst *pst, /* Post structure */
1576 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1578 typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
1579 Pst *pst, /* Post structure */
1580 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1582 typedef uint8_t (*MacSchUeDeleteReqFunc) ARGS((
1583 Pst *pst, /* Post structure */
1584 SchUeDelete *schUeDel)); /*Scheduler UE Del*/
1586 typedef uint8_t (*SchUeDeleteRspFunc) ARGS((
1587 Pst *pst, /* Post structure */
1588 SchUeDeleteRsp *delRsp)); /* Scheduler UE delete response */
1590 typedef uint8_t (*MacSchCellDeleteReqFunc) ARGS((
1591 Pst *pst, /* Post structure */
1592 SchCellDelete *schCellDelete)); /*Scheduler UE Del*/
1594 typedef uint8_t (*SchCellDeleteRspFunc) ARGS((
1595 Pst *pst, /* Post structure */
1596 SchCellDeleteRsp *schCellDeleteRsp)); /* Scheduler UE delete response */
1598 /* function declarations */
1599 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1600 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1601 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1602 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1603 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1604 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1605 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1606 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1607 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1608 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1609 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
1610 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1611 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1612 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1613 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1614 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1615 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1616 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1617 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1618 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1619 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1620 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1621 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1622 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1623 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1624 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1625 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1626 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1627 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1628 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1629 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1630 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1631 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1632 uint8_t packMacSchUeDeleteReq(Pst *pst, SchUeDelete *schUeDel);
1633 uint8_t MacSchUeDeleteReq(Pst *pst, SchUeDelete *ueDelete);
1634 uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *delRsp);
1635 uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp);
1636 uint8_t packMacSchCellDeleteReq(Pst *pst, SchCellDelete *schCellDelete);
1637 uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDelete *schCellDelete);
1638 uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
1639 uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
1641 /**********************************************************************
1643 **********************************************************************/