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_BRDCST_ALLOC 3
23 #define EVENT_UL_SCH_INFO 4
26 #define MAC_SCH_LC_SELECTOR 0
27 #define MAC_SCH_TC_SELECTOR 1
28 #define MAC_SCH_LWLC_SELECTOR 2
32 #define SSB_TRANSMISSION 1
34 #define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
37 #define SIB1_TRANSMISSION 1
38 #define SIB1_REPITITION 2
40 #define MAX_NUM_PRG 1 /* max value should be later 275 */
41 #define MAX_DIG_BF_INTERFACES 0 /* max value should be later 255 */
42 #define MAX_CODEWORDS 1 /* max should be 2 */
44 /* Datatype in UL SCH Info */
45 #define SCH_DATATYPE_PUSCH 1
46 #define SCH_DATATYPE_PUSCH_UCI 2
47 #define SCH_DATATYPE_UCI 4
48 #define SCH_DATATYPE_SRS 8
49 #define SCH_DATATYPE_PRACH 16
62 uint32_t ssbPbchPwr; /* SSB block power */
63 uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
64 uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
65 SSBPeriod ssbPeriod; /* SSB Periodicity in msec */
66 uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
67 uint32_t nSSBMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
72 uint8_t subcarrierSpacing;
81 uint16_t beamIdx[MAX_DIG_BF_INTERFACES];
84 typedef struct beamformingInfo
88 uint8_t digBfInterfaces;
92 /* SIB1 PDSCH structures */
94 typedef struct codewordinfo
96 uint16_t targetCodeRate;
104 typedef struct dmrsInfo
106 uint16_t dlDmrsSymbPos;
107 uint8_t dmrsConfigType;
108 uint16_t dlDmrsScramblingId;
110 uint8_t numDmrsCdmGrpsNoData;
114 typedef struct pdschFreqAlloc
116 uint8_t resourceAlloc;
117 /* since we are using type-1, hence rbBitmap excluded */
120 uint8_t vrbPrbMapping;
123 typedef struct pdschTimeAlloc
126 uint8_t startSymbolIndex;
130 typedef struct txPowerPdschInfo
132 uint8_t powerControlOffset;
133 uint8_t powerControlOffsetSS;
136 typedef struct sib1PdschCfg
141 BwpCfg sib1PdschBwpCfg;
142 uint8_t numCodewords;
143 CodewordInfo codeword[MAX_CODEWORDS];
144 uint16_t dataScramblingId;
146 uint8_t transmissionScheme;
149 PdschFreqAlloc sib1FreqAlloc;
150 PdschTimeAlloc sib1TimeAlloc;
151 BeamformingInfo beamPdschInfo;
152 TxPowerPdschInfo txPdschPower;
154 /* SIB1 PDSCH structures end */
156 /* SIB1 interface structure */
158 typedef struct coresetCfg
160 uint8_t coreSet0Size;
161 uint8_t startSymbolIndex;
162 uint8_t durationSymbols;
163 uint8_t freqDomainResource[6];
164 uint8_t cceRegMappingType;
165 uint8_t regBundleSize;
166 uint8_t interleaverSize;
169 uint8_t precoderGranularity;
171 uint8_t aggregationLevel;
174 typedef struct txPowerPdcchInfo
177 uint8_t powerControlOffsetSS;
183 uint16_t scramblingId;
184 uint16_t scramblingRnti;
187 BeamformingInfo beamPdcchInfo;
188 TxPowerPdcchInfo txPdcchPower;
189 Sib1PdschCfg *pdschCfg;
192 typedef struct sib1PdcchCfg
194 BwpCfg sib1PdcchBwpCfg;
195 /* coreset-0 configuration */
196 CoresetCfg sib1Coreset0Cfg;
199 DlDCI sib1DlDci; /* as of now its only one DCI, later it will be numDlCi */
201 /* end of SIB1 PDCCH structures */
205 /* parameters recieved from DU-APP */
207 uint16_t sib1NewTxPeriod;
208 uint16_t sib1RepetitionPeriod;
209 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
210 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
213 /* parameters derived in scheduler */
215 Sib1PdcchCfg sib1PdcchCfg;
216 Sib1PdschCfg sib1PdschCfg;
219 typedef struct schRachCfg
221 uint8_t prachCfgIdx; /* PRACH config idx */
222 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
223 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
224 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
225 uint16_t rootSeqIdx; /* Root sequence index */
226 uint8_t numRootSeq; /* Number of root sequences required for FD */
227 uint16_t k1; /* Frequency Offset for each FD */
228 uint8_t ssbPerRach; /* SSB per RACH occassion */
229 uint8_t prachMultCarrBand; /* Presence of Multiple carriers in Band */
230 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
231 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
232 uint8_t raRspWindow; /* RA Response Window */
235 typedef struct schCellCfg
237 uint16_t cellId; /* Cell Id */
238 uint16_t phyCellId; /* Physical cell id */
239 uint8_t bandwidth; /* Supported B/W */
240 DuplexMode dupMode; /* Duplex type: TDD/FDD */
241 SchSsbCfg ssbSchCfg; /* SSB config */
242 SchSib1Cfg sib1SchCfg; /* SIB1 config */
243 SchRachCfg schRachCfg; /* PRACH config */
246 typedef struct schCellCfgCfm
248 U16 cellId; /* Cell Id */
252 typedef struct timeDomainAlloc
254 uint16_t ssbStartSymbIdx;
255 uint16_t ssbSymbolDuration;
258 typedef struct freqDomainAlloc
260 uint16_t ssbStartPrbIdx;
261 uint16_t ssbPrbDuration;
264 typedef struct ssbInfo
266 uint8_t ssbIdx; /* SSB Index */
267 TimeDomainAlloc tdAlloc; /* Time domain allocation */
268 FreqDomainAlloc fdAlloc; /* Freq domain allocation */
271 typedef struct sib1AllocInfo
273 Sib1PdcchCfg sib1PdcchCfg;
274 Sib1PdschCfg sib1PdschCfg;
277 typedef struct prachSchInfo
279 uint8_t numPrachOcas; /* Num Prach Ocassions */
280 uint8_t prachFormat; /* PRACH Format */
281 uint8_t numRa; /* Freq domain ocassion */
282 uint8_t prachStartSymb; /* Freq domain ocassion */
285 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
286 typedef struct dlBrdcstAlloc
288 uint16_t cellId; /* Cell Id */
289 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
290 /* Ssb transmission is determined as follows:
291 * 0 : No tranamission
292 * 1 : SSB Transmission
293 * 2 : SSB Repetition */
295 uint8_t ssbIdxSupported;
296 SsbInfo ssbInfo[MAX_SSB_IDX];
297 /* Sib1 transmission is determined as follows:
298 * 0 : No tranamission
299 * 1 : SIB1 Transmission
300 * 2 : SIB1 Repetition */
302 Sib1AllocInfo sib1Alloc;
305 /* Interface structure signifying DL broadcast allocation for SSB, SIB1 */
306 typedef struct ulSchInfo
308 uint16_t cellId; /* Cell Id */
309 SlotIndInfo slotIndInfo; /* Slot Info: sfn, slot number */
310 uint8_t dataType; /* Type of info being scheduled */
311 PrachSchInfo prachSchInfo; /* Prach scheduling info */
314 /* function pointers */
316 typedef int (*SchCellCfgCfmFunc) ARGS((
317 Pst *pst, /* Post Structure */
318 SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
321 typedef int (*SchCellCfgFunc) ARGS((
322 Pst *pst, /* Post Structure */
323 SchCellCfg *schCellCfg /* Cell Cfg */
326 typedef int (*SchMacDlBrdcstAllocFunc) ARGS((
327 Pst *pst, /* Post Structure */
328 DlBrdcstAlloc *dlBrdcstAlloc /* DL Broadcast Info */
331 typedef int (*SchMacUlSchInfoFunc) ARGS((
332 Pst *pst, /* Post Structure */
333 UlSchInfo *ulSchInfo /* UL Sch Info */
336 /* function declarations */
337 int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
338 int packSchMacDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc);
339 int packSchMacUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo);
340 EXTERN int packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
341 EXTERN int packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
343 EXTERN int MacProcDlBrdcstAlloc(Pst *pst, DlBrdcstAlloc *dlBrdcstAlloc);
344 EXTERN int MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
345 EXTERN int MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
346 EXTERN int SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
347 EXTERN int schActvInit(Ent entity, Inst instId, Region region, Reason reason);
348 EXTERN S16 SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
349 EXTERN int MacProcUlSchInfo(Pst *pst, UlSchInfo *ulSchInfo);
351 /**********************************************************************
353 **********************************************************************/