Merge "[Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-472] Handling of drx timer in SCH...
[o-du/l2.git] / src / 5gnrmac / mac_cfg_hdl.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18 /* This file stores handler for MAC and SCH configuration requests */
19 /* header include files (.h) */
20 #include "common_def.h"
21 #include "lrg.h"
22 #include "lrg.x"
23 #include "du_app_mac_inf.h"
24 #include "mac_sch_interface.h"
25 #include "lwr_mac_upr_inf.h"
26 #include "mac.h"
27 #include "rlc_mac_inf.h"
28 #include "mac_upr_inf_api.h"
29 #include "lwr_mac.h"
30 #include "lwr_mac_fsm.h"
31 #include "mac_utils.h"
32 #include "lwr_mac_phy.h"
33
34 uint8_t ssbPeriodicity[6] = {5, 10, 20, 40, 80, 160};
35
36 uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg  *macCellCfg);
37
38 packMacCellCfgConfirm packMacCellCfmOpts[] =
39 {
40    packMacCellCfgCfm,      /* packing for loosely coupled */
41    duHandleMacCellCfgCfm,      /* packing for tightly coupled */
42    packMacCellCfgCfm,    /* packing for light weight loosly coupled */
43 };
44
45 SchCellCfgFunc SchCellCfgOpts[] =
46 {
47    packSchCellCfg,   /* packing for loosely coupled */
48    SchHdlCellCfgReq, /* packing for tightly coupled */
49    packSchCellCfg    /* packing for light weight loosly coupled */
50 };
51
52 MacSchCellDeleteReqFunc macSchCellDeleteReqOpts[]=
53 {
54    packMacSchCellDeleteReq,    /* packing for loosely coupled */
55    MacSchCellDeleteReq,        /* packing for tightly coupled */
56    packMacSchCellDeleteReq     /* packing for light weight loosely coupled */
57 };
58
59 MacDuCellDeleteRspFunc macDuCellDeleteRspOpts[] =
60 {
61    packDuMacCellDeleteRsp,   /* packing for loosely coupled */
62    DuProcMacCellDeleteRsp,   /* packing for tightly coupled */
63    packDuMacCellDeleteRsp   /* packing for light weight loosly coupled */
64 };
65
66 MacDuSliceCfgRspFunc macDuSliceCfgRspOpts[] =
67 {
68    packDuMacSliceCfgRsp,   /* packing for loosely coupled */
69    DuProcMacSliceCfgRsp,   /* packing for tightly coupled */
70    packDuMacSliceCfgRsp   /* packing for light weight loosly coupled */
71 };
72
73 MacDuSliceRecfgRspFunc macDuSliceRecfgRspOpts[] =
74 {
75    packDuMacSliceRecfgRsp,   /* packing for loosely coupled */
76    DuProcMacSliceRecfgRsp,   /* packing for tightly coupled */
77    packDuMacSliceRecfgRsp    /* packing for light weight loosly coupled */
78 };
79
80 MacSchPagingIndFunc macSchPagingIndOpts[] = 
81 {
82    packMacSchPagingInd,   /* packing for loosely coupled */
83    MacSchPagingInd,       /* packing for tightly coupled */
84    packMacSchPagingInd    /* packing for light weight loosely coupled */
85 };
86
87 /**
88  * @brief Layer Manager  Configuration request handler for Scheduler
89  *
90  * @details
91  *
92  *     Function : MacSchGenCfgReq
93  *
94  *     This function receives general configurations for Scheduler
95  *     from DU APP and forwards to Scheduler.
96  *
97  *  @param[in]  Pst *pst, the post structure
98  *  @param[in]  RgMngmt *cfg, the configuration parameter's structure
99  *  @return 
100  *      -# ROK
101  **/
102 uint8_t MacSchGenCfgReq(Pst *pst, RgMngmt *cfg)
103 {
104    Pst schPst;
105
106    printf("\nReceived Scheduler gen config at MAC");
107    memset(&schPst, 0, sizeof(Pst));
108    FILL_PST_MAC_TO_SCH(schPst, EVENT_SCH_GEN_CFG);
109    SchProcGenCfgReq(&schPst, cfg);
110
111    return ROK;
112 }
113
114 /**
115  * @brief Layer Manager Configuration response from Scheduler
116  *
117  * @details
118  *
119  *     Function : SchSendCfgCfm
120  *
121  *     This function sends general configurations response from
122  *     Scheduler to DU APP.
123  *
124  *  @param[in]  Pst *pst, the post structure
125  *  @param[in]  RgMngmt *cfm, the configuration confirm structure
126  *  @return 
127  *      -# ROK
128  **/
129 uint8_t SchSendCfgCfm(Pst *pst, RgMngmt  *cfm)
130 {
131    DU_LOG("\nDEBUG  -->  Sending Scheduler config confirm to DU APP");
132    pst->dstEnt = ENTDUAPP;
133    pst->dstInst = 0;
134    pst->srcInst = 0;
135    pst->selector = ODU_SELECTOR_LC;
136    RgMiLrgSchCfgCfm(pst, cfm);
137
138    return ROK;
139 }
140
141 /**
142  * @brief Layer Manager Configuration request handler.
143  *
144  * @details
145  *
146  *     Function : MacProcCellCfgReq
147  *
148  *     This function handles the gNB and cell configuration
149  *     request received from DU APP.
150  *     This API unapcks and forwards the config towards SCH
151  *
152  *  @param[in]  Pst           *pst
153  *  @param[in]  MacCellCfg    *macCellCfg
154  *  @return  
155  *      -# ROK
156  **/
157 uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
158 {
159    Pst cfmPst;
160    uint16_t cellIdx;
161    uint8_t ret = ROK, sliceIdx = 0;
162    MacCellCb     *macCellCb;
163
164    memset((uint8_t *)&cfmPst, 0, sizeof(Pst));
165
166    MAC_ALLOC(macCellCb, sizeof(MacCellCb));
167    if(macCellCb == NULLP)
168    {
169       DU_LOG("\nERROR  -->  MAC : macCellCb is NULL at handling of macCellCfg\n");
170       return RFAILED;
171    }
172    memset(macCellCb, 0, sizeof(MacCellCb));
173
174    GET_CELL_IDX(macCellCfg->cellId, cellIdx);
175    macCb.macCell[cellIdx] = macCellCb;
176    macCb.macCell[cellIdx]->cellId = macCellCfg->cellId;
177    macCb.macCell[cellIdx]->numOfSlots = 10 * (1 << macCellCfg->numerology);
178    memcpy(&macCb.macCell[cellIdx]->macCellCfg, macCellCfg, sizeof(MacCellCfg));
179
180    MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu, \
181          macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen);
182    if(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu == NULLP)
183    {
184       DU_LOG("\nERROR  -->  MAC : macCellCb is NULL at handling of sib1Pdu of macCellCfg\n");
185       return RFAILED;
186    }
187    memcpy(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1Pdu, \
188          macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen);
189    
190    macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.numSupportedSlice = macCellCfg->plmnInfoList.numSupportedSlice;
191    MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai, macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.numSupportedSlice\
192          * sizeof(Snssai*));
193    if(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai == NULLP)
194    {
195       DU_LOG("\nERROR  --> MAC: Memory allocation failed at MacProcCellCfgReq");
196       return RFAILED;
197    }
198
199    if(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai)
200    {
201       for(sliceIdx=0; sliceIdx<macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.numSupportedSlice; sliceIdx++)
202       {
203          if(macCellCfg->plmnInfoList.snssai[sliceIdx])
204          {
205             MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
206             if(!macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai[sliceIdx])
207             {
208                DU_LOG("\nERROR  --> MAC: Memory allocation failed at MacProcCellCfgReq");
209                return RFAILED;
210             }
211             memcpy(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai[sliceIdx], macCellCfg->plmnInfoList.snssai[sliceIdx],\
212             sizeof(Snssai));
213          }
214       }
215    }
216
217    /* Send cell cfg to scheduler */
218    ret = MacSchCellCfgReq(pst, macCellCfg);
219    if(ret != ROK)
220    {
221       MacCellCfgCfm macCellCfgCfm;
222       macCellCfgCfm.rsp = RSP_NOK;
223       macCellCfgCfm.cellId = macCellCfg->cellId;
224       /* Fill Pst */
225       FILL_PST_MAC_TO_DUAPP(cfmPst, EVENT_MAC_CELL_CONFIG_CFM);
226       cfmPst.selector  = ODU_SELECTOR_LC;
227
228       ret = (*packMacCellCfmOpts[cfmPst.selector])(&cfmPst,&macCellCfgCfm);
229    }
230    else
231    {
232       MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg ,sizeof(MacCellCfg));
233    }
234    return ret;
235 } /* end of MacProcCellCfgReq */
236
237 /**
238  * @brief Layer Manager Configuration request handler.
239  *
240  * @details
241  *
242  *     Function : MacSchCellCfgReq
243  *
244  *     This function sends cell configuration to SCH
245  *
246  *  @param[in]  Pst           *pst
247  *  @param[in]  MacCellCfg    *macCellCfg
248  *  @return  
249  *      -# ROK
250  **/
251 uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
252 {
253    SchCellCfg schCellCfg;
254    Pst        cfgPst;
255    uint8_t    ssbMaskIdx = 0, rsrcListIdx = 0, ret=0, sliceIdx=0;
256
257    memset(&cfgPst, 0, sizeof(Pst));
258    memset(&schCellCfg, 0, sizeof(SchCellCfg));
259    schCellCfg.cellId = macCellCfg->cellId;
260    schCellCfg.phyCellId = macCellCfg->phyCellId;
261    schCellCfg.numerology = macCellCfg->numerology;
262    schCellCfg.dupMode = macCellCfg->dupType;
263    schCellCfg.bandwidth = macCellCfg->dlCarrCfg.bw;
264    schCellCfg.dlFreq = macCellCfg->dlCarrCfg.freq;
265    schCellCfg.ulFreq = macCellCfg->ulCarrCfg.freq;
266
267    /* fill ssb scheduler parameters */
268    schCellCfg.ssbSchCfg.ssbPbchPwr = macCellCfg->ssbCfg.ssbPbchPwr;
269    schCellCfg.ssbSchCfg.scsCommon = macCellCfg->ssbCfg.scsCmn;
270    schCellCfg.ssbSchCfg.ssbOffsetPointA = macCellCfg->ssbCfg.ssbOffsetPointA;
271    schCellCfg.ssbSchCfg.ssbPeriod = ssbPeriodicity[macCellCfg->ssbCfg.ssbPeriod];
272    schCellCfg.ssbSchCfg.ssbSubcOffset = macCellCfg->ssbCfg.ssbScOffset;
273    for(ssbMaskIdx=0; ssbMaskIdx<SSB_MASK_SIZE; ssbMaskIdx++)
274    {
275       schCellCfg.ssbSchCfg.nSSBMask[ssbMaskIdx] = macCellCfg->ssbCfg.ssbMask[ssbMaskIdx];
276    }
277    schCellCfg.ssbSchCfg.totNumSsb = countSetBits(schCellCfg.ssbSchCfg.nSSBMask[0]);
278
279    /* fill SIB1 scheduler parameters */
280    schCellCfg.sib1SchCfg.sib1PduLen = macCellCfg->sib1Cfg.sib1PduLen;
281    schCellCfg.sib1SchCfg.sib1RepetitionPeriod = macCellCfg->sib1Cfg.sib1RepetitionPeriod;
282    schCellCfg.sib1SchCfg.coresetZeroIndex = macCellCfg->sib1Cfg.coresetZeroIndex;
283    schCellCfg.sib1SchCfg.searchSpaceZeroIndex = macCellCfg->sib1Cfg.searchSpaceZeroIndex;
284    schCellCfg.sib1SchCfg.sib1Mcs = macCellCfg->sib1Cfg.sib1Mcs;
285    schCellCfg.sib1SchCfg.pageCfg.numPO  =  macCellCfg->sib1Cfg.pagingCfg.numPO;
286    schCellCfg.sib1SchCfg.pageCfg.poPresent = macCellCfg->sib1Cfg.pagingCfg.poPresent;
287
288    if(schCellCfg.sib1SchCfg.pageCfg.poPresent)
289    {
290       memcpy(schCellCfg.sib1SchCfg.pageCfg.pagingOcc, macCellCfg->sib1Cfg.pagingCfg.pagingOcc, MAX_PO_PER_PF);
291    }
292
293    /* fill RACH config params */
294    schCellCfg.schRachCfg.prachCfgIdx = macCellCfg->prachCfg.prachCfgIdx;
295    schCellCfg.schRachCfg.prachSubcSpacing = \
296                                             macCellCfg->prachCfg.prachSubcSpacing;
297    schCellCfg.schRachCfg.msg1FreqStart = macCellCfg->prachCfg.msg1FreqStart;
298    schCellCfg.schRachCfg.msg1Fdm       = macCellCfg->prachCfg.msg1Fdm;
299    schCellCfg.schRachCfg.rootSeqLen    = macCellCfg->prachCfg.rootSeqLen;
300    schCellCfg.schRachCfg.rootSeqIdx    = macCellCfg->prachCfg.fdm[0].rootSeqIdx;
301    schCellCfg.schRachCfg.numRootSeq    = macCellCfg->prachCfg.fdm[0].numRootSeq;
302    schCellCfg.schRachCfg.k1            = macCellCfg->prachCfg.fdm[0].k1;
303    schCellCfg.schRachCfg.totalNumRaPreamble = macCellCfg->prachCfg.totalNumRaPreamble;
304    schCellCfg.schRachCfg.ssbPerRach    = macCellCfg->prachCfg.ssbPerRach;
305    schCellCfg.schRachCfg.numCbPreamblePerSsb = macCellCfg->prachCfg.numCbPreamblePerSsb;
306    schCellCfg.schRachCfg.prachMultCarrBand = macCellCfg->prachCfg.prachMultCarrBand;
307    schCellCfg.schRachCfg.raContResTmr  = macCellCfg->prachCfg.raContResTmr;
308    schCellCfg.schRachCfg.rsrpThreshSsb = macCellCfg->prachCfg.rsrpThreshSsb;
309    schCellCfg.schRachCfg.raRspWindow   = macCellCfg->prachCfg.raRspWindow;
310
311    /* fill initial DL BWP */
312    schCellCfg.schInitialDlBwp.bwp.freqAlloc.startPrb = macCellCfg->initialDlBwp.bwp.firstPrb;
313    schCellCfg.schInitialDlBwp.bwp.freqAlloc.numPrb = macCellCfg->initialDlBwp.bwp.numPrb;
314    schCellCfg.schInitialDlBwp.bwp.scs = macCellCfg->initialDlBwp.bwp.scs;
315    schCellCfg.schInitialDlBwp.bwp.cyclicPrefix = macCellCfg->initialDlBwp.bwp.cyclicPrefix;
316    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId =
317       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId;
318    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.coresetId =
319       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.coresetId;
320    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot =
321       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot;
322    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.duration =
323       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.duration;
324    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol =
325       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol;
326    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel1 =
327       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel1;
328    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel2 =
329       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel2;
330    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel4 =
331       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel4;
332    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel8 =
333       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel8;
334    schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel16 =
335       macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel16;
336    schCellCfg.schInitialDlBwp.pdschCommon.numTimeDomAlloc = macCellCfg->initialDlBwp.pdschCommon.numTimeDomAlloc;
337    for(rsrcListIdx = 0; rsrcListIdx<macCellCfg->initialDlBwp.pdschCommon.numTimeDomAlloc; rsrcListIdx++)
338    {
339       schCellCfg.schInitialDlBwp.pdschCommon.timeDomRsrcAllocList[rsrcListIdx].k0 = 
340          macCellCfg->initialDlBwp.pdschCommon.timeDomRsrcAllocList[rsrcListIdx].k0;
341       schCellCfg.schInitialDlBwp.pdschCommon.timeDomRsrcAllocList[rsrcListIdx].mappingType =
342          macCellCfg->initialDlBwp.pdschCommon.timeDomRsrcAllocList[rsrcListIdx].mappingType;
343       schCellCfg.schInitialDlBwp.pdschCommon.timeDomRsrcAllocList[rsrcListIdx].startSymbol =
344          macCellCfg->initialDlBwp.pdschCommon.timeDomRsrcAllocList[rsrcListIdx].startSymbol;
345       schCellCfg.schInitialDlBwp.pdschCommon.timeDomRsrcAllocList[rsrcListIdx].lengthSymbol =
346          macCellCfg->initialDlBwp.pdschCommon.timeDomRsrcAllocList[rsrcListIdx].lengthSymbol;
347    }
348
349    /* fill initial UL BWP */
350    schCellCfg.schInitialUlBwp.bwp.freqAlloc.startPrb = macCellCfg->initialUlBwp.bwp.firstPrb;
351    schCellCfg.schInitialUlBwp.bwp.freqAlloc.numPrb = macCellCfg->initialUlBwp.bwp.numPrb;
352    schCellCfg.schInitialUlBwp.bwp.scs = macCellCfg->initialUlBwp.bwp.scs;
353    schCellCfg.schInitialUlBwp.bwp.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix;
354    schCellCfg.schInitialUlBwp.puschCommon.numTimeDomRsrcAlloc = \
355       macCellCfg->initialUlBwp.puschCommon.numTimeDomRsrcAlloc;
356    for(rsrcListIdx = 0; rsrcListIdx < macCellCfg->initialUlBwp.puschCommon.numTimeDomRsrcAlloc; rsrcListIdx++)
357    {
358       schCellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].k2 = 
359          macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].k2;
360       schCellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].mappingType =
361          macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].mappingType;
362       schCellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].startSymbol =
363          macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].startSymbol;
364       schCellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].symbolLength =
365          macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[rsrcListIdx].symbolLength;
366    }
367
368    if(macCellCfg->plmnInfoList.snssai) 
369    {
370       schCellCfg.plmnInfoList.numSliceSupport = macCellCfg->plmnInfoList.numSupportedSlice;
371       MAC_ALLOC(schCellCfg.plmnInfoList.snssai, schCellCfg.plmnInfoList.numSliceSupport * sizeof(Snssai*));
372       if(!schCellCfg.plmnInfoList.snssai)
373       {
374          DU_LOG("\nERROR  --> MAC: Memory allocation failed at MacSchCellCfgReq");
375          return RFAILED;
376       }
377       for(sliceIdx=0; sliceIdx<schCellCfg.plmnInfoList.numSliceSupport; sliceIdx++)
378       {
379          if(macCellCfg->plmnInfoList.snssai[sliceIdx])
380          {
381             MAC_ALLOC(schCellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
382             if(!schCellCfg.plmnInfoList.snssai[sliceIdx])
383             {
384                DU_LOG("\nERROR  --> MAC: Memory allocation failed at MacSchCellCfgReq");
385                return RFAILED;
386             }
387             memcpy(schCellCfg.plmnInfoList.snssai[sliceIdx], macCellCfg->plmnInfoList.snssai[sliceIdx],  sizeof(Snssai));
388          }
389       }
390    }
391
392 #ifdef NR_TDD
393    memcpy(&schCellCfg.tddCfg, &macCellCfg->tddCfg, sizeof(TDDCfg));
394 #endif
395
396    FILL_PST_MAC_TO_SCH(cfgPst, EVENT_SCH_CELL_CFG);
397
398    ret = (*SchCellCfgOpts[cfgPst.selector])(&cfgPst, &schCellCfg);
399    return ret;
400 } /* end of MacSchCellCfgReq */
401
402
403 /*******************************************************************
404  *
405  * @brief Sends Cell config confirm to DU APP
406  *
407  * @details
408  *
409  *    Function : MacSendCellCfgCfm
410  *
411  *    Functionality:
412  *      Sends Cell config confirm to DU APP
413  *
414  * @params[in] Response status
415  * @return void
416  *
417  * ****************************************************************/
418 void MacSendCellCfgCfm(uint16_t cellId, uint8_t response)
419 {
420    Pst pst;
421    uint16_t   cellIdx;
422    MacCellCfgCfm macCellCfgCfm;
423
424    memset(&pst, 0, sizeof(Pst));
425
426    GET_CELL_IDX(cellId, cellIdx);
427    macCellCfgCfm.cellId = macCb.macCell[cellIdx]->macCellCfg.cellId;
428    macCellCfgCfm.rsp = response;
429
430    /* Fill Pst */
431    FILL_PST_MAC_TO_DUAPP(pst, EVENT_MAC_CELL_CONFIG_CFM);
432    pst.selector  = ODU_SELECTOR_LC;
433
434    (*packMacCellCfmOpts[pst.selector])(&pst,&macCellCfgCfm);
435 }
436
437
438 /**
439  * @brief Layer Manager Configuration response handler.
440  *
441  * @details
442  *
443  *     Function : MacProcSchCellCfgCfm
444  *
445  *     This function processes cell configuration to SCH
446  *
447  *  @param[in]  Pst           *pst
448  *  @param[in]  SchCellCfgCfm *schCellCfgCfm
449  *  @return  int
450  *      -# ROK
451  **/
452 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm)
453 {
454    uint16_t *cellId = NULLP;
455
456 #ifdef CALL_FLOW_DEBUG_LOG
457    DU_LOG("\nCall Flow: ENTSCH -> ENTMAC : EVENT_SCH_CELL_CFG_CFM\n");
458 #endif
459
460    if(schCellCfgCfm->rsp == RSP_OK)
461    {
462       cellId = &schCellCfgCfm->cellId;
463 #ifdef INTEL_TIMER_MODE
464       sendToLowerMac(UL_IQ_SAMPLE, 0, (void *)cellId);
465 #else
466       sendToLowerMac(CONFIG_REQUEST, 0, (void *)cellId);
467 #endif
468    }
469    else
470    {
471       MacSendCellCfgCfm(schCellCfgCfm->cellId, RSP_NOK);
472    }
473    return ROK;
474 }
475
476 /*******************************************************************
477  *
478  * @brief MAC handler for config response from PHY
479  *
480  * @details
481  *
482  *    Function : fapiMacConfigRsp
483  *
484  *    Functionality:
485  *     Processes config response from PHY and sends cell config
486  *     confirm to DU APP
487  *
488  * @params[in]
489  * @return void
490  *
491  * ****************************************************************/
492 void fapiMacConfigRsp(uint16_t cellId)
493 {
494    /* TODO : Processing of config response from PHY */
495
496    /* Send cell config cfm to DU APP */
497    MacSendCellCfgCfm(cellId, RSP_OK);
498 }
499
500 /*******************************************************************
501  *
502  * @brief Fill and Send Cell Delete response from MAC to DU APP
503  *
504  * @details
505  *
506  *    Function : MacSendCellDeleteRsp
507  *
508  *    Functionality: Fill and Send Cell Delete response from MAC to DUAPP
509  *
510  * @params[in] MAC Cell delete result
511  *             SCH Cell delete response
512  * @return ROK     - success
513  *         RFAILED - failure
514  *
515  * ****************************************************************/
516 uint8_t MacSendCellDeleteRsp(CellDeleteStatus result, uint8_t cellId)
517 {
518    MacCellDeleteRsp *deleteRsp=NULLP;
519    Pst            rspPst;
520
521    MAC_ALLOC_SHRABL_BUF(deleteRsp, sizeof(MacCellDeleteRsp));
522    if(!deleteRsp)
523    {
524       DU_LOG("\nERROR  -->  MAC : MacSendCellDeleteRsp(): Memory allocation for Cell delete response failed");
525       return RFAILED;
526    }
527
528    /* Filling CELL delete response */
529    
530    memset(deleteRsp, 0, sizeof(MacCellDeleteRsp));
531    deleteRsp->cellId = cellId;
532    deleteRsp->result = result;
533
534    /* Fill Post structure and send CELL delete response*/
535    memset(&rspPst, 0, sizeof(Pst));
536    FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_CELL_DELETE_RSP);
537    return (*macDuCellDeleteRspOpts[rspPst.selector])(&rspPst, deleteRsp);
538 }
539
540 /*******************************************************************
541  *
542  * @brief  Processes CELL delete response from scheduler
543  *
544  * @details
545  *
546  *    Function : MacProcSchCellDeleteRsp
547  *
548  *    Functionality:
549  *      Processes CELL delete from scheduler
550  *
551  * @params[in] Pst : Post structure
552  *             schCellDelRsp : Scheduler CELL delete respons
553  * @return ROK     - success
554  *         RFAILED - failure
555  *
556  * * ****************************************************************/
557 uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDelRsp)
558 {
559    uint8_t  ret = ROK, sliceIdx = 0;
560    uint16_t cellIdx=0;
561    CellDeleteStatus status;
562    
563 #ifdef CALL_FLOW_DEBUG_LOG
564    DU_LOG("\nCall Flow: ENTSCH -> ENTMAC : EVENT_CELL_DELETE_RSP_TO_MAC\n");
565 #endif  
566
567    if(schCellDelRsp)
568    {
569       if(schCellDelRsp->rsp == RSP_OK)
570       {
571          DU_LOG("\nINFO   -->  MAC : SCH CELL Delete response for cellId[%d] is successful ", \
572          schCellDelRsp->cellId);
573          GET_CELL_IDX(schCellDelRsp->cellId, cellIdx);
574          if(macCb.macCell[cellIdx])
575          {
576             if(macCb.macCell[cellIdx]->cellId == schCellDelRsp->cellId)
577             {
578                status  = SUCCESSFUL_RSP;
579                if(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai)
580                {
581                   for(sliceIdx = 0; sliceIdx<macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.numSupportedSlice; sliceIdx++)
582                   {
583                      MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
584                   }
585                   MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.snssai, macCb.macCell[cellIdx]->macCellCfg.plmnInfoList.\
586                   numSupportedSlice * sizeof(Snssai*));
587                }
588                MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu, \
589                   macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen);
590                MAC_FREE(macCb.macCell[cellIdx], sizeof(MacCellCb));
591             }
592             else
593             {
594                 DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
595                 status = CELL_ID_INVALID;
596                 ret = RFAILED;
597             }
598          }
599          else
600          {
601             DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
602             status = CELL_ID_INVALID;
603             ret = RFAILED;
604          }
605       }
606       else
607       {
608          DU_LOG("ERROR  -->  MAC : MacProcSchCellDeleteRsp(): CellId[%d] does not exists", schCellDelRsp->cellId);
609          status = CELL_ID_INVALID;
610          ret = RFAILED;
611       }
612       if(MacSendCellDeleteRsp(status, schCellDelRsp->cellId) != ROK)
613       {
614          DU_LOG("\nERROR  -->  MAC: MacProcSchCellDeleteRsp(): Failed to send CELL delete response");
615          ret = RFAILED;
616       }
617
618    }
619    else
620    {
621       DU_LOG("\nERROR  -->  MAC: MacProcSchCellDeleteRsp(): schCellDelRsp is NULL");
622       ret = RFAILED;
623    }
624    return ret;
625 }
626
627 /*******************************************************************
628  *
629  * @brief Sends Cell delete req to Scheduler
630  *
631  * @details
632  *
633  *    Function : sendCellDelReqToSch
634  *
635  *    Functionality: sends Cell delete req to Scheduler
636  *
637  * @params[in]  SchCellDelete *schCellDel
638  * @return ROK     - success
639  *         RFAILED - failure
640  *
641  * ****************************************************************/
642
643 uint8_t sendCellDelReqToSch(SchCellDeleteReq *schCellDelReq)
644 {
645    Pst schPst;
646    FILL_PST_MAC_TO_SCH(schPst, EVENT_CELL_DELETE_REQ_TO_SCH);
647    return(*macSchCellDeleteReqOpts[schPst.selector])(&schPst, schCellDelReq);
648 }
649
650 /*******************************************************************
651  *
652  * @brief Handles CELL Delete requst from DU APP
653  *
654  * @details
655  *
656  *    Function : MacProcCellDeleteReq
657  *
658  *    Functionality: Handles CELL Delete requst from DU APP
659  *
660  * @params[in] Pst *pst, MacCellDelete *cellDelete
661  * @return ROK     - success
662  *         RFAILED - failure
663  *
664  *
665  * ****************************************************************/
666 uint8_t MacProcCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete)
667 {
668    uint8_t ret = ROK, cellIdx=0;
669    SchCellDeleteReq schCellDelete;
670
671    DU_LOG("\nINFO   -->  MAC : Cell Delete Request received for cellId[%d]", cellDelete->cellId);
672
673    if(cellDelete)
674    {
675       GET_CELL_IDX(cellDelete->cellId, cellIdx);
676       if(macCb.macCell[cellIdx])
677       {
678          if(macCb.macCell[cellIdx]->cellId == cellDelete->cellId)
679          {
680             memset(&schCellDelete, 0, sizeof(SchCellDeleteReq ));
681             schCellDelete.cellId =  cellDelete->cellId;
682             ret = sendCellDelReqToSch(&schCellDelete);
683             if(ret != ROK)
684             {
685                DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Failed to send UE Delete Request to SCH");
686                ret = RFAILED;
687             }
688          }
689          else
690          {
691             DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Failed to find the MacUeCb of CellId = %d",\
692             cellDelete->cellId);
693             ret = RFAILED;
694          }
695       }
696       else
697       {
698          DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Failed to find the MacUeCb of CellId = %d",\
699                cellDelete->cellId);
700          ret = RFAILED;
701       }
702
703       if(ret == RFAILED)
704       {
705           DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Sending failure response to DU");
706           if(MacSendCellDeleteRsp(CELL_ID_INVALID, cellDelete->cellId) != ROK)
707           {
708              DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): failed to send cell delete rsp for cellID[%d]",\
709              cellDelete->cellId);
710           }
711
712       }
713       MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellDelete, sizeof(MacCellDeleteReq));
714    }
715    else
716    {
717       DU_LOG("\nERROR  -->  MAC : MacProcCellDeleteReq(): Received MacCellDelete is NULL");
718       ret = RFAILED;
719    }
720    return ret;
721 }
722
723 /**
724  * @brief free the temporary slice cfg stored in macCb.
725  *
726  * @details
727  *
728  *     Function : freeMacSliceCfgReq 
729  *
730  *   free the temporary slice cfg stored in macCb
731  *
732  *  @param[in]  
733  *  @return  int
734  *      -# ROK
735  **/
736 void freeMacSliceCfgReq(MacSliceCfgReq *cfgReq,Pst *pst)
737 {
738    uint8_t cfgIdx = 0;
739    
740    if(cfgReq)
741    {
742       if(cfgReq->numOfConfiguredSlice)
743       {
744          for(cfgIdx = 0; cfgIdx<cfgReq->numOfConfiguredSlice; cfgIdx++)
745          {
746             if(cfgReq->listOfSliceCfg[cfgIdx])
747             {
748                MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfSliceCfg[cfgIdx]->rrmPolicyRatio, sizeof(RrmPolicyRatio)); 
749             }
750             MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfSliceCfg[cfgIdx], sizeof(MacSliceRrmPolicy));
751          }
752          MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfSliceCfg, cfgReq->numOfConfiguredSlice * sizeof(MacSliceRrmPolicy*));
753       }
754       MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq, sizeof(MacSliceCfgReq));
755    }
756 }
757 /**
758  * @brief fill Mac Slice Config Rsp
759  *
760  * @details
761  *
762  *     Function : fillMacSliceCfgRsp 
763  *
764  *     This function   fill Mac Slice Config Rsp
765  *
766  *  @param[in]  SchSliceCfgRsp *sliceCfgRsp, MacSliceCfgRsp *macSliceCfgRsp,
767  *  uint8_t *count
768  *  @return  int
769  *      -# ROK
770  **/
771 uint8_t fillMacSliceCfgRsp(SchSliceCfgRsp *schSliceCfgRsp, MacSliceCfgRsp *macSliceCfgRsp)
772 {
773    
774     bool sliceFound = false;
775     uint8_t cfgIdx = 0;
776
777     macSliceCfgRsp->numSliceCfgRsp  = schSliceCfgRsp->numSliceCfgRsp;
778     MAC_ALLOC_SHRABL_BUF(macSliceCfgRsp->listOfSliceCfgRsp,  macSliceCfgRsp->numSliceCfgRsp* sizeof(MacSliceRsp*));
779     if(macSliceCfgRsp->listOfSliceCfgRsp == NULLP)
780     {
781        DU_LOG("\nERROR  -->  MAC : Memory allocation failedi in fillMacSliceCfgRsp");
782        return RFAILED;
783     }
784
785     for(cfgIdx = 0; cfgIdx<schSliceCfgRsp->numSliceCfgRsp; cfgIdx++)
786     {
787        sliceFound = false;
788        if(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp == RSP_OK)
789        {
790           sliceFound = true;
791        }
792
793        MAC_ALLOC_SHRABL_BUF(macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(SliceRsp));
794        if(macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx] == NULLP)
795        {
796           DU_LOG("\nERROR  -->  MAC : Memory allocation failedi in fillMacSliceCfgRsp");
797           return RFAILED;
798        }
799
800        macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->snssai = schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->snssai;
801        if(sliceFound == true)
802           macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp    = MAC_DU_APP_RSP_OK;
803        else
804        {
805           macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->rsp    = MAC_DU_APP_RSP_NOK;
806           macSliceCfgRsp->listOfSliceCfgRsp[cfgIdx]->cause  = SLICE_NOT_PRESENT;
807        }
808     }
809     return ROK;
810 }
811
812 /**
813  * @brief send slice cfg response to duapp.
814  *
815  * @details
816  *
817  *     Function : MacSendSliceConfigRsp
818  *
819  *   sends  slice cfg response to duapp
820  *
821  *  @param[in] MacSliceCfgRsp macSliceCfgRsp 
822  *  @return  int
823  *      -# ROK
824  **/
825 uint8_t MacSendSliceConfigRsp(MacSliceCfgRsp *macSliceCfgRsp)
826 {
827     Pst  rspPst;
828     
829     memset(&rspPst, 0, sizeof(Pst));
830     FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_SLICE_CFG_RSP);
831     return (*macDuSliceCfgRspOpts[rspPst.selector])(&rspPst, macSliceCfgRsp);
832
833 }
834 /**
835  * @brief free the slice cfg rsp received from sch.
836  *
837  * @details
838  *
839  *     Function : freeSchSliceCfgRsp 
840  *
841  *     This free the slice cfg rsp received from sch
842  *
843  *  @param[in]  SchSliceCfgRsp *sliceCfgrsp
844  *  @return  int
845  *      -# ROK
846  **/
847 void freeSchSliceCfgRsp(SchSliceCfgRsp *schSliceCfgRsp)
848 {
849    uint8_t cfgIdx = 0;
850
851    if(schSliceCfgRsp)
852    {
853       if(schSliceCfgRsp->numSliceCfgRsp)
854       {
855          for(cfgIdx = 0; cfgIdx< schSliceCfgRsp->numSliceCfgRsp; cfgIdx++)
856          {
857             MAC_FREE(schSliceCfgRsp->listOfSliceCfgRsp[cfgIdx], sizeof(SliceRsp));
858          }
859          MAC_FREE(schSliceCfgRsp->listOfSliceCfgRsp, schSliceCfgRsp->numSliceCfgRsp * sizeof(SliceRsp*));
860       }
861    }
862 }
863
864 /**
865  * @brief Mac process the slice cfg rsp received from sch.
866  *
867  * @details
868  *
869  *     Function : MacProcSchSliceCfgRsp 
870  *
871  *     This function  process the slice cfg rsp received from sch
872  *
873  *  @param[in]  Pst           *pst
874  *  @param[in]  SchSliceCfgRsp *sliceCfgrsp
875  *  @return  int
876  *      -# ROK
877  **/
878 uint8_t MacProcSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *schSliceCfgRsp)
879 {
880    MacSliceCfgRsp *macSliceCfgRsp = NULLP;
881
882    if(schSliceCfgRsp)
883    {
884       MAC_ALLOC_SHRABL_BUF(macSliceCfgRsp, sizeof(MacSliceCfgRsp));
885       if(macSliceCfgRsp == NULLP)
886       {
887           DU_LOG("\nERROR  -->  MAC : Failed to allocate memory in MacProcSchSliceCfgRsp");
888           return RFAILED;
889       }
890       if(schSliceCfgRsp->listOfSliceCfgRsp)
891       {
892          if(fillMacSliceCfgRsp(schSliceCfgRsp, macSliceCfgRsp) != ROK)
893          {
894             DU_LOG("\nERROR  -->  MAC : Failed to fill the slice cfg response");
895             return RFAILED;
896          }
897          MacSendSliceConfigRsp(macSliceCfgRsp);
898       }
899       freeSchSliceCfgRsp(schSliceCfgRsp);
900    }
901    return ROK;
902 }
903
904 /**
905 * @brief send slice cfg response to duapp.
906 *
907 * @details
908 *
909 *     Function : MacSendSliceReconfigRsp 
910 *
911 *   sends  slice cfg response to duapp
912 *
913 *  @param[in] MacSliceRecfgRsp macSliceRecfgRsp
914 *  @return  int
915 *      -# ROK
916 **/
917 uint8_t MacSendSliceReconfigRsp(MacSliceRecfgRsp *macSliceRecfgRsp)
918 {
919    Pst  rspPst;
920
921    memset(&rspPst, 0, sizeof(Pst));
922    FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_SLICE_RECFG_RSP);
923    return (*macDuSliceRecfgRspOpts[rspPst.selector])(&rspPst, macSliceRecfgRsp);
924
925 }
926
927 /**
928  * @brief Mac process the slice cfg rsp received from sch.
929  *
930  * @details
931  *
932  *     Function : MacProcSchSliceRecfgRsp 
933  *
934  *     This function  process the slice cfg rsp received from sch
935  *
936  *  @param[in]  Pst           *pst
937  *  @param[in]  SchSliceCfgRsp *schSliceRecfgRsp
938  *  @return  int
939  *      -# ROK
940  **/
941 uint8_t MacProcSchSliceRecfgRsp(Pst *pst, SchSliceRecfgRsp *schSliceRecfgRsp)
942 {
943    MacSliceRecfgRsp *macSliceRecfgRsp = NULLP;
944
945    if(schSliceRecfgRsp)
946    {
947       MAC_ALLOC_SHRABL_BUF(macSliceRecfgRsp, sizeof(MacSliceRecfgRsp));
948       if(macSliceRecfgRsp == NULLP)
949       {
950           DU_LOG("\nERROR  -->  MAC : Failed to allocate memory in MacProcSchSliceRecfgRsp");
951           return RFAILED;
952       }
953
954       if(schSliceRecfgRsp->listOfSliceCfgRsp)
955       {
956          if(fillMacSliceCfgRsp(schSliceRecfgRsp, macSliceRecfgRsp) != ROK)
957          {
958             DU_LOG("\nERROR  -->  MAC : Failed to fill the slice Recfg response");
959             return RFAILED;
960          }
961          MacSendSliceReconfigRsp(macSliceRecfgRsp);
962       }
963       freeSchSliceCfgRsp(schSliceRecfgRsp);
964    }
965    return ROK;
966 }
967
968 /**
969  * @brief Mac process the downlink pcch indication received from DUAPP
970  *
971  * @details
972  *
973  *     Function : MacProcDlPcchInd 
974  *
975  *     This function process the downlink pcch indication received from DUAPP
976  *
977  *  @param[in]  Pst           *pst
978  *  @param[in]  DlPcchInd    *pcchInd 
979  *  @return  int
980  *      -# ROK
981  **/
982 uint8_t MacProcDlPcchInd(Pst *pst, DlPcchInd *pcchInd)
983 {
984    uint8_t ret = RFAILED;
985    uint16_t cellIdx = 0;
986    Pst       schPst;
987    SchPageInd *schPageInd = NULLP;
988
989    if(pcchInd)
990    {
991       DU_LOG("\nINFO   -->  MAC : Received DL PCCH IND from DU_APP for cellId[%d]", pcchInd->cellId);
992       
993       GET_CELL_IDX(pcchInd->cellId, cellIdx);
994
995       if(macCb.macCell[cellIdx] == NULLP || macCb.macCell[cellIdx]->cellId != pcchInd->cellId)
996       {
997          DU_LOG("\nERROR  -->  MAC : MacProcDlPcchInd(): CellId[%d] does not exist", pcchInd->cellId);
998       }
999       else
1000       {
1001          if((pcchInd->pcchPdu == NULLP) || (pcchInd->pduLen <= 0))
1002          {
1003             DU_LOG("\nERROR  -->  MAC : MacProcDlPcchInd(): Received Pcch pdu is null");
1004          }
1005          else
1006          {
1007             MAC_ALLOC(schPageInd, sizeof(SchPageInd));
1008             if(schPageInd == NULLP)
1009             {
1010                DU_LOG("\nERROR  -->  MAC : MacProcDlPcchInd(): Failed to allocate memory");
1011             }
1012             else
1013             {
1014                schPageInd->cellId = pcchInd->cellId;
1015                schPageInd->pf = pcchInd->pf;
1016                schPageInd->i_s = pcchInd->i_s;
1017                schPageInd->pduLen = pcchInd->pduLen;
1018                
1019                MAC_ALLOC(schPageInd->pagePdu, pcchInd->pduLen);
1020                if(schPageInd->pagePdu == NULLP)
1021                {
1022                   DU_LOG("\nERROR  -->  MAC : MacProcDlPcchInd(): Failed to allocate memory");
1023                   MAC_FREE(schPageInd, sizeof(SchPageInd));
1024                }
1025                else
1026                {
1027                   memcpy(schPageInd->pagePdu, pcchInd->pcchPdu, pcchInd->pduLen);
1028
1029                   FILL_PST_MAC_TO_SCH(schPst, EVENT_PAGING_IND_TO_SCH);
1030                   ret = (*macSchPagingIndOpts[schPst.selector])(&schPst, schPageInd);
1031                }
1032             }
1033          }
1034       }
1035       if((pcchInd->pcchPdu) && (pcchInd->pduLen > 0))
1036       {
1037          MAC_FREE_SHRABL_BUF(pst->region, pst->pool, pcchInd->pcchPdu, pcchInd->pduLen);
1038       }
1039       MAC_FREE_SHRABL_BUF(pst->region, pst->pool, pcchInd, sizeof(DlPcchInd));
1040    }
1041    else
1042    {
1043       DU_LOG("\nERROR  -->  MAC : MacProcDlPcchInd(): Received Null pointer");
1044    }
1045    return ret;
1046 }
1047 /**********************************************************************
1048   End of file
1049  **********************************************************************/