uint32_t pduLen = 0;
uint32_t *sib1TxdataValue = NULLP;
- pduDesc->pduIndex = pduIndex;
- pduDesc->numTlvs = 1;
+ pduDesc[pduIndex].pduIndex = pduIndex;
+ pduDesc[pduIndex].numTlvs = 1;
/* fill the TLV */
/* as of now, memory is allocated from SSI, later WLS memory needs to be taken */
- pduDesc->tlvs[0].tl.tag = 1; /* pointer to be sent */
- pduDesc->tlvs[0].tl.length = macCellCfg->sib1Cfg.sib1PduLen;
+ pduDesc[pduIndex].tlvs[0].tl.tag = 1; /* pointer to be sent */
+ pduDesc[pduIndex].tlvs[0].tl.length = macCellCfg->sib1Cfg.sib1PduLen;
LWR_MAC_ALLOC(sib1TxdataValue,macCellCfg->sib1Cfg.sib1PduLen);
if(sib1TxdataValue == NULLP)
{
}
memcpy(sib1TxdataValue,macCellCfg->sib1Cfg.sib1Pdu,
macCellCfg->sib1Cfg.sib1PduLen);
- pduDesc->tlvs[0].value = sib1TxdataValue;
+ pduDesc[pduIndex].tlvs[0].value = sib1TxdataValue;
/* The total length of the PDU description and PDU data */
pduLen += 8; /* size of PDU length 2 bytes, PDU index 2 bytes, numTLV 4 bytes */
pduLen += sizeof(fapi_uint32_tlv_t); /* only 1 TLV is present */
- pduDesc->pduLength = pduLen;
+ pduDesc[pduIndex].pduLength = pduLen;
msgLen += pduLen;
#ifndef INTEL_WLS
void sendToLowerMac(U16, U32, void *);
uint16_t handleDlTtiReq(CmLteTimingInfo *dlTtiReqtimingInfo);
void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
+S16 handleUlTtiReq(CmLteTimingInfo *currTimingInfo);
typedef S16 (*lwrMacFsmHdlr)(void *);
#endif
#define RG_MAX_DL_HARQ_NUM 8
#endif
-#define MAC_MEM_REGION 4
+#define MAC_MEM_REGION 4
#define MAC_POOL 1
/* allocate and zero out a MAC static buffer */
#define MAC_ALLOC(_datPtr, _size) \
SPutSBuf(MAC_MEM_REGION, MAC_POOL, \
(Data *)_datPtr, _size);
+/* Allocate shared memory to be used for LWLC
+ * during inter-layer communication */
+#define MAC_ALLOC_SHRABL_BUF(_buf, _size) \
+{ \
+ if(SGetStaticBuffer(MAC_MEM_REGION, MAC_POOL, \
+ (Data **)&_buf, (Size) _size, 0) == ROK) \
+ { \
+ cmMemset((U8 *)(_buf), 0, _size); \
+ } \
+ else \
+ { \
+ (_buf) = NULLP; \
+ } \
+}
+
+/* Free shared memory, received through LWLC */
+#define MAC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
+{ \
+ if (_buf != NULLP) \
+ { \
+ (Void) SPutStaticBuffer(_region, _pool, \
+ (Data *) _buf, (Size) _size, 0); \
+ _buf = NULLP; \
+ } \
+}
+
/* Free shared memory, received through LWLC */
#define MAC_FREE_MEM(_region, _pool, _datPtr, _size) \
if(_datPtr) \
int sendSlotIndMacToDuApp(SlotIndInfo *slotInd)
{
Pst pst;
+ uint16_t ret;
SlotInfo *slotInfo;
-
- /* Send Slot Indication to DU APP */
- MAC_ALLOC(slotInfo, sizeof(SlotInfo));
+
+ /* Allocate sharable memory */
+ MAC_ALLOC_SHRABL_BUF(slotInfo, sizeof(SlotInfo));
if(!slotInfo)
{
DU_LOG("\nMAC : Slot Indication memory allocation failed");
pst.prior = 0;
pst.intfVer = 0;
- return MacDuAppSlotInd(&pst, slotInfo);
-
+ ret = MacDuAppSlotInd(&pst, slotInfo);
+ if(ret != ROK)
+ {
+ DU_LOG("\nMAC: Failed to send slot indication to DU APP");
+ MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, slotInfo, sizeof(SlotInfo));
+ }
+
+ return ret;
}
/**
* ****************************************************************/
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");
- return 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 */
#define DU_PROC 0
/* Memory related configs */
#define DU_APP_MEM_REGION 0
-#define RLC_UL_MEM_REGION 1
-#define RLC_DL_MEM_REGION 4
-#define MAC_MEM_REGION 4
+#define RLC_UL_MEM_REGION 1
+#define RLC_DL_MEM_REGION 4
+#define MAC_MEM_REGION 4
#define DU_POOL 1
#define RLC_POOL 1
(Data *)_datPtr, _size);
/* Free shared memory, received through LWLC */
-#define DU_FREE_MEM(_region, _pool, _datPtr, _size) \
- if(_datPtr) \
- SPutSBuf(_region, _pool,(Data *)_datPtr, _size); \
- _datPtr = NULL;
+#define DU_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
+{ \
+ if (_buf != NULLP) \
+ { \
+ (Void) SPutStaticBuffer(_region, _pool, \
+ (Data *) _buf, (Size) _size, 0); \
+ _buf = NULLP; \
+ } \
+}
+
typedef enum
{
#ifdef EGTP_TEST
duSendEgtpSlotInd();
#endif
- DU_FREE_MEM(MAC_MEM_REGION, pst->pool, slotInfo, sizeof(SlotInfo));
+
+ if((pst->selector == DU_SELECTOR_LWLC) || (pst->selector == DU_SELECTOR_TC))
+ DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, slotInfo, sizeof(SlotInfo));
+
return ROK;
}