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 */
24 #define MAXIMUM_TDD_PERIODICITY 5
25 #define MAX_SYMB_PER_SLOT 14
27 #define NUM_SSB 1 /* max value is 64 */
28 #define SSB_MASK_SIZE 1 /* SSB mask size is 32bit for sub6 */
29 #define SIB1_NEW_TX_PERIOD 160
30 #define SIB1_REPETITION_PERIOD 20
31 #define CORESET_0_INDEX 0
32 #define SEARCHSPACE_0_INDEX 0
33 #define SEARCHSPACE_1_INDEX 1
34 #define SS_MONITORING_SLOT_SL1 0 /* all slots */
35 #define SS_MONITORING_SYMBOL 0x2000; /* symbol-0, set 14th bit */
38 /* Macros for coupling */
44 #define EVENT_MAC_CELL_CONFIG_REQ 200
45 #define EVENT_MAC_CELL_CONFIG_CFM 201
46 #define EVENT_MAC_CELL_START_REQ 202
47 #define EVENT_MAC_CELL_STOP_REQ 203
48 #define EVENT_MAC_SLOT_IND 204
58 MAC_GEN_FULL_PBCH_PAYLD, /* MAC generated the full PBCH Payload */
59 PHY_GEN_TIMING_PBCH_BIT, /* PHY generates the timing PBCH bits */
60 PHY_GEN_FULL_PBCH_PAYLD /* PHY generates full PBCH payload */
72 RESTRICTED_SET_TYPE_A,
118 typedef struct carrierCfg
121 U16 bw; /* DL/UL bandwidth */
122 U32 freq; /* Absolute frequency of DL/UL point A in KHz */
123 U16 k0[NUM_NUMEROLOGY]; /* K0 for DL/UL */
124 U16 gridSize[NUM_NUMEROLOGY]; /* DL/UL Grid size for each numerologies */
125 U16 numAnt; /* Number of Tx/Rx antennas */
128 typedef struct ssbCfg
130 uint32_t ssbPbchPwr; /* SSB block power */
131 BchPduOpt bchPayloadFlag; /* Options for generation of payload */
132 uint8_t scsCmn; /* subcarrier spacing for common */
133 uint16_t ssbOffsetPointA; /* SSB subcarrier offset from point A */
135 SSBPeriod ssbPeriod; /* SSB Periodicity in msec */
136 uint8_t ssbScOffset; /* Subcarrier Offset */
137 uint8_t mibPdu[3]; /* MIB payload */
138 uint32_t ssbMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
139 uint8_t beamId[NUM_SSB];
140 Bool multCarrBand; /* Multiple carriers in a band */
141 Bool multCellCarr; /* Multiple cells in single carrier */
144 typedef struct fdmInfo
146 U16 rootSeqIdx; /* Root sequence index */
147 U8 numRootSeq; /* Number of root sequences required for FD */
148 U16 k1; /* Frequency Offset for each FD */
149 U8 zeroCorrZoneCfg; /* Zero correlation zone cofig */
150 U8 numUnusedRootSeq; /* Number of unused root sequence */
151 U8 *unsuedRootSeq; /* Unused root sequence per FD */
154 typedef struct prachCfg
157 uint8_t prachCfgIdx; /* PRACH Cfg Index */
158 PrachSeqLen prachSeqLen; /* RACH Sequence length: Long/short */
159 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
160 RstSetCfg prachRstSetCfg; /* PRACH restricted set config */
161 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
162 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
163 PrachFdmInfo fdm[8]; /* FDM info */
164 uint8_t ssbPerRach; /* SSB per RACH occassion */
165 Bool prachMultCarrBand; /* Multiple carriers in Band */
166 uint8_t prachRestrictedSet; /* Support for PRACH restricted set */
167 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
168 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
169 uint8_t raRspWindow; /* RA Response Window */
172 typedef struct tddCfg
175 DlUlTxPeriodicity tddPeriod; /* DL UL Transmission periodicity */
176 SlotConfig slotCfg[MAXIMUM_TDD_PERIODICITY][MAX_SYMB_PER_SLOT];
179 typedef struct sib1CellCfg
183 uint16_t sib1NewTxPeriod;
184 uint16_t sib1RepetitionPeriod;
185 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
186 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
190 typedef struct bwpParams
195 uint8_t cyclicPrefix;
198 typedef struct candidatesInfo
207 typedef struct searchSpaceCfg
209 uint8_t searchSpaceId;
211 uint16_t monitoringSlot;
213 uint16_t monitoringSymbol;
214 CandidatesInfo candidate;
217 typedef struct pdcchConfigCommon
219 SearchSpaceCfg raSearchSpace;
222 typedef struct bwpDlConfig
225 PdcchConfigCommon pdcchCommon;
228 typedef struct macCellCfg
231 U16 cellId; /* Cell Id */
232 U8 numTlv; /* Number of configuration TLVs */
233 U8 carrierId; /* Carrired Index */
234 U16 phyCellId; /* Physical cell id */
235 DuplexMode dupType; /* Duplex type: TDD/FDD */
236 CarrierCfg dlCarrCfg; /* DL Carrier configuration */
237 CarrierCfg ulCarrCfg; /* UL Carrier configuration */
238 Bool freqShft; /* Indicates presence of 7.5kHz frequency shift */
239 SsbCfg ssbCfg; /* SSB configuration */
240 PrachCfg prachCfg; /* PRACH Configuration */
241 TDDCfg tddCfg; /* TDD periodicity and slot configuration */
242 RSSIMeasUnit rssiUnit; /* RSSI measurement unit */
244 BwpDlConfig initialBwp;
247 typedef struct macCellCfgCfm
253 typedef struct slotInfo
260 typedef struct macCellStartInfo
265 typedef struct macCellStopInfo
270 /* Functions for slot Ind from MAC to DU APP*/
271 typedef uint16_t (*DuMacSlotInd) ARGS((
273 SlotInfo *slotInfo ));
275 extern uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo );
276 extern uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
277 extern uint16_t duHandleSlotInd(Pst *pst, SlotInfo *slotInfo);
279 /* Functions for mac cell start req */
280 typedef uint16_t (*DuMacCellStartReq) ARGS((
282 MacCellStartInfo *cellStartInfo ));
284 extern uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo);
285 extern uint16_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf);
286 extern uint16_t MacHdlCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo);
288 /* Functions for mac cell stop request */
289 typedef uint16_t (*DuMacCellStopReq) ARGS((
291 MacCellStopInfo *cellStopInfo ));
293 extern uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo);
294 extern uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf);
295 extern uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo);
297 /* Function pointers for packing macCellCfg Request and Confirm */
298 typedef int (*packMacCellCfgReq) ARGS((
300 MacCellCfg *macCellCfg ));
302 typedef int (*packMacCellCfgConfirm) ARGS((
304 MacCellCfgCfm *macCellCfgCfm ));
306 typedef int (*DuMacCellCfgReq) ARGS((
308 MacCellCfg *macCellCfg));
310 typedef int (*DuMacCellCfgCfm) ARGS((
312 MacCellCfgCfm *macCellCfgCfm ));
314 extern int packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
315 extern int MacHdlCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
316 extern void cmUnpackLwLcMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf);
317 extern int unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
318 extern int duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
322 /**********************************************************************
324 **********************************************************************/