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
24 #define MAC_SCH_LC_SELECTOR 0
25 #define MAC_SCH_TC_SELECTOR 1
26 #define MAC_SCH_LWLC_SELECTOR 2
30 #define SSB_TRANSMISSION 1
32 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
35 #define SIB1_TRANSMISSION 1
36 #define SIB1_REPITITION 2
38 #define MAX_NUM_PRG 1 /* max value should be later 275 */
39 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
40 #define MAX_CODEWORDS 1 /* max should be 2 */
53 uint32_t ssbPbchPwr; /* SSB block power */
54 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
55 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
56 SSBPeriod ssbPeriod; /* SSB Periodicity in msec */
57 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
58 uint32_t nSSBMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
61 /* SIB1 interface structure */
68 typedef struct coresetCfg
70 uint8_t startSymbolIndex;
71 uint8_t durationSymbols;
72 uint8_t freqDomainResource[6];
73 uint8_t cceRegMappingType;
74 uint8_t regBundleSize;
75 uint8_t interleaverSize;
78 uint8_t precoderGranularity;
80 uint8_t aggregationLevel;
86 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
89 typedef struct beamformingInfo
93 uint8_t digBfInterfaces;
97 typedef struct txPowerPdcchInfo
100 uint8_t powerControlOffsetSS;
106 uint16_t scramblingId;
107 uint16_t scramblingRnti;
110 BeamformingInfo beamPdcchInfo;
111 TxPowerPdcchInfo txPdcchPower;
114 typedef struct sib1PdcchCfg
116 BwpCfg sib1PdcchBwpCfg;
118 uint8_t subcarrierSpacing;
119 uint8_t cyclicPrefix;
121 /* coreset-0 configuration */
122 CoresetCfg sib1Coreset0Cfg;
125 DlDCI sib1DlDci; /* as of now its only one DCI, later it will be numDlCi */
127 /* end of SIB1 PDCCH structures */
129 /* SIB1 PDSCH structures */
131 typedef struct codewordinfo
133 uint16_t targetCodeRate;
141 typedef struct dmrsInfo
143 uint16_t dlDmrsSymbPos;
144 uint8_t dmrsConfigType;
145 uint16_t dlDmrsScramblingId;
147 uint8_t numDmrsCdmGrpsNoData;
151 typedef struct pdschFreqAlloc
153 uint8_t resourceAlloc;
154 /* since we are using type-1, hence rbBitmap excluded */
157 uint8_t vrbPrbMapping;
160 typedef struct pdschTimeAlloc
162 uint8_t startSymbolIndex;
166 typedef struct txPowerPdschInfo
168 uint8_t powerControlOffset;
169 uint8_t powerControlOffsetSS;
172 typedef struct sib1PdschCfg
177 BwpCfg sib1PdschBwpCfg;
178 uint8_t numCodewords;
179 CodewordInfo codeword[MAX_CODEWORDS];
180 uint16_t dataScramblingId;
182 uint8_t transmissionScheme;
185 PdschFreqAlloc sib1FreqAlloc;
186 PdschTimeAlloc sib1TimeAlloc;
187 BeamformingInfo beamPdschInfo;
188 TxPowerPdschInfo txPdschPower;
190 /* SIB1 PDSCH structures end */
194 /* parameters recieved from DU-APP */
196 uint16_t sib1NewTxPeriod;
197 uint16_t sib1RepetitionPeriod;
198 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
199 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
202 /* parameters derived in scheduler */
204 Sib1PdcchCfg sib1PdcchCfg;
205 Sib1PdschCfg sib1PdschCfg;
208 typedef struct schCellCfg
210 U16 cellId; /* Cell Id */
211 U16 phyCellId; /* Physical cell id */
212 U8 bandwidth; /* Supported B/W */
213 DuplexMode dupMode; /* Duplex type: TDD/FDD */
215 Sib1SchCfg sib1SchCfg;
218 typedef struct schCellCfgCfm
220 U16 cellId; /* Cell Id */
224 typedef struct timeDomainAlloc
226 uint16_t ssbStartSymbIdx;
227 uint16_t ssbSymbolDuration;
230 typedef struct freqDomainAlloc
232 uint16_t ssbStartPrbIdx;
233 uint16_t ssbPrbDuration;
236 typedef struct ssbInfo
238 uint8_t ssbIdx; /* SSB Index */
239 TimeDomainAlloc tdAlloc; /* Time domain allocation */
240 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
243 typedef struct sib1AllocInfo
245 Sib1PdcchCfg sib1PdcchCfg;
246 Sib1PdschCfg sib1PdschCfg;
249 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
250 typedef struct dlBrdcstAlloc
252 uint16_t cellId; /* Cell Id */
253 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
254 /* Ssb transmission is determined as follows:
255 * 0 : No tranamission
256 * 1 : SSB Transmission
257 * 2 : SSB Repetition */
259 uint8_t ssbIdxSupported;
260 SsbInfo ssbInfo[MAX_SSB_IDX];
261 /* Sib1 transmission is determined as follows:
262 * 0 : No tranamission
263 * 1 : SIB1 Transmission
264 * 2 : SIB1 Repetition */
266 Sib1AllocInfo sib1Alloc;
269 /* function pointers */
271 typedef int (*SchMacDlBrdcstAllocFunc) ARGS((
272 Pst *pst, /* Post Structure */
273 DlBrdcstAlloc *dlBrdcstAlloc /* slot ind Info */
276 typedef int (*SchCellCfgCfmFunc) ARGS((
277 Pst *pst, /* Post Structure */
278 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
281 typedef int (*SchCellCfgFunc) ARGS((
282 Pst *pst, /* Post Structure */
283 SchCellCfg *schCellCfg /* Cell Cfg */
285 /* function declarations */
286 int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
287 int packSchMacDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc);
288 EXTERN int packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
289 EXTERN int packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
291 EXTERN int MacProcDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc);
292 EXTERN int MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
293 EXTERN int MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
294 EXTERN int SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
295 EXTERN int schActvInit(Ent entity, Inst instId, Region region, Reason reason);
296 EXTERN S16 SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
298 /**********************************************************************
300 **********************************************************************/