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 RAR_PAYLOAD_SIZE 10 /* As per spec 38.321, sections 6.1.5 and 6.2.3, RAR PDU is 8 bytes long and 2 bytes of padding */
96 #define TX_PAYLOAD_HDR_LEN 32 /* Intel L1 requires adding a 32 byte header to transmitted payload */
99 #define ADD_DELTA_TO_TIME(crntTime, toFill, incr) \
101 if ((crntTime.slot + incr) > (MAX_SLOTS - 1)) \
103 toFill.sfn = (crntTime.sfn + 1); \
107 toFill.sfn = crntTime.sfn; \
109 toFill.slot = (crntTime.slot + incr) % MAX_SLOTS; \
110 if (toFill.sfn >= MAX_SFN) \
112 toFill.sfn%=MAX_SFN; \
120 RESOURCE_UNAVAILABLE,
157 TIME_ALIGNMENT_TIMER_MS500,
158 TIME_ALIGNMENT_TIMER_MS750,
159 TIME_ALIGNMENT_TIMER_MS1280,
160 TIME_ALIGNMENT_TIMER_MS1920,
161 TIME_ALIGNMENT_TIMER_MS2560,
162 TIME_ALIGNMENT_TIMER_MS5120,
163 TIME_ALIGNMENT_TIMER_MS10240,
164 TIME_ALIGNMENT_TIMER_INFINITE
165 }SchTimeAlignmentTimer;
169 PHR_PERIODIC_TIMER_SF10,
170 PHR_PERIODIC_TIMER_SF20,
171 PHR_PERIODIC_TIMER_SF50,
172 PHR_PERIODIC_TIMER_SF100,
173 PHR_PERIODIC_TIMER_SF200,
174 PHR_PERIODIC_TIMER_SF500,
175 PHR_PERIODIC_TIMER_SF1000,
176 PHR_PERIODIC_TIMER_INFINITE
177 }SchPhrPeriodicTimer;
181 PHR_PROHIBIT_TIMER_SF0,
182 PHR_PROHIBIT_TIMER_SF10,
183 PHR_PROHIBIT_TIMER_SF20,
184 PHR_PROHIBIT_TIMER_SF50,
185 PHR_PROHIBIT_TIMER_SF100,
186 PHR_PROHIBIT_TIMER_SF200,
187 PHR_PROHIBIT_TIMER_SF500,
188 PHR_PROHIBIT_TIMER_SF1000
189 }SchPhrProhibitTimer;
193 PHR_TX_PWR_FACTOR_CHANGE_DB1,
194 PHR_TX_PWR_FACTOR_CHANGE_DB3,
195 PHR_TX_PWR_FACTOR_CHANGE_DB6,
196 PHR_TX_PWR_FACTOR_CHANGE_INFINITE
197 }SchPhrTxPwrFactorChange;
207 HARQ_ACK_CODEBOOK_SEMISTATIC,
208 HARQ_ACK_CODEBOOK_DYNAMIC
209 }SchPdschHarqAckCodebook;
213 NUM_HARQ_PROC_FOR_PDSCH_N2,
214 NUM_HARQ_PROC_FOR_PDSCH_N4,
215 NUM_HARQ_PROC_FOR_PDSCH_N6,
216 NUM_HARQ_PROC_FOR_PDSCH_N10,
217 NUM_HARQ_PROC_FOR_PDSCH_N16
218 }SchNumHarqProcForPdsch;
222 MAX_CODE_BLOCK_GROUP_PER_TB_N2,
223 MAX_CODE_BLOCK_GROUP_PER_TB_N4,
224 MAX_CODE_BLOCK_GROUP_PER_TB_N6,
225 MAX_CODE_BLOCK_GROUP_PER_TB_N8
226 }SchMaxCodeBlkGrpPerTB;
230 PDSCH_X_OVERHEAD_XOH_6,
231 PDSCH_X_OVERHEAD_XOH_12,
232 PDSCH_X_OVERHEAD_XOH_18
237 DMRS_ADDITIONAL_POS0,
238 DMRS_ADDITIONAL_POS1,
240 }SchDmrsAdditionPosition;
244 RESOURCE_ALLOCTION_TYPE_0,
245 RESOURCE_ALLOCTION_TYPE_1,
246 RESOURCE_ALLOCTION_DYN_SWITCH
247 }SchResourceAllocType;
251 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_A,
252 TIME_DOMAIN_RSRC_ALLOC_MAPPING_TYPE_B
253 }SchTimeDomRsrcAllocMappingType;
257 ENABLED_TRANSFORM_PRECODER,
258 DISABLED_TRANSFORM_PRECODER
259 }SchTransformPrecoder;
263 INTERLEAVED_CCE_REG_MAPPING = 1,
264 NONINTERLEAVED_CCE_REG_MAPPING
269 SLOT_PERIODICITY_AND_OFFSET_SL_1 = 1,
270 SLOT_PERIODICITY_AND_OFFSET_SL_2,
271 SLOT_PERIODICITY_AND_OFFSET_SL_4,
272 SLOT_PERIODICITY_AND_OFFSET_SL_5,
273 SLOT_PERIODICITY_AND_OFFSET_SL_8,
274 SLOT_PERIODICITY_AND_OFFSET_SL_10,
275 SLOT_PERIODICITY_AND_OFFSET_SL_16,
276 SLOT_PERIODICITY_AND_OFFSET_SL_20,
277 SLOT_PERIODICITY_AND_OFFSET_SL_40,
278 SLOT_PERIODICITY_AND_OFFSET_SL_80,
279 SLOT_PERIODICITY_AND_OFFSET_SL_160,
280 SLOT_PERIODICITY_AND_OFFSET_SL_320,
281 SLOT_PERIODICITY_AND_OFFSET_SL_640,
282 SLOT_PERIODICITY_AND_OFFSET_SL_1280,
283 SLOT_PERIODICITY_AND_OFFSET_SL_2560
284 }SchMSlotPeriodAndOffset;
294 SEARCH_SPACE_TYPE_COMMON = 1,
295 SEARCH_SPACE_TYPE_UE_SPECIFIC
300 SCH_QOS_NON_DYNAMIC = 1,
306 AGGREGATION_LEVEL_N0,
307 AGGREGATION_LEVEL_N1,
308 AGGREGATION_LEVEL_N2,
309 AGGREGATION_LEVEL_N3,
310 AGGREGATION_LEVEL_N4,
311 AGGREGATION_LEVEL_N5,
312 AGGREGATION_LEVEL_N6,
324 CODE_WORDS_SCHED_BY_DCI_N1,
325 CODE_WORDS_SCHED_BY_DCI_N2
326 }SchCodeWordsSchedByDci;
330 STATIC_BUNDLING_TYPE = 1,
331 DYNAMIC_BUNDLING_TYPE
337 SCH_SET1_SIZE_WIDEBAND,
338 SCH_SET1_SIZE_N2_WIDEBAND,
339 SCH_SET1_SIZE_N4_WIDEBAND
340 }SchBundlingSizeSet1;
345 SCH_SET2_SIZE_WIDEBAND
346 }SchBundlingSizeSet2;
388 SCH_MCS_TABLE_QAM_64,
389 SCH_MCS_TABLE_QAM_256,
390 SCH_MCS_TABLE_QAM_64_LOW_SE
394 typedef struct timeDomainAlloc
400 typedef struct freqDomainAlloc
409 uint32_t ssbPbchPwr; /* SSB block power */
410 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
411 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
412 SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
413 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
414 uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
417 typedef struct bwpCfg
419 uint8_t subcarrierSpacing;
420 uint8_t cyclicPrefix;
421 FreqDomainAlloc freqAlloc;
427 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
430 typedef struct beamformingInfo
434 uint8_t digBfInterfaces;
435 Prg prg[MAX_NUM_PRG];
438 /* SIB1 PDSCH structures */
440 typedef struct codewordinfo
442 uint16_t targetCodeRate;
450 typedef struct dmrsInfo
452 uint16_t dlDmrsSymbPos;
453 uint8_t dmrsConfigType;
454 uint16_t dlDmrsScramblingId;
456 uint8_t numDmrsCdmGrpsNoData;
459 uint8_t nrOfDmrsSymbols;
463 typedef struct pdschFreqAlloc
465 uint8_t resourceAllocType;
466 /* since we are using type-1, rbBitmap excluded */
467 FreqDomainAlloc freqAlloc;
468 uint8_t vrbPrbMapping;
471 typedef struct pdschTimeAlloc
474 TimeDomainAlloc timeAlloc;
477 typedef struct txPowerPdschInfo
479 uint8_t powerControlOffset;
480 uint8_t powerControlOffsetSS;
483 typedef struct pdschCfg
488 uint8_t numCodewords;
489 CodewordInfo codeword[MAX_CODEWORDS];
490 uint16_t dataScramblingId;
492 uint8_t transmissionScheme;
495 PdschFreqAlloc pdschFreqAlloc;
496 PdschTimeAlloc pdschTimeAlloc;
497 BeamformingInfo beamPdschInfo;
498 TxPowerPdschInfo txPdschPower;
500 /* SIB1 PDSCH structures end */
502 /* SIB1 interface structure */
504 typedef struct coresetCfg
507 uint8_t startSymbolIndex;
508 uint8_t durationSymbols;
509 uint8_t freqDomainResource[6];
510 uint8_t cceRegMappingType;
511 uint8_t regBundleSize;
512 uint8_t interleaverSize;
515 uint8_t precoderGranularity;
517 uint8_t aggregationLevel;
520 typedef struct txPowerPdcchInfo
523 uint8_t powerControlOffsetSS;
529 uint16_t scramblingId;
530 uint16_t scramblingRnti;
533 BeamformingInfo beamPdcchInfo;
534 TxPowerPdcchInfo txPdcchPower;
538 typedef struct pdcchCfg
540 /* coreset-0 configuration */
541 CoresetCfg coresetCfg;
544 DlDCI dci; /* as of now its only one DCI, later it will be numDlCi */
546 /* end of SIB1 PDCCH structures */
550 /* parameters recieved from DU-APP */
552 uint16_t sib1RepetitionPeriod;
553 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
554 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
557 /* parameters derived in scheduler */
560 PdcchCfg sib1PdcchCfg;
561 PdschCfg sib1PdschCfg;
564 typedef struct schRachCfg
566 uint8_t prachCfgIdx; /* PRACH config idx */
567 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
568 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
569 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
570 uint8_t rootSeqLen; /* root sequence length */
571 uint16_t rootSeqIdx; /* Root sequence index */
572 uint8_t numRootSeq; /* Number of root sequences required for FD */
573 uint16_t k1; /* Frequency Offset for each FD */
574 uint8_t ssbPerRach; /* SSB per RACH occassion */
575 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
576 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
577 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
578 uint8_t raRspWindow; /* RA Response Window */
581 typedef struct schBwpParams
583 FreqDomainAlloc freqAlloc;
585 uint8_t cyclicPrefix;
588 typedef struct schCandidatesInfo
597 typedef struct schSearchSpaceCfg
599 uint8_t searchSpaceId;
601 uint16_t monitoringSlot;
603 uint16_t monitoringSymbol;
604 SchCandidatesInfo candidate;
607 typedef struct schPdcchCfgCmn
609 SchSearchSpaceCfg commonSearchSpace;
610 uint8_t raSearchSpaceId;
613 typedef struct schPdschCfgCmn
618 uint8_t lengthSymbol;
621 typedef struct schPucchCfgCmn
623 uint8_t pucchResourceCommon;
624 uint8_t pucchGroupHopping;
627 typedef struct schPuschCfgCmn
632 uint8_t lengthSymbol;
635 typedef struct schBwpDlCfg
638 SchPdcchCfgCmn pdcchCommon;
639 SchPdschCfgCmn pdschCommon;
642 typedef struct schBwpUlCfg
645 SchPucchCfgCmn pucchCommon;
646 SchPuschCfgCmn puschCommon;
649 typedef struct schCellCfg
651 uint16_t cellId; /* Cell Id */
652 uint16_t phyCellId; /* Physical cell id */
653 uint8_t numerology; /* Supported numerology */
654 SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
655 uint8_t bandwidth; /* Supported B/W */
656 uint32_t dlFreq; /* DL Frequency */
657 uint32_t ulFreq; /* UL Frequency */
658 SchSsbCfg ssbSchCfg; /* SSB config */
659 SchSib1Cfg sib1SchCfg; /* SIB1 config */
660 SchRachCfg schRachCfg; /* PRACH config */
661 SchBwpDlCfg schInitialDlBwp; /* Initial DL BWP */
662 SchBwpUlCfg schInitialUlBwp; /* Initial UL BWP */
664 TDDCfg tddCfg; /* TDD Cfg */
668 typedef struct schCellCfgCfm
670 uint16_t cellId; /* Cell Id */
674 typedef struct ssbInfo
676 uint8_t ssbIdx; /* SSB Index */
677 TimeDomainAlloc tdAlloc; /* Time domain allocation */
678 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
681 typedef struct sib1AllocInfo
684 PdcchCfg sib1PdcchCfg;
685 PdschCfg sib1PdschCfg;
688 typedef struct prachSchInfo
690 uint8_t numPrachOcas; /* Num Prach Ocassions */
691 uint8_t prachFormat; /* PRACH Format */
692 uint8_t numRa; /* Freq domain ocassion */
693 uint8_t prachStartSymb; /* Freq domain ocassion */
696 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
697 typedef struct dlBrdcstAlloc
699 /* Ssb transmission is determined as follows:
700 * 0 : No tranamission
701 * 1 : SSB Transmission
702 * 2 : SSB Repetition */
704 uint8_t ssbIdxSupported;
705 SsbInfo ssbInfo[MAX_SSB_IDX];
706 /* Sib1 transmission is determined as follows:
707 * 0 : No tranamission
708 * 1 : SIB1 Transmission
709 * 2 : SIB1 Repetition */
711 Sib1AllocInfo sib1Alloc;
714 typedef struct rarInfo
719 FreqDomainAlloc msg3FreqAlloc;
721 uint8_t rarPdu[RAR_PAYLOAD_SIZE];
725 typedef struct rarAlloc
729 PdcchCfg rarPdcchCfg;
730 PdschCfg rarPdschCfg;
733 typedef struct dlMsgInfo
741 uint8_t harqFeedbackInd;
744 uint16_t dlMsgPduLen;
748 typedef struct lcSchInfo
751 uint32_t schBytes; /* Number of scheduled bytes */
754 typedef struct dlMsgAlloc
758 LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
760 PdcchCfg dlMsgPdcchCfg;
761 PdschCfg dlMsgPdschCfg;
765 typedef struct schSlotValue
767 SlotIndInfo currentTime;
768 SlotIndInfo broadcastTime;
770 SlotIndInfo dlMsgTime;
771 SlotIndInfo ulDciTime;
774 typedef struct format0_0
776 uint8_t resourceAllocType;
777 /* since we are using type-1, hence rbBitmap excluded */
778 FreqDomainAlloc freqAlloc;
779 TimeDomainAlloc timeAlloc;
782 uint8_t harqProcId; /* HARQ Process ID */
785 uint8_t ndi; /* NDI */
786 uint8_t rv; /* Redundancy Version */
791 typedef struct format0_1
797 typedef struct format1_0
803 typedef struct format1_1
808 typedef struct dciInfo
811 uint16_t crnti; /* CRNI */
812 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
813 BwpCfg bwpCfg; /* BWP Cfg */
814 CoresetCfg coresetCfg; /* Coreset1 Cfg */
815 FormatType formatType; /* DCI Format */
818 Format0_0 format0_0; /* Format 0_0 */
819 Format0_1 format0_1; /* Format 0_1 */
820 Format1_0 format1_0; /* Format 1_0 */
821 Format1_1 format1_1; /* Format 1_1 */
827 typedef struct dlSchedInfo
829 uint16_t cellId; /* Cell Id */
830 SchSlotValue schSlotValue;
832 /* Allocation for broadcast messages */
833 bool isBroadcastPres;
834 DlBrdcstAlloc brdcstAlloc;
836 /* Allocation for RAR message */
840 /* Allocation from MSG4 */
841 //Msg4Alloc *msg4Alloc;
843 /* UL grant in response to BSR */
846 /* Allocation from dedicated DL msg */
847 DlMsgAlloc *dlMsgAlloc;
851 typedef struct tbInfo
853 uint8_t qamOrder; /* Modulation Order */
854 uint8_t mcs; /* MCS */
855 SchMcsTable mcsTable; /* MCS Table */
856 uint8_t ndi; /* NDI */
857 uint8_t rv; /* Redundancy Version */
858 uint16_t tbSize; /* TB Size */
861 typedef struct schPuschInfo
864 uint8_t harqProcId; /* HARQ Process ID */
865 uint8_t resAllocType; /* Resource allocation type */
866 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
867 TimeDomainAlloc tdAlloc; /* Time domain allocation */
868 TbInfo tbInfo; /* TB info */
869 uint8_t dmrsMappingType;
870 uint8_t nrOfDmrsSymbols;
874 typedef struct schPucchFormatCfg
876 uint8_t interSlotFreqHop;
884 typedef struct schPucchInfo
888 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
889 TimeDomainAlloc tdAlloc; /* Time domain allocation */
895 uint8_t intraFreqHop;
896 uint16_t secondPrbHop;
897 uint8_t initialCyclicShift;
901 SchPucchFormatCfg cmnFormatCfg;
904 typedef struct ulSchedInfo
906 uint16_t cellId; /* Cell Id */
907 uint16_t crnti; /* CRNI */
908 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
909 uint8_t dataType; /* Type of info being scheduled */
910 PrachSchInfo prachSchInfo; /* Prach scheduling info */
911 SchPuschInfo schPuschInfo; /* Pusch scheduling info */
912 SchPucchInfo schPucchInfo; /* Pusch scheduling info */
915 typedef struct rachIndInfo
919 SlotIndInfo timingInfo;
928 typedef struct crcIndInfo
932 SlotIndInfo timingInfo;
934 uint8_t crcInd[MAX_NUMBER_OF_CRC_IND_BITS];
937 typedef struct boInfo
943 typedef struct dlRlcBOInfo
951 /* Info of Scheduling Request to Add/Modify */
952 typedef struct schSchedReqInfo
955 SchSrProhibitTimer srProhibitTmr;
956 SchSrTransMax srTransMax;
959 /* Scheduling Request Configuration */
960 typedef struct schSchedReqCfg
962 uint8_t addModListCount;
963 SchSchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
964 uint8_t relListCount;
965 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
968 /* Info of Tag to Add/Modify */
969 typedef struct schTagInfo
972 SchTimeAlignmentTimer timeAlignmentTmr;
975 /* Timing Advance Group Configuration */
976 typedef struct schTagCfg
978 uint8_t addModListCount;
979 SchTagInfo addModList[MAX_NUM_TAGS]; /* List of Tag to Add/Modify */
980 uint8_t relListCount;
981 uint8_t relList[MAX_NUM_TAGS]; /* list of Tag Id to release */
984 /* Configuration for Power headroom reporting */
985 typedef struct schPhrCfg
987 SchPhrPeriodicTimer periodicTmr;
988 SchPhrProhibitTimer prohibitTmr;
989 SchPhrTxPwrFactorChange txpowerFactorChange;
993 SchPhrModeOtherCG modeOtherCG;
996 /* MAC cell Group configuration */
997 typedef struct schMacCellGrpCfg
999 SchSchedReqCfg schedReqCfg;
1001 SchPhrCfg phrCfg; /* To be used only if phrCfgSetupPres is true */
1004 /* Physical Cell Group Configuration */
1005 typedef struct schPhyCellGrpCfg
1007 SchPdschHarqAckCodebook pdschHarqAckCodebook;
1011 /* Control resource set info */
1012 typedef struct schControlRsrcSet
1014 uint8_t cRSetId; /* Control resource set id */
1015 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
1017 SchREGMappingType cceRegMappingType;
1018 SchPrecoderGranul precoderGranularity;
1019 uint16_t dmrsScramblingId;
1022 /* Search Space info */
1023 typedef struct schSearchSpace
1025 uint8_t searchSpaceId;
1027 SchMSlotPeriodAndOffset mSlotPeriodicityAndOffset;
1028 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
1029 SchAggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
1030 SchAggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
1031 SchAggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
1032 SchAggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
1033 SchAggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
1034 SchSearchSpaceType searchSpaceType;
1035 uint8_t ueSpecificDciFormat;
1038 /* PDCCH cofniguration */
1039 typedef struct schPdcchConfig
1041 uint8_t numCRsetToAddMod;
1042 SchControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
1043 uint8_t numCRsetToRel;
1044 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
1045 uint8_t numSearchSpcToAddMod;
1046 SchSearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
1047 uint8_t numSearchSpcToRel;
1048 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
1051 /* PDSCH time domain resource allocation */
1052 typedef struct schPdschTimeDomRsrcAlloc
1054 SchTimeDomRsrcAllocMappingType mappingType;
1055 uint8_t startSymbol;
1056 uint8_t symbolLength;
1057 }SchPdschTimeDomRsrcAlloc;
1060 typedef struct schPdschBundling
1062 struct schStaticBundling
1064 SchBundlingSizeSet2 size;
1066 struct schDynamicBundling
1068 SchBundlingSizeSet1 sizeSet1;
1069 SchBundlingSizeSet2 sizeSet2;
1070 }SchDynamicBundling;
1073 /* DMRS downlink configuration */
1074 typedef struct schDmrsDlCfg
1076 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1079 /* PDSCH Configuration */
1080 typedef struct schPdschConfig
1082 SchDmrsDlCfg dmrsDlCfgForPdschMapTypeA;
1083 SchResourceAllocType resourceAllocType;
1084 uint8_t numTimeDomRsrcAlloc;
1085 SchPdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
1087 SchCodeWordsSchedByDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
1088 SchBundlingType bundlingType;
1089 SchPdschBundling bundlingInfo;
1092 /* Initial Downlink BWP */
1093 typedef struct schInitalDlBwp
1096 SchPdcchConfig pdcchCfg;
1098 SchPdschConfig pdschCfg;
1101 /* BWP Downlink common */
1102 typedef struct schBwpDlCommon
1106 /* Downlink BWP information */
1107 typedef struct schDlBwpInfo
1112 /* PDCCH Serving Cell configuration */
1113 typedef struct schPdschServCellCfg
1115 uint8_t *maxMimoLayers;
1116 SchNumHarqProcForPdsch numHarqProcForPdsch;
1117 SchMaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
1118 bool *codeBlkGrpFlushInd;
1119 SchPdschXOverhead *xOverhead;
1120 }SchPdschServCellCfg;
1122 /* PUCCH Configuration */
1123 typedef struct schPucchResrcSetInfo
1126 uint8_t resrcListCount;
1127 uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
1128 uint8_t maxPayLoadSize;
1129 }SchPucchResrcSetInfo;
1131 typedef struct schPucchResrcSetCfg
1133 uint8_t resrcSetToAddModListCount;
1134 SchPucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
1135 uint8_t resrcSetToRelListCount;
1136 uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
1137 }SchPucchResrcSetCfg;
1139 typedef struct schPucchFormat0
1141 uint8_t initialCyclicShift;
1143 uint8_t startSymbolIdx;
1146 typedef struct schPucchFormat1
1148 uint8_t initialCyclicShift;
1150 uint8_t startSymbolIdx;
1154 typedef struct schPucchFormat2_3
1158 uint8_t startSymbolIdx;
1161 typedef struct schPucchFormat4
1166 uint8_t startSymbolIdx;
1169 typedef struct schPucchResrcInfo
1173 uint8_t intraFreqHop;
1174 uint16_t secondPrbHop;
1175 uint8_t pucchFormat;
1177 SchPucchFormat0 *format0;
1178 SchPucchFormat1 *format1;
1179 SchPucchFormat2_3 *format2;
1180 SchPucchFormat2_3 *format3;
1181 SchPucchFormat4 *format4;
1185 typedef struct schPucchResrcCfg
1187 uint8_t resrcToAddModListCount;
1188 SchPucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
1189 uint8_t resrcToRelListCount;
1190 uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
1194 typedef struct schSchedReqResrcInfo
1198 uint8_t periodicity;
1201 }SchSchedReqResrcInfo;
1203 typedef struct schPucchSchedReqCfg
1205 uint8_t schedAddModListCount;
1206 SchSchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1207 uint8_t schedRelListCount;
1208 uint8_t schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1209 }SchPucchSchedReqCfg;
1211 typedef struct schSpatialRelationInfo
1213 uint8_t spatialRelationId;
1214 uint8_t servCellIdx;
1215 uint8_t pathLossRefRSId;
1217 uint8_t closeLoopIdx;
1218 }SchSpatialRelationInfo;
1220 typedef struct schPucchSpatialCfg
1222 uint8_t spatialAddModListCount;
1223 SchSpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1224 uint8_t spatialRelListCount;
1225 uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1226 }SchPucchSpatialCfg;
1228 typedef struct schP0PucchCfg
1234 typedef struct schPathLossRefRSCfg
1236 uint8_t pathLossRefRSId;
1237 }SchPathLossRefRSCfg;
1239 typedef struct schPucchMultiCsiCfg
1241 uint8_t multiCsiResrcListCount;
1242 uint8_t multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1243 }SchPucchMultiCsiCfg;
1245 typedef struct schPucchDlDataToUlAck
1247 uint8_t dlDataToUlAckListCount;
1248 uint8_t dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1249 }SchPucchDlDataToUlAck;
1251 typedef struct schPucchPowerControl
1259 SchP0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1260 uint8_t pathLossRefRSListCount;
1261 SchPathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1262 }SchPucchPowerControl;
1264 typedef struct schPucchCfg
1266 SchPucchResrcSetCfg *resrcSet;
1267 SchPucchResrcCfg *resrc;
1268 SchPucchFormatCfg *format1;
1269 SchPucchFormatCfg *format2;
1270 SchPucchFormatCfg *format3;
1271 SchPucchFormatCfg *format4;
1272 SchPucchSchedReqCfg *schedReq;
1273 SchPucchMultiCsiCfg *multiCsiCfg;
1274 SchPucchSpatialCfg *spatialInfo;
1275 SchPucchDlDataToUlAck *dlDataToUlAck;
1276 SchPucchPowerControl *powerControl;
1279 /* Transform precoding disabled */
1280 typedef struct schTransPrecodDisabled
1282 uint16_t scramblingId0;
1283 }SchTransPrecodDisabled;
1285 /* DMRS Uplink configuration */
1286 typedef struct SchDmrsUlCfg
1288 SchDmrsAdditionPosition addPos; /* DMRS additional position */
1289 SchTransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1292 /* PUSCH Time Domain Resource Allocation */
1293 typedef struct schPuschTimeDomRsrcAlloc
1296 SchTimeDomRsrcAllocMappingType mappingType;
1297 uint8_t startSymbol;
1298 uint8_t symbolLength;
1299 }SchPuschTimeDomRsrcAlloc;
1301 /* PUSCH Configuration */
1302 typedef struct schPuschCfg
1304 uint8_t dataScramblingId;
1305 SchDmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1306 SchResourceAllocType resourceAllocType;
1307 uint8_t numTimeDomRsrcAlloc;
1308 SchPuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1309 SchTransformPrecoder transformPrecoder;
1312 /* Initial Uplink BWP */
1313 typedef struct schInitialUlBwp
1316 SchPucchCfg pucchCfg;
1318 SchPuschCfg puschCfg;
1321 /* Uplink BWP information */
1322 typedef struct schUlBwpInfo
1327 /* Serving cell configuration */
1328 typedef struct schServCellCfgInfo
1330 SchInitalDlBwp initDlBwp;
1331 uint8_t numDlBwpToAdd;
1332 SchDlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1333 uint8_t firstActvDlBwpId;
1334 uint8_t defaultDlBwpId;
1335 uint8_t *bwpInactivityTmr;
1336 SchPdschServCellCfg pdschServCellCfg;
1337 SchInitialUlBwp initUlBwp;
1338 uint8_t numUlBwpToAdd;
1339 SchUlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1340 uint8_t firstActvUlBwpId;
1341 }SchServCellCfgInfo;
1343 typedef struct schNonDynFiveQi
1348 uint16_t maxDataBurstVol;
1351 typedef struct schDynFiveQi
1354 uint16_t packetDelayBudget;
1355 uint8_t packetErrRateScalar;
1356 uint8_t packetErrRateExp;
1358 uint8_t delayCritical;
1360 uint16_t maxDataBurstVol;
1363 typedef struct schNgRanAllocAndRetPri
1365 uint8_t priorityLevel;
1366 uint8_t preEmptionCap;
1367 uint8_t preEmptionVul;
1368 }SchNgRanAllocAndRetPri;
1370 typedef struct schGrbQosFlowInfo
1372 uint32_t maxFlowBitRateDl;
1373 uint32_t maxFlowBitRateUl;
1374 uint32_t guarFlowBitRateDl;
1375 uint32_t guarFlowBitRateUl;
1379 typedef struct schDrbQos
1381 SchQosType fiveQiType; /* Dynamic or non-dynamic */
1384 SchNonDynFiveQi nonDyn5Qi;
1385 SchDynFiveQi dyn5Qi;
1387 SchNgRanAllocAndRetPri ngRanRetPri;
1388 SchGrbQosFlowInfo grbQosFlowInfo;
1389 uint16_t pduSessionId;
1390 uint32_t ulPduSessAggMaxBitRate; /* UL PDU Session Aggregate max bit rate */
1393 typedef struct schSnssai
1396 uint8_t sd[SD_SIZE];
1399 /* Special cell configuration */
1400 typedef struct schSpCellCfg
1402 uint8_t servCellIdx;
1403 SchServCellCfgInfo servCellCfg;
1406 /* Uplink logical channel configuration */
1407 typedef struct SchUlLcCfg
1412 uint8_t pbr; // prioritisedBitRate
1413 uint8_t bsd; // bucketSizeDuration
1416 /* Downlink logical channel configuration */
1417 typedef struct schDlLcCfg
1419 uint8_t lcp; // logical Channel Prioritization
1422 /* Logical Channel configuration */
1423 typedef struct schLcCfg
1425 ConfigType configType;
1427 SchDrbQosInfo *drbQos;
1433 /* Aggregate max bit rate */
1434 typedef struct schAmbrCfg
1436 uint32_t ulBr; /* Ul BitRate */
1439 typedef struct schModulationInfo
1443 SchMcsTable mcsTable;
1446 /* UE configuration */
1447 typedef struct schUeCfg
1451 bool macCellGrpCfgPres;
1452 SchMacCellGrpCfg macCellGrpCfg;
1453 bool phyCellGrpCfgPres;
1454 SchPhyCellGrpCfg phyCellGrpCfg;
1456 SchSpCellCfg spCellCfg;
1457 SchAmbrCfg *ambrCfg;
1458 SchModulationInfo dlModInfo;
1459 SchModulationInfo ulModInfo;
1461 SchLcCfg schLcCfg[MAX_NUM_LC];
1464 typedef struct schUeCfgRsp
1470 SchFailureCause cause;
1473 typedef struct schUeDelete
1479 typedef struct schUeDeleteRsp
1487 typedef struct schCellDelete
1493 typedef struct schCellDeleteRsp
1499 typedef struct dataVolInfo
1505 typedef struct ulBufferStatusRptInd
1511 DataVolInfo dataVolInfo[MAX_NUM_LOGICAL_CHANNEL_GROUPS];
1512 }UlBufferStatusRptInd;
1514 typedef struct srUciIndInfo
1518 SlotIndInfo slotInd;
1520 uint8_t srPayload[MAX_SR_BITS_IN_BYTES];
1523 /* function pointers */
1525 typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
1526 Pst *pst, /* Post Structure */
1527 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
1530 typedef uint8_t (*SchCellCfgFunc) ARGS((
1531 Pst *pst, /* Post Structure */
1532 SchCellCfg *schCellCfg /* Cell Cfg */
1535 typedef uint8_t (*SchMacDlAllocFunc) ARGS((
1536 Pst *pst, /* Post Structure */
1537 DlSchedInfo *dlSchedInfo /* dl allocation Info */
1540 typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
1541 Pst *pst, /* Post Structure */
1542 UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
1545 typedef uint8_t (*MacSchRachIndFunc) ARGS((
1546 Pst *pst, /* Post structure */
1547 RachIndInfo *rachInd)); /* Rach Indication Info */
1549 typedef uint8_t (*MacSchCrcIndFunc) ARGS((
1550 Pst *pst, /* Post structure */
1551 CrcIndInfo *crcInd)); /* CRC Info */
1553 typedef uint8_t (*MacSchDlRlcBoInfoFunc) ARGS((
1554 Pst *pst, /* Post structure */
1555 DlRlcBoInfo *dlBoInfo)); /* DL BO Info */
1557 typedef uint8_t (*MacSchAddUeConfigReqFunc) ARGS((
1558 Pst *pst, /* Post structure */
1559 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1561 typedef uint8_t (*SchUeCfgRspFunc) ARGS((
1562 Pst *pst, /* Post structure */
1563 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1565 typedef uint8_t (*MacSchSlotIndFunc) ARGS((
1566 Pst *pst, /* Post structure */
1567 SlotIndInfo *slotInd)); /* Slot Info */
1569 typedef uint8_t (*MacSchBsrFunc) ARGS((
1571 UlBufferStatusRptInd *bsrInd
1574 typedef uint8_t (*MacSchSrUciIndFunc) ARGS((
1575 Pst *pst, /* Post structure */
1576 SrUciIndInfo *uciInd)); /* UCI IND Info */
1578 typedef uint8_t (*MacSchModUeConfigReqFunc) ARGS((
1579 Pst *pst, /* Post structure */
1580 SchUeCfg *ueCfgToSch)); /* Scheduler UE Cfg */
1582 typedef uint8_t (*SchUeReCfgRspFunc) ARGS((
1583 Pst *pst, /* Post structure */
1584 SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
1586 typedef uint8_t (*MacSchUeDeleteReqFunc) ARGS((
1587 Pst *pst, /* Post structure */
1588 SchUeDelete *schUeDel)); /*Scheduler UE Del*/
1590 typedef uint8_t (*SchUeDeleteRspFunc) ARGS((
1591 Pst *pst, /* Post structure */
1592 SchUeDeleteRsp *delRsp)); /* Scheduler UE delete response */
1594 typedef uint8_t (*MacSchCellDeleteReqFunc) ARGS((
1595 Pst *pst, /* Post structure */
1596 SchCellDelete *schCellDelete)); /*Scheduler UE Del*/
1598 typedef uint8_t (*SchCellDeleteRspFunc) ARGS((
1599 Pst *pst, /* Post structure */
1600 SchCellDeleteRsp *schCellDeleteRsp)); /* Scheduler UE delete response */
1602 /* function declarations */
1603 uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
1604 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1605 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1606 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1607 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1608 uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
1609 uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
1610 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
1611 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
1612 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
1613 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
1614 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1615 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
1616 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1617 uint8_t MacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
1618 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1619 uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo);
1620 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1621 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1622 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1623 uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1624 uint8_t MacSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
1625 uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
1626 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
1627 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1628 uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd);
1629 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1630 uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd);
1631 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1632 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfgToSch);
1633 uint8_t packSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1634 uint8_t MacProcSchUeReconfigRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
1635 uint8_t packMacSchUeDeleteReq(Pst *pst, SchUeDelete *schUeDel);
1636 uint8_t MacSchUeDeleteReq(Pst *pst, SchUeDelete *ueDelete);
1637 uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *delRsp);
1638 uint8_t MacProcSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *schUeDelRsp);
1639 uint8_t packMacSchCellDeleteReq(Pst *pst, SchCellDelete *schCellDelete);
1640 uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDelete *schCellDelete);
1641 uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
1642 uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp);
1644 /**********************************************************************
1646 **********************************************************************/