* ****************************************************************/
uint8_t MacProcRlcDlData(Pst* pstInfo, RlcData *dlData)
{
- uint8_t pduIdx =0;
- uint8_t lcIdx = 0;
- uint8_t *txPdu =NULLP;
- uint16_t tbSize =0;
- MacDlData macDlData;
- MacDlSlot *currDlSlot = NULLP;
- DlRlcBoInfo dlBoInfo;
-
+ uint8_t pduIdx =0;
+ uint8_t lcIdx = 0;
+ uint8_t *txPdu =NULLP;
+ uint16_t tbSize =0,cellIdx=0;
+ MacDlData macDlData;
+ MacDlSlot *currDlSlot = NULLP;
+ DlRlcBoInfo dlBoInfo;
+
memset(&macDlData , 0, sizeof(MacDlData));
DU_LOG("\nDEBUG --> MAC: Received DL data for sfn=%d slot=%d numPdu= %d", \
dlData->slotInfo.sfn, dlData->slotInfo.slot, dlData->numPdu);
macDlData.pduInfo[pduIdx].dlPdu = dlData->pduInfo[pduIdx].pduBuf;
}
+ GET_CELL_IDX(dlData->cellId, cellIdx);
/* Store DL data in the scheduled slot */
- currDlSlot = &macCb.macCell[dlData->cellId -1]->dlSlot[dlData->slotInfo.slot];
- if(currDlSlot)
+ if(macCb.macCell[cellIdx] ==NULLP)
+ {
+ DU_LOG("\nERROR --> MAC : MacProcRlcDlData(): macCell does not exists");
+ return RFAILED;
+ }
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlData->slotInfo.slot];
+ if(currDlSlot->dlInfo.dlMsgAlloc)
{
- if(currDlSlot->dlInfo.dlMsgAlloc)
+ tbSize = currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
+ MAC_ALLOC(txPdu, tbSize);
+ if(!txPdu)
{
- tbSize = currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
- MAC_ALLOC(txPdu, tbSize);
- if(!txPdu)
- {
- DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
- return RFAILED;
- }
- macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
-
- currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
- currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
+ return RFAILED;
}
+ macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
+
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
}
for(lcIdx = 0; lcIdx < dlData->numLc; lcIdx++)
for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
{
MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData->pduInfo[pduIdx].pduBuf,\
- dlData->pduInfo[pduIdx].pduLen);
+ dlData->pduInfo[pduIdx].pduLen);
}
if(pstInfo->selector == ODU_SELECTOR_LWLC)
{
MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData));
}
-
return ROK;
}
DU_LOG("\nINFO --> MAC : Sending cell stop request to Lower Mac");
GET_CELL_IDX(cellId->cellId, cellIdx);
- slotInfo.cellId = cellId->cellId;
- slotInfo.sfn = macCb.macCell[cellIdx]->currTime.sfn;
- slotInfo.slot = macCb.macCell[cellIdx]->currTime.slot;
- sendToLowerMac(FAPI_STOP_REQUEST, 0, &slotInfo);
+ if(macCb.macCell[cellIdx])
+ {
+ slotInfo.cellId = cellId->cellId;
+ slotInfo.sfn = macCb.macCell[cellIdx]->currTime.sfn;
+ slotInfo.slot = macCb.macCell[cellIdx]->currTime.slot;
+ sendToLowerMac(FAPI_STOP_REQUEST, 0, &slotInfo);
+ }
#endif
MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, \
if(dlCcchIndInfo->msgType == RRC_SETUP)
{
dlBoInfo.lcId = SRB0_LCID; // SRB ID 0 for msg4
- dlBoInfo.dataVolume = dlCcchIndInfo->dlCcchMsgLen;
+ /* (MSG4 pdu + 3 bytes sub-header) + (Contention resolution id MAC CE + 1b byte sub-header) */
+ dlBoInfo.dataVolume = (dlCcchIndInfo->dlCcchMsgLen + 3) + (MAX_CRI_SIZE + 1);
/* storing Msg4 Pdu in raCb */
GET_UE_IDX(dlBoInfo.crnti, ueIdx);