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"
22 /**************************************************************************
23 * @brief Function to pack Loose Coupled
24 * MAC cell config parameters required by MAC
28 * Function : packMacCellCfg
31 * packs the macCellCfg parameters
33 * @param[in] Pst *pst, Post structure of the primitive.
34 * @param[in] MacCellCfg *macCellCfg, mac cell config parameters.
35 * @return ROK - success
38 ***************************************************************************/
39 uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
41 if(pst->selector == ODU_SELECTOR_LC)
43 /* we are now implemented only light wieght lossely coupled interface */
46 else if(pst->selector == ODU_SELECTOR_LWLC)
50 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
55 /* pack the address of the structure */
56 CMCHKPK(oduPackPointer,(PTR)macCellCfg, mBuf);
58 DU_LOG("\nDEBUG --> DU-APP : MAC CELL config sent");
59 return ODU_POST_TASK(pst,mBuf);
64 /**************************************************************************
65 * @brief Function to pack Loose Coupled
66 * MAC cell config parameters required by MAC
70 * Function : unpackDuMacCellCfg
73 * packs the macCellCfg parameters
75 * @param[in] DuMacCellCfgReq func; function pointer
76 * @param[in] Pst *pst, Post structure of the primitive.
77 * @param[in] Buffer *mBuf
78 * @return ROK - success
81 ***************************************************************************/
82 uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf)
85 MacCellCfg *macCellCfg;
87 if(pst->selector == ODU_SELECTOR_LWLC)
89 /* unpack the address of the structure */
90 CMCHKUNPK(oduUnpackPointer, (PTR *)&macCellCfg, mBuf);
91 ret = (*func)(pst, macCellCfg);
95 /* only LWLC is implemented now */
102 /**************************************************************************
103 * @brief Function to pack Loose Coupled
104 * MAC cell config confirm message
108 * Function : packMacCellCfgCfm
111 * packs the transaction ID
113 * @param[in] Pst *pst, Post structure of the primitive.
114 * @param[in] MacCellCfgCfm *macCellCfgCfm, mac cell config confirm.
115 * @return ROK - success
118 ***************************************************************************/
119 uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
121 if(pst->selector == ODU_SELECTOR_LC)
123 Buffer *mBuf = NULLP;
124 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
129 /* pack the transaction ID in CNF structure */
130 CMCHKPK(oduUnpackUInt16, macCellCfgCfm->cellId, mBuf);
131 CMCHKPK(oduUnpackUInt8, macCellCfgCfm->rsp, mBuf);
133 return ODU_POST_TASK(pst,mBuf);
135 else if(pst->selector == ODU_SELECTOR_LWLC)
137 /* only LC is supported */
143 /**************************************************************************
144 * @brief Function to pack MAC cell config confirm message
148 * Function : unpackMacCellCfgCfm
151 * packs the transaction ID
153 * @param[in] DuMacCellCfgCfm func; function pointer
154 * @param[in] Pst *pst, Post structure of the primitive.
155 * @param[in] Buffer *mBuf
156 * @return ROK - success
159 ***************************************************************************/
160 uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf)
162 MacCellCfgCfm macCellCfgCfm;
164 if(pst->selector == ODU_SELECTOR_LC)
166 /* unpack the transaction ID in CNF structure */
167 CMCHKUNPK(oduPackUInt8, &(macCellCfgCfm.rsp), mBuf);
168 CMCHKUNPK(oduPackUInt16, &(macCellCfgCfm.cellId), mBuf);
169 return (*func)(pst, &macCellCfgCfm);
173 /* only loose coupling is suported */
178 /*******************************************************************
180 * @brief Packs and Send Cell Start Request to MAC
184 * Function : packMacCellStart
187 * Packs and Sends Cell Start Request to MAC
189 * @params[in] Post structure pointer
191 * @return ROK - success
194 * ****************************************************************/
195 uint8_t packMacCellStart(Pst *pst, CellStartInfo *cellStart)
197 Buffer *mBuf = NULLP;
199 if(pst->selector == ODU_SELECTOR_LC)
201 /* Loose coupling not supported */
204 else if(pst->selector == ODU_SELECTOR_LWLC)
207 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
209 DU_LOG("\nERROR --> DU APP : Memory allocation failed for cell start req pack");
213 /* pack the address of the structure */
214 CMCHKPK(oduPackPointer,(PTR)cellStart, mBuf);
217 return ODU_POST_TASK(pst,mBuf);
220 /*******************************************************************
222 * @brief Unpacks MAC Cell Start Request from DU APP
226 * Function : unpackMaCellStart
229 * Unpacks MAC Cell Start Request from DU APP
231 * @params[in] Function pointer of cell start request handler
232 * Post structure pointer
234 * @return ROK - success
237 * ****************************************************************/
238 uint8_t unpackMacCellStart(DuMacCellStart func, Pst *pst, Buffer *mBuf)
240 CellStartInfo *cellStart;
242 if(pst->selector == ODU_SELECTOR_LWLC)
244 /* unpack the address of the structure */
245 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStart, mBuf);
246 ODU_PUT_MSG_BUF(mBuf);
247 return (*func)(pst, cellStart);
251 /* Nothing to do for loose coupling */
252 ODU_PUT_MSG_BUF(mBuf);
257 /*******************************************************************
259 * @brief Packs and Send cell stop request to MAC
263 * Function : packMacCellStop
266 * Packs and Send cell stop request to MAC
268 * @params[in] Post structure pointer
270 * @return ROK - success
273 * ****************************************************************/
274 uint8_t packMacCellStop(Pst *pst, CellStopInfo *cellStop)
276 if(pst->selector == ODU_SELECTOR_LC)
278 /* Loose coupling not supported */
281 else if(pst->selector == ODU_SELECTOR_LWLC)
283 Buffer *mBuf = NULLP;
285 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
287 DU_LOG("\nERROR --> DU APP : Memory allocation failed for cell stop req pack");
291 /* pack the address of the structure */
292 CMCHKPK(oduPackPointer,(PTR)cellStop, mBuf);
294 return ODU_POST_TASK(pst,mBuf);
299 /*******************************************************************
301 * @brief Unpacks cell stop request from DU APP
305 * Function : unpackMaCellStop
308 * Unpacks cell stop request from DU APP
310 * @params[in] Handler function pointer
311 * Post structure pointer
313 * @return ROK - success
316 * ****************************************************************/
317 uint8_t unpackMacCellStop(DuMacCellStop func, Pst *pst, Buffer *mBuf)
319 CellStopInfo *cellStop;
321 if(pst->selector == ODU_SELECTOR_LWLC)
323 /* unpack the address of the structure */
324 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellStop, mBuf);
325 ODU_PUT_MSG_BUF(mBuf);
326 return (*func)(pst, cellStop);
330 /* Nothing to do for loose coupling */
331 ODU_PUT_MSG_BUF(mBuf);
336 /*******************************************************************
338 * @brief Packs and Sends cell up ind from MAC to DUAPP
342 * Function : packMacCellUpInd
345 * Packs and Sends cell up ind from MAC to DUAPP
347 * @params[in] Post structure pointer
349 * @return ROK - success
352 * ****************************************************************/
353 uint8_t packMacCellUpInd(Pst *pst, OduCellId *cellId)
355 Buffer *mBuf = NULLP;
357 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
359 DU_LOG("\nERROR --> DU APP : Memory allocation failed for packMacCellUpInd");
363 if(pst->selector == ODU_SELECTOR_LC)
365 CMCHKPK(oduUnpackUInt16, cellId->cellId, mBuf);
366 CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, sizeof(OduCellId));
369 else if(pst->selector == ODU_SELECTOR_LWLC)
371 /* pack the address of the structure */
372 CMCHKPK(oduPackPointer,(PTR)cellId, mBuf);
376 ODU_PUT_MSG_BUF(mBuf);
379 return ODU_POST_TASK(pst, mBuf);
382 /*******************************************************************
384 * @brief Unpacks cell up indication from MAC
388 * Function : unpackMacCellUpInd
391 * Unpacks cell up indication from MAC
393 * @params[in] Pointer to Handler
394 * Post structure pointer
396 * @return ROK - success
399 * ****************************************************************/
400 uint8_t unpackMacCellUpInd(DuMacCellUpInd func, Pst *pst, Buffer *mBuf)
402 if(pst->selector == ODU_SELECTOR_LWLC)
406 /* unpack the address of the structure */
407 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
408 ODU_PUT_MSG_BUF(mBuf);
409 return (*func)(pst, cellId);
411 else if(pst->selector == ODU_SELECTOR_LC)
414 CMCHKUNPK(oduPackUInt16, &cellId.cellId, mBuf);
415 ODU_PUT_MSG_BUF(mBuf);
416 return (*func)(pst, &cellId);
420 /* Nothing to do for loose coupling */
421 ODU_PUT_MSG_BUF(mBuf);
427 /*******************************************************************
429 * @brief Packs and Sends stop ind from MAC to DUAPP
433 * Function : packMacStopInd
436 * Packs and Sends stop ind from MAC to DUAPP
438 * @params[in] Post structure pointer
439 * @return ROK - success
442 * ****************************************************************/
443 uint8_t packMacStopInd(Pst *pst, OduCellId *cellId)
445 Buffer *mBuf = NULLP;
447 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
449 DU_LOG("\nERROR --> DU APP : Memory allocation failed for stop Ind pack");
453 if(pst->selector == ODU_SELECTOR_LC)
455 /*pack the payload here*/
456 CMCHKPK(oduUnpackUInt16, cellId->cellId, mBuf);
457 CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, sizeof(OduCellId));
460 else if(pst->selector == ODU_SELECTOR_LWLC)
462 /* pack the address of the structure */
463 CMCHKPK(oduPackPointer,(PTR)cellId, mBuf);
467 ODU_PUT_MSG_BUF(mBuf);
470 return ODU_POST_TASK(pst,mBuf);
473 /*******************************************************************
475 * @brief Unpacks stop indication from MAC
479 * Function : unpackMacStopInd
482 * Unpacks stop indication from MAC
484 * @params[in] Pointer to Handler
485 * Post structure pointer
487 * @return ROK - success
490 * ****************************************************************/
491 uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf)
493 if(pst->selector == ODU_SELECTOR_LWLC)
495 OduCellId *cellId=NULLP;
496 /* unpack the address of the structure */
497 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellId, mBuf);
498 ODU_PUT_MSG_BUF(mBuf);
499 return (*func)(pst, cellId);
501 else if(pst->selector == ODU_SELECTOR_LC)
504 CMCHKUNPK(oduPackUInt16, &(cellId.cellId), mBuf);
506 ODU_PUT_MSG_BUF(mBuf);
507 return (*func)(pst, &cellId);
512 /* Nothing to do for loose coupling */
513 ODU_PUT_MSG_BUF(mBuf);
519 /*******************************************************************
521 * @brief Packs and Sends UL CCCH Ind from MAC to DUAPP
525 * Function : packMacUlCcchInd
528 * Packs and Sends UL CCCH Ind from MAC to DUAPP
530 * @params[in] Post structure pointer
531 * UL CCCH Ind pointer
532 * @return ROK - success
535 * ****************************************************************/
536 uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
538 Buffer *mBuf = NULLP;
540 if(pst->selector == ODU_SELECTOR_LWLC)
542 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
544 DU_LOG("\nERROR --> MAC : Memory allocation failed at packMacUlCcchInd");
547 /* pack the address of the structure */
548 CMCHKPK(oduPackPointer,(PTR)ulCcchIndInfo, mBuf);
552 DU_LOG("\nERROR --> MAC: Only LWLC supported for UL CCCH Ind ");
556 return ODU_POST_TASK(pst,mBuf);
559 /*******************************************************************
561 * @brief Unpacks UL CCCH indication from MAC
565 * Function : unpackMacUlCcchInd
568 * Unpacks UL CCCH indication from MAC
570 * @params[in] Pointer to Handler
571 * Post structure pointer
573 * @return ROK - success
576 * ****************************************************************/
577 uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf)
579 if(pst->selector == ODU_SELECTOR_LWLC)
581 UlCcchIndInfo *ulCcchIndInfo;
583 /* unpack the address of the structure */
584 CMCHKUNPK(oduUnpackPointer, (PTR *)&ulCcchIndInfo, mBuf);
585 ODU_PUT_MSG_BUF(mBuf);
586 return (*func)(pst, ulCcchIndInfo);
590 /* Nothing to do for other selectors */
591 DU_LOG("\nERROR --> MAC : Only LWLC supported for UL CCCH Ind ");
592 ODU_PUT_MSG_BUF(mBuf);
597 /*******************************************************************
599 * @brief Packs and Sends DL CCCH Ind from DUAPP to MAC
603 * Function : packMacDlCcchInd
606 * Packs and Sends DL CCCH Ind from DUAPP to MAC
609 * @params[in] Post structure pointer
610 * DL CCCH Ind pointer
611 * @return ROK - success
614 * ****************************************************************/
615 uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
617 Buffer *mBuf = NULLP;
619 if(pst->selector == ODU_SELECTOR_LWLC)
621 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
623 DU_LOG("\nERROR --> MAC : Memory allocation failed at packMacDlCcchInd");
626 /* pack the address of the structure */
627 CMCHKPK(oduPackPointer,(PTR)dlCcchIndInfo, mBuf);
631 DU_LOG("\nERROR --> DU APP : Only LWLC supported for DL CCCH Ind ");
635 return ODU_POST_TASK(pst,mBuf);
638 /*******************************************************************
640 * @brief Unpacks DL CCCH indication from DU APP
644 * Function : unpackMacDlCcchInd
647 * Unpacks DL CCCH indication from DU APP
649 * @params[in] Pointer to Handler
650 * Post structure pointer
652 * @return ROK - success
655 * ****************************************************************/
656 uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf)
658 if(pst->selector == ODU_SELECTOR_LWLC)
660 DlCcchIndInfo *dlCcchIndInfo;
662 /* unpack the address of the structure */
663 CMCHKUNPK(oduUnpackPointer, (PTR *)&dlCcchIndInfo, mBuf);
664 ODU_PUT_MSG_BUF(mBuf);
665 return (*func)(pst, dlCcchIndInfo);
669 /* Nothing to do for other selectors */
670 DU_LOG("\nERROR --> DU APP : Only LWLC supported for DL CCCH Ind ");
671 ODU_PUT_MSG_BUF(mBuf);
677 /*******************************************************************
679 * @brief Packs and Sends UE create Request from DUAPP to MAC
683 * Function : packDuMacUeCreateReq
686 * Packs and Sends UE Create Request from DUAPP to MAC
689 * @params[in] Post structure pointer
691 * @return ROK - success
694 * ****************************************************************/
695 uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg)
697 Buffer *mBuf = NULLP;
699 if(pst->selector == ODU_SELECTOR_LWLC)
701 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
703 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeCreateReq");
706 /* pack the address of the structure */
707 CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
711 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeCreateReq");
715 return ODU_POST_TASK(pst,mBuf);
718 /*******************************************************************
720 * @brief Unpacks UE Create Request received from DU APP
724 * Function : unpackMacUeCreateReq
727 * Unpacks UE Create Request received from DU APP
729 * @params[in] Pointer to Handler
730 * Post structure pointer
732 * @return ROK - success
735 * ****************************************************************/
736 uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf)
738 if(pst->selector == ODU_SELECTOR_LWLC)
742 /* unpack the address of the structure */
743 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf);
744 ODU_PUT_MSG_BUF(mBuf);
745 return (*func)(pst, ueCfg);
749 /* Nothing to do for other selectors */
750 DU_LOG("\nERROR --> DU APP : Only LWLC supported for UE Create Request ");
751 ODU_PUT_MSG_BUF(mBuf);
757 /*******************************************************************
759 * @brief Pack and send UE config response from MAC to DU APP
763 * Function : packDuMacUeCfgRsp
766 * Pack and send UE config response from MAC to DU APP
769 * @return ROK - success
772 * ****************************************************************/
773 uint8_t packDuMacUeCfgRsp(Pst *pst, MacUeCfgRsp *cfgRsp)
775 Buffer *mBuf = NULLP;
777 if(pst->selector == ODU_SELECTOR_LWLC)
779 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
781 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeCfgRsp");
784 /* pack the address of the structure */
785 CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
789 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeCfgRsp");
793 return ODU_POST_TASK(pst,mBuf);
795 /*******************************************************************
797 * @brief Unpack UE Config Response from MAC to DU APP
801 * Function :unpackDuMacUeCfgRsp
803 * Functionality: Unpack UE Config Response from MAC to DU APP
806 * @return ROK - success
809 * ****************************************************************/
810 uint8_t unpackDuMacUeCfgRsp(MacDuUeCfgRspFunc func, Pst *pst, Buffer *mBuf)
812 if(pst->selector == ODU_SELECTOR_LWLC)
814 MacUeCfgRsp *cfgRsp = NULLP;
816 /* unpack the address of the structure */
817 CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
818 ODU_PUT_MSG_BUF(mBuf);
819 return (*func)(pst, cfgRsp);
822 ODU_PUT_MSG_BUF(mBuf);
826 /*******************************************************************
828 * @brief Packs and Sends UE Reconig Request from DUAPP to MAC
832 * Function : packDuMacUeReconfigReq
835 * Packs and Sends UE Reconfig Request from DUAPP to MAC
838 * @params[in] Post structure pointer
840 * @return ROK - success
843 * ****************************************************************/
844 uint8_t packDuMacUeReconfigReq(Pst *pst, MacUeCfg *ueCfg)
846 Buffer *mBuf = NULLP;
848 if(pst->selector == ODU_SELECTOR_LWLC)
850 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
852 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeReconfigReq");
855 /* pack the address of the structure */
856 CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf);
860 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeReconfigReq");
864 return ODU_POST_TASK(pst,mBuf);
867 /*******************************************************************
869 * @brief Unpacks UE Reconfig Request received from DU APP
873 * Function : unpackMacUeReconfigReq
876 * Unpacks UE Reconfig Request received from DU APP
878 * @params[in] Pointer to Handler
879 * Post structure pointer
881 * @return ROK - success
884 * ****************************************************************/
885 uint8_t unpackMacUeReconfigReq(DuMacUeReconfigReq func, Pst *pst, Buffer *mBuf)
887 if(pst->selector == ODU_SELECTOR_LWLC)
891 /* unpack the address of the structure */
892 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf);
893 ODU_PUT_MSG_BUF(mBuf);
894 return (*func)(pst, ueCfg);
898 /* Nothing to do for other selectors */
899 DU_LOG("\nERROR --> DU APP : Only LWLC supported for UE Create Request ");
900 ODU_PUT_MSG_BUF(mBuf);
906 /*******************************************************************
908 * @brief Packs and Sends RACH Resource request from DUAPP to MAC
912 * Function : packDuMacRachRsrcReq
915 * Packs and Sends RACH Resource request from DU APP to MAC
918 * @params[in] Post structure pointer
919 * MacRachRsrcReq pointer
920 * @return ROK - success
923 * ****************************************************************/
924 uint8_t packDuMacRachRsrcReq(Pst *pst, MacRachRsrcReq *rachRsrcReq)
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 packDuMacRachRsrcReq,");
935 /* pack the address of the structure */
936 CMCHKPK(oduPackPointer, (PTR)rachRsrcReq, mBuf);
940 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacRachRsrcReq");
944 return ODU_POST_TASK(pst,mBuf);
947 /*******************************************************************
949 * @brief Unpacks RACH resource Request received from DU APP
953 * Function : unpackMacRachRsrcReq
956 * Unpacks RACH resource Request received from DU APP
958 * @params[in] Pointer to Handler
959 * Post structure pointer
961 * @return ROK - success
964 * ****************************************************************/
965 uint8_t unpackMacRachRsrcReq(DuMacRachRsrcReq func, Pst *pst, Buffer *mBuf)
967 if(pst->selector == ODU_SELECTOR_LWLC)
969 MacRachRsrcReq *rachRsrcReq;
971 /* unpack the address of the structure */
972 CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcReq, mBuf);
973 ODU_PUT_MSG_BUF(mBuf);
974 return (*func)(pst, rachRsrcReq);
978 /* Nothing to do for other selectors */
979 DU_LOG("\nERROR --> DU APP : Only LWLC supported for RACH resource Request ");
980 ODU_PUT_MSG_BUF(mBuf);
986 /*******************************************************************
988 * @brief Packs and Sends RACH Resource release from DUAPP to MAC
992 * Function : packDuMacRachRsrcRel
995 * Packs and Sends RACH Resource release from DU APP to MAC
998 * @params[in] Post structure pointer
999 * MacRachRsrcRel pointer
1000 * @return ROK - success
1003 * ****************************************************************/
1004 uint8_t packDuMacRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel)
1006 Buffer *mBuf = NULLP;
1008 if(pst->selector == ODU_SELECTOR_LWLC)
1010 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1012 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacRachRsrcRel");
1015 /* pack the address of the structure */
1016 CMCHKPK(oduPackPointer, (PTR)rachRsrcRel, mBuf);
1020 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacRachRsrcRel");
1024 return ODU_POST_TASK(pst,mBuf);
1027 /*******************************************************************
1029 * @brief Unpacks RACH Resource Release received from DU APP
1033 * Function : unpackMacRachRsrcRel
1036 * Unpacks RACH Resource Release received from DU APP
1038 * @params[in] Pointer to Handler
1039 * Post structure pointer
1041 * @return ROK - success
1044 * ****************************************************************/
1045 uint8_t unpackMacRachRsrcRel(DuMacRachRsrcRel func, Pst *pst, Buffer *mBuf)
1047 if(pst->selector == ODU_SELECTOR_LWLC)
1049 MacRachRsrcRel *rachRsrcRel;
1051 /* unpack the address of the structure */
1052 CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcRel, mBuf);
1053 ODU_PUT_MSG_BUF(mBuf);
1054 return (*func)(pst, rachRsrcRel);
1058 /* Nothing to do for other selectors */
1059 DU_LOG("\nERROR --> DU APP : Only LWLC supported for RACH Resource Release ");
1060 ODU_PUT_MSG_BUF(mBuf);
1066 /*******************************************************************
1068 * @brief Packs and Sends RACH Resource response from MAC to DU APP
1072 * Function : packDuMacRachRsrcRsp
1075 * Packs and Sends RACH Resource response from MAC to DU APP
1078 * @params[in] Post structure pointer
1079 * MacRachRsrcRsp pointer
1080 * @return ROK - success
1083 * ****************************************************************/
1084 uint8_t packDuMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp)
1086 Buffer *mBuf = NULLP;
1088 if(pst->selector == ODU_SELECTOR_LWLC)
1090 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1092 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacRachRsrcRsp");
1095 /* pack the address of the structure */
1096 CMCHKPK(oduPackPointer, (PTR)rachRsrcRsp, mBuf);
1100 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacRachRsrcRsp");
1104 return ODU_POST_TASK(pst,mBuf);
1107 /*******************************************************************
1109 * @brief Unpacks RACH resource Response received from MAC
1113 * Function : unpackDuMacRachRsrcRsp
1116 * Unpacks RACH resource Response received from MAC
1118 * @params[in] Pointer to Handler
1119 * Post structure pointer
1121 * @return ROK - success
1124 * ****************************************************************/
1125 uint8_t unpackDuMacRachRsrcRsp(MacDuRachRsrcRspFunc func, Pst *pst, Buffer *mBuf)
1127 if(pst->selector == ODU_SELECTOR_LWLC)
1129 MacRachRsrcRsp *rachRsrcRsp;
1131 /* unpack the address of the structure */
1132 CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcRsp, mBuf);
1133 ODU_PUT_MSG_BUF(mBuf);
1134 return (*func)(pst, rachRsrcRsp);
1138 /* Nothing to do for other selectors */
1139 DU_LOG("\nERROR --> DU APP : Only LWLC supported for RACH resource Response ");
1140 ODU_PUT_MSG_BUF(mBuf);
1145 /*******************************************************************
1147 * @brief Packs and Sends UE Delete Request from DUAPP to MAC
1151 * Function : packDuMacUeDeleteReq
1154 * Packs and Sends UE Delete Request from DUAPP to MAC
1157 * @params[in] Post structure pointer
1158 * MacUeDelete pointer
1159 * @return ROK - success
1162 * ****************************************************************/
1163 uint8_t packDuMacUeDeleteReq(Pst *pst, MacUeDelete *ueDel)
1165 Buffer *mBuf = NULLP;
1167 if(pst->selector == ODU_SELECTOR_LWLC)
1169 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1171 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeDeleteReq");
1174 /* pack the address of the structure */
1175 CMCHKPK(oduPackPointer,(PTR)ueDel, mBuf);
1179 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeDeleteReq");
1183 return ODU_POST_TASK(pst,mBuf);
1185 /*******************************************************************
1187 * @brief Unpacks UE Delete Request received from DU APP
1191 * Function : unpackMacUeDeleteReq
1194 * Unpacks UE Delete Request received from DU APP
1196 * @params[in] Pointer to Handler
1197 * Post structure pointer
1199 * @return ROK - success
1202 * ****************************************************************/
1203 uint8_t unpackMacUeDeleteReq(DuMacUeDeleteReq func, Pst *pst, Buffer *mBuf)
1205 if(pst->selector == ODU_SELECTOR_LWLC)
1207 MacUeDelete *ueDelete;
1209 /* unpack the address of the structure */
1210 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf);
1211 ODU_PUT_MSG_BUF(mBuf);
1212 return (*func)(pst, ueDelete);
1216 /* Nothing to do for other selectors */
1217 DU_LOG("\nERROR --> DU APP : Only LWLC supported for UE Delete Request ");
1218 ODU_PUT_MSG_BUF(mBuf);
1223 /*******************************************************************
1225 * @brief Pack and send UE delete response from MAC to DU APP
1229 * Function : packDuMacUeDeleteRsp
1232 * Pack and send UE delete response from MAC to DU APP
1235 * @return ROK - success
1238 * ****************************************************************/
1239 uint8_t packDuMacUeDeleteRsp(Pst *pst, MacUeDeleteRsp *deleteRsp)
1241 Buffer *mBuf = NULLP;
1243 if(pst->selector == ODU_SELECTOR_LWLC)
1245 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1247 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacUeDeleteRsp");
1250 /* pack the address of the structure */
1251 CMCHKPK(oduPackPointer,(PTR)deleteRsp, mBuf);
1255 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacUeDeleteRsp");
1259 return ODU_POST_TASK(pst,mBuf);
1263 /*******************************************************************
1265 * @brief Unpack UE Config Response from MAC to DU APP
1269 * Function :unpackDuMacUeDeleteRsp
1271 * Functionality: Unpack UE Config Response from MAC to DU APP
1274 * @return ROK - success
1277 * ****************************************************************/
1278 uint8_t unpackDuMacUeDeleteRsp(MacDuUeDeleteRspFunc func, Pst *pst, Buffer *mBuf)
1280 if(pst->selector == ODU_SELECTOR_LWLC)
1282 MacUeDeleteRsp *ueDeleteRsp = NULLP;
1284 /* unpack the address of the structure */
1285 CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf);
1286 ODU_PUT_MSG_BUF(mBuf);
1287 return (*func)(pst, ueDeleteRsp);
1290 ODU_PUT_MSG_BUF(mBuf);
1294 /*******************************************************************
1296 * @brief Unpacks Cell Delete Request received from DU APP
1300 * Function : unpackMacCellDeleteReq
1303 * Unpacks Cell Delete Request received from DU APP
1305 * @params[in] Pointer to Handler
1306 * Post structure pointer
1308 * @return ROK - success
1311 * ****************************************************************/
1313 uint8_t unpackMacCellDeleteReq(DuMacCellDeleteReq func, Pst *pst, Buffer *mBuf)
1315 if(pst->selector == ODU_SELECTOR_LWLC)
1317 MacCellDeleteReq *cellDelete=NULLP;
1319 /* unpack the address of the structure */
1320 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDelete, mBuf);
1321 ODU_PUT_MSG_BUF(mBuf);
1322 return (*func)(pst, cellDelete);
1326 /* Nothing to do for other
1328 DU_LOG("\nERROR --> DU APP : unpackMacCellDeleteReq(): Only LWLC supported for CELL Delete Request ");
1329 ODU_PUT_MSG_BUF(mBuf);
1335 /*******************************************************************
1337 * @brief Pack and send Cell delete request to MAC
1341 * Function : packDuMacCellDeleteReq
1344 * Pack and send Cell delete request to MAC
1346 * @params[in] Post structure
1347 * MacCellDelete *cellDelete;
1348 * @return ROK - success
1351 * ****************************************************************/
1353 uint8_t packDuMacCellDeleteReq(Pst *pst, MacCellDeleteReq *cellDelete)
1355 Buffer *mBuf = NULLP;
1357 if(pst->selector == ODU_SELECTOR_LWLC)
1359 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1361 DU_LOG("\nERROR --> MAC : packDuMacCellDeleteReq(): Memory allocation failed ");
1364 CMCHKPK(oduPackPointer,(PTR)cellDelete, mBuf);
1365 return ODU_POST_TASK(pst,mBuf);
1369 DU_LOG("\nERROR --> MAC: packDuMacCellDeleteReq(): Only LWLC supported ");
1374 /*******************************************************************
1376 * @brief Pack and send CELL delete response from MAC to DU APP
1380 * Function : packDuMacCellDeleteRsp
1383 * Pack and send CELL delete response from MAC to DU APP
1385 * @params[in] Pst *pst, MacCellDeleteRsp *deleteRsp
1386 * @return ROK - success
1389 * ****************************************************************/
1391 uint8_t packDuMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *cellDeleteRsp)
1393 Buffer *mBuf = NULLP;
1395 if(pst->selector == ODU_SELECTOR_LWLC)
1397 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1399 DU_LOG("\nERROR --> MAC : packDuMacCellDeleteRsp(): Memory allocation failed ");
1402 CMCHKPK(oduPackPointer,(PTR)cellDeleteRsp, mBuf);
1406 DU_LOG("\nERROR --> MAC: packDuMacCellDeleteRsp(): Only LWLC supported ");
1410 return ODU_POST_TASK(pst,mBuf);
1414 /*******************************************************************
1416 * @brief Unpack cell delete response from MAC to DU APP
1420 * Function : unpackDuMacCellDeleteRsp
1422 * Functionality: Unpack cell delete response from MAC to DU APP
1424 * @params[in] MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf
1425 * @return ROK - success
1428 * ****************************************************************/
1430 uint8_t unpackDuMacCellDeleteRsp(MacDuCellDeleteRspFunc func, Pst *pst, Buffer *mBuf)
1432 if(pst->selector == ODU_SELECTOR_LWLC)
1434 MacCellDeleteRsp *cellDeleteRsp = NULLP;
1436 CMCHKUNPK(oduUnpackPointer, (PTR *)&cellDeleteRsp, mBuf);
1437 ODU_PUT_MSG_BUF(mBuf);
1438 return (*func)(pst, cellDeleteRsp);
1442 DU_LOG("\nERROR --> DU APP : unpackDuMacCellDeleteRsp(): Only LWLC supported ");
1443 ODU_PUT_MSG_BUF(mBuf);
1448 /*******************************************************************
1450 * @brief Pack and send Slice Cfg request from MAC to DU APP
1454 * Function : packDuMacSliceCfgReq
1457 * Pack and send Slice Cfg request from MAC to DU APP
1459 * @params[in] Pst *pst, MacSliceCfgReq *sliceCfgReq
1460 * @return ROK - success
1463 * ****************************************************************/
1465 uint8_t packDuMacSliceCfgReq(Pst *pst, MacSliceCfgReq *sliceCfgReq)
1467 Buffer *mBuf = NULLP;
1469 if(pst->selector == ODU_SELECTOR_LWLC)
1471 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1473 DU_LOG("\nERROR --> MAC : Memory allocation failed in packDuMacSliceCfgReq");
1476 CMCHKPK(oduPackPointer,(PTR)sliceCfgReq, mBuf);
1480 DU_LOG("\nERROR --> MAC: Only LWLC supported in packDuMacSliceCfgReq");
1484 return ODU_POST_TASK(pst,mBuf);
1487 /*******************************************************************
1489 * @brief Unpacks Slice Cfg request received from DU APP
1493 * Function : unpackMacSliceCfgReq
1496 * Unpacks Slice Cfg Request received from DU APP
1498 * @params[in] Pointer to Handler
1499 * Post structure pointer
1501 * @return ROK - success
1504 * ****************************************************************/
1505 uint8_t unpackMacSliceCfgReq(DuMacSliceCfgReq func, Pst *pst, Buffer *mBuf)
1507 if(pst->selector == ODU_SELECTOR_LWLC)
1509 MacSliceCfgReq *sliceCfgReq;
1510 /* unpack the address of the structure */
1511 CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceCfgReq, mBuf);
1512 ODU_PUT_MSG_BUF(mBuf);
1513 return (*func)(pst, sliceCfgReq);
1517 /* Nothing to do for other selectors */
1518 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Slice Cfg Request ");
1519 ODU_PUT_MSG_BUF(mBuf);
1525 /*******************************************************************
1527 * @brief Pack and send Slice config response from MAC to DU APP
1531 * Function : packDuMacSliceCfgRsp
1534 * Pack and send Slice config response from MAC to DU APP
1537 * @return ROK - success
1540 * ****************************************************************/
1541 uint8_t packDuMacSliceCfgRsp(Pst *pst, MacSliceCfgRsp *cfgRsp)
1543 Buffer *mBuf = NULLP;
1545 if(pst->selector == ODU_SELECTOR_LWLC)
1547 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1549 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacSliceCfgRsp");
1552 /* pack the address of the structure */
1553 CMCHKPK(oduPackPointer,(PTR)cfgRsp, mBuf);
1557 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacSliceCfgRsp");
1561 return ODU_POST_TASK(pst,mBuf);
1564 /*******************************************************************
1566 * @brief Unpack Slice Config Response from MAC to DU APP
1570 * Function :unpackDuMacSliceCfgRsp
1572 * Functionality: Unpack Slice Config Response from MAC to DU APP
1575 * @return ROK - success
1578 * ****************************************************************/
1579 uint8_t unpackDuMacSliceCfgRsp(MacDuSliceCfgRspFunc func, Pst *pst, Buffer *mBuf)
1581 if(pst->selector == ODU_SELECTOR_LWLC)
1583 MacSliceCfgRsp *cfgRsp = NULLP;
1585 /* unpack the address of the structure */
1586 CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf);
1587 ODU_PUT_MSG_BUF(mBuf);
1588 return (*func)(pst, cfgRsp);
1591 ODU_PUT_MSG_BUF(mBuf);
1596 /*******************************************************************
1598 * @brief Pack and send Slice ReCfg request from MAC to DU APP
1602 * Function : packDuMacSliceRecfgReq
1605 * Pack and send Slice ReCfg request from MAC to DU APP
1607 * @params[in] Pst *pst, MacSliceRecfgReq *sliceRecfgReq
1608 * @return ROK - success
1611 * ****************************************************************/
1613 uint8_t packDuMacSliceRecfgReq(Pst *pst, MacSliceRecfgReq *sliceRecfgReq)
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 in packDuMacSliceRecfgReq");
1624 CMCHKPK(oduPackPointer,(PTR)sliceRecfgReq, mBuf);
1628 DU_LOG("\nERROR --> MAC: Only LWLC supported in packDuMacSliceRecfgReq");
1632 return ODU_POST_TASK(pst,mBuf);
1635 /*******************************************************************
1637 * @brief Unpacks Slice ReCfg request received from DU APP
1641 * Function : unpackMacSliceCfgReq
1644 * Unpacks Slice ReCfg Request received from DU APP
1646 * @params[in] Pointer to Handler
1647 * Post structure pointer
1649 * @return ROK - success
1652 * ****************************************************************/
1653 uint8_t unpackMacSliceRecfgReq(DuMacSliceRecfgReq func, Pst *pst, Buffer *mBuf)
1655 if(pst->selector == ODU_SELECTOR_LWLC)
1657 MacSliceRecfgReq *sliceRecfgReq;
1658 /* unpack the address of the structure */
1659 CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceRecfgReq, mBuf);
1660 ODU_PUT_MSG_BUF(mBuf);
1661 return (*func)(pst, sliceRecfgReq);
1665 /* Nothing to do for other selectors */
1666 DU_LOG("\nERROR --> DU APP : Only LWLC supported for Slice ReCfg Request ");
1667 ODU_PUT_MSG_BUF(mBuf);
1673 /*******************************************************************
1675 * @brief Pack and send Slice config response from MAC to DU APP
1679 * Function : packDuMacSliceRecfgRsp
1682 * Pack and send Slice config response from MAC to DU APP
1685 * @return ROK - success
1688 * ****************************************************************/
1689 uint8_t packDuMacSliceRecfgRsp(Pst *pst, MacSliceRecfgRsp *sliceRecfgRsp)
1691 Buffer *mBuf = NULLP;
1693 if(pst->selector == ODU_SELECTOR_LWLC)
1695 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1697 DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacSliceRecfgRsp");
1700 /* pack the address of the structure */
1701 CMCHKPK(oduPackPointer,(PTR)sliceRecfgRsp, mBuf);
1705 DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacSliceRecfgRsp");
1709 return ODU_POST_TASK(pst,mBuf);
1712 /*******************************************************************
1714 * @brief Unpack Slice ReConfig Response from MAC to DU APP
1718 * Function :unpackDuMacSliceRecfgRsp
1720 * Functionality: Unpack Slice ReConfig Response from MAC to DU APP
1723 * @return ROK - success
1726 * ****************************************************************/
1727 uint8_t unpackDuMacSliceRecfgRsp(MacDuSliceRecfgRspFunc func, Pst *pst, Buffer *mBuf)
1729 if(pst->selector == ODU_SELECTOR_LWLC)
1731 MacSliceRecfgRsp *sliceRecfgRsp = NULLP;
1733 /* unpack the address of the structure */
1734 CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceRecfgRsp, mBuf);
1735 ODU_PUT_MSG_BUF(mBuf);
1736 return (*func)(pst, sliceRecfgRsp);
1739 ODU_PUT_MSG_BUF(mBuf);
1743 /*******************************************************************
1745 * @brief Pack and send Slot ind from MAC to DU APP
1749 * Function : packMacSlotInd
1752 * Pack and send Slot ind from MAC to DU APP
1754 * @params[in] Pst *pst, SlotTimingInfo *slotIndInfo
1755 * @return ROK - success
1758 * ****************************************************************/
1759 uint8_t packMacSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo)
1761 Buffer *mBuf = NULLP;
1763 if(pst->selector == ODU_SELECTOR_LWLC)
1765 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
1767 DU_LOG("\nERROR --> MAC : Memory allocation failed at packMacSlotInd");
1770 /* pack the address of the structure */
1771 CMCHKPK(oduPackPointer,(PTR)slotIndInfo, mBuf);
1775 DU_LOG("\nERROR --> MAC: Only LWLC supported for packMacSlotInd");
1779 return ODU_POST_TASK(pst,mBuf);
1782 /*******************************************************************
1784 * @brief Unpack Slot indication from MAC to DU APP
1788 * Function :unpackDuMacSlotInd
1790 * Functionality: Unpack Slot Indication from MAC to DU APP
1792 * @params[in] DuMacSlotInd func, Pst *pst, Buffer *mBuf
1793 * @return ROK - success
1796 * ****************************************************************/
1797 uint8_t unpackDuMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf)
1799 if(pst->selector == ODU_SELECTOR_LWLC)
1801 SlotTimingInfo *slotIndInfo;
1803 /* unpack the address of the structure */
1804 CMCHKUNPK(oduUnpackPointer, (PTR *)&slotIndInfo, mBuf);
1805 ODU_PUT_MSG_BUF(mBuf);
1806 return (*func)(pst, slotIndInfo);
1809 ODU_PUT_MSG_BUF(mBuf);
1813 /*******************************************************************
1815 * @brief Pack and send Dl Pcch indication to MAC
1819 * Function : packDuMacDlPcchInd
1822 * Pack and send Dl Pcch indication to MAC
1824 * @params[in] Post structure
1825 * DlPcchInd *pcchInd;
1826 * @return ROK - success
1829 * ****************************************************************/
1831 uint8_t packDuMacDlPcchInd(Pst *pst, DlPcchInd *pcchInd)
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 : packDuMacDlPcchInd(): Memory allocation failed ");
1842 CMCHKPK(oduPackPointer,(PTR)pcchInd, mBuf);
1843 return ODU_POST_TASK(pst,mBuf);
1847 DU_LOG("\nERROR --> MAC: packDuMacDlPcchInd(): Only LWLC supported ");
1852 /*******************************************************************
1854 * @brief Unpacks downlink pcch indication received from DU APP
1858 * Function : unpackMacDlPcchInd
1861 * Unpacks downlink pcch indication received from DU APP
1863 * @params[in] Pointer to Handler
1864 * Post structure pointer
1866 * @return ROK - success
1869 * ****************************************************************/
1871 uint8_t unpackMacDlPcchInd(DuMacDlPcchInd func, Pst *pst, Buffer *mBuf)
1873 if(pst->selector == ODU_SELECTOR_LWLC)
1875 DlPcchInd *pcchInd=NULLP;
1877 /* unpack the address of the structure */
1878 CMCHKUNPK(oduUnpackPointer, (PTR *)&pcchInd, mBuf);
1879 ODU_PUT_MSG_BUF(mBuf);
1880 return (*func)(pst, pcchInd);
1884 /* Nothing to do for other selectors */
1885 DU_LOG("\nERROR --> DU APP : unpackMacDlPcchInd(): Only LWLC supported");
1886 ODU_PUT_MSG_BUF(mBuf);
1892 /*******************************************************************
1894 * @brief Searches for first unset bit in ueBitMap
1898 * Function : getFreeBitFromUeBitMap
1900 * Functionality: Searches for first unset bit in ueBitMap of
1901 * a cell. Search starts from LSB to MSB. Returns index of the
1902 * free bit, considering LSB at index 0 and increasing index
1905 * @params[in] Cell Id
1906 * @return Index of free bit - success
1909 * ****************************************************************/
1910 int8_t getFreeBitFromUeBitMap(uint16_t cellId)
1912 uint8_t bitIdx = 0; /* bit position */
1913 uint16_t cellIdx = 0; /* Index to acces ueBitMapPerCell[] */
1914 uint64_t mask = 1; /* bit mask */
1916 GET_CELL_IDX(cellId, cellIdx);
1919 /* Find the first unset bit in Bit Map */
1920 if((ueBitMapPerCell[cellIdx] & (mask << bitIdx)) == 0)
1922 SET_ONE_BIT(bitIdx, ueBitMapPerCell[cellIdx]);
1931 /*******************************************************************
1933 * @brief Unset a previously set bit in UeBitMap
1937 * Function : unsetBitInUeBitMap
1939 * Functionality: Searches for bit at given index and unset it.
1941 * @params[in] Cell Id
1945 * ****************************************************************/
1946 void unsetBitInUeBitMap(uint16_t cellId, uint8_t bitPos)
1950 GET_CELL_IDX(cellId, cellIdx);
1951 UNSET_ONE_BIT(bitPos, ueBitMapPerCell[cellIdx]);
1954 /**********************************************************************
1956 **********************************************************************/