c2165da6063d9be8217e6137e008b677e01d968d
[o-du/l2.git] / src / cm / du_app_mac_inf.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
19 #include "common_def.h"
20 #include "du_app_mac_inf.h"
21
22 /**************************************************************************
23  * @brief Function to pack Loose Coupled 
24  *        MAC cell config parameters required by MAC
25  *
26  * @details
27  *
28  *      Function : packMacCellCfg
29  *
30  *      Functionality:
31  *           packs the macCellCfg parameters
32  *
33  * @param[in] Pst     *pst, Post structure of the primitive.
34  * @param[in] MacCellCfg  *macCellCfg, mac cell config parameters.
35  * @return ROK     - success
36  *         RFAILED - failure
37  *
38  ***************************************************************************/
39 uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
40 {
41    if(pst->selector == ODU_SELECTOR_LC)
42    {
43       /* we are now implemented only light wieght lossely coupled interface */
44       return RFAILED;
45    }
46    else if(pst->selector == ODU_SELECTOR_LWLC)
47    {
48       Buffer *mBuf = NULLP;
49
50       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
51       {
52          return RFAILED;
53       }
54
55       /* pack the address of the structure */
56       CMCHKPK(oduPackPointer,(PTR)macCellCfg, mBuf);
57
58       DU_LOG("\nDEBUG  -->  DU-APP : MAC CELL config sent");
59       return ODU_POST_TASK(pst,mBuf);
60    } 
61    return ROK;
62 }
63
64 /**************************************************************************
65  * @brief Function to pack Loose Coupled 
66  *        MAC cell config parameters required by MAC
67  *
68  * @details
69  *
70  *      Function : unpackDuMacCellCfg
71  *
72  *      Functionality:
73  *           packs the macCellCfg parameters
74  *
75  * @param[in] DuMacCellCfgReq func; function pointer
76  * @param[in] Pst     *pst, Post structure of the primitive.
77  * @param[in] Buffer *mBuf
78  * @return ROK     - success
79  *         RFAILED - failure
80  *
81  ***************************************************************************/
82 uint8_t  unpackDuMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf)
83 {
84    uint16_t ret = ROK;
85    MacCellCfg *macCellCfg;
86
87    if(pst->selector == ODU_SELECTOR_LWLC)
88    {
89       /* unpack the address of the structure */
90       CMCHKUNPK(oduUnpackPointer, (PTR *)&macCellCfg, mBuf);
91       ret = (*func)(pst, macCellCfg);
92    }
93    else
94    {
95       /* only LWLC is implemented now */
96       ret = ROK;
97    }
98
99    return ret;
100 }
101
102 /**************************************************************************
103  * @brief Function to pack Loose Coupled 
104  *        MAC cell config confirm message
105  *
106  * @details
107  *
108  *      Function : packMacCellCfgCfm
109  *
110  *      Functionality:
111  *           packs the transaction ID  
112  *
113  * @param[in] Pst     *pst, Post structure of the primitive.
114  * @param[in] MacCellCfgCfm  *macCellCfgCfm, mac cell config confirm.
115  * @return ROK     - success
116  *         RFAILED - failure
117  *
118  ***************************************************************************/
119 uint8_t  packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
120 {
121    if(pst->selector == ODU_SELECTOR_LC)
122    {
123       Buffer *mBuf = NULLP;
124       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
125       {
126          return RFAILED;
127       }
128
129       /* pack the transaction ID in CNF structure */
130       CMCHKPK(oduUnpackUInt16, macCellCfgCfm->cellId, mBuf);
131       CMCHKPK(oduUnpackUInt8, macCellCfgCfm->rsp, mBuf);
132
133       return ODU_POST_TASK(pst,mBuf);
134    }
135    else if(pst->selector == ODU_SELECTOR_LWLC)
136    {
137       /* only LC is supported */
138       return RFAILED;
139    }
140    return ROK;
141 }
142
143 /**************************************************************************
144  * @brief Function to pack MAC cell config confirm message
145  *
146  * @details
147  *
148  *      Function : unpackMacCellCfgCfm
149  *
150  *      Functionality:
151  *           packs the transaction ID  
152  *
153  * @param[in] DuMacCellCfgCfm func; function pointer
154  * @param[in] Pst     *pst, Post structure of the primitive.
155  * @param[in] Buffer *mBuf
156  * @return ROK     - success
157  *         RFAILED - failure
158  *
159  ***************************************************************************/
160 uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf)
161 {
162    MacCellCfgCfm macCellCfgCfm;
163
164    if(pst->selector == ODU_SELECTOR_LC)
165    {
166       /* unpack the transaction ID in CNF structure */
167       CMCHKUNPK(oduPackUInt8, &(macCellCfgCfm.rsp), mBuf);
168       CMCHKUNPK(oduPackUInt16, &(macCellCfgCfm.cellId), mBuf);
169       return (*func)(pst, &macCellCfgCfm);
170    }
171    else
172    {
173       /* only loose coupling is suported */
174       return ROK;
175    }
176 }
177
178 /*******************************************************************
179  *
180  * @brief Packs and Send Cell Start Request to MAC
181  *
182  * @details
183  *
184  *    Function : packMacCellStart
185  *
186  *    Functionality:
187  *      Packs and Sends Cell Start Request to MAC
188  *
189  * @params[in] Post structure pointer
190  *             Cell Id
191  * @return ROK     - success
192  *         RFAILED - failure
193  *
194  * ****************************************************************/
195 uint8_t packMacCellStart(Pst *pst, CellStartInfo *cellStart)
196 {
197    Buffer *mBuf = NULLP;
198
199    if(pst->selector == ODU_SELECTOR_LC)
200    {
201       /* Loose coupling not supported */
202       return RFAILED;
203    }
204    else if(pst->selector == ODU_SELECTOR_LWLC)
205    {
206
207       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
208       {
209          DU_LOG("\nERROR  --> DU APP : Memory allocation failed for cell start req pack");
210          return RFAILED;
211       }
212
213       /* pack the address of the structure */
214       CMCHKPK(oduPackPointer,(PTR)cellStart, mBuf);
215
216    }
217    return ODU_POST_TASK(pst,mBuf);
218 }
219
220 /*******************************************************************
221  *
222  * @brief Unpacks MAC Cell Start Request from DU APP
223  *
224  * @details
225  *
226  *    Function : unpackMaCellStart
227  *
228  *    Functionality:
229  *      Unpacks MAC Cell Start Request from DU APP
230  *
231  * @params[in] Function pointer of cell start request handler
232  *             Post structure pointer
233  *             Message Buffer
234  * @return ROK     - success
235  *         RFAILED - failure
236  *
237  * ****************************************************************/
238 uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf)
239 {
240    CellStartInfo  *cellStart;
241
242    if(pst->selector == ODU_SELECTOR_LWLC)
243    {
244       /* unpack the address of the structure */
245       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStart, mBuf);
246       ODU_PUT_MSG_BUF(mBuf); 
247       return (*func)(pst, cellStart);
248    }
249    else
250    {
251       /* Nothing to do for loose coupling */
252       ODU_PUT_MSG_BUF(mBuf);
253       return ROK;
254    }
255 }
256
257 /*******************************************************************
258  *
259  * @brief Packs and Send cell stop request to MAC
260  *
261  * @details
262  *
263  *    Function : packMacCellStop
264  *
265  *    Functionality:
266  *       Packs and Send cell stop request to MAC
267  *
268  * @params[in] Post structure pointer
269  *             Cell Id 
270  * @return ROK     - success
271  *         RFAILED - failure
272  *
273  * ****************************************************************/
274 uint8_t packMacCellStop(Pst *pst, CellStopInfo *cellStop)
275 {
276    if(pst->selector == ODU_SELECTOR_LC)
277    {
278       /* Loose coupling not supported */
279       return RFAILED;
280    }
281    else if(pst->selector == ODU_SELECTOR_LWLC)
282    {
283       Buffer *mBuf = NULLP;
284
285       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
286       {
287          DU_LOG("\nERROR  --> DU APP : Memory allocation failed for cell stop req pack");
288          return RFAILED;
289       }
290
291       /* pack the address of the structure */
292       CMCHKPK(oduPackPointer,(PTR)cellStop, mBuf);
293
294       return ODU_POST_TASK(pst,mBuf);
295    }
296    return ROK;
297 }
298
299 /*******************************************************************
300  *
301  * @brief Unpacks cell stop request from DU APP 
302  *
303  * @details
304  *
305  *    Function : unpackMaCellStop 
306  *
307  *    Functionality:
308  *       Unpacks cell stop request from DU APP 
309  *
310  * @params[in] Handler function pointer
311  *             Post structure pointer
312  *             Message Buffer
313  * @return ROK     - success
314  *         RFAILED - failure
315  *
316  * ****************************************************************/
317 uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf)
318 {
319    CellStopInfo *cellStop;
320    
321    if(pst->selector == ODU_SELECTOR_LWLC)
322    {
323       /* unpack the address of the structure */
324       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStop, mBuf);
325       ODU_PUT_MSG_BUF(mBuf);
326       return (*func)(pst, cellStop);
327    }
328    else
329    {
330       /* Nothing to do for loose coupling */
331       ODU_PUT_MSG_BUF(mBuf);
332       return ROK;
333    }
334 }
335
336 /*******************************************************************
337  *
338  * @brief Packs and Sends cell up ind from MAC to DUAPP
339  *
340  * @details
341  *
342  *    Function : packMacCellUpInd
343  *
344  *    Functionality:
345  *       Packs and Sends cell up ind from MAC to DUAPP
346  *
347  * @params[in] Post structure pointer
348  *             Cell Id
349  * @return ROK     - success
350  *         RFAILED - failure
351  *
352  * ****************************************************************/
353 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId)
354 {
355    Buffer *mBuf = NULLP;
356
357    if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
358    {
359       DU_LOG("\nERROR  --> DU APP : Memory allocation failed for packMacCellUpInd");
360       return RFAILED;
361    }
362
363    if(pst->selector == ODU_SELECTOR_LC)
364    {
365       CMCHKPK(oduUnpackUInt16, cellId->cellId, mBuf);
366       CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, sizeof(OduCellId));
367       cellId = NULL;
368    }
369    else if(pst->selector == ODU_SELECTOR_LWLC)
370    {
371       /* pack the address of the structure */
372       CMCHKPK(oduPackPointer,(PTR)cellId, mBuf);
373    }
374    else
375    {
376       ODU_PUT_MSG_BUF(mBuf);
377    }
378
379    return ODU_POST_TASK(pst, mBuf);
380 }
381
382 /*******************************************************************
383  *
384  * @brief Unpacks cell up indication from MAC
385  *
386  * @details
387  *
388  *    Function : unpackMacCellUpInd
389  *
390  *    Functionality:
391  *         Unpacks cell up indication from MAC
392  *
393  * @params[in] Pointer to Handler
394  *             Post structure pointer
395  *             Message Buffer
396  * @return ROK     - success
397  *         RFAILED - failure
398  *
399  * ****************************************************************/
400 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf)
401 {
402    if(pst->selector == ODU_SELECTOR_LWLC)
403    {
404       OduCellId *cellId;
405
406       /* unpack the address of the structure */
407       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
408       ODU_PUT_MSG_BUF(mBuf);
409       return (*func)(pst, cellId);
410    }
411    else if(pst->selector == ODU_SELECTOR_LC)
412    {
413       OduCellId cellId;
414       CMCHKUNPK(oduPackUInt16, &cellId.cellId, mBuf);
415       ODU_PUT_MSG_BUF(mBuf);
416       return (*func)(pst, &cellId);
417    }
418    else
419    {
420       /* Nothing to do for loose coupling */
421       ODU_PUT_MSG_BUF(mBuf);
422       return ROK;
423    }
424    return ROK;
425 }
426
427 /*******************************************************************
428  *
429  * @brief Packs and Sends stop ind from MAC to DUAPP
430  *
431  * @details
432  *
433  *    Function : packMacStopInd
434  *
435  *    Functionality:
436  *       Packs and Sends stop ind from MAC to DUAPP
437  *
438  * @params[in] Post structure pointer
439  * @return ROK     - success
440  *         RFAILED - failure
441  *
442  * ****************************************************************/
443 uint8_t packMacStopInd(Pst *pst, OduCellId *cellId)
444 {
445    Buffer *mBuf = NULLP;
446
447    if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
448    {
449       DU_LOG("\nERROR  --> DU APP : Memory allocation failed for stop Ind pack");
450       return RFAILED;
451    }
452
453    if(pst->selector == ODU_SELECTOR_LC)
454    {
455       /*pack the payload here*/
456       CMCHKPK(oduUnpackUInt16, cellId->cellId, mBuf);
457       CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, sizeof(OduCellId));
458       cellId = NULL;
459    }
460    else if(pst->selector == ODU_SELECTOR_LWLC)
461    {
462       /* pack the address of the structure */
463       CMCHKPK(oduPackPointer,(PTR)cellId, mBuf);
464    }
465    else
466    {
467       ODU_PUT_MSG_BUF(mBuf);
468    }
469
470    return ODU_POST_TASK(pst,mBuf);
471 }
472
473 /*******************************************************************
474  *
475  * @brief Unpacks stop indication from MAC
476  *
477  * @details
478  *
479  *    Function : unpackMacStopInd
480  *
481  *    Functionality:
482  *         Unpacks stop indication from MAC
483  *
484  * @params[in] Pointer to Handler
485  *             Post structure pointer
486  *             Message Buffer
487  * @return ROK     - success
488  *         RFAILED - failure
489  *
490  * ****************************************************************/
491 uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf)
492 {
493    if(pst->selector == ODU_SELECTOR_LWLC)
494    {
495       OduCellId *cellId=NULLP;
496       /* unpack the address of the structure */
497       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
498       ODU_PUT_MSG_BUF(mBuf);
499       return (*func)(pst, cellId);
500    }
501    else if(pst->selector == ODU_SELECTOR_LC)
502    {
503       OduCellId cellId;
504       CMCHKUNPK(oduPackUInt16, &(cellId.cellId), mBuf);
505
506       ODU_PUT_MSG_BUF(mBuf);
507       return (*func)(pst, &cellId);
508
509    }
510    else
511    {
512       /* Nothing to do for loose coupling */
513       ODU_PUT_MSG_BUF(mBuf);
514       return ROK;
515    }
516    return ROK;
517 }
518
519 /*******************************************************************
520  *
521  * @brief Packs and Sends UL CCCH Ind from MAC to DUAPP
522  *
523  * @details
524  *
525  *    Function : packMacUlCcchInd
526  *
527  *    Functionality:
528  *       Packs and Sends UL CCCH Ind from MAC to DUAPP
529  *
530  * @params[in] Post structure pointer
531  *             UL CCCH Ind pointer              
532  * @return ROK     - success
533  *         RFAILED - failure
534  *
535  * ****************************************************************/
536 uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
537 {
538    Buffer *mBuf = NULLP;
539
540    if(pst->selector == ODU_SELECTOR_LWLC)
541    {
542       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
543       {
544          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packMacUlCcchInd");
545          return RFAILED;
546       }
547       /* pack the address of the structure */
548       CMCHKPK(oduPackPointer,(PTR)ulCcchIndInfo, mBuf);
549    }
550    else
551    {
552       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for UL CCCH Ind ");
553       return RFAILED;
554    }
555
556    return ODU_POST_TASK(pst,mBuf);
557 }
558
559 /*******************************************************************
560  *
561  * @brief Unpacks UL CCCH indication from MAC
562  *
563  * @details
564  *
565  *    Function : unpackMacUlCcchInd
566  *
567  *    Functionality:
568  *         Unpacks UL CCCH indication from MAC
569  *
570  * @params[in] Pointer to Handler
571  *             Post structure pointer
572  *             Message Buffer
573  * @return ROK     - success
574  *         RFAILED - failure
575  *
576  * ****************************************************************/
577 uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf)
578 {
579    if(pst->selector == ODU_SELECTOR_LWLC)
580    {
581       UlCcchIndInfo *ulCcchIndInfo;
582
583       /* unpack the address of the structure */
584       CMCHKUNPK(oduUnpackPointer, (PTR *)&ulCcchIndInfo, mBuf);
585       ODU_PUT_MSG_BUF(mBuf);
586       return (*func)(pst, ulCcchIndInfo);
587    }
588    else
589    {
590       /* Nothing to do for other selectors */
591       DU_LOG("\nERROR  -->  MAC : Only LWLC supported for UL CCCH Ind ");
592       ODU_PUT_MSG_BUF(mBuf);
593    }
594    return RFAILED;
595 }
596
597 /*******************************************************************
598  *
599  * @brief Packs and Sends DL CCCH Ind from DUAPP to MAC
600  *
601  * @details
602  *
603  *    Function : packMacDlCcchInd
604  *
605  *    Functionality:
606  *       Packs and Sends DL CCCH Ind from DUAPP to MAC
607  *
608  *
609  * @params[in] Post structure pointer
610  *             DL CCCH Ind pointer              
611  * @return ROK     - success
612  *         RFAILED - failure
613  *
614  * ****************************************************************/
615 uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
616 {
617    Buffer *mBuf = NULLP;
618
619    if(pst->selector == ODU_SELECTOR_LWLC)
620    {
621       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
622       {
623          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packMacDlCcchInd");
624          return RFAILED;
625       }
626       /* pack the address of the structure */
627       CMCHKPK(oduPackPointer,(PTR)dlCcchIndInfo, mBuf);
628    }
629    else
630    {
631       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for DL CCCH Ind ");
632       return RFAILED;
633    }
634
635    return ODU_POST_TASK(pst,mBuf);
636 }
637
638 /*******************************************************************
639  *
640  * @brief Unpacks DL CCCH indication from DU APP
641  *
642  * @details
643  *
644  *    Function : unpackMacDlCcchInd
645  *
646  *    Functionality:
647  *         Unpacks DL CCCH indication from DU APP
648  *
649  * @params[in] Pointer to Handler
650  *             Post structure pointer
651  *             Message Buffer
652  * @return ROK     - success
653  *         RFAILED - failure
654  *
655  * ****************************************************************/
656 uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf)
657 {
658    if(pst->selector == ODU_SELECTOR_LWLC)
659    {
660       DlCcchIndInfo *dlCcchIndInfo;
661
662       /* unpack the address of the structure */
663       CMCHKUNPK(oduUnpackPointer, (PTR *)&dlCcchIndInfo, mBuf);
664       ODU_PUT_MSG_BUF(mBuf);
665       return (*func)(pst, dlCcchIndInfo);
666    }
667    else
668    {
669       /* Nothing to do for other selectors */
670       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for DL CCCH Ind ");
671       ODU_PUT_MSG_BUF(mBuf);
672    }
673
674    return RFAILED;
675 }
676
677 /*******************************************************************
678  *
679  * @brief Packs and Sends UE create Request from DUAPP to MAC
680  *
681  * @details
682  *
683  *    Function : packDuMacUeCreateReq
684  *
685  *    Functionality:
686  *       Packs and Sends UE Create Request from DUAPP to MAC
687  *
688  *
689  * @params[in] Post structure pointer
690  *             MacUeCfg pointer              
691  * @return ROK     - success
692  *         RFAILED - failure
693  *
694  * ****************************************************************/
695 uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg)
696 {
697    Buffer *mBuf = NULLP;
698
699    if(pst->selector == ODU_SELECTOR_LWLC)
700    {
701       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
702       {
703          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeCreateReq");
704          return RFAILED;
705       }
706       /* pack the address of the structure */
707       CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
708    }
709    else
710    {
711       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeCreateReq");
712       return RFAILED;
713    }
714
715    return ODU_POST_TASK(pst,mBuf);
716 }
717
718 /*******************************************************************
719  *
720  * @brief Unpacks UE Create Request received from DU APP
721  *
722  * @details
723  *
724  *    Function : unpackMacUeCreateReq
725  *
726  *    Functionality:
727  *         Unpacks UE Create Request received from DU APP
728  *
729  * @params[in] Pointer to Handler
730  *             Post structure pointer
731  *             Message Buffer
732  * @return ROK     - success
733  *         RFAILED - failure
734  *
735  * ****************************************************************/
736 uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf)
737 {
738    if(pst->selector == ODU_SELECTOR_LWLC)
739    {
740       MacUeCfg *ueCfg;
741
742       /* unpack the address of the structure */
743       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf);
744       ODU_PUT_MSG_BUF(mBuf);
745       return (*func)(pst, ueCfg);
746    }
747    else
748    {
749       /* Nothing to do for other selectors */
750       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for UE Create Request ");
751       ODU_PUT_MSG_BUF(mBuf);
752    }
753
754    return RFAILED;
755 }
756
757 /*******************************************************************
758  *
759  * @brief Pack and send UE config response from MAC to DU APP
760  *
761  * @details
762  *
763  *    Function : packDuMacUeCfgRsp
764  *
765  *    Functionality:
766  *       Pack and send UE config response from MAC to DU APP
767  *
768  * @params[in] 
769  * @return ROK     - success
770  *         RFAILED - failure
771  *
772  * ****************************************************************/
773 uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
774 {
775    Buffer *mBuf = NULLP;
776
777    if(pst->selector == ODU_SELECTOR_LWLC)
778    {
779       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
780       {
781          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeCfgRsp");
782          return RFAILED;
783       }
784       /* pack the address of the structure */
785       CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
786    }
787    else
788    {
789       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeCfgRsp");
790       return RFAILED;
791    }
792
793    return ODU_POST_TASK(pst,mBuf);
794 }
795 /*******************************************************************
796  *
797  * @brief Unpack UE Config Response from MAC to DU APP
798  *
799  * @details
800  *
801  *    Function :unpackDuMacUeCfgRsp 
802  *
803  *    Functionality: Unpack UE Config Response from MAC to DU APP
804  *
805  * @params[in] 
806  * @return ROK     - success
807  *         RFAILED - failure
808  *
809  * ****************************************************************/
810 uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf)
811 {
812    if(pst->selector == ODU_SELECTOR_LWLC)
813    {
814       MacUeCfgRsp *cfgRsp = NULLP;
815
816       /* unpack the address of the structure */
817       CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
818       ODU_PUT_MSG_BUF(mBuf);
819       return (*func)(pst, cfgRsp);
820    }
821
822    ODU_PUT_MSG_BUF(mBuf);
823    return RFAILED;
824 }
825
826 /*******************************************************************
827  *
828  * @brief Packs and Sends UE Reconig Request from DUAPP to MAC
829  *
830  * @details
831  *
832  *    Function : packDuMacUeReconfigReq
833  *
834  *    Functionality:
835  *       Packs and Sends UE Reconfig Request from DUAPP to MAC
836  *
837  *
838  * @params[in] Post structure pointer
839  *             MacUeCfg pointer              
840  * @return ROK     - success
841  *         RFAILED - failure
842  *
843  * ****************************************************************/
844 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeRecfg *ueCfg)
845 {
846    Buffer *mBuf = NULLP;
847
848    if(pst->selector == ODU_SELECTOR_LWLC)
849    {
850       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
851       {
852          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeReconfigReq");
853          return RFAILED;
854       }
855       /* pack the address of the structure */
856       CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
857    }
858    else
859    {
860       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeReconfigReq");
861       return RFAILED;
862    }
863
864    return ODU_POST_TASK(pst,mBuf);
865 }
866
867 /*******************************************************************
868  *
869  * @brief Unpacks UE Reconfig Request received from DU APP
870  *
871  * @details
872  *
873  *    Function : unpackMacUeReconfigReq
874  *
875  *    Functionality:
876  *         Unpacks UE Reconfig Request received from DU APP
877  *
878  * @params[in] Pointer to Handler
879  *             Post structure pointer
880  *             Message Buffer
881  * @return ROK     - success
882  *         RFAILED - failure
883  *
884  * ****************************************************************/
885 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf)
886 {
887    if(pst->selector == ODU_SELECTOR_LWLC)
888    {
889       MacUeRecfg *ueRecfg;
890
891       /* unpack the address of the structure */
892       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueRecfg, mBuf);
893       ODU_PUT_MSG_BUF(mBuf);
894       return (*func)(pst, ueRecfg);
895    }
896    else
897    {
898       /* Nothing to do for other selectors */
899       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for UE Create Request ");
900       ODU_PUT_MSG_BUF(mBuf);
901    }
902
903    return RFAILED;
904 }
905
906 /*******************************************************************
907  *
908  * @brief Pack and send UE Reconfig response from MAC to DU APP
909  *
910  * @details
911  *
912  *    Function : packDuMacUeRecfgRsp
913  *
914  *    Functionality:
915  *       Pack and send UE Reconfig response from MAC to DU APP
916  *
917  * @params[in] 
918  * @return ROK     - success
919  *         RFAILED - failure
920  *
921  * ****************************************************************/
922 uint8_t packDuMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *recfgRsp)
923 {
924    Buffer *mBuf = NULLP;
925
926    if(pst->selector == ODU_SELECTOR_LWLC)
927    {
928       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
929       {
930          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeRecfgRsp");
931          return RFAILED;
932       }
933       /* pack the address of the structure */
934       CMCHKPK(oduPackPointer,(PTR)recfgRsp, mBuf);
935    }
936    else
937    {
938       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeRecfgRsp");
939       return RFAILED;
940    }
941
942    return ODU_POST_TASK(pst,mBuf);
943 }
944
945 /*******************************************************************
946  *
947  * @brief Unpack UE ReConfig Response from MAC to DU APP
948  *
949  * @details
950  *
951  *    Function :unpackDuMacUeRecfgRsp 
952  *
953  *    Functionality: Unpack UE ReConfig Response from MAC to DU APP
954  *
955  * @params[in] 
956  * @return ROK     - success
957  *         RFAILED - failure
958  *
959  * ****************************************************************/
960 uint8_t unpackDuMacUeRecfgRsp(MacDuUeRecfgRspFunc func, Pst *pst, Buffer *mBuf)
961 {
962    if(pst->selector == ODU_SELECTOR_LWLC)
963    {
964       MacUeRecfgRsp *recfgRsp = NULLP;
965
966       /* unpack the address of the structure */
967       CMCHKUNPK(oduUnpackPointer, (PTR *)&recfgRsp, mBuf);
968       ODU_PUT_MSG_BUF(mBuf);
969       return (*func)(pst, recfgRsp);
970    }
971
972    ODU_PUT_MSG_BUF(mBuf);
973    return RFAILED;
974 }
975
976 /*******************************************************************
977  *
978  * @brief Packs and Sends RACH Resource request from DUAPP to MAC
979  *
980  * @details
981  *
982  *    Function : packDuMacRachRsrcReq
983  *
984  *    Functionality:
985  *       Packs and Sends RACH Resource request from DU APP to MAC
986  *
987  *
988  * @params[in] Post structure pointer
989  *             MacRachRsrcReq pointer              
990  * @return ROK     - success
991  *         RFAILED - failure
992  *
993  * ****************************************************************/
994 uint8_t packDuMacRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq)
995 {
996    Buffer *mBuf = NULLP;
997
998    if(pst->selector == ODU_SELECTOR_LWLC)
999    {
1000       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1001       {
1002          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacRachRsrcReq,");
1003          return RFAILED;
1004       }
1005       /* pack the address of the structure */
1006       CMCHKPK(oduPackPointer, (PTR)rachRsrcReq, mBuf);
1007    }
1008    else
1009    {
1010       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacRachRsrcReq");
1011       return RFAILED;
1012    }
1013
1014    return ODU_POST_TASK(pst,mBuf);
1015 }
1016
1017 /*******************************************************************
1018  *
1019  * @brief Unpacks RACH resource Request received from DU APP
1020  *
1021  * @details
1022  *
1023  *    Function : unpackMacRachRsrcReq
1024  *
1025  *    Functionality:
1026  *         Unpacks RACH resource Request received from DU APP
1027  *
1028  * @params[in] Pointer to Handler
1029  *             Post structure pointer
1030  *             Message Buffer
1031  * @return ROK     - success
1032  *         RFAILED - failure
1033  *
1034  * ****************************************************************/
1035 uint8_t unpackMacRachRsrcReq(DuMacRachRsrcReq func, Pst *pst, Buffer *mBuf)
1036 {
1037    if(pst->selector == ODU_SELECTOR_LWLC)
1038    {
1039       MacRachRsrcReq *rachRsrcReq;
1040
1041       /* unpack the address of the structure */
1042       CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcReq, mBuf);
1043       ODU_PUT_MSG_BUF(mBuf);
1044       return (*func)(pst, rachRsrcReq);
1045    }
1046    else
1047    {
1048       /* Nothing to do for other selectors */
1049       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for RACH resource Request ");
1050       ODU_PUT_MSG_BUF(mBuf);
1051    }
1052
1053    return RFAILED;
1054 }
1055
1056 /*******************************************************************
1057  *
1058  * @brief Packs and Sends RACH Resource release from DUAPP to MAC
1059  *
1060  * @details
1061  *
1062  *    Function : packDuMacRachRsrcRel
1063  *
1064  *    Functionality:
1065  *       Packs and Sends RACH Resource release from DU APP to MAC
1066  *
1067  *
1068  * @params[in] Post structure pointer
1069  *             MacRachRsrcRel pointer              
1070  * @return ROK     - success
1071  *         RFAILED - failure
1072  *
1073  * ****************************************************************/
1074 uint8_t packDuMacRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel)
1075 {
1076    Buffer *mBuf = NULLP;
1077
1078    if(pst->selector == ODU_SELECTOR_LWLC)
1079    {
1080       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1081       {
1082          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacRachRsrcRel");
1083          return RFAILED;
1084       }
1085       /* pack the address of the structure */
1086       CMCHKPK(oduPackPointer, (PTR)rachRsrcRel, mBuf);
1087    }
1088    else
1089    {
1090       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacRachRsrcRel");
1091       return RFAILED;
1092    }
1093
1094    return ODU_POST_TASK(pst,mBuf);
1095 }
1096
1097 /*******************************************************************
1098  *
1099  * @brief Unpacks RACH Resource Release received from DU APP
1100  *
1101  * @details
1102  *
1103  *    Function : unpackMacRachRsrcRel
1104  *
1105  *    Functionality:
1106  *         Unpacks RACH Resource Release received from DU APP
1107  *
1108  * @params[in] Pointer to Handler
1109  *             Post structure pointer
1110  *             Message Buffer
1111  * @return ROK     - success
1112  *         RFAILED - failure
1113  *
1114  * ****************************************************************/
1115 uint8_t unpackMacRachRsrcRel(DuMacRachRsrcRel func, Pst *pst, Buffer *mBuf)
1116 {
1117    if(pst->selector == ODU_SELECTOR_LWLC)
1118    {
1119       MacRachRsrcRel *rachRsrcRel;
1120
1121       /* unpack the address of the structure */
1122       CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcRel, mBuf);
1123       ODU_PUT_MSG_BUF(mBuf);
1124       return (*func)(pst, rachRsrcRel);
1125    }
1126    else
1127    {
1128       /* Nothing to do for other selectors */
1129       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for RACH Resource Release ");
1130       ODU_PUT_MSG_BUF(mBuf);
1131    }
1132
1133    return RFAILED;
1134 }
1135
1136 /*******************************************************************
1137  *
1138  * @brief Packs and Sends RACH Resource response from MAC to DU APP
1139  *
1140  * @details
1141  *
1142  *    Function : packDuMacRachRsrcRsp
1143  *
1144  *    Functionality:
1145  *       Packs and Sends RACH Resource response from MAC to DU APP
1146  *
1147  *
1148  * @params[in] Post structure pointer
1149  *             MacRachRsrcRsp pointer              
1150  * @return ROK     - success
1151  *         RFAILED - failure
1152  *
1153  * ****************************************************************/
1154 uint8_t packDuMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp)
1155 {
1156    Buffer *mBuf = NULLP;
1157
1158    if(pst->selector == ODU_SELECTOR_LWLC)
1159    {
1160       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1161       {
1162          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacRachRsrcRsp");
1163          return RFAILED;
1164       }
1165       /* pack the address of the structure */
1166       CMCHKPK(oduPackPointer, (PTR)rachRsrcRsp, mBuf);
1167    }
1168    else
1169    {
1170       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacRachRsrcRsp");
1171       return RFAILED;
1172    }
1173
1174    return ODU_POST_TASK(pst,mBuf);
1175 }
1176
1177 /*******************************************************************
1178  *
1179  * @brief Unpacks RACH resource Response received from MAC
1180  *
1181  * @details
1182  *
1183  *    Function : unpackDuMacRachRsrcRsp
1184  *
1185  *    Functionality:
1186  *         Unpacks RACH resource Response received from MAC
1187  *
1188  * @params[in] Pointer to Handler
1189  *             Post structure pointer
1190  *             Message Buffer
1191  * @return ROK     - success
1192  *         RFAILED - failure
1193  *
1194  * ****************************************************************/
1195 uint8_t unpackDuMacRachRsrcRsp(MacDuRachRsrcRspFunc func, Pst *pst, Buffer *mBuf)
1196 {
1197    if(pst->selector == ODU_SELECTOR_LWLC)
1198    {
1199       MacRachRsrcRsp *rachRsrcRsp;
1200
1201       /* unpack the address of the structure */
1202       CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcRsp, mBuf);
1203       ODU_PUT_MSG_BUF(mBuf);
1204       return (*func)(pst, rachRsrcRsp);
1205    }
1206    else
1207    {
1208       /* Nothing to do for other selectors */
1209       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for RACH resource Response ");
1210       ODU_PUT_MSG_BUF(mBuf);
1211    }
1212
1213    return RFAILED;
1214 }
1215 /*******************************************************************
1216 *
1217 * @brief Packs and Sends UE Delete Request from DUAPP to MAC
1218 *
1219 * @details
1220 *
1221 *    Function : packDuMacUeDeleteReq
1222 *
1223 *    Functionality:
1224 *       Packs and Sends UE Delete Request from DUAPP to MAC
1225 *
1226 *
1227 * @params[in] Post structure pointer
1228 *             MacUeDelete pointer
1229 * @return ROK     - success
1230 *         RFAILED - failure
1231 *
1232 * ****************************************************************/
1233 uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDel)
1234 {
1235     Buffer *mBuf = NULLP;
1236
1237     if(pst->selector == ODU_SELECTOR_LWLC)
1238     {
1239        if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1240        {
1241           DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeDeleteReq");
1242           return RFAILED;
1243        }
1244        /* pack the address of the structure */
1245        CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
1246     }
1247     else
1248     {
1249        DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeDeleteReq");
1250        return RFAILED;
1251     }
1252
1253     return ODU_POST_TASK(pst,mBuf);
1254 }
1255 /*******************************************************************
1256 *
1257 * @brief Unpacks UE Delete Request received from DU APP
1258 *
1259 * @details
1260 *
1261 *    Function : unpackMacUeDeleteReq 
1262 *
1263 *    Functionality:
1264 *         Unpacks UE Delete Request received from DU APP
1265 *
1266 * @params[in] Pointer to Handler
1267 *             Post structure pointer
1268 *             Message Buffer
1269 * @return ROK     - success
1270 *         RFAILED - failure
1271 *
1272 * ****************************************************************/
1273 uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf)
1274 {
1275     if(pst->selector == ODU_SELECTOR_LWLC)
1276     {
1277        MacUeDelete *ueDelete;
1278
1279        /* unpack the address of the structure */
1280        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf);
1281        ODU_PUT_MSG_BUF(mBuf);
1282        return (*func)(pst, ueDelete);
1283     }
1284     else
1285     {
1286        /* Nothing to do for other selectors */
1287        DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for UE Delete Request ");
1288        ODU_PUT_MSG_BUF(mBuf);
1289     }
1290
1291     return RFAILED;
1292 }
1293 /*******************************************************************
1294  *
1295  * @brief Pack and send UE delete response from MAC to DU APP
1296  *
1297  * @details
1298  *
1299  *    Function : packDuMacUeDeleteRsp
1300  *
1301  *    Functionality:
1302  *       Pack and send UE  delete response from MAC to DU APP
1303  *
1304  * @params[in]
1305  * @return ROK     - success
1306  *         RFAILED - failure
1307  *
1308  * ****************************************************************/
1309 uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
1310 {
1311    Buffer *mBuf = NULLP;
1312    
1313    if(pst->selector == ODU_SELECTOR_LWLC)
1314    {
1315       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1316       {
1317          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeDeleteRsp");
1318          return RFAILED;
1319       }
1320       /* pack the address of the structure */
1321       CMCHKPK(oduPackPointer,(PTR)deleteRsp, mBuf);
1322    }
1323    else
1324    {
1325       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeDeleteRsp");
1326       return RFAILED;
1327    }
1328    
1329    return ODU_POST_TASK(pst,mBuf);
1330    
1331 }
1332
1333 /*******************************************************************
1334 *
1335 * @brief Unpack UE Config Response from MAC to DU APP
1336 *
1337 * @details
1338 *
1339 *    Function :unpackDuMacUeDeleteRsp 
1340 *
1341 *    Functionality: Unpack UE Config Response from MAC to DU APP
1342 *
1343 * @params[in]
1344 * @return ROK     - success
1345 *         RFAILED - failure
1346 *
1347 * ****************************************************************/
1348 uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf)
1349 {
1350     if(pst->selector == ODU_SELECTOR_LWLC)
1351     {
1352        MacUeDeleteRsp *ueDeleteRsp = NULLP;
1353
1354        /* unpack the address of the structure */
1355        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf);
1356        ODU_PUT_MSG_BUF(mBuf);
1357        return (*func)(pst, ueDeleteRsp);
1358     }
1359
1360     ODU_PUT_MSG_BUF(mBuf);
1361     return RFAILED;
1362 }
1363
1364 /*******************************************************************
1365  *
1366  * @brief Unpacks Cell Delete Request received from DU APP
1367  *
1368  * @details
1369  *
1370  *    Function : unpackMacCellDeleteReq
1371  *
1372  *    Functionality:
1373  *         Unpacks Cell Delete Request received from DU APP
1374  *
1375  * @params[in] Pointer to Handler
1376  *             Post structure pointer
1377  *             Message Buffer
1378  * @return ROK     - success
1379  *         RFAILED - failure
1380  *
1381  * ****************************************************************/
1382
1383 uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf)
1384 {
1385    if(pst->selector == ODU_SELECTOR_LWLC)
1386    {
1387       MacCellDeleteReq *cellDelete=NULLP;
1388
1389       /* unpack the address of the structure */
1390       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDelete, mBuf);
1391       ODU_PUT_MSG_BUF(mBuf);
1392       return (*func)(pst, cellDelete);
1393    }
1394    else
1395    {
1396       /* Nothing to do for other
1397        * selectors */
1398       DU_LOG("\nERROR  -->  DU APP : unpackMacCellDeleteReq(): Only LWLC supported for CELL Delete Request ");
1399       ODU_PUT_MSG_BUF(mBuf);
1400    }
1401
1402    return RFAILED;
1403 }
1404
1405 /*******************************************************************
1406  *
1407  * @brief Pack and send Cell delete request to MAC
1408  *
1409  * @details
1410  *
1411  *    Function : packDuMacCellDeleteReq
1412  *
1413  *    Functionality:
1414  *       Pack and send Cell delete request to MAC
1415  *
1416  * @params[in] Post structure
1417  *             MacCellDelete *cellDelete;
1418  * @return ROK     - success
1419  *         RFAILED - failure
1420  *
1421  * ****************************************************************/
1422
1423 uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete)
1424 {
1425    Buffer *mBuf = NULLP;
1426
1427    if(pst->selector == ODU_SELECTOR_LWLC)
1428    {
1429       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1430       {
1431          DU_LOG("\nERROR  --> MAC : packDuMacCellDeleteReq(): Memory allocation failed ");
1432          return RFAILED;
1433       }
1434       CMCHKPK(oduPackPointer,(PTR)cellDelete, mBuf);
1435       return ODU_POST_TASK(pst,mBuf);
1436    }
1437    else
1438    {
1439       DU_LOG("\nERROR  -->  MAC: packDuMacCellDeleteReq(): Only LWLC supported ");
1440    }
1441    return RFAILED;
1442 }
1443
1444 /*******************************************************************
1445  *
1446  * @brief Pack and send CELL delete response from MAC to DU APP
1447  *
1448  * @details
1449  *
1450  *    Function : packDuMacCellDeleteRsp
1451  *
1452  *    Functionality:
1453  *       Pack and send CELL  delete response from MAC to DU APP
1454  *
1455  * @params[in] Pst *pst, MacCellDeleteRsp *deleteRsp
1456  * @return ROK     - success
1457  *         RFAILED - failure
1458  *
1459  * ****************************************************************/
1460
1461 uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp)
1462 {
1463    Buffer *mBuf = NULLP;
1464
1465    if(pst->selector == ODU_SELECTOR_LWLC)
1466    {
1467       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1468       {
1469          DU_LOG("\nERROR  --> MAC : packDuMacCellDeleteRsp(): Memory allocation failed ");
1470          return RFAILED;
1471       }
1472       CMCHKPK(oduPackPointer,(PTR)cellDeleteRsp, mBuf);
1473    }
1474    else
1475    {
1476       DU_LOG("\nERROR  -->  MAC: packDuMacCellDeleteRsp(): Only LWLC supported ");
1477       return RFAILED;
1478    }
1479
1480    return ODU_POST_TASK(pst,mBuf);
1481
1482 }
1483
1484 /*******************************************************************
1485  *
1486  * @brief Unpack cell delete response from MAC to DU APP
1487  *
1488  * @details
1489  *
1490  *    Function : unpackDuMacCellDeleteRsp
1491  *
1492  *    Functionality: Unpack cell delete response from MAC to DU APP
1493  *
1494  * @params[in] MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf
1495  * @return ROK     - success
1496  *         RFAILED - failure
1497  *
1498  * ****************************************************************/
1499
1500 uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf)
1501 {
1502    if(pst->selector == ODU_SELECTOR_LWLC)
1503    {
1504       MacCellDeleteRsp *cellDeleteRsp = NULLP;
1505
1506       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDeleteRsp, mBuf);
1507       ODU_PUT_MSG_BUF(mBuf);
1508       return (*func)(pst, cellDeleteRsp);
1509    }
1510    else
1511    {  
1512       DU_LOG("\nERROR  -->  DU APP : unpackDuMacCellDeleteRsp(): Only LWLC supported ");
1513       ODU_PUT_MSG_BUF(mBuf);
1514    }
1515    return RFAILED;
1516 }
1517
1518 /*******************************************************************
1519  *
1520  * @brief Pack and send Slice Cfg request from MAC to DU APP
1521  *
1522  * @details
1523  *
1524  *    Function : packDuMacSliceCfgReq
1525  *
1526  *    Functionality:
1527  *       Pack and send Slice Cfg request from MAC to DU APP
1528  *
1529  * @params[in] Pst *pst, MacSliceCfgReq *sliceCfgReq
1530  * @return ROK     - success
1531  *         RFAILED - failure
1532  *
1533  * ****************************************************************/
1534
1535 uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq)
1536 {
1537    Buffer *mBuf = NULLP;
1538
1539    if(pst->selector == ODU_SELECTOR_LWLC)
1540    {
1541       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1542       {
1543          DU_LOG("\nERROR  --> MAC : Memory allocation failed in packDuMacSliceCfgReq");
1544          return RFAILED;
1545       }
1546       CMCHKPK(oduPackPointer,(PTR)sliceCfgReq, mBuf);
1547    }
1548    else
1549    {
1550       DU_LOG("\nERROR  -->  MAC: Only LWLC supported in packDuMacSliceCfgReq");
1551       return RFAILED;
1552    }
1553
1554    return ODU_POST_TASK(pst,mBuf);
1555
1556 }
1557 /*******************************************************************
1558 *
1559 * @brief Unpacks Slice Cfg request received from DU APP
1560 *
1561 * @details
1562 *
1563 *    Function : unpackMacSliceCfgReq 
1564 *
1565 *    Functionality:
1566 *         Unpacks Slice Cfg Request received from DU APP
1567 *
1568 * @params[in] Pointer to Handler
1569 *             Post structure pointer
1570 *             Message Buffer
1571 * @return ROK     - success
1572 *         RFAILED - failure
1573 *
1574 * ****************************************************************/
1575 uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf)
1576 {
1577     if(pst->selector == ODU_SELECTOR_LWLC)
1578     {
1579        MacSliceCfgReq *sliceCfgReq;
1580        /* unpack the address of the structure */
1581        CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceCfgReq, mBuf);
1582        ODU_PUT_MSG_BUF(mBuf);
1583        return (*func)(pst, sliceCfgReq);
1584     }
1585     else
1586     {
1587        /* Nothing to do for other selectors */
1588        DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for Slice Cfg Request ");
1589        ODU_PUT_MSG_BUF(mBuf);
1590     }
1591
1592     return RFAILED;
1593 }
1594
1595 /*******************************************************************
1596  *
1597  * @brief Pack and send Slice config response from MAC to DU APP
1598  *
1599  * @details
1600  *
1601  *    Function : packDuMacSliceCfgRsp
1602  *
1603  *    Functionality:
1604  *       Pack and send Slice config response from MAC to DU APP
1605  *
1606  * @params[in] 
1607  * @return ROK     - success
1608  *         RFAILED - failure
1609  *
1610  * ****************************************************************/
1611 uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
1612 {
1613    Buffer *mBuf = NULLP;
1614
1615    if(pst->selector == ODU_SELECTOR_LWLC)
1616    {
1617       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1618       {
1619          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacSliceCfgRsp");
1620          return RFAILED;
1621       }
1622       /* pack the address of the structure */
1623       CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
1624    }
1625    else
1626    {
1627       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacSliceCfgRsp");
1628       return RFAILED;
1629    }
1630
1631    return ODU_POST_TASK(pst,mBuf);
1632 }
1633
1634 /*******************************************************************
1635  *
1636  * @brief Unpack Slice Config Response from MAC to DU APP
1637  *
1638  * @details
1639  *
1640  *    Function :unpackDuMacSliceCfgRsp 
1641  *
1642  *    Functionality: Unpack Slice Config Response from MAC to DU APP
1643  *
1644  * @params[in] 
1645  * @return ROK     - success
1646  *         RFAILED - failure
1647  *
1648  * ****************************************************************/
1649 uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf)
1650 {
1651    if(pst->selector == ODU_SELECTOR_LWLC)
1652    {
1653       MacSliceCfgRsp *cfgRsp = NULLP;
1654
1655       /* unpack the address of the structure */
1656       CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
1657       ODU_PUT_MSG_BUF(mBuf);
1658       return (*func)(pst, cfgRsp);
1659    }
1660
1661    ODU_PUT_MSG_BUF(mBuf);
1662    return RFAILED;
1663 }
1664
1665
1666 /*******************************************************************
1667  *
1668  * @brief Pack and send Slice ReCfg request from MAC to DU APP
1669  *
1670  * @details
1671  *
1672  *    Function : packDuMacSliceRecfgReq
1673  *
1674  *    Functionality:
1675  *       Pack and send Slice ReCfg request from MAC to DU APP
1676  *
1677  * @params[in] Pst *pst, MacSliceRecfgReq *sliceRecfgReq
1678  * @return ROK     - success
1679  *         RFAILED - failure
1680  *
1681  * ****************************************************************/
1682
1683 uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq)
1684 {
1685    Buffer *mBuf = NULLP;
1686
1687    if(pst->selector == ODU_SELECTOR_LWLC)
1688    {
1689       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1690       {
1691          DU_LOG("\nERROR  --> MAC : Memory allocation failed in packDuMacSliceRecfgReq");
1692          return RFAILED;
1693       }
1694       CMCHKPK(oduPackPointer,(PTR)sliceRecfgReq, mBuf);
1695    }
1696    else
1697    {
1698       DU_LOG("\nERROR  -->  MAC: Only LWLC supported in packDuMacSliceRecfgReq");
1699       return RFAILED;
1700    }
1701
1702    return ODU_POST_TASK(pst,mBuf);
1703
1704 }
1705 /*******************************************************************
1706 *
1707 * @brief Unpacks Slice ReCfg request received from DU APP
1708 *
1709 * @details
1710 *
1711 *    Function : unpackMacSliceCfgReq 
1712 *
1713 *    Functionality:
1714 *         Unpacks Slice ReCfg Request received from DU APP
1715 *
1716 * @params[in] Pointer to Handler
1717 *             Post structure pointer
1718 *             Message Buffer
1719 * @return ROK     - success
1720 *         RFAILED - failure
1721 *
1722 * ****************************************************************/
1723 uint8_t unpackMacSliceRecfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf)
1724 {
1725     if(pst->selector == ODU_SELECTOR_LWLC)
1726     {
1727        MacSliceRecfgReq *sliceRecfgReq;
1728        /* unpack the address of the structure */
1729        CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceRecfgReq, mBuf);
1730        ODU_PUT_MSG_BUF(mBuf);
1731        return (*func)(pst, sliceRecfgReq);
1732     }
1733     else
1734     {
1735        /* Nothing to do for other selectors */
1736        DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for Slice ReCfg Request ");
1737        ODU_PUT_MSG_BUF(mBuf);
1738     }
1739
1740     return RFAILED;
1741 }
1742
1743 /*******************************************************************
1744  *
1745  * @brief Pack and send Slice config response from MAC to DU APP
1746  *
1747  * @details
1748  *
1749  *    Function : packDuMacSliceRecfgRsp
1750  *
1751  *    Functionality:
1752  *       Pack and send Slice config response from MAC to DU APP
1753  *
1754  * @params[in] 
1755  * @return ROK     - success
1756  *         RFAILED - failure
1757  *
1758  * ****************************************************************/
1759 uint8_t packDuMacSliceRecfgRsp(Pst *pst, MacSliceRecfgRsp *sliceRecfgRsp)
1760 {
1761    Buffer *mBuf = NULLP;
1762
1763    if(pst->selector == ODU_SELECTOR_LWLC)
1764    {
1765       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1766       {
1767          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacSliceRecfgRsp");
1768          return RFAILED;
1769       }
1770       /* pack the address of the structure */
1771       CMCHKPK(oduPackPointer,(PTR)sliceRecfgRsp, mBuf);
1772    }
1773    else
1774    {
1775       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacSliceRecfgRsp");
1776       return RFAILED;
1777    }
1778
1779    return ODU_POST_TASK(pst,mBuf);
1780 }
1781
1782 /*******************************************************************
1783  *
1784  * @brief Unpack Slice ReConfig Response from MAC to DU APP
1785  *
1786  * @details
1787  *
1788  *    Function :unpackDuMacSliceRecfgRsp 
1789  *
1790  *    Functionality: Unpack Slice ReConfig Response from MAC to DU APP
1791  *
1792  * @params[in] 
1793  * @return ROK     - success
1794  *         RFAILED - failure
1795  *
1796  * ****************************************************************/
1797 uint8_t unpackDuMacSliceRecfgRsp(MacDuSliceRecfgRspFunc func, Pst *pst, Buffer *mBuf)
1798 {
1799    if(pst->selector == ODU_SELECTOR_LWLC)
1800    {
1801       MacSliceRecfgRsp *sliceRecfgRsp = NULLP;
1802
1803       /* unpack the address of the structure */
1804       CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceRecfgRsp, mBuf);
1805       ODU_PUT_MSG_BUF(mBuf);
1806       return (*func)(pst, sliceRecfgRsp);
1807    }
1808
1809    ODU_PUT_MSG_BUF(mBuf);
1810    return RFAILED;
1811 }
1812
1813 /*******************************************************************
1814  *
1815  * @brief Pack and send Slot ind from MAC to DU APP
1816  *
1817  * @details
1818  *
1819  *    Function : packMacSlotInd
1820  *
1821  *    Functionality:
1822  *       Pack and send Slot ind from MAC to DU APP
1823  *
1824  * @params[in] Pst *pst, SlotTimingInfo *slotIndInfo 
1825  * @return ROK     - success
1826  *         RFAILED - failure
1827  *
1828  * ****************************************************************/
1829 uint8_t packMacSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo)
1830 {
1831    Buffer *mBuf = NULLP;
1832
1833    if(pst->selector == ODU_SELECTOR_LWLC)
1834    {
1835       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1836       {
1837          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packMacSlotInd");
1838          return RFAILED;
1839       }
1840       /* pack the address of the structure */
1841       CMCHKPK(oduPackPointer,(PTR)slotIndInfo, mBuf);
1842    }
1843    else
1844    {
1845       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packMacSlotInd");
1846       return RFAILED;
1847    }
1848
1849    return ODU_POST_TASK(pst,mBuf);
1850 }
1851
1852 /*******************************************************************
1853  *
1854  * @brief Unpack Slot indication from MAC to DU APP
1855  *
1856  * @details
1857  *
1858  *    Function :unpackDuMacSlotInd 
1859  *
1860  *    Functionality: Unpack Slot Indication from MAC to DU APP
1861  *
1862  * @params[in] DuMacSlotInd func, Pst *pst, Buffer *mBuf 
1863  * @return ROK     - success
1864  *         RFAILED - failure
1865  *
1866  * ****************************************************************/
1867 uint8_t unpackDuMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf)
1868 {
1869    if(pst->selector == ODU_SELECTOR_LWLC)
1870    {
1871       SlotTimingInfo *slotIndInfo;
1872       
1873       /* unpack the address of the structure */
1874       CMCHKUNPK(oduUnpackPointer, (PTR *)&slotIndInfo, mBuf);
1875       ODU_PUT_MSG_BUF(mBuf);
1876       return (*func)(pst, slotIndInfo);
1877    }
1878
1879    ODU_PUT_MSG_BUF(mBuf);
1880    return RFAILED;
1881 }
1882
1883 /*******************************************************************
1884  *
1885  * @brief Pack and send Dl Pcch indication to MAC
1886  *
1887  * @details
1888  *
1889  *    Function : packDuMacDlPcchInd
1890  *
1891  *    Functionality:
1892  *       Pack and send Dl Pcch indication to MAC
1893  *
1894  * @params[in] Post structure
1895  *             DlPcchInd *pcchInd;
1896  * @return ROK     - success
1897  *         RFAILED - failure
1898  *
1899  * ****************************************************************/
1900
1901 uint8_t packDuMacDlPcchInd(Pst *pst, DlPcchInd *pcchInd)
1902 {
1903    Buffer *mBuf = NULLP;
1904
1905    if(pst->selector == ODU_SELECTOR_LWLC)
1906    {
1907       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1908       {
1909          DU_LOG("\nERROR  --> MAC : packDuMacDlPcchInd(): Memory allocation failed ");
1910          return RFAILED;
1911       }
1912       CMCHKPK(oduPackPointer,(PTR)pcchInd, mBuf);
1913       return ODU_POST_TASK(pst,mBuf);
1914    }
1915    else
1916    {
1917       DU_LOG("\nERROR  -->  MAC: packDuMacDlPcchInd(): Only LWLC supported ");
1918    }
1919    return RFAILED;
1920 }
1921
1922 /*******************************************************************
1923  *
1924  * @brief Unpacks downlink pcch indication received from DU APP
1925  *
1926  * @details
1927  *
1928  *    Function : unpackMacDlPcchInd
1929  *
1930  *    Functionality:
1931  *         Unpacks downlink pcch indication received from DU APP
1932  *
1933  * @params[in] Pointer to Handler
1934  *             Post structure pointer
1935  *             Message Buffer
1936  * @return ROK     - success
1937  *         RFAILED - failure
1938  *
1939  * ****************************************************************/
1940
1941 uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf)
1942 {
1943    if(pst->selector == ODU_SELECTOR_LWLC)
1944    {
1945       DlPcchInd *pcchInd=NULLP;
1946
1947       /* unpack the address of the structure */
1948       CMCHKUNPK(oduUnpackPointer, (PTR *)&pcchInd, mBuf);
1949       ODU_PUT_MSG_BUF(mBuf);
1950       return (*func)(pst, pcchInd);
1951    }
1952    else
1953    {
1954       /* Nothing to do for other selectors */
1955       DU_LOG("\nERROR  -->  DU APP : unpackMacDlPcchInd(): Only LWLC supported");
1956       ODU_PUT_MSG_BUF(mBuf);
1957    }
1958
1959    return RFAILED;
1960 }
1961
1962 /*******************************************************************
1963 *
1964 * @brief Packs and Sends UE Reset Request from DUAPP to MAC
1965 *
1966 * @details
1967 *
1968 *    Function : packDuMacUeResetReq
1969 *
1970 *    Functionality:
1971 *       Packs and Sends UE Reset Request from DUAPP to MAC
1972 *
1973 *
1974 * @params[in] Post structure pointer
1975 *             MacUeResetReq pointer
1976 * @return ROK     - success
1977 *         RFAILED - failure
1978 *
1979 * ****************************************************************/
1980 uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueDel)
1981 {
1982     Buffer *mBuf = NULLP;
1983
1984     if(pst->selector == ODU_SELECTOR_LWLC)
1985     {
1986        if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1987        {
1988           DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeResetReq");
1989           return RFAILED;
1990        }
1991        /* pack the address of the structure */
1992        CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
1993     }
1994     else
1995     {
1996        DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeResetReq");
1997        return RFAILED;
1998     }
1999     return ODU_POST_TASK(pst,mBuf);
2000 }
2001
2002 /*******************************************************************
2003 *
2004 * @brief Unpacks UE Reset Request received from DU APP
2005 *
2006 * @details
2007 *
2008 *    Function : unpackMacUeResetReq 
2009 *
2010 *    Functionality:
2011 *         Unpacks UE Reset Request received from DU APP
2012 *
2013 * @params[in] Pointer to Handler
2014 *             Post structure pointer
2015 *             Message Buffer
2016 * @return ROK     - success
2017 *         RFAILED - failure
2018 *
2019 * ****************************************************************/
2020 uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf)
2021 {
2022     if(pst->selector == ODU_SELECTOR_LWLC)
2023     {
2024        MacUeResetReq *ueReset;
2025
2026        /* unpack the address of the structure */
2027        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueReset, mBuf);
2028        ODU_PUT_MSG_BUF(mBuf);
2029        return (*func)(pst, ueReset);
2030     }
2031     else
2032     {
2033        /* Nothing to do for other selectors */
2034        DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for UE Reset Request ");
2035        ODU_PUT_MSG_BUF(mBuf);
2036     }
2037
2038     return RFAILED;
2039 }
2040
2041 /*******************************************************************
2042  *
2043  * @brief Pack and send UE reset response from MAC to DU APP
2044  *
2045  * @details
2046  *
2047  *    Function : packDuMacUeResetRsp
2048  *
2049  *    Functionality:
2050  *       Pack and send UE  reset response from MAC to DU APP
2051  *
2052  * @params[in]
2053  * @return ROK     - success
2054  *         RFAILED - failure
2055  *
2056  * ****************************************************************/
2057 uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp)
2058 {
2059    Buffer *mBuf = NULLP;
2060    
2061    if(pst->selector == ODU_SELECTOR_LWLC)
2062    {
2063       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2064       {
2065          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeResetRsp");
2066          return RFAILED;
2067       }
2068       /* pack the address of the structure */
2069       CMCHKPK(oduPackPointer,(PTR)resetRsp, mBuf);
2070    }
2071    else
2072    {
2073       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeResetRsp");
2074       return RFAILED;
2075    }
2076    
2077    return ODU_POST_TASK(pst,mBuf);
2078 }
2079
2080 /*******************************************************************
2081 *
2082 * @brief Unpack UE Config Response from MAC to DU APP
2083 *
2084 * @details
2085 *
2086 *    Function :unpackDuMacUeResetRsp 
2087 *
2088 *    Functionality: Unpack UE Config Response from MAC to DU APP
2089 *
2090 * @params[in]
2091 * @return ROK     - success
2092 *         RFAILED - failure
2093 *
2094 * ****************************************************************/
2095 uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf)
2096 {
2097     if(pst->selector == ODU_SELECTOR_LWLC)
2098     {
2099        MacUeResetRsp *ueResetRsp = NULLP;
2100
2101        /* unpack the address of the structure */
2102        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueResetRsp, mBuf);
2103        ODU_PUT_MSG_BUF(mBuf);
2104        return (*func)(pst, ueResetRsp);
2105     }
2106
2107     ODU_PUT_MSG_BUF(mBuf);
2108     return RFAILED;
2109 }
2110
2111 /*******************************************************************
2112  *
2113  * @brief Searches for first unset bit in ueBitMap
2114  *
2115  * @details
2116  *
2117  *    Function : getFreeBitFromUeBitMap
2118  *
2119  *    Functionality: Searches for first unset bit in ueBitMap of
2120  *       a cell. Search starts from LSB to MSB. Returns index of the
2121  *       free bit, considering LSB at index 0 and increasing index
2122  *       towards MSB.
2123  *
2124  * @params[in] Cell Id
2125  * @return Index of free bit - success 
2126  *         -1 - failure
2127  *
2128  * ****************************************************************/
2129 int8_t getFreeBitFromUeBitMap(uint16_t cellId)
2130 {
2131    uint8_t  bitIdx = 0;  /* bit position */
2132    uint16_t cellIdx = 0; /* Index to acces ueBitMapPerCell[] */
2133    uint64_t mask = 1;    /* bit mask */
2134
2135    GET_CELL_IDX(cellId, cellIdx);
2136    while(bitIdx < 64) 
2137    {   
2138       /* Find the first unset bit in Bit Map */
2139       if((ueBitMapPerCell[cellIdx] & (mask << bitIdx)) == 0)
2140       {   
2141          SET_ONE_BIT(bitIdx, ueBitMapPerCell[cellIdx]);
2142          return bitIdx;
2143       }   
2144       else
2145          bitIdx++;
2146    }   
2147    return -1; 
2148 }
2149
2150 /*******************************************************************
2151  *
2152  * @brief Unset a previously set bit in UeBitMap
2153  *
2154  * @details
2155  *
2156  *    Function : unsetBitInUeBitMap
2157  *
2158  *    Functionality: Searches for bit at given index and unset it.
2159  *
2160  * @params[in] Cell Id
2161  *             Bit Index
2162  * @return void 
2163  *
2164  * ****************************************************************/
2165 void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos)
2166 {
2167     uint16_t cellIdx;
2168
2169    GET_CELL_IDX(cellId, cellIdx);
2170    UNSET_ONE_BIT(bitPos, ueBitMapPerCell[cellIdx]);
2171 }
2172
2173 /**********************************************************************
2174   End of file
2175  **********************************************************************/