1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 #include "common_def.h"
20 #include "du_app_mac_inf.h"
21 /********************* Global Variable ********************/
22 uint64_t ueBitMapPerCell[MAX_NUM_CELL]; /* Bit Map to store used/free UE-IDX per Cell */
24 /**************************************************************************
25 * @brief Function to pack Loose Coupled
26 * MAC cell config parameters required by MAC
30 * Function : packMacCellCfg
33 * packs the macCellCfg parameters
35 * @param[in] Pst *pst, Post structure of the primitive.
36 * @param[in] MacCellCfg *macCellCfg, mac cell config parameters.
37 * @return ROK - success
40 ***************************************************************************/
41 uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
43 if(pst->selector == ODU_SELECTOR_LC)
45 /* we are now implemented only light wieght lossely coupled interface */
48 else if(pst->selector == ODU_SELECTOR_LWLC)
52 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
57 /* pack the address of the structure */
58 CMCHKPK(oduPackPointer,(PTR)macCellCfg, mBuf);
60 DU_LOG("\nDEBUG --> DU-APP : MAC CELL config sent");
61 return ODU_POST_TASK(pst,mBuf);
66 /**************************************************************************
67 * @brief Function to pack Loose Coupled
68 * MAC cell config parameters required by MAC
72 * Function : unpackDuMacCellCfg
75 * packs the macCellCfg parameters
77 * @param[in] DuMacCellCfgReq func; function pointer
78 * @param[in] Pst *pst, Post structure of the primitive.
79 * @param[in] Buffer *mBuf
80 * @return ROK - success
83 ***************************************************************************/
84 uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf)
87 MacCellCfg *macCellCfg;
89 if(pst->selector == ODU_SELECTOR_LWLC)
91 /* unpack the address of the structure */
92 CMCHKUNPK(oduUnpackPointer, (PTR *)&macCellCfg, mBuf);
93 ret = (*func)(pst, macCellCfg);
97 /* only LWLC is implemented now */
104 /**************************************************************************
105 * @brief Function to pack Loose Coupled
106 * MAC cell config confirm message
110 * Function : packMacCellCfgCfm
113 * packs the transaction ID
115 * @param[in] Pst *pst, Post structure of the primitive.
116 * @param[in] MacCellCfgCfm *macCellCfgCfm, mac cell config confirm.
117 * @return ROK - success
120 ***************************************************************************/
121 uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
123 if(pst->selector == ODU_SELECTOR_LC)
125 Buffer *mBuf = NULLP;
126 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
131 /* pack the transaction ID in CNF structure */
132 CMCHKPK(oduPackUInt16, macCellCfgCfm->cellId, mBuf);
133 CMCHKPK(oduPackUInt8, macCellCfgCfm->rsp, mBuf);
135 return ODU_POST_TASK(pst,mBuf);
137 else if(pst->selector == ODU_SELECTOR_LWLC)
139 /* only LC is supported */
145 /**************************************************************************
146 * @brief Function to pack MAC cell config confirm message
150 * Function : unpackMacCellCfgCfm
153 * packs the transaction ID
155 * @param[in] DuMacCellCfgCfm func; function pointer
156 * @param[in] Pst *pst, Post structure of the primitive.
157 * @param[in] Buffer *mBuf
158 * @return ROK - success
161 ***************************************************************************/
162 uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf)
164 MacCellCfgCfm macCellCfgCfm;
166 if(pst->selector == ODU_SELECTOR_LC)
168 /* unpack the transaction ID in CNF structure */
169 CMCHKUNPK(oduUnpackUInt8, &(macCellCfgCfm.rsp), mBuf);
170 CMCHKUNPK(oduUnpackUInt16, &(macCellCfgCfm.cellId), mBuf);
171 return (*func)(pst, &macCellCfgCfm);
175 /* only loose coupling is suported */
180 /*******************************************************************
182 * @brief Packs and Send Cell Start Request to MAC
186 * Function : packMacCellStart
189 * Packs and Sends Cell Start Request to MAC
191 * @params[in] Post structure pointer
193 * @return ROK - success
196 * ****************************************************************/
197 uint8_t packMacCellStart(Pst *pst, CellStartInfo *cellStart)
199 Buffer *mBuf = NULLP;
201 if(pst->selector == ODU_SELECTOR_LC)
203 /* Loose coupling not supported */
206 else if(pst->selector == ODU_SELECTOR_LWLC)
209 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
211 DU_LOG("\nERROR --> DU APP : Memory allocation failed for cell start req pack");
215 /* pack the address of the structure */
216 CMCHKPK(oduPackPointer,(PTR)cellStart, mBuf);
219 return ODU_POST_TASK(pst,mBuf);
222 /*******************************************************************
224 * @brief Unpacks MAC Cell Start Request from DU APP
228 * Function : unpackMaCellStart
231 * Unpacks MAC Cell Start Request from DU APP
233 * @params[in] Function pointer of cell start request handler
234 * Post structure pointer
236 * @return ROK - success
239 * ****************************************************************/
240 uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf)
242 CellStartInfo *cellStart;
244 if(pst->selector == ODU_SELECTOR_LWLC)
246 /* unpack the address of the structure */
247 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStart, mBuf);
248 ODU_PUT_MSG_BUF(mBuf);
249 return (*func)(pst, cellStart);
253 /* Nothing to do for loose coupling */
254 ODU_PUT_MSG_BUF(mBuf);
259 /*******************************************************************
261 * @brief Packs and Send cell stop request to MAC
265 * Function : packMacCellStop
268 * Packs and Send cell stop request to MAC
270 * @params[in] Post structure pointer
272 * @return ROK - success
275 * ****************************************************************/
276 uint8_t packMacCellStop(Pst *pst, CellStopInfo *cellStop)
278 if(pst->selector == ODU_SELECTOR_LC)
280 /* Loose coupling not supported */
283 else if(pst->selector == ODU_SELECTOR_LWLC)
285 Buffer *mBuf = NULLP;
287 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
289 DU_LOG("\nERROR --> DU APP : Memory allocation failed for cell stop req pack");
293 /* pack the address of the structure */
294 CMCHKPK(oduPackPointer,(PTR)cellStop, mBuf);
296 return ODU_POST_TASK(pst,mBuf);
301 /*******************************************************************
303 * @brief Unpacks cell stop request from DU APP
307 * Function : unpackMaCellStop
310 * Unpacks cell stop request from DU APP
312 * @params[in] Handler function pointer
313 * Post structure pointer
315 * @return ROK - success
318 * ****************************************************************/
319 uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf)
321 CellStopInfo *cellStop;
323 if(pst->selector == ODU_SELECTOR_LWLC)
325 /* unpack the address of the structure */
326 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStop, mBuf);
327 ODU_PUT_MSG_BUF(mBuf);
328 return (*func)(pst, cellStop);
332 /* Nothing to do for loose coupling */
333 ODU_PUT_MSG_BUF(mBuf);
338 /*******************************************************************
340 * @brief Packs and Sends cell up ind from MAC to DUAPP
344 * Function : packMacCellUpInd
347 * Packs and Sends cell up ind from MAC to DUAPP
349 * @params[in] Post structure pointer
351 * @return ROK - success
354 * ****************************************************************/
355 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId)
357 Buffer *mBuf = NULLP;
359 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
361 DU_LOG("\nERROR --> DU APP : Memory allocation failed for packMacCellUpInd");
365 if(pst->selector == ODU_SELECTOR_LC)
367 CMCHKPK(oduPackUInt16, cellId->cellId, mBuf);
368 CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, sizeof(OduCellId));
371 else if(pst->selector == ODU_SELECTOR_LWLC)
373 /* pack the address of the structure */
374 CMCHKPK(oduPackPointer,(PTR)cellId, mBuf);
378 ODU_PUT_MSG_BUF(mBuf);
381 return ODU_POST_TASK(pst, mBuf);
384 /*******************************************************************
386 * @brief Unpacks cell up indication from MAC
390 * Function : unpackMacCellUpInd
393 * Unpacks cell up indication from MAC
395 * @params[in] Pointer to Handler
396 * Post structure pointer
398 * @return ROK - success
401 * ****************************************************************/
402 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf)
404 if(pst->selector == ODU_SELECTOR_LWLC)
408 /* unpack the address of the structure */
409 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
410 ODU_PUT_MSG_BUF(mBuf);
411 return (*func)(pst, cellId);
413 else if(pst->selector == ODU_SELECTOR_LC)
416 CMCHKUNPK(oduUnpackUInt16, &cellId.cellId, mBuf);
417 ODU_PUT_MSG_BUF(mBuf);
418 return (*func)(pst, &cellId);
422 /* Nothing to do for loose coupling */
423 ODU_PUT_MSG_BUF(mBuf);
429 /*******************************************************************
431 * @brief Packs and Sends stop ind from MAC to DUAPP
435 * Function : packMacStopInd
438 * Packs and Sends stop ind from MAC to DUAPP
440 * @params[in] Post structure pointer
441 * @return ROK - success
444 * ****************************************************************/
445 uint8_t packMacStopInd(Pst *pst, OduCellId *cellId)
447 Buffer *mBuf = NULLP;
449 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
451 DU_LOG("\nERROR --> DU APP : Memory allocation failed for stop Ind pack");
455 if(pst->selector == ODU_SELECTOR_LC)
457 /*pack the payload here*/
458 CMCHKPK(oduPackUInt16, cellId->cellId, mBuf);
459 CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, sizeof(OduCellId));
462 else if(pst->selector == ODU_SELECTOR_LWLC)
464 /* pack the address of the structure */
465 CMCHKPK(oduPackPointer,(PTR)cellId, mBuf);
469 ODU_PUT_MSG_BUF(mBuf);
472 return ODU_POST_TASK(pst,mBuf);
475 /*******************************************************************
477 * @brief Unpacks stop indication from MAC
481 * Function : unpackMacStopInd
484 * Unpacks stop indication from MAC
486 * @params[in] Pointer to Handler
487 * Post structure pointer
489 * @return ROK - success
492 * ****************************************************************/
493 uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf)
495 if(pst->selector == ODU_SELECTOR_LWLC)
497 OduCellId *cellId=NULLP;
498 /* unpack the address of the structure */
499 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
500 ODU_PUT_MSG_BUF(mBuf);
501 return (*func)(pst, cellId);
503 else if(pst->selector == ODU_SELECTOR_LC)
506 CMCHKUNPK(oduUnpackUInt16, &(cellId.cellId), mBuf);
508 ODU_PUT_MSG_BUF(mBuf);
509 return (*func)(pst, &cellId);
514 /* Nothing to do for loose coupling */
515 ODU_PUT_MSG_BUF(mBuf);
521 /*******************************************************************
523 * @brief Packs and Sends UL CCCH Ind from MAC to DUAPP
527 * Function : packMacUlCcchInd
530 * Packs and Sends UL CCCH Ind from MAC to DUAPP
532 * @params[in] Post structure pointer
533 * UL CCCH Ind pointer
534 * @return ROK - success
537 * ****************************************************************/
538 uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
540 Buffer *mBuf = NULLP;
542 if(pst->selector == ODU_SELECTOR_LWLC)
544 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
546 DU_LOG("\nERROR --> MAC : Memory allocation failed at packMacUlCcchInd");
549 /* pack the address of the structure */
550 CMCHKPK(oduPackPointer,(PTR)ulCcchIndInfo, mBuf);
554 DU_LOG("\nERROR --> MAC: Only LWLC supported for UL CCCH Ind ");
558 return ODU_POST_TASK(pst,mBuf);
561 /*******************************************************************
563 * @brief Unpacks UL CCCH indication from MAC
567 * Function : unpackMacUlCcchInd
570 * Unpacks UL CCCH indication from MAC
572 * @params[in] Pointer to Handler
573 * Post structure pointer
575 * @return ROK - success
578 * ****************************************************************/
579 uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf)
581 if(pst->selector == ODU_SELECTOR_LWLC)
583 UlCcchIndInfo *ulCcchIndInfo;
585 /* unpack the address of the structure */
586 CMCHKUNPK(oduUnpackPointer, (PTR *)&ulCcchIndInfo, mBuf);
587 ODU_PUT_MSG_BUF(mBuf);
588 return (*func)(pst, ulCcchIndInfo);
592 /* Nothing to do for other selectors */
593 DU_LOG("\nERROR --> MAC : Only LWLC supported for UL CCCH Ind ");
594 ODU_PUT_MSG_BUF(mBuf);
599 /*******************************************************************
601 * @brief Packs and Sends DL CCCH Ind from DUAPP to MAC
605 * Function : packMacDlCcchInd
608 * Packs and Sends DL CCCH Ind from DUAPP to MAC
611 * @params[in] Post structure pointer
612 * DL CCCH Ind pointer
613 * @return ROK - success
616 * ****************************************************************/
617 uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
619 Buffer *mBuf = NULLP;
621 if(pst->selector == ODU_SELECTOR_LWLC)
623 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
625 DU_LOG("\nERROR --> MAC : Memory allocation failed at packMacDlCcchInd");
628 /* pack the address of the structure */
629 CMCHKPK(oduPackPointer,(PTR)dlCcchIndInfo, mBuf);
633 DU_LOG("\nERROR --> DU APP : Only LWLC supported for DL CCCH Ind ");
637 return ODU_POST_TASK(pst,mBuf);
640 /*******************************************************************
642 * @brief Unpacks DL CCCH indication from DU APP
646 * Function : unpackMacDlCcchInd
649 * Unpacks DL CCCH indication from DU APP
651 * @params[in] Pointer to Handler
652 * Post structure pointer
654 * @return ROK - success
657 * ****************************************************************/
658 uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf)
660 if(pst->selector == ODU_SELECTOR_LWLC)
662 DlCcchIndInfo *dlCcchIndInfo;
664 /* unpack the address of the structure */
665 CMCHKUNPK(oduUnpackPointer, (PTR *)&dlCcchIndInfo, mBuf);
666 ODU_PUT_MSG_BUF(mBuf);
667 return (*func)(pst, dlCcchIndInfo);
671 /* Nothing to do for other selectors */
672 DU_LOG("\nERROR --> DU APP : Only LWLC supported for DL CCCH Ind ");
673 ODU_PUT_MSG_BUF(mBuf);
679 /*******************************************************************
681 * @brief Packs and Sends UE create Request from DUAPP to MAC
685 * Function : packDuMacUeCreateReq
688 * Packs and Sends UE Create Request from DUAPP to MAC
691 * @params[in] Post structure pointer
692 * MacUeCreateReq pointer
693 * @return ROK - success
696 * ****************************************************************/
697 uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCreateReq *ueCfg)
699 Buffer *mBuf = NULLP;
701 if(pst->selector == ODU_SELECTOR_LWLC)
703 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
705 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeCreateReq");
708 /* pack the address of the structure */
709 CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
713 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeCreateReq");
717 return ODU_POST_TASK(pst,mBuf);
720 /*******************************************************************
722 * @brief Unpacks UE Create Request received from DU APP
726 * Function : unpackMacUeCreateReq
729 * Unpacks UE Create Request received from DU APP
731 * @params[in] Pointer to Handler
732 * Post structure pointer
734 * @return ROK - success
737 * ****************************************************************/
738 uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf)
740 if(pst->selector == ODU_SELECTOR_LWLC)
742 MacUeCreateReq *ueCfg;
744 /* unpack the address of the structure */
745 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf);
746 ODU_PUT_MSG_BUF(mBuf);
747 return (*func)(pst, ueCfg);
751 /* Nothing to do for other selectors */
752 DU_LOG("\nERROR --> DU APP : Only LWLC supported for UE Create Request ");
753 ODU_PUT_MSG_BUF(mBuf);
759 /*******************************************************************
761 * @brief Pack and send UE create response from MAC to DU APP
765 * Function : packDuMacUeCreateRsp
768 * Pack and send UE create response from MAC to DU APP
771 * @return ROK - success
774 * ****************************************************************/
775 uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCreateRsp *cfgRsp)
777 Buffer *mBuf = NULLP;
779 if(pst->selector == ODU_SELECTOR_LWLC)
781 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
783 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeCreateRsp");
786 /* pack the address of the structure */
787 CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
791 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeCreateRsp");
795 return ODU_POST_TASK(pst,mBuf);
797 /*******************************************************************
799 * @brief Unpack UE Create Response from MAC to DU APP
803 * Function :unpackDuMacUeCreateRsp
805 * Functionality: Unpack UE Create Response from MAC to DU APP
808 * @return ROK - success
811 * ****************************************************************/
812 uint8_t unpackDuMacUeCreateRsp(MacDuUeCreateRspFunc func, Pst *pst, Buffer *mBuf)
814 if(pst->selector == ODU_SELECTOR_LWLC)
816 MacUeCreateRsp *cfgRsp = NULLP;
818 /* unpack the address of the structure */
819 CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
820 ODU_PUT_MSG_BUF(mBuf);
821 return (*func)(pst, cfgRsp);
824 ODU_PUT_MSG_BUF(mBuf);
828 /*******************************************************************
830 * @brief Packs and Sends UE Reconig Request from DUAPP to MAC
834 * Function : packDuMacUeReconfigReq
837 * Packs and Sends UE Reconfig Request from DUAPP to MAC
840 * @params[in] Post structure pointer
842 * @return ROK - success
845 * ****************************************************************/
846 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeRecfg *ueCfg)
848 Buffer *mBuf = NULLP;
850 if(pst->selector == ODU_SELECTOR_LWLC)
852 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
854 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeReconfigReq");
857 /* pack the address of the structure */
858 CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
862 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeReconfigReq");
866 return ODU_POST_TASK(pst,mBuf);
869 /*******************************************************************
871 * @brief Unpacks UE Reconfig Request received from DU APP
875 * Function : unpackMacUeReconfigReq
878 * Unpacks UE Reconfig Request received from DU APP
880 * @params[in] Pointer to Handler
881 * Post structure pointer
883 * @return ROK - success
886 * ****************************************************************/
887 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf)
889 if(pst->selector == ODU_SELECTOR_LWLC)
893 /* unpack the address of the structure */
894 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueRecfg, mBuf);
895 ODU_PUT_MSG_BUF(mBuf);
896 return (*func)(pst, ueRecfg);
900 /* Nothing to do for other selectors */
901 DU_LOG("\nERROR --> DU APP : Only LWLC supported for UE Create Request ");
902 ODU_PUT_MSG_BUF(mBuf);
908 /*******************************************************************
910 * @brief Pack and send UE Reconfig response from MAC to DU APP
914 * Function : packDuMacUeRecfgRsp
917 * Pack and send UE Reconfig response from MAC to DU APP
920 * @return ROK - success
923 * ****************************************************************/
924 uint8_t packDuMacUeRecfgRsp(Pst *pst, MacUeRecfgRsp *recfgRsp)
926 Buffer *mBuf = NULLP;
928 if(pst->selector == ODU_SELECTOR_LWLC)
930 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
932 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeRecfgRsp");
935 /* pack the address of the structure */
936 CMCHKPK(oduPackPointer,(PTR)recfgRsp, mBuf);
940 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeRecfgRsp");
944 return ODU_POST_TASK(pst,mBuf);
947 /*******************************************************************
949 * @brief Unpack UE ReConfig Response from MAC to DU APP
953 * Function :unpackDuMacUeRecfgRsp
955 * Functionality: Unpack UE ReConfig Response from MAC to DU APP
958 * @return ROK - success
961 * ****************************************************************/
962 uint8_t unpackDuMacUeRecfgRsp(MacDuUeRecfgRspFunc func, Pst *pst, Buffer *mBuf)
964 if(pst->selector == ODU_SELECTOR_LWLC)
966 MacUeRecfgRsp *recfgRsp = NULLP;
968 /* unpack the address of the structure */
969 CMCHKUNPK(oduUnpackPointer, (PTR *)&recfgRsp, mBuf);
970 ODU_PUT_MSG_BUF(mBuf);
971 return (*func)(pst, recfgRsp);
974 ODU_PUT_MSG_BUF(mBuf);
978 /*******************************************************************
980 * @brief Packs and Sends RACH Resource request from DUAPP to MAC
984 * Function : packDuMacRachRsrcReq
987 * Packs and Sends RACH Resource request from DU APP to MAC
990 * @params[in] Post structure pointer
991 * MacRachRsrcReq pointer
992 * @return ROK - success
995 * ****************************************************************/
996 uint8_t packDuMacRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq)
998 Buffer *mBuf = NULLP;
1000 if(pst->selector == ODU_SELECTOR_LWLC)
1002 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1004 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacRachRsrcReq,");
1007 /* pack the address of the structure */
1008 CMCHKPK(oduPackPointer, (PTR)rachRsrcReq, mBuf);
1012 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacRachRsrcReq");
1016 return ODU_POST_TASK(pst,mBuf);
1019 /*******************************************************************
1021 * @brief Unpacks RACH resource Request received from DU APP
1025 * Function : unpackMacRachRsrcReq
1028 * Unpacks RACH resource Request received from DU APP
1030 * @params[in] Pointer to Handler
1031 * Post structure pointer
1033 * @return ROK - success
1036 * ****************************************************************/
1037 uint8_t unpackMacRachRsrcReq(DuMacRachRsrcReq func, Pst *pst, Buffer *mBuf)
1039 if(pst->selector == ODU_SELECTOR_LWLC)
1041 MacRachRsrcReq *rachRsrcReq;
1043 /* unpack the address of the structure */
1044 CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcReq, mBuf);
1045 ODU_PUT_MSG_BUF(mBuf);
1046 return (*func)(pst, rachRsrcReq);
1050 /* Nothing to do for other selectors */
1051 DU_LOG("\nERROR --> DU APP : Only LWLC supported for RACH resource Request ");
1052 ODU_PUT_MSG_BUF(mBuf);
1058 /*******************************************************************
1060 * @brief Packs and Sends RACH Resource release from DUAPP to MAC
1064 * Function : packDuMacRachRsrcRel
1067 * Packs and Sends RACH Resource release from DU APP to MAC
1070 * @params[in] Post structure pointer
1071 * MacRachRsrcRel pointer
1072 * @return ROK - success
1075 * ****************************************************************/
1076 uint8_t packDuMacRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel)
1078 Buffer *mBuf = NULLP;
1080 if(pst->selector == ODU_SELECTOR_LWLC)
1082 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1084 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacRachRsrcRel");
1087 /* pack the address of the structure */
1088 CMCHKPK(oduPackPointer, (PTR)rachRsrcRel, mBuf);
1092 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacRachRsrcRel");
1096 return ODU_POST_TASK(pst,mBuf);
1099 /*******************************************************************
1101 * @brief Unpacks RACH Resource Release received from DU APP
1105 * Function : unpackMacRachRsrcRel
1108 * Unpacks RACH Resource Release received from DU APP
1110 * @params[in] Pointer to Handler
1111 * Post structure pointer
1113 * @return ROK - success
1116 * ****************************************************************/
1117 uint8_t unpackMacRachRsrcRel(DuMacRachRsrcRel func, Pst *pst, Buffer *mBuf)
1119 if(pst->selector == ODU_SELECTOR_LWLC)
1121 MacRachRsrcRel *rachRsrcRel;
1123 /* unpack the address of the structure */
1124 CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcRel, mBuf);
1125 ODU_PUT_MSG_BUF(mBuf);
1126 return (*func)(pst, rachRsrcRel);
1130 /* Nothing to do for other selectors */
1131 DU_LOG("\nERROR --> DU APP : Only LWLC supported for RACH Resource Release ");
1132 ODU_PUT_MSG_BUF(mBuf);
1138 /*******************************************************************
1140 * @brief Packs and Sends RACH Resource response from MAC to DU APP
1144 * Function : packDuMacRachRsrcRsp
1147 * Packs and Sends RACH Resource response from MAC to DU APP
1150 * @params[in] Post structure pointer
1151 * MacRachRsrcRsp pointer
1152 * @return ROK - success
1155 * ****************************************************************/
1156 uint8_t packDuMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp)
1158 Buffer *mBuf = NULLP;
1160 if(pst->selector == ODU_SELECTOR_LWLC)
1162 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1164 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacRachRsrcRsp");
1167 /* pack the address of the structure */
1168 CMCHKPK(oduPackPointer, (PTR)rachRsrcRsp, mBuf);
1172 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacRachRsrcRsp");
1176 return ODU_POST_TASK(pst,mBuf);
1179 /*******************************************************************
1181 * @brief Unpacks RACH resource Response received from MAC
1185 * Function : unpackDuMacRachRsrcRsp
1188 * Unpacks RACH resource Response received from MAC
1190 * @params[in] Pointer to Handler
1191 * Post structure pointer
1193 * @return ROK - success
1196 * ****************************************************************/
1197 uint8_t unpackDuMacRachRsrcRsp(MacDuRachRsrcRspFunc func, Pst *pst, Buffer *mBuf)
1199 if(pst->selector == ODU_SELECTOR_LWLC)
1201 MacRachRsrcRsp *rachRsrcRsp;
1203 /* unpack the address of the structure */
1204 CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcRsp, mBuf);
1205 ODU_PUT_MSG_BUF(mBuf);
1206 return (*func)(pst, rachRsrcRsp);
1210 /* Nothing to do for other selectors */
1211 DU_LOG("\nERROR --> DU APP : Only LWLC supported for RACH resource Response ");
1212 ODU_PUT_MSG_BUF(mBuf);
1217 /*******************************************************************
1219 * @brief Packs and Sends UE Delete Request from DUAPP to MAC
1223 * Function : packDuMacUeDeleteReq
1226 * Packs and Sends UE Delete Request from DUAPP to MAC
1229 * @params[in] Post structure pointer
1230 * MacUeDelete pointer
1231 * @return ROK - success
1234 * ****************************************************************/
1235 uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDel)
1237 Buffer *mBuf = NULLP;
1239 if(pst->selector == ODU_SELECTOR_LWLC)
1241 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1243 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeDeleteReq");
1246 /* pack the address of the structure */
1247 CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
1251 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeDeleteReq");
1255 return ODU_POST_TASK(pst,mBuf);
1257 /*******************************************************************
1259 * @brief Unpacks UE Delete Request received from DU APP
1263 * Function : unpackMacUeDeleteReq
1266 * Unpacks UE Delete Request received from DU APP
1268 * @params[in] Pointer to Handler
1269 * Post structure pointer
1271 * @return ROK - success
1274 * ****************************************************************/
1275 uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf)
1277 if(pst->selector == ODU_SELECTOR_LWLC)
1279 MacUeDelete *ueDelete;
1281 /* unpack the address of the structure */
1282 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf);
1283 ODU_PUT_MSG_BUF(mBuf);
1284 return (*func)(pst, ueDelete);
1288 /* Nothing to do for other selectors */
1289 DU_LOG("\nERROR --> DU APP : Only LWLC supported for UE Delete Request ");
1290 ODU_PUT_MSG_BUF(mBuf);
1295 /*******************************************************************
1297 * @brief Pack and send UE delete response from MAC to DU APP
1301 * Function : packDuMacUeDeleteRsp
1304 * Pack and send UE delete response from MAC to DU APP
1307 * @return ROK - success
1310 * ****************************************************************/
1311 uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
1313 Buffer *mBuf = NULLP;
1315 if(pst->selector == ODU_SELECTOR_LWLC)
1317 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1319 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeDeleteRsp");
1322 /* pack the address of the structure */
1323 CMCHKPK(oduPackPointer,(PTR)deleteRsp, mBuf);
1327 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeDeleteRsp");
1331 return ODU_POST_TASK(pst,mBuf);
1335 /*******************************************************************
1337 * @brief Unpack UE Config Response from MAC to DU APP
1341 * Function :unpackDuMacUeDeleteRsp
1343 * Functionality: Unpack UE Config Response from MAC to DU APP
1346 * @return ROK - success
1349 * ****************************************************************/
1350 uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf)
1352 if(pst->selector == ODU_SELECTOR_LWLC)
1354 MacUeDeleteRsp *ueDeleteRsp = NULLP;
1356 /* unpack the address of the structure */
1357 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf);
1358 ODU_PUT_MSG_BUF(mBuf);
1359 return (*func)(pst, ueDeleteRsp);
1362 ODU_PUT_MSG_BUF(mBuf);
1366 /*******************************************************************
1368 * @brief Unpacks Cell Delete Request received from DU APP
1372 * Function : unpackMacCellDeleteReq
1375 * Unpacks Cell Delete Request received from DU APP
1377 * @params[in] Pointer to Handler
1378 * Post structure pointer
1380 * @return ROK - success
1383 * ****************************************************************/
1385 uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf)
1387 if(pst->selector == ODU_SELECTOR_LWLC)
1389 MacCellDeleteReq *cellDelete=NULLP;
1391 /* unpack the address of the structure */
1392 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDelete, mBuf);
1393 ODU_PUT_MSG_BUF(mBuf);
1394 return (*func)(pst, cellDelete);
1398 /* Nothing to do for other
1400 DU_LOG("\nERROR --> DU APP : unpackMacCellDeleteReq(): Only LWLC supported for CELL Delete Request ");
1401 ODU_PUT_MSG_BUF(mBuf);
1407 /*******************************************************************
1409 * @brief Pack and send Cell delete request to MAC
1413 * Function : packDuMacCellDeleteReq
1416 * Pack and send Cell delete request to MAC
1418 * @params[in] Post structure
1419 * MacCellDelete *cellDelete;
1420 * @return ROK - success
1423 * ****************************************************************/
1425 uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete)
1427 Buffer *mBuf = NULLP;
1429 if(pst->selector == ODU_SELECTOR_LWLC)
1431 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1433 DU_LOG("\nERROR --> MAC : packDuMacCellDeleteReq(): Memory allocation failed ");
1436 CMCHKPK(oduPackPointer,(PTR)cellDelete, mBuf);
1437 return ODU_POST_TASK(pst,mBuf);
1441 DU_LOG("\nERROR --> MAC: packDuMacCellDeleteReq(): Only LWLC supported ");
1446 /*******************************************************************
1448 * @brief Pack and send CELL delete response from MAC to DU APP
1452 * Function : packDuMacCellDeleteRsp
1455 * Pack and send CELL delete response from MAC to DU APP
1457 * @params[in] Pst *pst, MacCellDeleteRsp *deleteRsp
1458 * @return ROK - success
1461 * ****************************************************************/
1463 uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp)
1465 Buffer *mBuf = NULLP;
1467 if(pst->selector == ODU_SELECTOR_LWLC)
1469 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1471 DU_LOG("\nERROR --> MAC : packDuMacCellDeleteRsp(): Memory allocation failed ");
1474 CMCHKPK(oduPackPointer,(PTR)cellDeleteRsp, mBuf);
1478 DU_LOG("\nERROR --> MAC: packDuMacCellDeleteRsp(): Only LWLC supported ");
1482 return ODU_POST_TASK(pst,mBuf);
1486 /*******************************************************************
1488 * @brief Unpack cell delete response from MAC to DU APP
1492 * Function : unpackDuMacCellDeleteRsp
1494 * Functionality: Unpack cell delete response from MAC to DU APP
1496 * @params[in] MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf
1497 * @return ROK - success
1500 * ****************************************************************/
1502 uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf)
1504 if(pst->selector == ODU_SELECTOR_LWLC)
1506 MacCellDeleteRsp *cellDeleteRsp = NULLP;
1508 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDeleteRsp, mBuf);
1509 ODU_PUT_MSG_BUF(mBuf);
1510 return (*func)(pst, cellDeleteRsp);
1514 DU_LOG("\nERROR --> DU APP : unpackDuMacCellDeleteRsp(): Only LWLC supported ");
1515 ODU_PUT_MSG_BUF(mBuf);
1520 /*******************************************************************
1522 * @brief Pack and send Slice Cfg request from MAC to DU APP
1526 * Function : packDuMacSliceCfgReq
1529 * Pack and send Slice Cfg request from MAC to DU APP
1531 * @params[in] Pst *pst, MacSliceCfgReq *sliceCfgReq
1532 * @return ROK - success
1535 * ****************************************************************/
1537 uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq)
1539 Buffer *mBuf = NULLP;
1541 if(pst->selector == ODU_SELECTOR_LWLC)
1543 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1545 DU_LOG("\nERROR --> MAC : Memory allocation failed in packDuMacSliceCfgReq");
1548 CMCHKPK(oduPackPointer,(PTR)sliceCfgReq, mBuf);
1552 DU_LOG("\nERROR --> MAC: Only LWLC supported in packDuMacSliceCfgReq");
1556 return ODU_POST_TASK(pst,mBuf);
1559 /*******************************************************************
1561 * @brief Unpacks Slice Cfg request received from DU APP
1565 * Function : unpackMacSliceCfgReq
1568 * Unpacks Slice Cfg Request received from DU APP
1570 * @params[in] Pointer to Handler
1571 * Post structure pointer
1573 * @return ROK - success
1576 * ****************************************************************/
1577 uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf)
1579 if(pst->selector == ODU_SELECTOR_LWLC)
1581 MacSliceCfgReq *sliceCfgReq;
1582 /* unpack the address of the structure */
1583 CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceCfgReq, mBuf);
1584 ODU_PUT_MSG_BUF(mBuf);
1585 return (*func)(pst, sliceCfgReq);
1589 /* Nothing to do for other selectors */
1590 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Slice Cfg Request ");
1591 ODU_PUT_MSG_BUF(mBuf);
1597 /*******************************************************************
1599 * @brief Pack and send Slice config response from MAC to DU APP
1603 * Function : packDuMacSliceCfgRsp
1606 * Pack and send Slice config response from MAC to DU APP
1609 * @return ROK - success
1612 * ****************************************************************/
1613 uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
1615 Buffer *mBuf = NULLP;
1617 if(pst->selector == ODU_SELECTOR_LWLC)
1619 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1621 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacSliceCfgRsp");
1624 /* pack the address of the structure */
1625 CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
1629 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacSliceCfgRsp");
1633 return ODU_POST_TASK(pst,mBuf);
1636 /*******************************************************************
1638 * @brief Unpack Slice Config Response from MAC to DU APP
1642 * Function :unpackDuMacSliceCfgRsp
1644 * Functionality: Unpack Slice Config Response from MAC to DU APP
1647 * @return ROK - success
1650 * ****************************************************************/
1651 uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf)
1653 if(pst->selector == ODU_SELECTOR_LWLC)
1655 MacSliceCfgRsp *cfgRsp = NULLP;
1657 /* unpack the address of the structure */
1658 CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
1659 ODU_PUT_MSG_BUF(mBuf);
1660 return (*func)(pst, cfgRsp);
1663 ODU_PUT_MSG_BUF(mBuf);
1668 /*******************************************************************
1670 * @brief Pack and send Slice ReCfg request from MAC to DU APP
1674 * Function : packDuMacSliceRecfgReq
1677 * Pack and send Slice ReCfg request from MAC to DU APP
1679 * @params[in] Pst *pst, MacSliceRecfgReq *sliceRecfgReq
1680 * @return ROK - success
1683 * ****************************************************************/
1685 uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq)
1687 Buffer *mBuf = NULLP;
1689 if(pst->selector == ODU_SELECTOR_LWLC)
1691 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1693 DU_LOG("\nERROR --> MAC : Memory allocation failed in packDuMacSliceRecfgReq");
1696 CMCHKPK(oduPackPointer,(PTR)sliceRecfgReq, mBuf);
1700 DU_LOG("\nERROR --> MAC: Only LWLC supported in packDuMacSliceRecfgReq");
1704 return ODU_POST_TASK(pst,mBuf);
1707 /*******************************************************************
1709 * @brief Unpacks Slice ReCfg request received from DU APP
1713 * Function : unpackMacSliceCfgReq
1716 * Unpacks Slice ReCfg Request received from DU APP
1718 * @params[in] Pointer to Handler
1719 * Post structure pointer
1721 * @return ROK - success
1724 * ****************************************************************/
1725 uint8_t unpackMacSliceRecfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf)
1727 if(pst->selector == ODU_SELECTOR_LWLC)
1729 MacSliceRecfgReq *sliceRecfgReq;
1730 /* unpack the address of the structure */
1731 CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceRecfgReq, mBuf);
1732 ODU_PUT_MSG_BUF(mBuf);
1733 return (*func)(pst, sliceRecfgReq);
1737 /* Nothing to do for other selectors */
1738 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Slice ReCfg Request ");
1739 ODU_PUT_MSG_BUF(mBuf);
1745 /*******************************************************************
1747 * @brief Pack and send Slice config response from MAC to DU APP
1751 * Function : packDuMacSliceRecfgRsp
1754 * Pack and send Slice config response from MAC to DU APP
1757 * @return ROK - success
1760 * ****************************************************************/
1761 uint8_t packDuMacSliceRecfgRsp(Pst *pst, MacSliceRecfgRsp *sliceRecfgRsp)
1763 Buffer *mBuf = NULLP;
1765 if(pst->selector == ODU_SELECTOR_LWLC)
1767 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1769 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacSliceRecfgRsp");
1772 /* pack the address of the structure */
1773 CMCHKPK(oduPackPointer,(PTR)sliceRecfgRsp, mBuf);
1777 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacSliceRecfgRsp");
1781 return ODU_POST_TASK(pst,mBuf);
1784 /*******************************************************************
1786 * @brief Unpack Slice ReConfig Response from MAC to DU APP
1790 * Function :unpackDuMacSliceRecfgRsp
1792 * Functionality: Unpack Slice ReConfig Response from MAC to DU APP
1795 * @return ROK - success
1798 * ****************************************************************/
1799 uint8_t unpackDuMacSliceRecfgRsp(MacDuSliceRecfgRspFunc func, Pst *pst, Buffer *mBuf)
1801 if(pst->selector == ODU_SELECTOR_LWLC)
1803 MacSliceRecfgRsp *sliceRecfgRsp = NULLP;
1805 /* unpack the address of the structure */
1806 CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceRecfgRsp, mBuf);
1807 ODU_PUT_MSG_BUF(mBuf);
1808 return (*func)(pst, sliceRecfgRsp);
1811 ODU_PUT_MSG_BUF(mBuf);
1815 /*******************************************************************
1817 * @brief Pack and send Slot ind from MAC to DU APP
1821 * Function : packMacSlotInd
1824 * Pack and send Slot ind from MAC to DU APP
1826 * @params[in] Pst *pst, SlotTimingInfo *slotIndInfo
1827 * @return ROK - success
1830 * ****************************************************************/
1831 uint8_t packMacSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo)
1833 Buffer *mBuf = NULLP;
1835 if(pst->selector == ODU_SELECTOR_LWLC)
1837 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1839 DU_LOG("\nERROR --> MAC : Memory allocation failed at packMacSlotInd");
1842 /* pack the address of the structure */
1843 CMCHKPK(oduPackPointer,(PTR)slotIndInfo, mBuf);
1847 DU_LOG("\nERROR --> MAC: Only LWLC supported for packMacSlotInd");
1851 return ODU_POST_TASK(pst,mBuf);
1854 /*******************************************************************
1856 * @brief Unpack Slot indication from MAC to DU APP
1860 * Function :unpackDuMacSlotInd
1862 * Functionality: Unpack Slot Indication from MAC to DU APP
1864 * @params[in] DuMacSlotInd func, Pst *pst, Buffer *mBuf
1865 * @return ROK - success
1868 * ****************************************************************/
1869 uint8_t unpackDuMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf)
1871 if(pst->selector == ODU_SELECTOR_LWLC)
1873 SlotTimingInfo *slotIndInfo;
1875 /* unpack the address of the structure */
1876 CMCHKUNPK(oduUnpackPointer, (PTR *)&slotIndInfo, mBuf);
1877 ODU_PUT_MSG_BUF(mBuf);
1878 return (*func)(pst, slotIndInfo);
1881 ODU_PUT_MSG_BUF(mBuf);
1885 /*******************************************************************
1887 * @brief Pack and send Dl Pcch indication to MAC
1891 * Function : packDuMacDlPcchInd
1894 * Pack and send Dl Pcch indication to MAC
1896 * @params[in] Post structure
1897 * DlPcchInd *pcchInd;
1898 * @return ROK - success
1901 * ****************************************************************/
1903 uint8_t packDuMacDlPcchInd(Pst *pst, DlPcchInd *pcchInd)
1905 Buffer *mBuf = NULLP;
1907 if(pst->selector == ODU_SELECTOR_LWLC)
1909 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1911 DU_LOG("\nERROR --> MAC : packDuMacDlPcchInd(): Memory allocation failed ");
1914 CMCHKPK(oduPackPointer,(PTR)pcchInd, mBuf);
1915 return ODU_POST_TASK(pst,mBuf);
1919 DU_LOG("\nERROR --> MAC: packDuMacDlPcchInd(): Only LWLC supported ");
1924 /*******************************************************************
1926 * @brief Unpacks downlink pcch indication received from DU APP
1930 * Function : unpackMacDlPcchInd
1933 * Unpacks downlink pcch indication received from DU APP
1935 * @params[in] Pointer to Handler
1936 * Post structure pointer
1938 * @return ROK - success
1941 * ****************************************************************/
1943 uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf)
1945 if(pst->selector == ODU_SELECTOR_LWLC)
1947 DlPcchInd *pcchInd=NULLP;
1949 /* unpack the address of the structure */
1950 CMCHKUNPK(oduUnpackPointer, (PTR *)&pcchInd, mBuf);
1951 ODU_PUT_MSG_BUF(mBuf);
1952 return (*func)(pst, pcchInd);
1956 /* Nothing to do for other selectors */
1957 DU_LOG("\nERROR --> DU APP : unpackMacDlPcchInd(): Only LWLC supported");
1958 ODU_PUT_MSG_BUF(mBuf);
1964 /*******************************************************************
1966 * @brief Packs and Sends UE Reset Request from DUAPP to MAC
1970 * Function : packDuMacUeResetReq
1973 * Packs and Sends UE Reset Request from DUAPP to MAC
1976 * @params[in] Post structure pointer
1977 * MacUeResetReq pointer
1978 * @return ROK - success
1981 * ****************************************************************/
1982 uint8_t packDuMacUeResetReq(Pst *pst, MacUeResetReq *ueDel)
1984 Buffer *mBuf = NULLP;
1986 if(pst->selector == ODU_SELECTOR_LWLC)
1988 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1990 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeResetReq");
1993 /* pack the address of the structure */
1994 CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
1998 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeResetReq");
2001 return ODU_POST_TASK(pst,mBuf);
2004 /*******************************************************************
2006 * @brief Unpacks UE Reset Request received from DU APP
2010 * Function : unpackMacUeResetReq
2013 * Unpacks UE Reset Request received from DU APP
2015 * @params[in] Pointer to Handler
2016 * Post structure pointer
2018 * @return ROK - success
2021 * ****************************************************************/
2022 uint8_t unpackMacUeResetReq(DuMacUeResetReq func, Pst *pst, Buffer *mBuf)
2024 if(pst->selector == ODU_SELECTOR_LWLC)
2026 MacUeResetReq *ueReset;
2028 /* unpack the address of the structure */
2029 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueReset, mBuf);
2030 ODU_PUT_MSG_BUF(mBuf);
2031 return (*func)(pst, ueReset);
2035 /* Nothing to do for other selectors */
2036 DU_LOG("\nERROR --> DU APP : Only LWLC supported for UE Reset Request ");
2037 ODU_PUT_MSG_BUF(mBuf);
2043 /*******************************************************************
2045 * @brief Pack and send UE reset response from MAC to DU APP
2049 * Function : packDuMacUeResetRsp
2052 * Pack and send UE reset response from MAC to DU APP
2055 * @return ROK - success
2058 * ****************************************************************/
2059 uint8_t packDuMacUeResetRsp(Pst *pst, MacUeResetRsp *resetRsp)
2061 Buffer *mBuf = NULLP;
2063 if(pst->selector == ODU_SELECTOR_LWLC)
2065 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2067 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeResetRsp");
2070 /* pack the address of the structure */
2071 CMCHKPK(oduPackPointer,(PTR)resetRsp, mBuf);
2075 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeResetRsp");
2079 return ODU_POST_TASK(pst,mBuf);
2082 /*******************************************************************
2084 * @brief Unpack UE Config Response from MAC to DU APP
2088 * Function :unpackDuMacUeResetRsp
2090 * Functionality: Unpack UE Config Response from MAC to DU APP
2093 * @return ROK - success
2096 * ****************************************************************/
2097 uint8_t unpackDuMacUeResetRsp(MacDuUeResetRspFunc func, Pst *pst, Buffer *mBuf)
2099 if(pst->selector == ODU_SELECTOR_LWLC)
2101 MacUeResetRsp *ueResetRsp = NULLP;
2103 /* unpack the address of the structure */
2104 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueResetRsp, mBuf);
2105 ODU_PUT_MSG_BUF(mBuf);
2106 return (*func)(pst, ueResetRsp);
2109 ODU_PUT_MSG_BUF(mBuf);
2113 /*******************************************************************
2115 * @brief Pack and send UE Sync Status Indication from MAC to DU APP
2119 * Function : packDuMacUeSyncStatusInd
2122 * Pack and send UE Sync Status Indication from MAC to DU APP
2125 * @return ROK - success
2128 * ****************************************************************/
2129 uint8_t packDuMacUeSyncStatusInd(Pst *pst, MacUeSyncStatusInd *SyncStatusInd)
2131 Buffer *mBuf = NULLP;
2133 if(pst->selector == ODU_SELECTOR_LWLC)
2135 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2137 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeSyncStatusInd");
2140 /* pack the address of the structure */
2141 CMCHKPK(oduPackPointer,(PTR)SyncStatusInd, mBuf);
2145 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeSyncStatusInd");
2149 return ODU_POST_TASK(pst,mBuf);
2152 /*******************************************************************
2154 * @brief Unpack UE Config Response from MAC to DU APP
2158 * Function :unpackDuMacUeSyncStatusInd
2160 * Functionality: Unpack UE Config Response from MAC to DU APP
2163 * @return ROK - success
2166 * ****************************************************************/
2167 uint8_t unpackDuMacUeSyncStatusInd(MacDuUeSyncStatusIndFunc func, Pst *pst, Buffer *mBuf)
2169 if(pst->selector == ODU_SELECTOR_LWLC)
2171 MacUeSyncStatusInd *ueSyncStatusInd = NULLP;
2173 /* unpack the address of the structure */
2174 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueSyncStatusInd, mBuf);
2175 ODU_PUT_MSG_BUF(mBuf);
2176 return (*func)(pst, ueSyncStatusInd);
2179 ODU_PUT_MSG_BUF(mBuf);
2183 /*******************************************************************
2185 * @brief Packs and Sends Dl Broadcast Request from DUAPP to MAC
2189 * Function : packDuMacDlBroadcastReq
2192 * Packs and Sends Dl Broadcast Request from DUAPP to MAC
2195 * @params[in] Post structure pointer
2196 * MacDlBroadcastReq pointer
2197 * @return ROK - success
2200 * ****************************************************************/
2201 uint8_t packDuMacDlBroadcastReq(Pst *pst, MacDlBroadcastReq *ueDel)
2203 Buffer *mBuf = NULLP;
2205 if(pst->selector == ODU_SELECTOR_LWLC)
2207 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2209 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacDlBroadcastReq");
2212 /* pack the address of the structure */
2213 CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
2217 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacDlBroadcastReq");
2220 return ODU_POST_TASK(pst,mBuf);
2223 /*******************************************************************
2225 * @brief Unpacks Dl Broadcast Request received from DU APP
2229 * Function : unpackMacDlBroadcastReq
2232 * Unpacks Dl Broadcast Request received from DU APP
2234 * @params[in] Pointer to Handler
2235 * Post structure pointer
2237 * @return ROK - success
2240 * ****************************************************************/
2241 uint8_t unpackMacDlBroadcastReq(DuMacDlBroadcastReq func, Pst *pst, Buffer *mBuf)
2243 if(pst->selector == ODU_SELECTOR_LWLC)
2245 MacDlBroadcastReq *dlBroadcast;
2247 /* unpack the address of the structure */
2248 CMCHKUNPK(oduUnpackPointer, (PTR *)&dlBroadcast, mBuf);
2249 ODU_PUT_MSG_BUF(mBuf);
2250 return (*func)(pst, dlBroadcast);
2254 /* Nothing to do for other selectors */
2255 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Dl Broadcast Request ");
2256 ODU_PUT_MSG_BUF(mBuf);
2261 /*******************************************************************
2263 * @brief Searches for first unset bit in ueBitMap
2267 * Function : getFreeBitFromUeBitMap
2269 * Functionality: Searches for first unset bit in ueBitMap of
2270 * a cell. Search starts from LSB to MSB. Returns index of the
2271 * free bit, considering LSB at index 0 and increasing index
2274 * @params[in] Cell Id
2275 * @return Index of free bit - success
2278 * ****************************************************************/
2279 int8_t getFreeBitFromUeBitMap(uint16_t cellId)
2281 uint8_t bitIdx = 0; /* bit position */
2282 uint16_t cellIdx = 0; /* Index to acces ueBitMapPerCell[] */
2283 uint64_t mask = 1; /* bit mask */
2285 GET_CELL_IDX(cellId, cellIdx);
2288 /* Find the first unset bit in Bit Map */
2289 if((ueBitMapPerCell[cellIdx] & (mask << bitIdx)) == 0)
2291 SET_ONE_BIT(bitIdx, ueBitMapPerCell[cellIdx]);
2300 /*******************************************************************
2302 * @brief Unset a previously set bit in UeBitMap
2306 * Function : unsetBitInUeBitMap
2308 * Functionality: Searches for bit at given index and unset it.
2310 * @params[in] Cell Id
2314 * ****************************************************************/
2315 void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos)
2319 GET_CELL_IDX(cellId, cellIdx);
2320 UNSET_ONE_BIT(bitPos, ueBitMapPerCell[cellIdx]);
2323 /*******************************************************************
2325 * @brief Packs and Sends Statistics Request from DUAPP to MAC
2329 * Function : packDuMacStatsReq
2332 * Packs and Sends statistics request from DUAPP to MAC
2335 * @params[in] Post structure pointer
2337 * @return ROK - success
2340 * ****************************************************************/
2341 uint8_t packDuMacStatsReq(Pst *pst, MacStatsReq *statsReq)
2343 Buffer *mBuf = NULLP;
2345 if(pst->selector == ODU_SELECTOR_LWLC)
2347 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2349 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsReq");
2352 /* pack the address of the structure */
2353 CMCHKPK(oduPackPointer,(PTR)statsReq, mBuf);
2357 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsReq");
2360 return ODU_POST_TASK(pst,mBuf);
2363 /*******************************************************************
2365 * @brief Unpacks Statistics Request received from DU APP
2369 * Function : unpackMacStatsReq
2372 * Unpacks Statistics Request received from DU APP
2374 * @params[in] Pointer to Handler
2375 * Post structure pointer
2377 * @return ROK - success
2380 * ****************************************************************/
2381 uint8_t unpackMacStatsReq(DuMacStatsReqFunc func, Pst *pst, Buffer *mBuf)
2383 if(pst->selector == ODU_SELECTOR_LWLC)
2385 MacStatsReq *statsReq;
2387 /* unpack the address of the structure */
2388 CMCHKUNPK(oduUnpackPointer, (PTR *)&statsReq, mBuf);
2389 ODU_PUT_MSG_BUF(mBuf);
2390 return (*func)(pst, statsReq);
2394 /* Nothing to do for other selectors */
2395 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Request ");
2396 ODU_PUT_MSG_BUF(mBuf);
2402 /*******************************************************************
2404 * @brief Packs and Sends Statistics Response from MAC to DUAPP
2408 * Function : packDuMacStatsRsp
2411 * Packs and Sends statistics response from MAC to DUAPP
2414 * @params[in] Post structure pointer
2416 * @return ROK - success
2419 * ****************************************************************/
2420 uint8_t packDuMacStatsRsp(Pst *pst, MacStatsRsp *statsRsp)
2422 Buffer *mBuf = NULLP;
2424 if(pst->selector == ODU_SELECTOR_LWLC)
2426 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2428 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsRsp");
2431 /* pack the address of the structure */
2432 CMCHKPK(oduPackPointer,(PTR)statsRsp, mBuf);
2436 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsRsp");
2439 return ODU_POST_TASK(pst,mBuf);
2442 /*******************************************************************
2444 * @brief Unpacks Statistics Response received from MAC
2448 * Function : unpackDuMacStatsRsp
2451 * Unpacks Statistics Response received from MAC
2453 * @params[in] Pointer to Handler
2454 * Post structure pointer
2456 * @return ROK - success
2459 * ****************************************************************/
2460 uint8_t unpackDuMacStatsRsp(MacDuStatsRspFunc func, Pst *pst, Buffer *mBuf)
2462 if(pst->selector == ODU_SELECTOR_LWLC)
2464 MacStatsRsp *statsRsp;
2466 /* unpack the address of the structure */
2467 CMCHKUNPK(oduUnpackPointer, (PTR *)&statsRsp, mBuf);
2468 ODU_PUT_MSG_BUF(mBuf);
2469 return (*func)(pst, statsRsp);
2473 /* Nothing to do for other selectors */
2474 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Response ");
2475 ODU_PUT_MSG_BUF(mBuf);
2481 /*******************************************************************
2483 * @brief Packs and Sends Statistics Indication from MAC to DUAPP
2487 * Function : packDuMacStatsInd
2490 * Packs and Sends statistics response from MAC to DUAPP
2493 * @params[in] Post structure pointer
2495 * @return ROK - success
2498 * ****************************************************************/
2499 uint8_t packDuMacStatsInd(Pst *pst, MacStatsInd *statsInd)
2501 Buffer *mBuf = NULLP;
2503 if(pst->selector == ODU_SELECTOR_LWLC)
2505 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2507 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsInd");
2510 /* pack the address of the structure */
2511 CMCHKPK(oduPackPointer,(PTR)statsInd, mBuf);
2515 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsInd");
2518 return ODU_POST_TASK(pst,mBuf);
2521 /*******************************************************************
2523 * @brief Unpacks Statistics Indication received from MAC
2527 * Function : unpackDuMacStatsInd
2530 * Unpacks Statistics Indication received from MAC
2532 * @params[in] Pointer to Handler
2533 * Post structure pointer
2535 * @return ROK - success
2538 * ****************************************************************/
2539 uint8_t unpackDuMacStatsInd(MacDuStatsIndFunc func, Pst *pst, Buffer *mBuf)
2541 if(pst->selector == ODU_SELECTOR_LWLC)
2543 MacStatsInd *statsInd;
2545 /* unpack the address of the structure */
2546 CMCHKUNPK(oduUnpackPointer, (PTR *)&statsInd, mBuf);
2547 ODU_PUT_MSG_BUF(mBuf);
2548 return (*func)(pst, statsInd);
2552 /* Nothing to do for other selectors */
2553 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Indication ");
2554 ODU_PUT_MSG_BUF(mBuf);
2560 /*******************************************************************
2562 * @brief Packs and Sends Statistics Delete Request from DUAPP to MAC
2566 * Function : packDuMacStatsDeleteReq
2569 * Packs and Sends statistics Delete Request from DUAPP to MAC
2572 * @params[in] Post structure pointer
2573 * StatsDeleteReq pointer
2574 * @return ROK - success
2577 * ****************************************************************/
2578 uint8_t packDuMacStatsDeleteReq(Pst *pst, MacStatsDeleteReq *statsDeleteReq)
2580 Buffer *mBuf = NULLP;
2582 if(pst->selector == ODU_SELECTOR_LWLC)
2584 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2586 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsDeleteReq");
2589 /* pack the address of the structure */
2590 CMCHKPK(oduPackPointer,(PTR)statsDeleteReq, mBuf);
2594 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsDeleteReq");
2597 return ODU_POST_TASK(pst,mBuf);
2600 /*******************************************************************
2602 * @brief Unpacks Statistics Delete Request received from DU APP
2606 * Function : unpackMacStatsDeleteReq
2609 * Unpacks Statistics Delete Request received from DU APP
2611 * @params[in] Pointer to Handler
2612 * Post structure pointer
2614 * @return ROK - success
2617 * ****************************************************************/
2618 uint8_t unpackMacStatsDeleteReq(DuMacStatsDeleteReqFunc func, Pst *pst, Buffer *mBuf)
2620 if(pst->selector == ODU_SELECTOR_LWLC)
2622 MacStatsDeleteReq *statsDeleteReq;
2624 /* unpack the address of the structure */
2625 CMCHKUNPK(oduUnpackPointer, (PTR *)&statsDeleteReq, mBuf);
2626 ODU_PUT_MSG_BUF(mBuf);
2627 return (*func)(pst, statsDeleteReq);
2631 /* Nothing to do for other selectors */
2632 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Delete Request ");
2633 ODU_PUT_MSG_BUF(mBuf);
2639 /*******************************************************************
2641 * @brief Packs and Sends Statistics Delete Response from MAC to DUAPP
2645 * Function : packDuMacStatsDeleteRsp
2648 * Packs and Sends Statistics Delete Response from MAC to DUAPP
2651 * @params[in] Post structure pointer
2652 * StatsDeleteRsp pointer
2653 * @return ROK - success
2656 * ****************************************************************/
2657 uint8_t packDuMacStatsDeleteRsp(Pst *pst, MacStatsDeleteRsp *statsRsp)
2659 Buffer *mBuf = NULLP;
2661 if(pst->selector == ODU_SELECTOR_LWLC)
2663 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2665 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsDeleteRsp");
2668 /* pack the address of the structure */
2669 CMCHKPK(oduPackPointer,(PTR)statsRsp, mBuf);
2673 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsDeleteRsp");
2676 return ODU_POST_TASK(pst,mBuf);
2679 /*******************************************************************
2681 * @brief Unpacks Statistics Delete Response received from MAC
2685 * Function : unpackDuMacStatsDeleteRsp
2688 * Unpacks Statistics Delete Response received from MAC
2690 * @params[in] Pointer to Handler
2691 * Post structure pointer
2693 * @return ROK - success
2696 * ****************************************************************/
2697 uint8_t unpackDuMacStatsDeleteRsp(MacDuStatsDeleteRspFunc func, Pst *pst, Buffer *mBuf)
2699 if(pst->selector == ODU_SELECTOR_LWLC)
2701 MacStatsDeleteRsp *statsRsp;
2703 /* unpack the address of the structure */
2704 CMCHKUNPK(oduUnpackPointer, (PTR *)&statsRsp, mBuf);
2705 ODU_PUT_MSG_BUF(mBuf);
2706 return (*func)(pst, statsRsp);
2710 /* Nothing to do for other selectors */
2711 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Delete Response ");
2712 ODU_PUT_MSG_BUF(mBuf);
2718 /*******************************************************************
2720 * @brief Packs and Sends Statistics Modification Request from DUAPP to MAC
2724 * Function : packDuMacStatsModificationReq
2727 * Packs and Sends statistics Modification request from DUAPP to MAC
2730 * @params[in] Post structure pointer
2731 * StatsModificationReq pointer
2732 * @return ROK - success
2735 * ****************************************************************/
2736 uint8_t packDuMacStatsModificationReq(Pst *pst, MacStatsModificationReq *statsModificationReq)
2738 Buffer *mBuf = NULLP;
2740 if(pst->selector == ODU_SELECTOR_LWLC)
2742 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2744 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsModificationReq");
2747 /* pack the address of the structure */
2748 CMCHKPK(oduPackPointer,(PTR)statsModificationReq, mBuf);
2752 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsModificationReq");
2755 return ODU_POST_TASK(pst,mBuf);
2758 /*******************************************************************
2760 * @brief Unpacks Statistics Modification Request received from DU APP
2764 * Function : unpackMacStatsModificationReq
2767 * Unpacks Statistics Modification Request received from DU APP
2769 * @params[in] Pointer to Handler
2770 * Post structure pointer
2772 * @return ROK - success
2775 * ****************************************************************/
2776 uint8_t unpackMacStatsModificationReq(DuMacStatsModificationReqFunc func, Pst *pst, Buffer *mBuf)
2778 if(pst->selector == ODU_SELECTOR_LWLC)
2780 MacStatsModificationReq *statsModificationReq=NULLP;
2782 /* unpack the address of the structure */
2783 CMCHKUNPK(oduUnpackPointer, (PTR *)&statsModificationReq, mBuf);
2784 ODU_PUT_MSG_BUF(mBuf);
2785 return (*func)(pst, statsModificationReq);
2789 /* Nothing to do for other selectors */
2790 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Modification Request ");
2791 ODU_PUT_MSG_BUF(mBuf);
2797 /*******************************************************************
2799 * @brief Packs and Sends Statistics Modification Response from MAC to DUAPP
2803 * Function : packDuMacStatsModificationRsp
2806 * Packs and Sends statistics Modification response from MAC to DUAPP
2809 * @params[in] Post structure pointer
2810 * StatsModificationRsp pointer
2811 * @return ROK - success
2814 * ****************************************************************/
2815 uint8_t packDuMacStatsModificationRsp(Pst *pst, MacStatsModificationRsp *statsModificationRsp)
2817 Buffer *mBuf = NULLP;
2819 if(pst->selector == ODU_SELECTOR_LWLC)
2821 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
2823 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacStatsModificationRsp");
2826 /* pack the address of the structure */
2827 CMCHKPK(oduPackPointer,(PTR)statsModificationRsp, mBuf);
2831 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacStatsModificationRsp");
2834 return ODU_POST_TASK(pst,mBuf);
2837 /*******************************************************************
2839 * @brief Unpacks Statistics Modification Response received from MAC
2843 * Function : unpackDuMacStatsModificationRsp
2846 * Unpacks Statistics Modification Response received from MAC
2848 * @params[in] Pointer to Handler
2849 * Post structure pointer
2851 * @return ROK - success
2854 * ****************************************************************/
2855 uint8_t unpackDuMacStatsModificationRsp(MacDuStatsModificationRspFunc func, Pst *pst, Buffer *mBuf)
2857 if(pst->selector == ODU_SELECTOR_LWLC)
2859 MacStatsModificationRsp *statsModificationRsp=NULLP;
2861 /* unpack the address of the structure */
2862 CMCHKUNPK(oduUnpackPointer, (PTR *)&statsModificationRsp, mBuf);
2863 ODU_PUT_MSG_BUF(mBuf);
2864 return (*func)(pst, statsModificationRsp);
2868 /* Nothing to do for other selectors */
2869 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Statistics Modification Response ");
2870 ODU_PUT_MSG_BUF(mBuf);
2876 /**********************************************************************
2878 **********************************************************************/