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