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
35 /* Macros for coupling */
41 #define EVENT_MAC_CELL_CONFIG_REQ 200
42 #define EVENT_MAC_CELL_CONFIG_CFM 201
43 #define EVENT_MAC_CELL_START_REQ 202
44 #define EVENT_MAC_CELL_STOP_REQ 203
45 #define EVENT_MAC_SLOT_IND 204
55 MAC_GEN_FULL_PBCH_PAYLD, /* MAC generated the full PBCH Payload */
56 PHY_GEN_TIMING_PBCH_BIT, /* PHY generates the timing PBCH bits */
57 PHY_GEN_FULL_PBCH_PAYLD /* PHY generates full PBCH payload */
69 RESTRICTED_SET_TYPE_A,
115 typedef struct carrierCfg
118 U16 bw; /* DL/UL bandwidth */
119 U32 freq; /* Absolute frequency of DL/UL point A in KHz */
120 U16 k0[NUM_NUMEROLOGY]; /* K0 for DL/UL */
121 U16 gridSize[NUM_NUMEROLOGY]; /* DL/UL Grid size for each numerologies */
122 U16 numAnt; /* Number of Tx/Rx antennas */
125 typedef struct ssbCfg
127 uint32_t ssbPbchPwr; /* SSB block power */
128 BchPduOpt bchPayloadFlag; /* Options for generation of payload */
129 uint8_t scsCmn; /* subcarrier spacing for common */
130 uint16_t ssbOffsetPointA; /* SSB subcarrier offset from point A */
132 SSBPeriod ssbPeriod; /* SSB Periodicity in msec */
133 uint8_t ssbScOffset; /* Subcarrier Offset */
134 uint8_t mibPdu[3]; /* MIB payload */
135 uint32_t ssbMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
136 uint8_t beamId[NUM_SSB];
137 Bool multCarrBand; /* Multiple carriers in a band */
138 Bool multCellCarr; /* Multiple cells in single carrier */
141 typedef struct fdmInfo
143 U16 rootSeqIdx; /* Root sequence index */
144 U8 numRootSeq; /* Number of root sequences required for FD */
145 U16 k1; /* Frequency Offset for each FD */
146 U8 zeroCorrZoneCfg; /* Zero correlation zone cofig */
147 U8 numUnusedRootSeq; /* Number of unused root sequence */
148 U8 *unsuedRootSeq; /* Unused root sequence per FD */
151 typedef struct prachCfg
154 uint8_t prachCfgIdx; /* PRACH Cfg Index */
155 PrachSeqLen prachSeqLen; /* RACH Sequence length: Long/short */
156 uint8_t prachSubcSpacing; /* Subcarrier spacing of RACH */
157 RstSetCfg prachRstSetCfg; /* PRACH restricted set config */
158 uint16_t msg1FreqStart; /* Msg1-FrequencyStart */
159 uint8_t msg1Fdm; /* PRACH FDM (1,2,4,8) */
160 PrachFdmInfo fdm[8]; /* FDM info */
161 uint8_t ssbPerRach; /* SSB per RACH occassion */
162 Bool prachMultCarrBand; /* Multiple carriers in Band */
163 uint8_t prachRestrictedSet; /* Support for PRACH restricted set */
164 uint8_t raContResTmr; /* RA Contention Resoultion Timer */
165 uint8_t rsrpThreshSsb; /* RSRP Threshold SSB */
166 uint8_t raRspWindow; /* RA Response Window */
169 typedef struct tddCfg
172 DlUlTxPeriodicity tddPeriod; /* DL UL Transmission periodicity */
173 SlotConfig slotCfg[MAXIMUM_TDD_PERIODICITY][MAX_SYMB_PER_SLOT];
176 typedef struct sib1CellCfg
180 uint16_t sib1NewTxPeriod;
181 uint16_t sib1RepetitionPeriod;
182 uint8_t coresetZeroIndex; /* derived from 4 LSB of pdcchSib1 present in MIB */
183 uint8_t searchSpaceZeroIndex; /* derived from 4 MSB of pdcchSib1 present in MIB */
187 typedef struct macCellCfg
190 U16 cellId; /* Cell Id */
191 U8 numTlv; /* Number of configuration TLVs */
192 U8 carrierId; /* Carrired Index */
193 U16 phyCellId; /* Physical cell id */
194 DuplexMode dupType; /* Duplex type: TDD/FDD */
195 CarrierCfg dlCarrCfg; /* DL Carrier configuration */
196 CarrierCfg ulCarrCfg; /* UL Carrier configuration */
197 Bool freqShft; /* Indicates presence of 7.5kHz frequency shift */
198 SsbCfg ssbCfg; /* SSB configuration */
199 PrachCfg prachCfg; /* PRACH Configuration */
200 TDDCfg tddCfg; /* TDD periodicity and slot configuration */
201 RSSIMeasUnit rssiUnit; /* RSSI measurement unit */
205 typedef struct macCellCfgCfm
211 typedef struct slotInfo
218 typedef struct macCellStartInfo
223 typedef struct macCellStopInfo
228 /* Functions for slot Ind from MAC to DU APP*/
229 typedef uint16_t (*DuMacSlotInd) ARGS((
231 SlotInfo *slotInfo ));
233 extern uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo );
234 extern uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
235 extern uint16_t duHandleSlotInd(Pst *pst, SlotInfo *slotInfo);
237 /* Functions for mac cell start req */
238 typedef uint16_t (*DuMacCellStartReq) ARGS((
240 MacCellStartInfo *cellStartInfo ));
242 extern uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo);
243 extern uint16_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf);
244 extern uint16_t MacHdlCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo);
246 /* Functions for mac cell stop request */
247 typedef uint16_t (*DuMacCellStopReq) ARGS((
249 MacCellStopInfo *cellStopInfo ));
251 extern uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo);
252 extern uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf);
253 extern uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo);
255 /* Function pointers for packing macCellCfg Request and Confirm */
256 typedef uint16_t (*packMacCellCfgReq) ARGS((
258 MacCellCfg *macCellCfg ));
260 typedef uint16_t (*packMacCellCfgConfirm) ARGS((
262 MacCellCfgCfm *macCellCfgCfm ));
264 typedef uint16_t (*DuMacCellCfgReq) ARGS((
266 MacCellCfg *macCellCfg));
268 typedef uint16_t (*DuMacCellCfgCfm) ARGS((
269 MacCellCfgCfm *macCellCfgCfm ));
271 extern uint16_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
272 extern int MacHdlCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
273 extern void cmUnpackLwLcMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf);
274 extern uint16_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
275 extern uint16_t duHandleMacCellCfgCfm(MacCellCfgCfm *macCellCfgCfm);
279 /**********************************************************************
281 **********************************************************************/