+ return ROK;
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Send Cell Start Request to MAC
+ *
+ * @details
+ *
+ * Function : packMacCellStartReq
+ *
+ * Functionality:
+ * Packs and Sends Cell Start Request to MAC
+ *
+ * @params[in] Post structure pointer
+ * MacCellStartInfo pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LC)
+ {
+ /* Loose coupling not supported */
+ return RFAILED;
+ }
+ else if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nDU APP : Memory allocation failed for cell start req pack");
+ return RFAILED;
+ }
+
+ /* pack the address of the structure */
+ CMCHKPK(cmPkPtr,(PTR)cellStartInfo, mBuf);
+
+ }
+ return SPstTsk(pst,mBuf);
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks MAC Cell Start Request from DU APP
+ *
+ * @details
+ *
+ * Function : unpackMaCellStartReq
+ *
+ * Functionality:
+ * Unpacks MAC Cell Start Request from DU APP
+ *
+ * @params[in] Function pointer of cell start request handler
+ * Post structure pointer
+ * Cell Start Request Info Pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf)
+{
+ MacCellStartInfo *cellStartInfo;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ /* unpack the address of the structure */
+ CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStartInfo, mBuf);
+ SPutMsg(mBuf);
+ return (*func)(pst, cellStartInfo);
+ }
+ else
+ {
+ /* Nothing to do for loose coupling */
+ SPutMsg(mBuf);
+ return ROK;
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Send cell stop request to MAC
+ *
+ * @details
+ *
+ * Function : packMacCellStopReq
+ *
+ * Functionality:
+ * Packs and Send cell stop request to MAC
+ *
+ * @params[in] Post structure pointer
+ * Cell stop info structure
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo)
+{
+ if(pst->selector == ODU_SELECTOR_LC)
+ {
+ /* Loose coupling not supported */
+ return RFAILED;
+ }
+ else if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ Buffer *mBuf = NULLP;
+
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nDU APP : Memory allocation failed for cell stop req pack");
+ return RFAILED;
+ }
+
+ /* pack the address of the structure */
+ CMCHKPK(cmPkPtr,(PTR)cellStopInfo, mBuf);
+
+ return SPstTsk(pst,mBuf);
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks cell stop request from DU APP
+ *
+ * @details
+ *
+ * Function : unpackMaCellStopReq
+ *
+ * Functionality:
+ * Unpacks cell stop request from DU APP
+ *
+ * @params[in] Handler function pointer
+ * Post structure pointer
+ * Message Buffer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf)
+{
+ MacCellStopInfo *cellStopInfo;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ /* unpack the address of the structure */
+ CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStopInfo, mBuf);
+ SPutMsg(mBuf);
+ return (*func)(pst, cellStopInfo);
+ }
+ else
+ {
+ /* Nothing to do for loose coupling */
+ SPutMsg(mBuf);
+ return ROK;
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Sends slot ind from MAC to DUAPP
+ *
+ * @details
+ *
+ * Function : packMacSlotInd
+ *
+ * Functionality:
+ * Packs and Sends slot ind from MAC to DUAPP
+ *
+ * @params[in] Post structure pointer
+ * Slot Info pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packMacSlotInd(Pst *pst, SlotIndInfo *slotInfo )
+{
+ Buffer *mBuf = NULLP;
+
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nDU APP : Memory allocation failed for cell start req pack");
+ return RFAILED;
+ }
+
+ if(pst->selector == ODU_SELECTOR_LC)
+ {
+ CMCHKPK(SPkU16, slotInfo->cellId, mBuf);
+ CMCHKPK(SPkU16, slotInfo->sfn, mBuf);
+ CMCHKPK(SPkU16, slotInfo->slot, mBuf);
+
+ CM_FREE_SHRABL_BUF(pst->region, pst->pool, slotInfo, sizeof(SlotIndInfo));
+ slotInfo = NULL;
+ }
+ else if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ /* pack the address of the structure */
+ CMCHKPK(cmPkPtr,(PTR)slotInfo, mBuf);
+ }
+ else
+ {
+ SPutMsg(mBuf);
+ }
+
+ return SPstTsk(pst,mBuf);
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks slot indication from MAC
+ *
+ * @details
+ *
+ * Function : unpackMacSlotInd
+ *
+ * Functionality:
+ * Unpacks slot indication from MAC
+ *
+ * @params[in] Pointer to Handler
+ * Post structure pointer
+ * Message Buffer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ SlotIndInfo *slotInfo;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(cmUnpkPtr, (PTR *)&slotInfo, mBuf);
+ SPutMsg(mBuf);
+ return (*func)(pst, slotInfo);
+ }
+ else if(pst->selector == ODU_SELECTOR_LC)
+ {
+ SlotIndInfo slotInfo;
+
+ CMCHKUNPK(SUnpkU16, &(slotInfo.slot), mBuf);
+ CMCHKUNPK(SUnpkU16, &(slotInfo.sfn), mBuf);
+ CMCHKUNPK(SUnpkU16, &(slotInfo.cellId), mBuf);
+
+ SPutMsg(mBuf);
+ return (*func)(pst, &slotInfo);
+
+ }
+ else
+ {
+ /* Nothing to do for loose coupling */
+ SPutMsg(mBuf);
+ return ROK;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Sends stop ind from MAC to DUAPP
+ *
+ * @details
+ *
+ * Function : packMacStopInd
+ *
+ * Functionality:
+ * Packs and Sends stop ind from MAC to DUAPP
+ *
+ * @params[in] Post structure pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId)
+{
+ Buffer *mBuf = NULLP;
+
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nDU APP : Memory allocation failed for stop Ind pack");
+ return RFAILED;
+ }
+
+ if(pst->selector == ODU_SELECTOR_LC)
+ {
+ /*pack the payload here*/
+ DU_LOG("\nDU APP : Packed CellId");
+ CMCHKPK(SPkU16, cellStopId->cellId, mBuf);
+ CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellStopId, sizeof(MacCellStopInfo));
+ cellStopId = NULL;
+ }
+ else if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ /* pack the address of the structure */
+ CMCHKPK(cmPkPtr,(PTR)cellStopId, mBuf);
+ }
+ else
+ {
+ SPutMsg(mBuf);
+ }
+
+ return SPstTsk(pst,mBuf);
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks stop indication from MAC
+ *
+ * @details
+ *
+ * Function : unpackMacStopInd
+ *
+ * Functionality:
+ * Unpacks stop indication from MAC
+ *
+ * @params[in] Pointer to Handler
+ * Post structure pointer
+ * Message Buffer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ MacCellStopInfo *cellStopId;
+ /* unpack the address of the structure */
+ CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStopId, mBuf);
+ SPutMsg(mBuf);
+ return (*func)(pst, cellStopId);
+ }
+ else if(pst->selector == ODU_SELECTOR_LC)
+ {
+ MacCellStopInfo cellStopId;
+ CMCHKUNPK(SUnpkU16, &(cellStopId.cellId), mBuf);
+
+ SPutMsg(mBuf);
+ return (*func)(pst, &cellStopId);
+
+ }
+ else
+ {
+ /* Nothing to do for loose coupling */
+ SPutMsg(mBuf);
+ return ROK;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Packs and Sends UL CCCH Ind from MAC to DUAPP
+ *
+ * @details
+ *
+ * Function : packMacUlCcchInd
+ *
+ * Functionality:
+ * Packs and Sends UL CCCH Ind from MAC to DUAPP
+ *
+ * @params[in] Post structure pointer
+ * UL CCCH Ind pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nMAC : Memory allocation failed at packMacUlCcchInd");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(cmPkPtr,(PTR)ulCcchIndInfo, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nMAC: Only LWLC supported for UL CCCH Ind ");
+ return RFAILED;
+ }
+
+ return SPstTsk(pst,mBuf);
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks UL CCCH indication from MAC
+ *
+ * @details
+ *
+ * Function : unpackMacUlCcchInd
+ *
+ * Functionality:
+ * Unpacks UL CCCH indication from MAC
+ *
+ * @params[in] Pointer to Handler
+ * Post structure pointer
+ * Message Buffer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ UlCcchIndInfo *ulCcchIndInfo;
+
+ /* unpack the address of the structure */
+ CMCHKUNPK(cmUnpkPtr, (PTR *)&ulCcchIndInfo, mBuf);
+ SPutMsg(mBuf);
+ return (*func)(pst, ulCcchIndInfo);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\n Only LWLC supported for UL CCCH Ind ");
+ SPutMsg(mBuf);