0aa49644175be46f205ad15159b6f68d4a30b6e3
[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, OduCellId *cellId)
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)cellId, 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    OduCellId  *cellId;
241
242    if(pst->selector == ODU_SELECTOR_LWLC)
243    {
244       /* unpack the address of the structure */
245       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
246       ODU_PUT_MSG_BUF(mBuf); 
247       return (*func)(pst, cellId);
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, OduCellId  *cellId)
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)cellId, 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    OduCellId *cellId;
320    
321    if(pst->selector == ODU_SELECTOR_LWLC)
322    {
323       /* unpack the address of the structure */
324       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
325       ODU_PUT_MSG_BUF(mBuf);
326       return (*func)(pst, cellId);
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, MacUeCfg *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  * @brief Unpacks UE Reconfig Request received from DU APP
869  *
870  * @details
871  *
872  *    Function : unpackMacUeReconfigReq
873  *
874  *    Functionality:
875  *         Unpacks UE Reconfig Request received from DU APP
876  *
877  * @params[in] Pointer to Handler
878  *             Post structure pointer
879  *             Message Buffer
880  * @return ROK     - success
881  *         RFAILED - failure
882  *
883  * ****************************************************************/
884 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf)
885 {
886    if(pst->selector == ODU_SELECTOR_LWLC)
887    {
888       MacUeCfg *ueCfg;
889
890       /* unpack the address of the structure */
891       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf);
892       ODU_PUT_MSG_BUF(mBuf);
893       return (*func)(pst, ueCfg);
894    }
895    else
896    {
897       /* Nothing to do for other selectors */
898       DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for UE Create Request ");
899       ODU_PUT_MSG_BUF(mBuf);
900    }
901
902    return RFAILED;
903 }
904 /*******************************************************************
905 *
906 * @brief Packs and Sends UE Delete Request from DUAPP to MAC
907 *
908 * @details
909 *
910 *    Function : packDuMacUeDeleteReq
911 *
912 *    Functionality:
913 *       Packs and Sends UE Delete Request from DUAPP to MAC
914 *
915 *
916 * @params[in] Post structure pointer
917 *             MacUeDelete pointer
918 * @return ROK     - success
919 *         RFAILED - failure
920 *
921 * ****************************************************************/
922 uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDel)
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 packDuMacUeDeleteReq");
931           return RFAILED;
932        }
933        /* pack the address of the structure */
934        CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
935     }
936     else
937     {
938        DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeDeleteReq");
939        return RFAILED;
940     }
941
942     return ODU_POST_TASK(pst,mBuf);
943 }
944 /*******************************************************************
945 *
946 * @brief Unpacks UE Delete Request received from DU APP
947 *
948 * @details
949 *
950 *    Function : unpackMacUeDeleteReq 
951 *
952 *    Functionality:
953 *         Unpacks UE Delete Request received from DU APP
954 *
955 * @params[in] Pointer to Handler
956 *             Post structure pointer
957 *             Message Buffer
958 * @return ROK     - success
959 *         RFAILED - failure
960 *
961 * ****************************************************************/
962 uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf)
963 {
964     if(pst->selector == ODU_SELECTOR_LWLC)
965     {
966        MacUeDelete *ueDelete;
967
968        /* unpack the address of the structure */
969        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf);
970        ODU_PUT_MSG_BUF(mBuf);
971        return (*func)(pst, ueDelete);
972     }
973     else
974     {
975        /* Nothing to do for other selectors */
976        DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for UE Delete Request ");
977        ODU_PUT_MSG_BUF(mBuf);
978     }
979
980     return RFAILED;
981 }
982 /*******************************************************************
983  *
984  * @brief Pack and send UE delete response from MAC to DU APP
985  *
986  * @details
987  *
988  *    Function : packDuMacUeDeleteRsp
989  *
990  *    Functionality:
991  *       Pack and send UE  delete response from MAC to DU APP
992  *
993  * @params[in]
994  * @return ROK     - success
995  *         RFAILED - failure
996  *
997  * ****************************************************************/
998 uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
999 {
1000    Buffer *mBuf = NULLP;
1001    
1002    if(pst->selector == ODU_SELECTOR_LWLC)
1003    {
1004       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1005       {
1006          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacUeDeleteRsp");
1007          return RFAILED;
1008       }
1009       /* pack the address of the structure */
1010       CMCHKPK(oduPackPointer,(PTR)deleteRsp, mBuf);
1011    }
1012    else
1013    {
1014       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacUeDeleteRsp");
1015       return RFAILED;
1016    }
1017    
1018    return ODU_POST_TASK(pst,mBuf);
1019    
1020 }
1021
1022 /*******************************************************************
1023 *
1024 * @brief Unpack UE Config Response from MAC to DU APP
1025 *
1026 * @details
1027 *
1028 *    Function :unpackDuMacUeDeleteRsp 
1029 *
1030 *    Functionality: Unpack UE Config Response from MAC to DU APP
1031 *
1032 * @params[in]
1033 * @return ROK     - success
1034 *         RFAILED - failure
1035 *
1036 * ****************************************************************/
1037 uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf)
1038 {
1039     if(pst->selector == ODU_SELECTOR_LWLC)
1040     {
1041        MacUeDeleteRsp *ueDeleteRsp = NULLP;
1042
1043        /* unpack the address of the structure */
1044        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf);
1045        ODU_PUT_MSG_BUF(mBuf);
1046        return (*func)(pst, ueDeleteRsp);
1047     }
1048
1049     ODU_PUT_MSG_BUF(mBuf);
1050     return RFAILED;
1051 }
1052
1053 /*******************************************************************
1054  *
1055  * @brief Unpacks Cell Delete Request received from DU APP
1056  *
1057  * @details
1058  *
1059  *    Function : unpackMacCellDeleteReq
1060  *
1061  *    Functionality:
1062  *         Unpacks Cell Delete Request received from DU APP
1063  *
1064  * @params[in] Pointer to Handler
1065  *             Post structure pointer
1066  *             Message Buffer
1067  * @return ROK     - success
1068  *         RFAILED - failure
1069  *
1070  * ****************************************************************/
1071
1072 uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf)
1073 {
1074    if(pst->selector == ODU_SELECTOR_LWLC)
1075    {
1076       MacCellDelete *cellDelete=NULLP;
1077
1078       /* unpack the address of the structure */
1079       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDelete, mBuf);
1080       ODU_PUT_MSG_BUF(mBuf);
1081       return (*func)(pst, cellDelete);
1082    }
1083    else
1084    {
1085       /* Nothing to do for other
1086        * selectors */
1087       DU_LOG("\nERROR  -->  DU APP : unpackMacCellDeleteReq(): Only LWLC supported for CELL Delete Request ");
1088       ODU_PUT_MSG_BUF(mBuf);
1089    }
1090
1091    return RFAILED;
1092 }
1093
1094 /*******************************************************************
1095  *
1096  * @brief Pack and send Cell delete request to MAC
1097  *
1098  * @details
1099  *
1100  *    Function : packDuMacCellDeleteReq
1101  *
1102  *    Functionality:
1103  *       Pack and send Cell delete request to MAC
1104  *
1105  * @params[in] Post structure
1106  *             MacCellDelete *cellDelete;
1107  * @return ROK     - success
1108  *         RFAILED - failure
1109  *
1110  * ****************************************************************/
1111
1112 uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDelete *cellDelete)
1113 {
1114    Buffer *mBuf = NULLP;
1115
1116    if(pst->selector == ODU_SELECTOR_LWLC)
1117    {
1118       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1119       {
1120          DU_LOG("\nERROR  --> MAC : packDuMacCellDeleteReq(): Memory allocation failed ");
1121          return RFAILED;
1122       }
1123       CMCHKPK(oduPackPointer,(PTR)cellDelete, mBuf);
1124       return ODU_POST_TASK(pst,mBuf);
1125    }
1126    else
1127    {
1128       DU_LOG("\nERROR  -->  MAC: packDuMacCellDeleteReq(): Only LWLC supported ");
1129    }
1130    return RFAILED;
1131 }
1132
1133 /*******************************************************************
1134  *
1135  * @brief Pack and send CELL delete response from MAC to DU APP
1136  *
1137  * @details
1138  *
1139  *    Function : packDuMacCellDeleteRsp
1140  *
1141  *    Functionality:
1142  *       Pack and send CELL  delete response from MAC to DU APP
1143  *
1144  * @params[in] Pst *pst, MacCellDeleteRsp *deleteRsp
1145  * @return ROK     - success
1146  *         RFAILED - failure
1147  *
1148  * ****************************************************************/
1149
1150 uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp)
1151 {
1152    Buffer *mBuf = NULLP;
1153
1154    if(pst->selector == ODU_SELECTOR_LWLC)
1155    {
1156       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1157       {
1158          DU_LOG("\nERROR  --> MAC : packDuMacCellDeleteRsp(): Memory allocation failed ");
1159          return RFAILED;
1160       }
1161       CMCHKPK(oduPackPointer,(PTR)cellDeleteRsp, mBuf);
1162    }
1163    else
1164    {
1165       DU_LOG("\nERROR  -->  MAC: packDuMacCellDeleteRsp(): Only LWLC supported ");
1166       return RFAILED;
1167    }
1168
1169    return ODU_POST_TASK(pst,mBuf);
1170
1171 }
1172
1173 /*******************************************************************
1174  *
1175  * @brief Unpack cell delete response from MAC to DU APP
1176  *
1177  * @details
1178  *
1179  *    Function : unpackDuMacCellDeleteRsp
1180  *
1181  *    Functionality: Unpack cell delete response from MAC to DU APP
1182  *
1183  * @params[in] MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf
1184  * @return ROK     - success
1185  *         RFAILED - failure
1186  *
1187  * ****************************************************************/
1188
1189 uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf)
1190 {
1191    if(pst->selector == ODU_SELECTOR_LWLC)
1192    {
1193       MacCellDeleteRsp *cellDeleteRsp = NULLP;
1194
1195       CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDeleteRsp, mBuf);
1196       ODU_PUT_MSG_BUF(mBuf);
1197       return (*func)(pst, cellDeleteRsp);
1198    }
1199    else
1200    {  
1201       DU_LOG("\nERROR  -->  DU APP : unpackDuMacCellDeleteRsp(): Only LWLC supported ");
1202       ODU_PUT_MSG_BUF(mBuf);
1203    }
1204    return RFAILED;
1205 }
1206
1207 /*******************************************************************
1208  *
1209  * @brief Pack and send Slice Cfg request from MAC to DU APP
1210  *
1211  * @details
1212  *
1213  *    Function : packDuMacSliceCfgReq
1214  *
1215  *    Functionality:
1216  *       Pack and send Slice Cfg request from MAC to DU APP
1217  *
1218  * @params[in] Pst *pst, MacSliceCfgReq *sliceCfgReq
1219  * @return ROK     - success
1220  *         RFAILED - failure
1221  *
1222  * ****************************************************************/
1223
1224 uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq)
1225 {
1226    Buffer *mBuf = NULLP;
1227
1228    if(pst->selector == ODU_SELECTOR_LWLC)
1229    {
1230       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1231       {
1232          DU_LOG("\nERROR  --> MAC : Memory allocation failed in packDuMacSliceCfgReq");
1233          return RFAILED;
1234       }
1235       CMCHKPK(oduPackPointer,(PTR)sliceCfgReq, mBuf);
1236    }
1237    else
1238    {
1239       DU_LOG("\nERROR  -->  MAC: Only LWLC supported in packDuMacSliceCfgReq");
1240       return RFAILED;
1241    }
1242
1243    return ODU_POST_TASK(pst,mBuf);
1244
1245 }
1246 /*******************************************************************
1247 *
1248 * @brief Unpacks Slice Cfg request received from DU APP
1249 *
1250 * @details
1251 *
1252 *    Function : unpackMacSliceCfgReq 
1253 *
1254 *    Functionality:
1255 *         Unpacks Slice Cfg Request received from DU APP
1256 *
1257 * @params[in] Pointer to Handler
1258 *             Post structure pointer
1259 *             Message Buffer
1260 * @return ROK     - success
1261 *         RFAILED - failure
1262 *
1263 * ****************************************************************/
1264 uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf)
1265 {
1266     if(pst->selector == ODU_SELECTOR_LWLC)
1267     {
1268        MacSliceCfgReq *sliceCfgReq;
1269        /* unpack the address of the structure */
1270        CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceCfgReq, mBuf);
1271        ODU_PUT_MSG_BUF(mBuf);
1272        return (*func)(pst, sliceCfgReq);
1273     }
1274     else
1275     {
1276        /* Nothing to do for other selectors */
1277        DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for Slice Cfg Request ");
1278        ODU_PUT_MSG_BUF(mBuf);
1279     }
1280
1281     return RFAILED;
1282 }
1283
1284 /*******************************************************************
1285  *
1286  * @brief Pack and send Slice config response from MAC to DU APP
1287  *
1288  * @details
1289  *
1290  *    Function : packDuMacSliceCfgRsp
1291  *
1292  *    Functionality:
1293  *       Pack and send Slice config response from MAC to DU APP
1294  *
1295  * @params[in] 
1296  * @return ROK     - success
1297  *         RFAILED - failure
1298  *
1299  * ****************************************************************/
1300 uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
1301 {
1302    Buffer *mBuf = NULLP;
1303
1304    if(pst->selector == ODU_SELECTOR_LWLC)
1305    {
1306       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1307       {
1308          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacSliceCfgRsp");
1309          return RFAILED;
1310       }
1311       /* pack the address of the structure */
1312       CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
1313    }
1314    else
1315    {
1316       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacSliceCfgRsp");
1317       return RFAILED;
1318    }
1319
1320    return ODU_POST_TASK(pst,mBuf);
1321 }
1322
1323 /*******************************************************************
1324  *
1325  * @brief Unpack Slice Config Response from MAC to DU APP
1326  *
1327  * @details
1328  *
1329  *    Function :unpackDuMacSliceCfgRsp 
1330  *
1331  *    Functionality: Unpack Slice Config Response from MAC to DU APP
1332  *
1333  * @params[in] 
1334  * @return ROK     - success
1335  *         RFAILED - failure
1336  *
1337  * ****************************************************************/
1338 uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf)
1339 {
1340    if(pst->selector == ODU_SELECTOR_LWLC)
1341    {
1342       MacSliceCfgRsp *cfgRsp = NULLP;
1343
1344       /* unpack the address of the structure */
1345       CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
1346       ODU_PUT_MSG_BUF(mBuf);
1347       return (*func)(pst, cfgRsp);
1348    }
1349
1350    ODU_PUT_MSG_BUF(mBuf);
1351    return RFAILED;
1352 }
1353
1354
1355 /*******************************************************************
1356  *
1357  * @brief Pack and send Slice ReCfg request from MAC to DU APP
1358  *
1359  * @details
1360  *
1361  *    Function : packDuMacSliceRecfgReq
1362  *
1363  *    Functionality:
1364  *       Pack and send Slice ReCfg request from MAC to DU APP
1365  *
1366  * @params[in] Pst *pst, MacSliceCfgReq *sliceReCfgReq
1367  * @return ROK     - success
1368  *         RFAILED - failure
1369  *
1370  * ****************************************************************/
1371
1372 uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceCfgReq *sliceReCfgReq)
1373 {
1374    Buffer *mBuf = NULLP;
1375
1376    if(pst->selector == ODU_SELECTOR_LWLC)
1377    {
1378       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1379       {
1380          DU_LOG("\nERROR  --> MAC : Memory allocation failed in packDuMacSliceRecfgReq");
1381          return RFAILED;
1382       }
1383       CMCHKPK(oduPackPointer,(PTR)sliceReCfgReq, mBuf);
1384    }
1385    else
1386    {
1387       DU_LOG("\nERROR  -->  MAC: Only LWLC supported in packDuMacSliceRecfgReq");
1388       return RFAILED;
1389    }
1390
1391    return ODU_POST_TASK(pst,mBuf);
1392
1393 }
1394 /*******************************************************************
1395 *
1396 * @brief Unpacks Slice ReCfg request received from DU APP
1397 *
1398 * @details
1399 *
1400 *    Function : unpackMacSliceCfgReq 
1401 *
1402 *    Functionality:
1403 *         Unpacks Slice ReCfg Request received from DU APP
1404 *
1405 * @params[in] Pointer to Handler
1406 *             Post structure pointer
1407 *             Message Buffer
1408 * @return ROK     - success
1409 *         RFAILED - failure
1410 *
1411 * ****************************************************************/
1412 uint8_t unpackMacSliceReCfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf)
1413 {
1414     if(pst->selector == ODU_SELECTOR_LWLC)
1415     {
1416        MacSliceCfgReq *sliceReCfgReq;
1417        /* unpack the address of the structure */
1418        CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceReCfgReq, mBuf);
1419        ODU_PUT_MSG_BUF(mBuf);
1420        return (*func)(pst, sliceReCfgReq);
1421     }
1422     else
1423     {
1424        /* Nothing to do for other selectors */
1425        DU_LOG("\nERROR  -->  DU APP : Only LWLC supported for Slice ReCfg Request ");
1426        ODU_PUT_MSG_BUF(mBuf);
1427     }
1428
1429     return RFAILED;
1430 }
1431
1432 /*******************************************************************
1433  *
1434  * @brief Pack and send Slice config response from MAC to DU APP
1435  *
1436  * @details
1437  *
1438  *    Function : packDuMacSliceReCfgRsp
1439  *
1440  *    Functionality:
1441  *       Pack and send Slice config response from MAC to DU APP
1442  *
1443  * @params[in] 
1444  * @return ROK     - success
1445  *         RFAILED - failure
1446  *
1447  * ****************************************************************/
1448 uint8_t packDuMacSliceReCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
1449 {
1450    Buffer *mBuf = NULLP;
1451
1452    if(pst->selector == ODU_SELECTOR_LWLC)
1453    {
1454       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1455       {
1456          DU_LOG("\nERROR  --> MAC : Memory allocation failed at packDuMacSliceReCfgRsp");
1457          return RFAILED;
1458       }
1459       /* pack the address of the structure */
1460       CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
1461    }
1462    else
1463    {
1464       DU_LOG("\nERROR  -->  MAC: Only LWLC supported for packDuMacSliceReCfgRsp");
1465       return RFAILED;
1466    }
1467
1468    return ODU_POST_TASK(pst,mBuf);
1469 }
1470
1471 /*******************************************************************
1472  *
1473  * @brief Unpack Slice ReConfig Response from MAC to DU APP
1474  *
1475  * @details
1476  *
1477  *    Function :unpackDuMacSliceReCfgRsp 
1478  *
1479  *    Functionality: Unpack Slice ReConfig Response from MAC to DU APP
1480  *
1481  * @params[in] 
1482  * @return ROK     - success
1483  *         RFAILED - failure
1484  *
1485  * ****************************************************************/
1486 uint8_t unpackDuMacSliceReCfgRsp(MacDuSliceReCfgRspFunc func, Pst *pst, Buffer *mBuf)
1487 {
1488    if(pst->selector == ODU_SELECTOR_LWLC)
1489    {
1490       MacSliceCfgRsp *cfgRsp = NULLP;
1491
1492       /* unpack the address of the structure */
1493       CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
1494       ODU_PUT_MSG_BUF(mBuf);
1495       return (*func)(pst, cfgRsp);
1496    }
1497
1498    ODU_PUT_MSG_BUF(mBuf);
1499    return RFAILED;
1500 }
1501 /**********************************************************************
1502   End of file
1503  **********************************************************************/