* RFAILED - failure
*
***************************************************************************/
-uint16_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
+int packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
{
if(pst->selector == DU_SELECTOR_LC)
{
if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* pack the address of the structure */
CMCHKPK(cmPkPtr,(PTR)macCellCfg, mBuf);
DU_LOG("\nDU-APP : MAC CELL config sent");
- RETVALUE(SPstTsk(pst,mBuf));
+ return SPstTsk(pst,mBuf);
}
+ return ROK;
}
/**************************************************************************
* RFAILED - failure
*
***************************************************************************/
-void unpackDuMacCellCfg(
+int unpackDuMacCellCfg(
DuMacCellCfgReq func,
Pst *pst,
Buffer *mBuf)
* RFAILED - failure
*
***************************************************************************/
-uint16_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
+int packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
{
if(pst->selector == DU_SELECTOR_LC)
{
Buffer *mBuf = NULLP;
if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* pack the transaction ID in CNF structure */
CMCHKPK(SPkU8, macCellCfgCfm->rsp, mBuf);
CMCHKPK(SPkU16, macCellCfgCfm->transId, mBuf);
- RETVALUE(SPstTsk(pst,mBuf));
+ return SPstTsk(pst,mBuf);
}
else if(pst->selector == DU_SELECTOR_LWLC)
{
* RFAILED - failure
*
***************************************************************************/
-uint16_t unpackMacCellCfgCfm(
+int unpackMacCellCfgCfm(
DuMacCellCfgCfm func,
Pst *pst,
Buffer *mBuf)
CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf);
CMCHKUNPK(SUnpkU8, &(macCellCfgCfm.rsp), mBuf);
- RETVALUE((*func)(&macCellCfgCfm));
+ return (*func)(pst, &macCellCfgCfm);
}
else
{
/* only loose coupling is suported */
+ return ROK;
}
}
if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
{
DU_LOG("\nDU APP : Memory allocation failed for cell start req pack");
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* pack the address of the structure */
if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
{
DU_LOG("\nDU APP : Memory allocation failed for cell stop req pack");
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* pack the address of the structure */
* ****************************************************************/
uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo )
{
- if(pst->selector == DU_SELECTOR_LC || pst->selector == DU_SELECTOR_TC)
+ Buffer *mBuf = NULLP;
+
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
{
- /* Loose coupling not supported */
- DU_LOG("\nDU APP : Only LWLC supported");
+ DU_LOG("\nDU APP : Memory allocation failed for cell start req pack");
return RFAILED;
}
- else if(pst->selector == DU_SELECTOR_LWLC)
+
+ if(pst->selector == DU_SELECTOR_LC)
{
- Buffer *mBuf = NULLP;
+ CMCHKPK(SPkU16, slotInfo->cellId, mBuf);
+ CMCHKPK(SPkU16, slotInfo->sfn, mBuf);
+ CMCHKPK(SPkU16, slotInfo->slot, mBuf);
- if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
- {
- DU_LOG("\nDU APP : Memory allocation failed for cell start req pack");
- RETVALUE(RFAILED);
- }
-
+ SPutStaticBuffer(pst->region, pst->pool, slotInfo, sizeof(SlotInfo), 0);
+ slotInfo = NULL;
+ }
+ else if(pst->selector == DU_SELECTOR_LWLC)
+ {
/* pack the address of the structure */
CMCHKPK(cmPkPtr,(PTR)slotInfo, mBuf);
-
- return SPstTsk(pst,mBuf);
}
- return ROK;
+ else
+ {
+ SPutMsg(mBuf);
+ }
+
+ return SPstTsk(pst,mBuf);
}
/*******************************************************************
* ****************************************************************/
uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf)
{
- SlotInfo *slotInfo;
-
if(pst->selector == DU_SELECTOR_LWLC)
{
+ SlotInfo *slotInfo;
+
/* unpack the address of the structure */
CMCHKUNPK(cmUnpkPtr, (PTR *)&slotInfo, mBuf);
SPutMsg(mBuf);
return (*func)(pst, slotInfo);
}
+ else if(pst->selector == DU_SELECTOR_LC)
+ {
+ SlotInfo 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 */