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 *******************************************************************************/
19 /* Defines APIs exchanged between du_app and cl module of MAC */
23 #define NUM_NUMEROLOGY 5 /* Number of numerology */
25 #define NUM_SSB 1 /* max value is 64 */
26 #define SSB_MASK_SIZE 1 /* SSB mask size is 32bit for sub6 */
27 #define SIB1_REPETITION_PERIOD 20
28 #define CORESET_0_INDEX 0
29 #define CORESET_1_INDEX 1
30 #define CORESET_2_INDEX 2
31 #define CORESET_3_INDEX 3
32 #define CORESET_4_INDEX 4
33 #define SEARCHSPACE_0_INDEX 0
34 #define SEARCHSPACE_1_INDEX 1
35 #define SEARCHSPACE_2_INDEX 2
36 #define SEARCHSPACE_3_INDEX 3
37 #define SEARCHSPACE_4_INDEX 4
38 #define SS_MONITORING_SLOT_SL1 0 /* all slots */
39 #define SS_MONITORING_SYMBOL 0x2000; /* symbol-0, set 14th bit */
41 /* Macro for Ue Context */
42 #define MAX_NUM_SR_CFG_PER_CELL_GRP 8 /* Max number of scheduling request config per cell group */
43 #define MAC_NUM_TAGS 4 /* Max number of timing advance groups */
44 #define MAX_NUM_BWP 4 /* Max number of BWP per serving cell */
45 #define MAX_NUM_CRSET 3 /* Max number of control resource set in add/modify/release list */
46 #define MAX_NUM_SEARCH_SPC 10 /* Max number of search space in add/modify/release list */
47 #define MONITORING_SYMB_WITHIN_SLOT_SIZE 2 /* i.e. 2 bytes because size of monitoring symbols within slot is 14 bits */
48 #define MAX_NUM_DL_ALLOC 16 /* Max number of pdsch time domain downlink allocation */
49 #define MAX_NUM_UL_ALLOC 16 /* Max number of pusch time domain uplink allocation */
50 #define MAX_NUM_SCELL 32
52 /* PUCCH Configuration Macro */
53 #define MAX_NUM_PUCCH_RESRC 128
54 #define MAX_NUM_PUCCH_RESRC_SET 4
55 #define MAX_NUM_PUCCH_PER_RESRC_SET 32
56 #define MAX_NUM_SPATIAL_RELATIONS 8
57 #define MAX_NUM_PUCCH_P0_PER_SET 8
58 #define MAX_NUM_PATH_LOSS_REF_RS 4
59 #define MAX_NUM_DL_DATA_TO_UL_ACK 15
62 #define EVENT_MAC_CELL_CONFIG_REQ 200
63 #define EVENT_MAC_CELL_CONFIG_CFM 201
64 #define EVENT_MAC_CELL_START 202
65 #define EVENT_MAC_CELL_STOP 203
66 #define EVENT_MAC_CELL_UP_IND 204
67 #define EVENT_MAC_STOP_IND 205
68 #define EVENT_MAC_UL_CCCH_IND 206
69 #define EVENT_MAC_DL_CCCH_IND 207
70 #define EVENT_MAC_UE_CREATE_REQ 208
71 #define EVENT_MAC_UE_CREATE_RSP 209
72 #define EVENT_MAC_UE_RECONFIG_REQ 210
73 #define EVENT_MAC_UE_RECONFIG_RSP 211
74 #define EVENT_MAC_UE_DELETE_REQ 212
75 #define EVENT_MAC_UE_DELETE_RSP 213
76 #define EVENT_MAC_CELL_DELETE_REQ 214
77 #define EVENT_MAC_CELL_DELETE_RSP 215
78 #define EVENT_MAC_SLICE_CFG_REQ 216
79 #define EVENT_MAC_SLICE_CFG_RSP 217
80 #define EVENT_MAC_SLICE_RECFG_REQ 218
81 #define EVENT_MAC_SLICE_RECFG_RSP 219
82 #define EVENT_MAC_SLOT_IND 220
83 #define EVENT_MAC_RACH_RESOURCE_REQ 221
84 #define EVENT_MAC_RACH_RESOURCE_RSP 222
85 #define EVENT_MAC_DL_PCCH_IND 223
87 #define BSR_PERIODIC_TIMER_SF_10 10
88 #define BSR_RETX_TIMER_SF_320 320
89 #define BSR_SR_DELAY_TMR_2560 2560
91 #define PAGING_SCHED_DELTA 4
126 MAC_GEN_FULL_PBCH_PAYLD, /* MAC generated the full PBCH Payload */
127 PHY_GEN_TIMING_PBCH_BIT, /* PHY generates the timing PBCH bits */
128 PHY_GEN_FULL_PBCH_PAYLD /* PHY generates full PBCH payload */
140 RESTRICTED_SET_TYPE_A,
141 RESTRICTED_SET_TYPE_B
173 /* Enums for Ue Create Request */
175 /* SR PROHIBIT TIMER */
202 TIME_ALIGNMENT_TIMER_MS_500,
203 TIME_ALIGNMENT_TIMER_MS_750,
204 TIME_ALIGNMENT_TIMER_MS_1280,
205 TIME_ALIGNMENT_TIMER_MS_1920,
206 TIME_ALIGNMENT_TIMER_MS_2560,
207 TIME_ALIGNMENT_TIMER_MS_5120,
208 TIME_ALIGNMENT_TIMER_MS_10240,
209 TIME_ALIGNMENT_TIMER_INFINITY
214 PHR_PERIODIC_TIMER_SF_10,
215 PHR_PERIODIC_TIMER_SF_20,
216 PHR_PERIODIC_TIMER_SF_50,
217 PHR_PERIODIC_TIMER_SF_100,
218 PHR_PERIODIC_TIMER_SF_200,
219 PHR_PERIODIC_TIMER_SF_500,
220 PHR_PERIODIC_TIMER_SF_1000,
221 PHR_PERIODIC_TIMER_INFINITY
226 PHR_PROHIBIT_TIMER_SF_0,
227 PHR_PROHIBIT_TIMER_SF_10,
228 PHR_PROHIBIT_TIMER_SF_20,
229 PHR_PROHIBIT_TIMER_SF_50,
230 PHR_PROHIBIT_TIMER_SF_100,
231 PHR_PROHIBIT_TIMER_SF_200,
232 PHR_PROHIBIT_TIMER_SF_500,
233 PHR_PROHIBIT_TIMER_SF_1000
238 PHR_TX_PWR_FACTOR_CHANGE_DB_1,
239 PHR_TX_PWR_FACTOR_CHANGE_DB_3,
240 PHR_TX_PWR_FACTOR_CHANGE_DB_6,
241 PHR_TX_PWR_FACTOR_CHANGE_INFINITY
242 }PhrTxPwrFactorChange;
246 PHR_MODE_OTHER_CG_REAL,
247 PHR_MODE_OTHER_CG_VIRTUAL
252 PDSCH_HARQ_ACK_CODEBOOK_SEMISTATIC,
253 PDSCH_HARQ_ACK_CODEBOOK_DYNAMIC
254 }PdschHarqAckCodebook;
258 NUM_HARQ_PROC_FOR_PDSCH_N_2,
259 NUM_HARQ_PROC_FOR_PDSCH_N_4,
260 NUM_HARQ_PROC_FOR_PDSCH_N_6,
261 NUM_HARQ_PROC_FOR_PDSCH_N_10,
262 NUM_HARQ_PROC_FOR_PDSCH_N_16
263 }NumHarqProcForPdsch;
267 MAX_CODE_BLOCK_GROUP_PER_TB_N_2,
268 MAX_CODE_BLOCK_GROUP_PER_TB_N_4,
269 MAX_CODE_BLOCK_GROUP_PER_TB_N_6,
270 MAX_CODE_BLOCK_GROUP_PER_TB_N_8
282 TRANSFORM_PRECODER_ENABLED,
283 TRANSFORM_PRECODER_DISABLED
288 CCE_REG_MAPPINGTYPE_PR_INTERLEAVED = 1,
289 CCE_REG_MAPPINGTYPE_PR_NONINTERLEAVED
294 SLOTPERIODICITYANDOFFSET_PR_SL1 = 1,
295 SLOTPERIODICITYANDOFFSET_PR_SL2,
296 SLOTPERIODICITYANDOFFSET_PR_SL4,
297 SLOTPERIODICITYANDOFFSET_PR_SL5,
298 SLOTPERIODICITYANDOFFSET_PR_SL8,
299 SLOTPERIODICITYANDOFFSET_PR_SL10,
300 SLOTPERIODICITYANDOFFSET_PR_SL16,
301 SLOTPERIODICITYANDOFFSET_PR_SL20,
302 SLOTPERIODICITYANDOFFSET_PR_SL40,
303 SLOTPERIODICITYANDOFFSET_PR_SL80,
304 SLOTPERIODICITYANDOFFSET_PR_SL160,
305 SLOTPERIODICITYANDOFFSET_PR_SL320,
306 SLOTPERIODICITYANDOFFSET_PR_SL640,
307 SLOTPERIODICITYANDOFFSET_PR_SL1280,
308 SLOTPERIODICITYANDOFFSET_PR_SL2560
309 }MSlotPeriodAndOffset;
319 SEARCHSPACETYPE_PR_COMMON = 1,
320 SEARCHSPACETYPE_PR_UE_SPECIFIC
331 AGGREGATIONLEVEL_N0 = 0,
332 AGGREGATIONLEVEL_N1 = 1,
333 AGGREGATIONLEVEL_N2 = 2,
334 AGGREGATIONLEVEL_N3 = 3,
335 AGGREGATIONLEVEL_N4 = 4,
336 AGGREGATIONLEVEL_N5 = 5,
337 AGGREGATIONLEVEL_N6 = 6,
338 AGGREGATIONLEVEL_N8 = 7
343 ADDITIONALPOSITION_POS0,
344 ADDITIONALPOSITION_POS1,
345 ADDITIONALPOSITION_POS3
356 RESOURCEALLOCATION_TYPE0,
357 RESOURCEALLOCATION_TYPE1,
358 RESOURCEALLOCATION_DYNAMICSWITCH
369 CODEWORDS_SCHED_BY_DCI_N1,
370 CODEWORDS_SCHED_BY_DCI_N2
375 TYPE_STATIC_BUNDLING = 1,
376 TYPE_DYNAMIC_BUNDLING
389 SET1_SIZE_N2_WIDEBAND,
390 SET1_SIZE_N4_WIDEBAND
444 TRANSPORT_LAYER_FAIL,
451 UNSPECIFIED_RADIO_NW_CAUSE,
453 UNKNOWN_GNB_CU_UE_F1AP_ID,
454 ALREADY_ALLOCATED_GNB_CU_UE_F1AP_ID,
455 UNKNOWN_GNB_DU_UE_F1AP_ID,
456 ALREADY_ALLOCATED_GNB_DU_UE_F1AP_ID,
457 UNKNOWN_UE_F1AP_ID_PAIR,
458 INCONSISTENT_UE_F1AP_ID_PAIR,
459 INTERACTION_WITH_OTHER_PROCEDURE,
461 ACTION_REQUIRED_FOR_RADIO_REASONS,
462 RADIO_RESOURCES_UNAVAILABLE,
468 RESOURCES_UNAVAILABLE_FOR_SLICE
473 UNSPECIFIED_TRANSPORT_LAYER_CAUSE,
474 TRANSPORT_RESOURCE_UNAVAILABLE
479 TRANSFER_SYNTAX_ERROR,
480 ABSTRACT_SYNTAX_ERROR_REJECT,
481 ABSTRACT_SYNTAX_ERROR_IGNORE_AND_REJECT,
482 INCOMPATIBLE_MESSAGE_FOR_RECEIVER_STATE,
484 ABSTRAXCT_SYNTAX_ERROR_FALSELY_CONSTRUCTED_MSG,
485 UNSPECIFIED_PROTOCOL_CAUSE
490 CONTROL_PROCESSING_OVERLOAD,
492 PLANE_PROCESSING_RESOURCES,
494 INTERVENTION_BY_O_AND_M,
495 UNSPECIFIED_MISC_CAUSE
502 MCS_TABLE_QAM64_LOW_SE
509 RSRC_RRC_CONNECTED_USERS
514 TRANSMISSION_ALLOWED,
517 }DataTransmissionAction;
519 typedef struct failureCause
524 RadioNwLyrCause radioNwCause;
525 TransLyrCause transportCause;
526 ProtCause protcolCause;
527 MiscFailCause miscCause;
531 typedef struct carrierCfg
534 uint32_t bw; /* DL/UL bandwidth */
535 uint32_t freq; /* Absolute frequency of DL/UL point A in KHz */
536 uint16_t k0[NUM_NUMEROLOGY]; /* K0 for DL/UL */
537 uint16_t gridSize[NUM_NUMEROLOGY]; /* DL/UL Grid size for each numerologies */
538 uint16_t numAnt; /* Number of Tx/Rx antennas */
541 typedef struct ssbCfg
543 uint32_t ssbPbchPwr; /* SSB block power */
544 BchPduOpt bchPayloadFlag; /* Options for generation of payload */
545 uint8_t scsCmn; /* subcarrier spacing for common */
546 uint16_t ssbOffsetPointA; /* SSB subcarrier offset from point A */
548 SSBPeriod ssbPeriod; /* SSB Periodicity in msec */
549 uint8_t ssbScOffset; /* Subcarrier Offset */
550 uint8_t mibPdu[3]; /* MIB payload */
551 uint32_t ssbMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
552 uint8_t beamId[NUM_SSB];
553 bool multCarrBand; /* Multiple carriers in a band */
554 bool multCellCarr; /* Multiple cells in single carrier */
557 typedef struct fdmInfo
559 uint16_t rootSeqIdx; /* Root sequence index */
560 uint8_t numRootSeq; /* Number of root sequences required for FD */
561 uint16_t k1; /* Frequency Offset for each FD */
562 uint8_t zeroCorrZoneCfg; /* Zero correlation zone cofig */
563 uint8_t numUnusedRootSeq; /* Number of unused root sequence */
564 uint8_t *unsuedRootSeq; /* Unused root sequence per FD */
567 typedef struct prachCfg
570 uint8_t prachCfgIdx; /* PRACH Cfg Index */
571 PrachSeqLen prachSeqLen; /* RACH Sequence length: Long/short */
572 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
573 RstSetCfg prachRstSetCfg; /* PRACH restricted set config */
574 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
575 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
576 uint8_t rootSeqLen; /* Root sequence length */
577 PrachFdmInfo fdm[8]; /* FDM info */
578 uint8_t totalNumRaPreamble; /* Total number of RA preambles */
579 uint8_t ssbPerRach; /* SSB per RACH occassion */
580 uint8_t numCbPreamblePerSsb; /* Number of CB preamble per SSB */
581 bool prachMultCarrBand; /* Multiple carriers in Band */
582 uint8_t prachRestrictedSet; /* Support for PRACH restricted set */
583 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
584 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
585 uint8_t raRspWindow; /* RA Response Window */
588 typedef struct schPageCfg
590 uint8_t numPO; /*Derived from Ns*/
591 bool poPresent; /*Whether FirstPDCCH-MonitoringPO is present or not*/
592 uint16_t pagingOcc[MAX_PO_PER_PF]; /*FirstPDCCH-Monitoring Paging Occasion*/
595 typedef struct sib1CellCfg
599 uint16_t sib1RepetitionPeriod;
600 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
601 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
603 SchPageCfg pagingCfg;
606 typedef struct bwpParams
611 uint8_t cyclicPrefix;
614 typedef struct candidatesInfo
623 typedef struct searchSpaceCfg
625 uint8_t searchSpaceId;
627 uint16_t monitoringSlot;
629 uint16_t monitoringSymbol;
630 CandidatesInfo candidate;
633 typedef struct pdcchConfigCommon
635 /* only one search space is configured during SIB1 */
636 SearchSpaceCfg commonSearchSpace;
637 uint8_t raSearchSpaceId;
640 typedef struct pdschCfgCommTimeDomRsrcAlloc
645 uint8_t lengthSymbol;
646 }PdschCfgCommTimeDomRsrcAlloc;
648 typedef struct pdschConfigCommon
650 uint8_t numTimeDomAlloc;
651 /* PDSCH time domain DL resource allocation list */
652 PdschCfgCommTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_DL_ALLOC];
655 typedef struct pucchConfigCommon
657 uint8_t pucchResourceCommon;
658 uint8_t pucchGroupHopping;
661 /* PUSCH Time Domain Resource Allocation */
662 typedef struct puschTimeDomRsrcAlloc
665 CommonMappingType mappingType;
667 uint8_t symbolLength;
668 uint8_t startSymbolAndLength;
669 }PuschTimeDomRsrcAlloc;
672 typedef struct puschConfigCommon
674 /* PUSCH-TimeDomainResourceAllocation info */
675 uint8_t numTimeDomRsrcAlloc;
676 PuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
679 typedef struct bwpDlConfig
682 PdcchConfigCommon pdcchCommon;
683 PdschConfigCommon pdschCommon;
686 typedef struct bwpUlConfig
689 // rach config common sent in PrachCfg
690 PucchConfigCommon pucchCommon;
691 PuschConfigCommon puschCommon;
694 typedef struct plmnInfoList
697 uint8_t numSupportedSlice; /* Total slice supporting */
698 Snssai **snssai; /* List of supporting snssai*/
701 typedef struct macCellCfg
703 uint16_t cellId; /* Cell Id */
704 uint8_t carrierId; /* Carrired Index */
705 uint16_t phyCellId; /* Physical cell id */
706 uint8_t numerology; /* Supported numerology */
707 DuplexMode dupType; /* Duplex type: TDD/FDD */
708 CarrierCfg dlCarrCfg; /* DL Carrier configuration */
709 CarrierCfg ulCarrCfg; /* UL Carrier configuration */
710 bool freqShft; /* Indicates presence of 7.5kHz frequency shift */
711 SsbCfg ssbCfg; /* SSB configuration */
712 PrachCfg prachCfg; /* PRACH Configuration */
714 TDDCfg tddCfg; /* TDD periodicity and slot configuration */
716 RSSIMeasUnit rssiUnit; /* RSSI measurement unit */
717 Sib1CellCfg sib1Cfg; /* SIB1 config */
718 BwpDlConfig initialDlBwp; /* Initial DL BWP */
719 BwpUlConfig initialUlBwp; /* Initial UL BWP */
720 uint8_t dmrsTypeAPos; /* DMRS Type A position */
721 PlmnInfoList plmnInfoList; /* Consits of PlmnId and Snssai list */
722 //RrmPolicy *rrmPolicy; /* RRM policy details */
725 typedef struct macCellCfgCfm
731 typedef struct ulCcchInd
735 uint16_t ulCcchMsgLen;
739 typedef struct dlCcchInd
743 DlCcchMsgType msgType;
744 uint16_t dlCcchMsgLen;
748 typedef struct bsrTmrCfg
750 uint16_t periodicTimer;
752 uint16_t srDelayTimer;
756 /* Info of Scheduling Request to Add/Modify */
757 typedef struct schedReqInfo
760 SrProhibitTimer srProhibitTmr;
761 SrTransMax srTransMax;
764 /* Scheduling Request Configuration */
765 typedef struct schedReqCfg
767 uint8_t addModListCount;
768 SchedReqInfo addModList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* List of Scheduling req to be added/modified */
769 uint8_t relListCount;
770 uint8_t relList[MAX_NUM_SR_CFG_PER_CELL_GRP]; /* list of scheduling request Id to be deleted */
773 typedef struct tagInfo
776 TimeAlignmentTimer timeAlignTimer;
779 typedef struct tagCfg
781 uint8_t addModListCount;
782 TagInfo addModList[MAC_NUM_TAGS]; /* List of Tag to Add/Modify */
783 uint8_t relListCount;
784 uint8_t relList[MAC_NUM_TAGS]; /* list of Tag Id to release */
787 typedef struct phrCfg
789 PhrPeriodicTimer periodicTimer;
790 PhrProhibitTimer prohibitTimer;
791 PhrTxPwrFactorChange txPowerFactor;
794 bool phrType2OtherCell;
795 PhrModeOtherCG phrOtherCG;
798 typedef struct macCellGrpCfg
800 SchedReqCfg schReqCfg;
803 bool phrCfgSetupPres; /* true/false: phrCfgSetup/phrCfgRelease */
807 typedef struct phyCellGrpCfg
809 PdschHarqAckCodebook pdschHarqAckCodebook;
813 /* Control resource set info */
814 typedef struct controlRsrcSet
816 uint8_t cRSetId; /* Control resource set id */
817 uint8_t freqDomainRsrc[FREQ_DOM_RSRC_SIZE]; /* Frequency domain resource */
819 REGMappingType cceRegMappingType;
820 PrecoderGranul precoderGranularity;
821 uint16_t dmrsScramblingId;
824 /* Search Space info */
825 typedef struct searchSpace
827 uint8_t searchSpaceId;
829 MSlotPeriodAndOffset mSlotPeriodicityAndOffset;
830 uint8_t mSymbolsWithinSlot[MONITORING_SYMB_WITHIN_SLOT_SIZE];
831 AggrLevel numCandidatesAggLevel1; /* Number of candidates for aggregation level 1 */
832 AggrLevel numCandidatesAggLevel2; /* Number of candidates for aggregation level 2 */
833 AggrLevel numCandidatesAggLevel4; /* Number of candidates for aggregation level 4 */
834 AggrLevel numCandidatesAggLevel8; /* Number of candidates for aggregation level 8 */
835 AggrLevel numCandidatesAggLevel16; /* Number of candidates for aggregation level 16 */
836 SearchSpaceType searchSpaceType;
837 uint8_t ueSpecificDciFormat;
840 /* PDCCH cofniguration */
841 typedef struct pdcchConfig
843 uint8_t numCRsetToAddMod;
844 ControlRsrcSet cRSetToAddModList[MAX_NUM_CRSET]; /* List of control resource set to add/modify */
845 uint8_t numCRsetToRel;
846 uint8_t cRSetToRelList[MAX_NUM_CRSET]; /* List of control resource set to release */
847 uint8_t numSearchSpcToAddMod;
848 SearchSpace searchSpcToAddModList[MAX_NUM_SEARCH_SPC]; /* List of search space to add/modify */
849 uint8_t numSearchSpcToRel;
850 uint8_t searchSpcToRelList[MAX_NUM_SEARCH_SPC]; /* List of search space to release */
853 /* PDSCH time domain resource allocation */
854 typedef struct pdschTimeDomRsrcAlloc
857 CommonMappingType mappingType;
859 uint8_t symbolLength;
860 uint8_t startSymbolAndLength;
861 }PdschTimeDomRsrcAlloc;
864 typedef struct pdschBundling
866 struct staticBundling
868 BundlingSizeSet2 size;
870 struct dynamicBundling
872 BundlingSizeSet1 sizeSet1;
873 BundlingSizeSet2 sizeSet2;
877 /* DMRS downlink configuration */
878 typedef struct dmrsDlCfg
880 AddPosType addPos; /* DMRS additional position */
883 /* PDSCH Configuration */
884 typedef struct pdschConfig
886 DmrsDlCfg dmrsDlCfgForPdschMapTypeA;
887 ResAllocType resourceAllocType;
888 uint8_t numTimeDomRsrcAlloc;
889 PdschTimeDomRsrcAlloc timeDomRsrcAllociList[MAX_NUM_DL_ALLOC]; /* PDSCH time domain DL resource allocation list */
891 CodeWordsSchedDci numCodeWordsSchByDci; /* Number of code words scheduled by DCI */
892 BundlingType bundlingType;
893 PdschBundling bundlingInfo;
896 /* Initial Downlink BWP */
897 typedef struct initialDlBwp
900 PdcchConfig pdcchCfg;
902 PdschConfig pdschCfg;
905 /* BWP Downlink common */
906 typedef struct bwpDlCommon
910 /* Downlink BWP information */
911 typedef struct dlBwpInfo
916 /* PDCCH Serving Cell configuration */
917 typedef struct pdschServCellCfg
919 uint8_t *maxMimoLayers;
920 NumHarqProcForPdsch numHarqProcForPdsch;
921 MaxCodeBlkGrpPerTB *maxCodeBlkGrpPerTb;
922 bool *codeBlkGrpFlushInd;
923 PdschXOverhead *xOverhead;
926 /* PUCCH Configuration */
928 typedef struct pucchResrcSetInfo
931 uint8_t resrcListCount;
932 uint8_t resrcList[MAX_NUM_PUCCH_PER_RESRC_SET];
933 uint8_t maxPayLoadSize;
936 typedef struct pucchResrcSetCfg
938 uint8_t resrcSetToAddModListCount;
939 PucchResrcSetInfo resrcSetToAddModList[MAX_NUM_PUCCH_RESRC_SET];
940 uint8_t resrcSetToRelListCount;
941 uint8_t resrcSetToRelList[MAX_NUM_PUCCH_RESRC];
944 typedef struct pucchFormat0
946 uint8_t initialCyclicShift;
948 uint8_t startSymbolIdx;
951 typedef struct pucchFormat1
953 uint8_t initialCyclicShift;
955 uint8_t startSymbolIdx;
959 typedef struct pucchFormat2_3
963 uint8_t startSymbolIdx;
966 typedef struct pucchFormat4
971 uint8_t startSymbolIdx;
974 typedef struct pucchResrcInfo
978 uint8_t intraFreqHop;
979 uint16_t secondPrbHop;
983 PucchFormat0 *format0;
984 PucchFormat1 *format1;
985 PucchFormat2_3 *format2;
986 PucchFormat2_3 *format3;
987 PucchFormat4 *format4;
991 typedef struct pucchResrcCfg
993 uint8_t resrcToAddModListCount;
994 PucchResrcInfo resrcToAddModList[MAX_NUM_PUCCH_RESRC];
995 uint8_t resrcToRelListCount;
996 uint8_t resrcToRelList[MAX_NUM_PUCCH_RESRC];
999 typedef struct pucchFormatCfg
1001 bool interSlotFreqHop;
1003 uint8_t maxCodeRate;
1009 typedef struct schedReqResrcInfo
1013 uint8_t periodicity;
1018 typedef struct pucchSchedReqCfg
1020 uint8_t schedAddModListCount;
1021 SchedReqResrcInfo schedAddModList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1022 uint8_t schedRelListCount;
1023 uint8_t schedRelList[MAX_NUM_SR_CFG_PER_CELL_GRP];
1026 typedef struct spatialRelationInfo
1028 uint8_t spatialRelationId;
1029 uint8_t servCellIdx;
1030 uint8_t pathLossRefRSId;
1032 uint8_t closeLoopIdx;
1033 }SpatialRelationInfo;
1035 typedef struct pucchSpatialCfg
1037 uint8_t spatialAddModListCount;
1038 SpatialRelationInfo spatialAddModList[MAX_NUM_SPATIAL_RELATIONS];
1039 uint8_t spatialRelListCount;
1040 uint8_t spatialRelList[MAX_NUM_SPATIAL_RELATIONS];
1043 typedef struct p0PucchCfg
1049 typedef struct pathLossRefRSCfg
1051 uint8_t pathLossRefRSId;
1054 typedef struct pucchMultiCsiCfg
1056 uint8_t multiCsiResrcListCount;
1057 uint8_t multiCsiResrcList[MAX_NUM_PUCCH_RESRC-1];
1060 typedef struct pucchDlDataToUlAck
1062 uint8_t dlDataToUlAckListCount;
1063 uint8_t dlDataToUlAckList[MAX_NUM_DL_DATA_TO_UL_ACK];
1064 }PucchDlDataToUlAck;
1066 typedef struct pucchPowerControl
1074 P0PucchCfg p0Set[MAX_NUM_PUCCH_P0_PER_SET];
1075 uint8_t pathLossRefRSListCount;
1076 PathLossRefRSCfg pathLossRefRSList[MAX_NUM_PATH_LOSS_REF_RS];
1079 typedef struct pucchCfg
1081 PucchResrcSetCfg *resrcSet;
1082 PucchResrcCfg *resrc;
1083 PucchFormatCfg *format1;
1084 PucchFormatCfg *format2;
1085 PucchFormatCfg *format3;
1086 PucchFormatCfg *format4;
1087 PucchSchedReqCfg *schedReq;
1088 PucchMultiCsiCfg *multiCsiCfg;
1089 PucchSpatialCfg *spatialInfo;
1090 PucchDlDataToUlAck *dlDataToUlAck;
1091 PucchPowerControl *powerControl;
1094 /* Transform precoding disabled */
1095 typedef struct transPrecodDisabled
1097 uint16_t scramblingId0;
1098 }TransPrecodDisabled;
1100 /* DMRS Uplink configuration */
1101 typedef struct dmrsUlCfg
1103 AddPosType addPos; /* DMRS additional position */
1104 TransPrecodDisabled transPrecodDisabled; /* Transform precoding disabled */
1107 /* PUSCH Configuration */
1108 typedef struct puschCfg
1110 uint8_t dataScramblingId;
1111 DmrsUlCfg dmrsUlCfgForPuschMapTypeA;
1112 ResAllocType resourceAllocType;
1113 uint8_t numTimeDomRsrcAlloc;
1114 PuschTimeDomRsrcAlloc timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
1115 TransformPrecoder transformPrecoder;
1118 /* Initial Uplink BWP */
1119 typedef struct initialUlBwp
1127 /* Uplink BWP information */
1128 typedef struct ulBwpInfo
1133 /* Serving cell configuration */
1134 typedef struct servCellCfgInfo
1136 InitialDlBwp initDlBwp;
1137 uint8_t numDlBwpToAdd;
1138 DlBwpInfo DlBwpToAddList[MAX_NUM_BWP];
1139 uint8_t firstActvDlBwpId;
1140 uint8_t defaultDlBwpId;
1141 uint8_t *bwpInactivityTmr;
1142 PdschServCellCfg pdschServCellCfg;
1143 InitialUlBwp initUlBwp;
1144 uint8_t numUlBwpToAdd;
1145 UlBwpInfo UlBwpToAddList[MAX_NUM_BWP];
1146 uint8_t firstActvUlBwpId;
1149 /* Special cell configuration */
1150 typedef struct spCellCfg
1152 uint8_t servCellIdx;
1153 ServCellCfgInfo servCellCfg;
1156 typedef struct ambrCfg
1158 uint32_t ulBr; /* UL Bit rate */
1161 typedef struct nonDynFiveQi
1166 uint16_t maxDataBurstVol;
1169 typedef struct dynFiveQi
1172 uint16_t packetDelayBudget;
1173 uint8_t packetErrRateScalar;
1174 uint8_t packetErrRateExp;
1176 uint8_t delayCritical;
1178 uint16_t maxDataBurstVol;
1181 typedef struct ngRanAllocAndRetPri
1183 uint8_t priorityLevel;
1184 uint8_t preEmptionCap;
1185 uint8_t preEmptionVul;
1186 }NgRanAllocAndRetPri;
1188 typedef struct grbQosInfo
1190 uint32_t maxFlowBitRateDl;
1191 uint32_t maxFlowBitRateUl;
1192 uint32_t guarFlowBitRateDl;
1193 uint32_t guarFlowBitRateUl;
1196 typedef struct drbQos
1198 QosType fiveQiType; /* Dynamic or non-dynamic */
1201 NonDynFiveQi nonDyn5Qi;
1204 NgRanAllocAndRetPri ngRanRetPri;
1205 GrbQosInfo grbQosInfo;
1206 uint16_t pduSessionId;
1207 uint32_t ulPduSessAggMaxBitRate;
1210 typedef struct ulLcCfg
1215 PBitRate pbr; // prioritisedBitRate
1216 BucketSizeDur bsd; // bucketSizeDuration
1219 typedef struct duLcCfg
1221 LcPriority lcp; // logical Channel Prioritization
1224 typedef struct lcCfg
1226 ConfigType configType;
1235 typedef struct modulationInfo
1237 uint8_t modOrder; /* Modulation order */
1238 uint8_t mcsIndex; /* MCS Index */
1239 McsTable mcsTable; /* MCS table */
1242 typedef struct macUeCfg
1247 bool macCellGrpCfgPres;
1248 MacCellGrpCfg macCellGrpCfg;
1249 bool phyCellGrpCfgPres;
1250 PhyCellGrpCfg phyCellGrpCfg;
1252 SpCellCfg spCellCfg;
1254 ModulationInfo dlModInfo; /* DL modulation info */
1255 ModulationInfo ulModInfo; /* UL modulation info */
1257 LcCfg lcCfgList[MAX_NUM_LC];
1258 UeCfgState macUeCfgState; /* InActive / Completed */
1259 DataTransmissionAction transmissionAction;
1262 typedef struct nrcgi
1268 typedef struct srbFailInfo
1274 typedef struct drbFailInfo
1280 typedef struct sCellFailInfo
1286 typedef struct ueCfgRsp
1291 uint8_t numSRBFailed; /* valid values : 0 to MAX_NUM_SRB */
1292 SRBFailInfo *failedSRBlisti;
1293 uint8_t numDRBFailed; /* valid values : 0 to MAX_NUM_DRB */
1294 DRBFailInfo *failedDRBlist;
1295 uint8_t numSCellFailed; /* valid values : 0 to MAX_NUM_SCELL */
1296 SCellFailInfo *failedSCellList;
1299 typedef struct rachRsrcReq
1304 uint8_t ssbIdx[MAX_NUM_SSB];
1307 typedef struct macCfraSsbResource
1310 uint8_t raPreambleIdx;
1311 }MacCfraSsbResource;
1313 typedef struct macCfraResource
1316 MacCfraSsbResource ssbResource[MAX_NUM_SSB];
1319 typedef struct macRachRsrcRsp
1324 uint16_t newCrnti; /* This parameter maps to 3GPP TS 38.331 newUE-Identity */
1325 MacCfraResource cfraResource;
1328 typedef struct ueDelete
1335 typedef struct ueDeleteRsp
1339 UeDeleteStatus result;
1342 typedef struct macCellDelete
1347 typedef struct macCellDeleteRsp
1350 CellDeleteStatus result;
1353 typedef struct macSliceRsp
1360 typedef struct rrmPolicyRatio
1362 uint8_t policyMaxRatio;
1363 uint8_t policyMinRatio;
1364 uint8_t policyDedicatedRatio;
1367 typedef struct macSliceRrmPolicy
1370 RrmPolicyRatio *rrmPolicyRatio;
1373 typedef struct macSliceCfgReq
1375 uint8_t numOfConfiguredSlice;
1376 MacSliceRrmPolicy **listOfSliceCfg;
1379 typedef struct macSliceCfgRsp
1381 uint8_t numSliceCfgRsp;
1382 MacSliceRsp **listOfSliceCfgRsp;
1385 typedef struct macPcchInd
1394 /* Functions for CellUp Ind from MAC to DU APP*/
1395 typedef uint8_t (*DuMacCellUpInd) ARGS((
1397 OduCellId *cellId ));
1399 /* Functions for slot Ind from MAC to DU APP*/
1400 typedef uint8_t (*DuMacSlotInd) ARGS((
1402 SlotTimingInfo *slotIndInfo));
1404 /* Functions for stop Ind from MAC to DU APP*/
1405 typedef uint8_t (*DuMacStopInd) ARGS((
1407 OduCellId *cellId ));
1409 /* Functions for mac cell start req */
1410 typedef uint8_t (*DuMacCellStart) ARGS((
1412 OduCellId *cellId));
1414 /* Functions for mac cell stop request */
1415 typedef uint8_t (*DuMacCellStop) ARGS((
1417 OduCellId *cellId ));
1419 /* Function pointers for packing macCellCfg Request and Confirm */
1420 typedef uint8_t (*packMacCellCfgReq) ARGS((
1422 MacCellCfg *macCellCfg ));
1424 typedef uint8_t (*packMacCellCfgConfirm) ARGS((
1426 MacCellCfgCfm *macCellCfgCfm ));
1428 typedef uint8_t (*DuMacCellCfgReq) ARGS((
1430 MacCellCfg *macCellCfg));
1432 typedef uint8_t (*DuMacCellCfgCfm) ARGS((
1434 MacCellCfgCfm *macCellCfgCfm ));
1436 /* Functions for UL CCCH Ind from MAC to DU APP*/
1437 typedef uint8_t (*DuMacUlCcchInd) ARGS((
1439 UlCcchIndInfo *ulCcchIndInfo ));
1441 /* Functions for DL CCCH Ind from DU APP to MAC*/
1442 typedef uint8_t (*DuMacDlCcchInd) ARGS((
1444 DlCcchIndInfo *dlCcchIndInfo ));
1446 /* UE create Request from DU APP to MAC*/
1447 typedef uint8_t (*DuMacUeCreateReq) ARGS((
1451 /* UE create Response from MAC to DU APP */
1452 typedef uint8_t (*MacDuUeCfgRspFunc) ARGS((
1454 MacUeCfgRsp *cfgRsp));
1456 /* UE Reconfig Request from DU APP to MAC*/
1457 typedef uint8_t (*DuMacUeReconfigReq) ARGS((
1461 /* RACH Resource Request from DU APP to MAC*/
1462 typedef uint8_t (*DuMacRachRsrcReq) ARGS((
1464 MacRachRsrcReq *rachRsrcReq));
1466 /* RACH Resource Response from MAC to DU APP*/
1467 typedef uint8_t (*MacDuRachRsrcRspFunc) ARGS((
1469 MacRachRsrcRsp *rachRsrcRsp));
1471 /* UE Delete Request from DU APP to MAC*/
1472 typedef uint8_t (*DuMacUeDeleteReq) ARGS((
1474 MacUeDelete *ueDel ));
1476 /* UE Delete Response from MAC to DU APP*/
1477 typedef uint8_t (*MacDuUeDeleteRspFunc) ARGS((
1479 MacUeDeleteRsp *deleteRsp));
1481 /* Cell Delete Request from DU APP to MAC*/
1482 typedef uint8_t (*DuMacCellDeleteReq) ARGS((
1484 MacCellDelete *cellDelete ));
1486 /* Cell Delete Response from MAC to DU APP*/
1487 typedef uint8_t (*MacDuCellDeleteRspFunc) ARGS((
1489 MacCellDeleteRsp *cellDeleteRsp));
1491 /* Slice Cfg Request from DU APP to MAC*/
1492 typedef uint8_t (*DuMacSliceCfgReq) ARGS((
1494 MacSliceCfgReq *CfgReq));
1496 /* Slice Cfg Response from MAC to DU APP */
1497 typedef uint8_t (*MacDuSliceCfgRspFunc) ARGS((
1499 MacSliceCfgRsp *cfgRsp));
1501 /* Slice ReReCfg Request from DU APP to MAC*/
1502 typedef uint8_t (*DuMacSliceRecfgReq) ARGS((
1504 MacSliceCfgReq *CfgReq));
1506 /* Slice ReReCfg Response from MAC to DU APP */
1507 typedef uint8_t (*MacDuSliceReCfgRspFunc) ARGS((
1509 MacSliceCfgRsp *cfgRsp));
1511 /* Pcch indication from DU APP to MAC*/
1512 typedef uint8_t (*DuMacDlPcchInd) ARGS((
1514 MacPcchInd *pcchInd));
1516 uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */
1518 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId);
1519 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf);
1520 uint8_t duHandleCellUpInd(Pst *pst, OduCellId *cellId);
1521 uint8_t packMacCellStart(Pst *pst, OduCellId *cellId);
1522 uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf);
1523 uint8_t MacProcCellStart(Pst *pst, OduCellId *cellId);
1524 uint8_t packMacCellStop(Pst *pst, OduCellId *cellId);
1525 uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf);
1526 uint8_t MacProcCellStop(Pst *pst, OduCellId *cellId);
1527 uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
1528 uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf);
1529 uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
1530 uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
1531 uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
1532 uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
1533 uint8_t packMacStopInd(Pst *pst, OduCellId *cellId);
1534 uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf);
1535 uint8_t duHandleStopInd(Pst *pst, OduCellId *cellId);
1536 uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
1537 uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf);
1538 uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
1539 uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
1540 uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf);
1541 uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
1542 uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
1543 uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf);
1544 uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
1545 uint8_t sendStopIndMacToDuApp(uint16_t cellId);
1546 uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
1547 uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf);
1548 uint8_t DuProcMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
1549 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
1550 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf);
1551 uint8_t MacProcUeReconfigReq(Pst *pst, MacUeCfg *ueCfg);
1552 uint8_t packDuMacRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq);
1553 uint8_t unpackMacRachRsrcReq(DuMacRachRsrcReq func, Pst *pst, Buffer *mBuf);
1554 uint8_t MacProcRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq);
1555 uint8_t packDuMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp);
1556 uint8_t unpackDuMacRachRsrcRsp(MacDuRachRsrcRspFunc func, Pst *pst, Buffer *mBuf);
1557 uint8_t DuProcMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp);
1558 uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDelete);
1559 uint8_t MacProcUeDeleteReq(Pst *pst, MacUeDelete *ueDelete);
1560 uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf);
1561 uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
1562 uint8_t DuProcMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp);
1563 uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf);
1564 uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDelete *cellDelete);
1565 uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDelete *cellDelete);
1566 uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf);
1567 uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
1568 uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp);
1569 uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf);
1570 uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
1571 uint8_t MacProcSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq);
1572 uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf);
1573 uint8_t DuProcMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
1574 uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
1575 uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf);
1576 uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceCfgReq *sliceReCfgReq);
1577 uint8_t MacProcSliceReCfgReq(Pst *pst, MacSliceCfgReq *sliceReCfgReq);
1578 uint8_t unpackMacSliceReCfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf);
1579 uint8_t DuProcMacSliceReCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
1580 uint8_t packDuMacSliceReCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp);
1581 uint8_t unpackDuMacSliceReCfgRsp(MacDuSliceReCfgRspFunc func, Pst *pst, Buffer *mBuf);
1582 uint8_t duHandleSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo);
1583 uint8_t packMacSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo);
1584 uint8_t unpackDuMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
1585 uint8_t packDuMacDlPcchInd(Pst *pst, MacPcchInd *pcchInd);
1586 uint8_t MacProcDlPcchInd(Pst *pst, MacPcchInd *pcchInd);
1587 uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf);
1588 int8_t getFreeBitFromUeBitMap(uint16_t cellId);
1589 void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos);
1593 /**********************************************************************
1595 **********************************************************************/