9d98a314b3f6a2c48e230e819ced7957ac188ac7
[o-du/l2.git] / src / cm / du_app_rlc_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_rlc_inf.h"
21
22 /*******************************************************************
23  *
24  * @brief Packs and Sends UE create Request from DUAPP to RLC
25  *
26  * @details
27  *
28  *    Function : packDuRlcUeCreateReq
29  *
30  *    Functionality:
31  *       Packs and Sends UE Create Request from DUAPP to RLC
32  *
33  *
34  * @params[in] Post structure pointer
35  *             RlcUeCfg pointer              
36  * @return ROK     - success
37  *         RFAILED - failure
38  *
39  * ****************************************************************/
40 uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg)
41 {
42    Buffer *mBuf = NULLP;
43  
44    if(pst->selector == ODU_SELECTOR_LWLC)
45    {
46       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
47       {
48          DU_LOG("\nERROR  --> RLC : Memory allocation failed at packDuRlcUeCreateReq");
49          return RFAILED;
50       }
51       /* pack the address of the structure */
52       CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
53    }
54    else
55    {
56       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packDuRlcUeCreateReq");
57       return RFAILED;
58    }
59
60     return ODU_POST_TASK(pst,mBuf);
61 }
62
63 /*******************************************************************
64  *
65  * @brief Unpacks UE Create Request received from DU APP
66  *
67  * @details
68  *
69  *    Function : unpackRlcUeCreateReq
70  *
71  *    Functionality:
72  *         Unpacks UE Create Request received from DU APP
73  *
74  * @params[in] Pointer to Handler
75  *             Post structure pointer
76  *             Message Buffer
77  * @return ROK     - success
78  *         RFAILED - failure
79  *
80  * ****************************************************************/
81 uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf)
82 {
83    if(pst->selector == ODU_SELECTOR_LWLC)
84    {
85       RlcUeCfg *ueCfg;
86       /* unpack the address of the structure */
87       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf);
88       ODU_PUT_MSG_BUF(mBuf);
89       return (*func)(pst, ueCfg);
90    }
91    else
92    {
93       /* Nothing to do for other selectors */
94       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UE Create Request ");
95       ODU_PUT_MSG_BUF(mBuf);
96    }
97
98    return RFAILED;
99 }
100
101 /*******************************************************************
102  *
103  * @brief Packs and Sends UE Cfg Response from RLC to DUAPP
104  *
105  * @details
106  *
107  *    Function : packRlcDuUeCfgRsp
108  *
109  *    Functionality:
110  *       Packs and Sends UE Cfg Rrsponse from RLC to DUAPP
111  *
112  *
113  * @params[in] Post structure pointer
114  *             RlcUeCfg pointer              
115  * @return ROK     - success
116  *         RFAILED - failure
117  *
118  * ****************************************************************/
119 uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg)
120 {
121    Buffer *mBuf = NULLP;
122  
123    if(pst->selector == ODU_SELECTOR_LWLC)
124    {
125       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
126       {
127          DU_LOG("\nERROR  --> RLC : Memory allocation failed at packRlcDuUeCfgRsp");
128          return RFAILED;
129       }
130       /* pack the address of the structure */
131       CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
132    }
133    else
134    {
135       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packRlcDuUeCfgRsp");
136       return RFAILED;
137    }
138
139     return ODU_POST_TASK(pst,mBuf);
140 }
141
142 /*******************************************************************
143  *
144  * @brief Unpacks UE Cfg Response received from DU APP
145  *
146  * @details
147  *
148  *    Function : unpackRlcUeCfgRsp
149  *
150  *    Functionality:
151  *         Unpacks UE Cfg Response received from DU APP
152  *
153  * @params[in] Pointer to Handler
154  *             Post structure pointer
155  *             Message Buffer
156  * @return ROK     - success
157  *         RFAILED - failure
158  *
159  * ****************************************************************/
160 uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf)
161 {
162    if(pst->selector == ODU_SELECTOR_LWLC)
163    {
164       RlcUeCfgRsp *cfgRsp = NULLP;
165       /* unpack the address of the structure */
166       CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
167       ODU_PUT_MSG_BUF(mBuf);
168       return (*func)(pst, cfgRsp);
169    }
170    else
171    {
172       /* Nothing to do for other selectors */
173       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UE Cfg Response ");
174       ODU_PUT_MSG_BUF(mBuf);
175    }
176
177    return RFAILED;
178 }
179
180 /*******************************************************************
181  *
182  * @brief Pack and send UL RRC message transfer from RLC to DU APP
183  *
184  * @details
185  *
186  *    Function : packRlcUlRrcMsgToDu
187  *
188  *    Functionality:
189  *       Pack and send UL RRC message transfer from RLC to DU APP
190  *
191  * @params[in] Post structure
192  *             UL RRC Msg transfer info
193  * @return ROK     - success
194  *         RFAILED - failure
195  *
196  * ****************************************************************/
197 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo)
198 {
199    Buffer *mBuf = NULLP;
200
201    if(pst->selector == ODU_SELECTOR_LWLC)
202    {
203       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
204       {
205          DU_LOG("\nERROR  --> RLC : Memory allocation failed at packRlcUlRrcMsgToDu");
206          return RFAILED;
207       }
208       /* pack the address of the structure */
209       CMCHKPK(oduPackPointer,(PTR)ulRrcMsgInfo, mBuf);
210       return ODU_POST_TASK(pst,mBuf);
211    }
212    else
213    {
214       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packRlcUlRrcMsgToDu");
215    }
216    return RFAILED;
217 }
218
219 /*******************************************************************
220  *
221  * @brief Unpack UL RRC Msg Transfer received at DU APP from RLC
222  *
223  * @details
224  *
225  *    Function : unpackRlcUlRrcMsgToDu
226  *
227  *    Functionality:
228  *      Unpack UL RRC Msg Transfer received at DU APP from RLC
229  *
230  * @params[in]
231  * @return ROK     - success
232  *         RFAILED - failure
233  *
234  * ****************************************************************/
235 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf)
236 {
237    if(pst->selector == ODU_SELECTOR_LWLC)
238    {
239       RlcUlRrcMsgInfo *ulRrcMsgInfo;
240       /* unpack the address of the structure */
241       CMCHKUNPK(oduUnpackPointer, (PTR *)&ulRrcMsgInfo, mBuf);
242       ODU_PUT_MSG_BUF(mBuf);
243       return (*func)(pst, ulRrcMsgInfo);
244    }
245    else
246    {
247       /* Nothing to do for other selectors */
248       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UL RRC Message transfer ");
249       ODU_PUT_MSG_BUF(mBuf);
250    }
251
252    return RFAILED;
253 }
254
255 /*******************************************************************
256  *
257  * @brief Pack and post DL RRC Message from DU APP to RLC 
258  *
259  * @details
260  *
261  *    Function : packDlRrcMsgToRlc
262  *
263  *    Functionality: Pack and post DL RRC Message from DU APP to RLC
264  *
265  * @params[in] Post structure
266  *             DL RRC Message info
267  * @return ROK     - success
268  *         RFAILED - failure
269  *
270  * ****************************************************************/
271 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
272 {
273    Buffer *mBuf = NULLP;
274
275    if(pst->selector == ODU_SELECTOR_LWLC)
276    {
277       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
278       {
279          DU_LOG("\nERROR  --> RLC : Memory allocation failed at packRlcDlRrcMsgToRlc");
280          return RFAILED;
281       }
282       /* pack the address of the structure */
283       CMCHKPK(oduPackPointer,(PTR)dlRrcMsgInfo, mBuf);
284       return ODU_POST_TASK(pst,mBuf);
285    }
286    else
287    {
288       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packDlRrcMsgToRlc");
289    }
290    return RFAILED;
291 }
292
293 /*******************************************************************
294  *
295  * @brief Unpacks DL RRC Message info received at RLC from DU APP
296  *
297  * @details
298  *
299  *    Function : unpackDlRrcMsgToRlc
300  *
301  *    Functionality:
302  *      Unpacks the DL RRC Message info received at RLC from DU APP
303  *
304  * @params[in] Pointer to handler function
305  *             Post structure
306  *             Messae buffer to be unpacked
307  * @return ROK     - success
308  *         RFAILED - failure
309  *
310  * ****************************************************************/
311 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf)
312 {
313    if(pst->selector == ODU_SELECTOR_LWLC)
314    {
315       RlcDlRrcMsgInfo *dlRrcMsgInfo;
316       /* unpack the address of the structure */
317       CMCHKUNPK(oduUnpackPointer, (PTR *)&dlRrcMsgInfo, mBuf);
318       ODU_PUT_MSG_BUF(mBuf);
319       return (*func)(pst, dlRrcMsgInfo);
320    }
321    else
322    {
323       /* Nothing to do for other selectors */
324       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UL RRC Message transfer ");
325       ODU_PUT_MSG_BUF(mBuf);
326    }
327    return RFAILED;
328 }
329
330 /*******************************************************************
331 *
332 * @brief packs RRC delivery report sending from  RLC to DU APP
333 *
334 * @details
335 *
336 *    Function : packRrcDeliveryReportToDu
337 *
338 *    Functionality:
339 *      Unpacks the DL RRC Message info received at RLC from DU APP
340 *
341 * @params[in] Pointer to handler function
342 *             Post structure
343 *             Messae buffer to be unpacked
344 * @return ROK     - success
345 *         RFAILED - failure
346 *
347 * ****************************************************************/
348 uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport)
349 {
350     Buffer *mBuf = NULLP;
351
352     if(pst->selector == ODU_SELECTOR_LWLC)
353     {
354        if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
355        {
356           DU_LOG("\nERROR  --> RLC : Memory allocation failed at packRrcDeliveryReportToDu");
357           return RFAILED;
358        }
359        /* pack the address of the structure */
360        CMCHKPK(oduPackPointer,(PTR)rrcDeliveryReport, mBuf);
361        return ODU_POST_TASK(pst,mBuf);
362     }
363     else
364     {
365        DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packRrcDeliveryReportToDu");
366     }
367     return RFAILED;
368  }
369
370 /*******************************************************************
371 *
372 * @brief Unpacks RRC Delivery Report info received at DU APP from RIC
373 *
374 * @details
375 *
376 *    Function : unpackRrcDeliveryReportToDu
377 *
378 *    Functionality:
379 *      Unpacks RRC Delivery Report info received at DU APP from RIC
380 *
381 * @params[in] Pointer to handler function
382 *             Post structure
383 *             Messae buffer to be unpacked
384 * @return ROK     - success
385 *         RFAILED - failure
386 *
387 * ****************************************************************/
388 uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func, Pst *pst, Buffer *mBuf)
389 {
390     if(pst->selector == ODU_SELECTOR_LWLC)
391     {
392        RrcDeliveryReport *rrcDeliveryReport;
393        /* unpack the address of the structure */
394        CMCHKUNPK(oduUnpackPointer, (PTR *)&rrcDeliveryReport, mBuf);
395        ODU_PUT_MSG_BUF(mBuf);
396        return (*func)(pst, rrcDeliveryReport);
397     }
398     else
399     {
400        /* Nothing to do for other selectors */
401        DU_LOG("\nERROR  -->  RLC: Only LWLC supported for RRC delivery Message transfer ");
402        ODU_PUT_MSG_BUF(mBuf);
403     }
404
405     return RFAILED;
406 }
407
408 /*******************************************************************
409  *
410  * @brief Packs and Sends UE Reconfig Request from DUAPP to RLC
411  *
412  * @details
413  *
414  *    Function : packDuRlcUeReconfigReq
415  *
416  *    Functionality:
417  *       Packs and Sends UE Reconfig Request from DUAPP to RLC
418  *
419  *
420  * @params[in] Post structure pointer
421  *             RlcUeCfg pointer              
422  * @return ROK     - success
423  *         RFAILED - failure
424  *
425  * ****************************************************************/
426 uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg)
427 {
428    Buffer *mBuf = NULLP;
429  
430    if(pst->selector == ODU_SELECTOR_LWLC)
431    {
432       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
433       {
434          DU_LOG("\nERROR  --> RLC : Memory allocation failed at packDuRlcUeReconfigReq");
435          return RFAILED;
436       }
437       /* pack the address of the structure */
438       CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
439    }
440    else
441    {
442       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packDuRlcUeReconfigReq");
443       return RFAILED;
444    }
445
446     return ODU_POST_TASK(pst,mBuf);
447 }
448
449 /*******************************************************************
450  * @brief Unpacks UE Reconfig Request received from DU APP
451  *
452  * @details
453  *
454  *    Function : unpackRlcUeReconfigReq
455  *
456  *    Functionality:
457  *         Unpacks UE Create Request received from DU APP
458  *
459  * @params[in] Pointer to Handler
460  *             Post structure pointer
461  *             Message Buffer
462  * @return ROK     - success
463  *         RFAILED - failure
464  *
465  * ****************************************************************/
466 uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf)
467 {
468    if(pst->selector == ODU_SELECTOR_LWLC)
469    {
470       RlcUeCfg *ueCfg;
471       /* unpack the address of the structure */
472       CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf);
473       ODU_PUT_MSG_BUF(mBuf);
474       return (*func)(pst, ueCfg);
475    }
476    else
477    {
478       /* Nothing to do for other selectors */
479       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UE Create Request ");
480       ODU_PUT_MSG_BUF(mBuf);
481    }
482    return RFAILED;
483 }
484
485 /*******************************************************************
486  *
487  * @brief Pack and send DL RRC message Response from RLC to DU APP
488  *
489  * @details
490  *
491  *    Function : packRlcDlRrcMsgRspToDu
492  *
493  *    Functionality:
494  *       Pack and send DL RRC message Response from RLC to DU APP
495  *
496  * @params[in] Post structure
497  *             DL RRC Msg Response 
498  * @return ROK     - success
499  *         RFAILED - failure
500  *
501  * ****************************************************************/
502 uint8_t packRlcDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp)
503 {
504    Buffer *mBuf = NULLP;
505
506    if(pst->selector == ODU_SELECTOR_LWLC)
507    {
508       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
509       {
510          DU_LOG("\nERROR  --> RLC : Memory allocation failed at packRlcDlRrcMsgRspToDu");
511          return RFAILED;
512       }
513       /* pack the address of the structure */
514       CMCHKPK(oduPackPointer,(PTR)dlRrcMsgRsp, mBuf);
515       return ODU_POST_TASK(pst,mBuf);
516    }
517    else
518    {
519       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packRlcDlRrcMsgRspToDu");
520    }
521    return RFAILED;
522 }
523
524 /*******************************************************************
525  *
526  * @brief Unpack DL RRC Msg Response received at DU APP from RLC
527  *
528  * @details
529  *
530  *    Function : unpackRlcDlRrcMsgRspToDu
531  *
532  *    Functionality:
533  *      Unpack DL RRC Msg Response received at DU APP from RLC
534  *
535  * @params[in]
536  * @return ROK     - success
537  *         RFAILED - failure
538  *
539  * ****************************************************************/
540 uint8_t unpackRlcDlRrcMsgRspToDu(RlcDlRrcMsgRspToDuFunc func, Pst *pst, Buffer *mBuf)
541 {
542    if(pst->selector == ODU_SELECTOR_LWLC)
543    {
544       RlcDlRrcMsgRsp *dlRrcMsgRsp;
545       /* unpack the address of the structure */
546       CMCHKUNPK(oduUnpackPointer, (PTR *)&dlRrcMsgRsp, mBuf);
547       ODU_PUT_MSG_BUF(mBuf);
548       return (*func)(pst, dlRrcMsgRsp);
549    }
550    else
551    {
552       /* Nothing to do for other selectors */
553       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for DL RRC Message transfer ");
554       ODU_PUT_MSG_BUF(mBuf);
555    }
556    return RFAILED;
557 }
558
559 /*******************************************************************
560  *
561  * @brief Pack and send UL user data from RLC to DU APP
562  *
563  * @details
564  *
565  *    Function : packRlcUlUserDataToDu
566  *
567  *    Functionality:
568  *       Pack and send UL User Data from RLC to DU APP
569  *
570  * @params[in] Post structure
571  *             UL user data
572  * @return ROK     - success
573  *         RFAILED - failure
574  *
575  * ****************************************************************/
576 uint8_t packRlcUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData)
577 {
578    Buffer *mBuf = NULLP;
579
580    if(pst->selector == ODU_SELECTOR_LWLC)
581    {
582       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
583       {
584          DU_LOG("\nERROR  -->  RLC UL: Memory allocation failed at packRlcUlUserDataToDu");
585          return RFAILED;
586       }
587       /* pack the address of the structure */
588       CMCHKPK(oduPackPointer,(PTR)ulUserData, mBuf);
589       return ODU_POST_TASK(pst,mBuf);
590    }
591    else
592    {
593       DU_LOG("\nERROR  -->  RLC UL: Only LWLC supported for packRlcUlUserDataToDu");
594    }
595    return RFAILED;
596 }
597
598 /*******************************************************************
599  *
600  * @brief Unpack UL user data received at DU APP from RLC
601  *
602  * @details
603  *
604  *    Function : unpackRlcUlUserDataToDu
605  *
606  *    Functionality:
607  *      Unpack UL user data received at DU APP from RLC
608  *
609  * @params[in]
610  * @return ROK     - success
611  *         RFAILED - failure
612  *
613  * ****************************************************************/
614 uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mBuf)
615 {
616    if(pst->selector == ODU_SELECTOR_LWLC)
617    {
618       RlcUlUserDatInfo *ulUserData;
619       /* unpack the address of the structure */
620       CMCHKUNPK(oduUnpackPointer, (PTR *)&ulUserData, mBuf);
621       ODU_PUT_MSG_BUF(mBuf);
622       return (*func)(pst, ulUserData);
623    }
624    else
625    {
626       /* Nothing to do for other selectors */
627       DU_LOG("\nERROR  --> RLC UL: Only LWLC supported for UL User data transfer ");
628       ODU_PUT_MSG_BUF(mBuf);
629    }
630
631    return RFAILED;
632 }
633
634 /*******************************************************************
635  *
636  * @brief Pack and send DL user data from DUAPP to RLC
637  *
638  * @details
639  *
640  *    Function : packRlcDlUserDataToRlc
641  *
642  *    Functionality:
643  *       Pack and send DL User Data from DUAPP to RLC
644  *
645  * @params[in] Post structure
646  *             DL user data
647  * @return ROK     - success
648  *         RFAILED - failure
649  *
650  * ****************************************************************/
651 uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlUserData)
652 {
653    Buffer *mBuf = NULLP;
654
655    if(pst->selector == ODU_SELECTOR_LWLC)
656    {
657       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
658       {
659          DU_LOG("\nERROR  -->  RLC DL: Memory allocation failed at packRlcDlUserDataToRlc");
660          return RFAILED;
661       }
662       /* pack the address of the structure */
663       CMCHKPK(oduPackPointer,(PTR)dlUserData, mBuf);
664       return ODU_POST_TASK(pst,mBuf);
665    }
666    else
667    {
668       DU_LOG("\nERROR  -->  RLC DL: Only LWLC supported for packRlcUlUserDataToDu");
669    }
670    return RFAILED;
671 }
672
673 /*******************************************************************
674  *
675  * @brief Unpack DL user data received at RLC from DUAPP
676  *
677  * @details
678  *
679  *    Function : unpackRlcDlUserDataToRlc
680  *
681  *    Functionality:
682  *      Unpack DL user data received at RLC from DUAPP
683  *
684  * @params[in]
685  * @return ROK     - success
686  *         RFAILED - failure
687  *
688  * ****************************************************************/
689 uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf)
690 {
691    if(pst->selector == ODU_SELECTOR_LWLC)
692    {
693       RlcDlUserDataInfo *dlUserData;
694       /* unpack the address of the structure */
695       CMCHKUNPK(oduUnpackPointer, (PTR *)&dlUserData, mBuf);
696       ODU_PUT_MSG_BUF(mBuf);
697       return (*func)(pst, dlUserData);
698    }
699    else
700    {
701       /* Nothing to do for other selectors */
702       DU_LOG("\nERROR  --> RLC DL: Only LWLC supported for UL User data transfer ");
703       ODU_PUT_MSG_BUF(mBuf);
704    }
705
706    return RFAILED;
707 }
708
709 /*******************************************************************
710 *
711 * @brief Packs and Sends UE Delete Request from DUAPP to RLC
712 *
713 * @details
714 *
715 *    Function : packDuRlcUeDeleteReq 
716 *
717 *    Functionality:
718 *       Packs and Sends UE Delete Request from DUAPP to RLC
719 *
720 *
721 * @params[in] Post structure pointer
722 *             RlcUeDelete pointer
723 * @return ROK     - success
724 *         RFAILED - failure
725 *
726 * ****************************************************************/
727
728 uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete)
729 {
730    Buffer *mBuf = NULLP;
731
732    if(pst->selector == ODU_SELECTOR_LWLC)
733    {
734       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
735       {
736          DU_LOG("\nERROR  --> RLC : Memory allocation failed at packDuRlcUeDeleteReq");
737          return RFAILED;
738       }
739       /* pack the address of the structure */
740       CMCHKPK(oduPackPointer,(PTR)ueDelete, mBuf);
741    }
742    else
743    {
744       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packDuRlcUeDeleteReq");
745       return RFAILED;
746    }
747
748    return ODU_POST_TASK(pst,mBuf);
749 }
750
751 /*******************************************************************
752 * @brief Unpacks UE Delete Request received from DU APP
753 *
754 * @details
755 *
756 *    Function : unpackRlcUeDeleteReq 
757 *
758 *    Functionality:
759 *         Unpacks UE Delete Request received from DU APP
760 *
761 * @params[in] Pointer to Handler
762 *             Post structure pointer
763 *             Message Buffer
764 * @return ROK     - success
765 *         RFAILED - failure
766 *
767 * ****************************************************************/
768
769 uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf)
770 {
771     if(pst->selector == ODU_SELECTOR_LWLC)
772     {
773        RlcUeDelete *ueDelete;
774        /* unpack the address of the structure */
775        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf);
776        ODU_PUT_MSG_BUF(mBuf);
777        return (*func)(pst, ueDelete);
778     }
779     else
780     {
781        /* Nothing to do for other selectors */
782        DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UE Delete Request ");
783        ODU_PUT_MSG_BUF(mBuf);
784     }
785     return RFAILED;
786 }
787
788 /*******************************************************************
789 *
790 * @brief Packs and Sends UE Del Response from RLC to DUAPP
791 *
792 * @details
793 *
794 *    Function : packRlcDuUeDeleteRsp
795 *
796 *    Functionality:
797 *       Packs and Sends UE Del Response from RLC to DUAPP
798 *
799 *
800 * @params[in] Post structure pointer
801 *             RlcUeDeleteRsp *ueDelRsp
802 *
803 * @return ROK     - success
804 *         RFAILED - failure
805 *
806 * ****************************************************************/
807
808 uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDelRsp)
809 {
810    Buffer *mBuf = NULLP;
811
812    if(pst->selector == ODU_SELECTOR_LWLC)
813    {
814       if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
815       {
816          DU_LOG("\nERROR  --> RLC : Memory allocation failed at packRlcDuUeDeleteRsp");
817          return RFAILED;
818       }
819       /* pack the address of the structure */
820       CMCHKPK(oduPackPointer,(PTR)ueDelRsp, mBuf);
821    }
822    else
823    {
824       DU_LOG("\nERROR  -->  RLC: Only LWLC supported for packRlcDuUeDeleteRsp");
825       return RFAILED;
826    }
827
828    return ODU_POST_TASK(pst,mBuf);
829 }
830
831 /*******************************************************************
832 *
833 * @brief Unpacks UE Del Response received from DU APP
834 *
835 * @details
836 *
837 *    Function : unpackRlcUeDeleteRsp
838 *
839 *    Functionality:
840 *         Unpacks UE Del Response received from DU APP
841 *
842 * @params[in] Pointer to Handler
843 *             Post structure pointer
844 *             Message Buffer
845 * @return ROK     - success
846 *         RFAILED - failure
847 *
848 * ****************************************************************/
849
850 uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf)
851 {
852     if(pst->selector == ODU_SELECTOR_LWLC)
853     {
854        RlcUeDeleteRsp *ueDeleteRsp = NULLP;
855        /* unpack the address of the structure */
856        CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf);
857        ODU_PUT_MSG_BUF(mBuf);
858        return (*func)(pst, ueDeleteRsp);
859     }
860     else
861     {
862        /* Nothing to do for other selectors */
863        DU_LOG("\nERROR  -->  RLC: Only LWLC supported for UE Del Response ");
864        ODU_PUT_MSG_BUF(mBuf);
865     }
866
867     return RFAILED;
868 }
869
870 /**********************************************************************
871          End of file
872 ***********************************************************************/