/* This file contains message handling functionality for MAC */
-extern MacCb macCb;
+MacCb macCb;
uint16_t buildMacPdu(RlcData *dlData);
#ifdef EGTP_TEST
{
uint16_t cellIdx;
CrcIndInfo crcIndInfo;
-
DU_LOG("\nMAC : Received CRC indication");
-
GET_CELL_IDX(crcInd->cellId, cellIdx);
/* Considering one pdu and one preamble */
- crcIndInfo.cellId = macCb.macCell[cellIdx]->cellId;;
+ crcIndInfo.cellId = macCb.macCell[cellIdx]->cellId;
crcIndInfo.crnti = crcInd->crcInfo[0].rnti;
crcIndInfo.timingInfo.sfn = crcInd->timingInfo.sfn;
crcIndInfo.timingInfo.slot = crcInd->timingInfo.slot;
crcIndInfo.numCrcInd = crcInd->crcInfo[0].numCb;
crcIndInfo.crcInd[0] = crcInd->crcInfo[0].cbCrcStatus[0];
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, crcInd, sizeof(CrcInd));
return(sendCrcIndMacToSch(&crcIndInfo));
}
uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
{
uint16_t pduIdx;
-
DU_LOG("\nMAC : Received Rx Data indication");
-
/* TODO : compare the handle received in RxDataInd with handle send in PUSCH
* PDU, which is stored in raCb */
for(pduIdx = 0; pduIdx < rxDataInd->numPdus; pduIdx++)
{
unpackRxData(rxDataInd->cellId, rxDataInd->timingInfo, &rxDataInd->pdus[pduIdx]);
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, rxDataInd->pdus[pduIdx].pduData,\
+ rxDataInd->pdus[pduIdx].pduLength);
}
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, rxDataInd, sizeof(RxDataInd));
return ROK;
}
* ****************************************************************/
uint8_t MacProcRlcDlData(Pst* pstInfo, RlcData *dlData)
{
- uint8_t pduIdx;
- uint8_t *txPdu;
- uint16_t tbSize;
+ uint8_t pduIdx =0;
+ uint8_t *txPdu =NULLP;
+ uint16_t tbSize =0;
MacDlData macDlData;
MacDlSlot *currDlSlot = NULLP;
-
+
+ memset(&macDlData , 0, sizeof(MacDlData));
DU_LOG("\nMAC: Received DL data for sfn=%d slot=%d", \
dlData->slotInfo.sfn, dlData->slotInfo.slot);
-
/* Copy the pdus to be muxed into mac Dl data */
macDlData.numPdu = dlData->numPdu;
for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
uint8_t lcId, uint16_t pduLen, uint8_t *pdu)
{
Pst pst;
- RlcData *ulData;
+ RlcData *ulData;
/* Filling RLC Ul Data*/
MAC_ALLOC_SHRABL_BUF(ulData, sizeof(RlcData));
DU_LOG("\nMAC: Memory allocation failure in sendSchResultRepToRlc");
return RFAILED;
}
- DU_LOG("\nMAC: Send scheduled result report for sfn %d slot %d", slotInfo.sfn, slotInfo.slot);
+ DU_LOG("\nMAC: Send scheduled result report for sfn %d slot %d", slotInfo.sfn, slotInfo.slot);
schedRpt->cellId = dlInfo.cellId;
schedRpt->rnti = dlInfo.dlMsgAlloc->crnti;
schedRpt->numLc = dlInfo.dlMsgAlloc->numLc;
*
* @details
*
- * Function : MacProcCellStartReq
+ * Function : MacProcCellStart
*
* Functionality:
* Handles cell start reuqest from DU APP
*
* @params[in] Post structure pointer
- * Cell Start Request info pointer
+ * Cell Id
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t MacProcCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo)
+uint8_t MacProcCellStart(Pst *pst, OduCellId *cellId)
{
DU_LOG("\nMAC : Handling cell start request");
- sendToLowerMac(START_REQUEST, 0, cellStartInfo);
+ gSlotCount = 0;
+ sendToLowerMac(START_REQUEST, 0, cellId);
- MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellStartInfo, \
- sizeof(MacCellStartInfo));
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, \
+ sizeof(OduCellId));
return ROK;
}
/*******************************************************************
*
- * @brief Handles cell stop request from DU APP
+ * @brief Handles cell stop from DU APP
*
* @details
*
- * Function : MacProcCellStartReq
+ * Function : MacProcCellStop
*
* Functionality:
- * Handles cell stop request from DU APP
+ * Handles cell stop from DU APP
*
* @params[in] Post structure pointer
- * Mac Cell stop information
+ * Cell Id
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t MacProcCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo)
+uint8_t MacProcCellStop(Pst *pst, OduCellId *cellId)
{
#ifdef INTEL_FAPI
+ uint16_t cellIdx;
+ SlotIndInfo slotInfo;
+
DU_LOG("\nMAC : Sending cell stop request to Lower Mac");
- sendToLowerMac(FAPI_STOP_REQUEST, 0, cellStopInfo);
+ 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);
#endif
- MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellStopInfo, \
- sizeof(MacCellStopInfo));
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, \
+ sizeof(OduCellId));
return ROK;
}
* ****************************************************************/
uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
{
- uint8_t ueIdx = 0;
- uint16_t cellIdx;
- uint16_t idx;
+ uint8_t ueIdx = 0;
+ uint16_t cellIdx;
+ uint16_t idx;
DlRlcBoInfo dlBoInfo;
memset(&dlBoInfo, 0, sizeof(DlRlcBoInfo));
memset(&srUciInd, 0, sizeof(SrUciIndInfo));
GET_CELL_IDX(macUciInd->cellId, cellIdx);
- srUciInd.cellId = macCb.macCell[cellIdx]->cellId;;
+ srUciInd.cellId = macCb.macCell[cellIdx]->cellId;
srUciInd.crnti = crnti;
srUciInd.slotInd.sfn = macUciInd->slotInd.sfn;
srUciInd.slotInd.slot = macUciInd->slotInd.slot;
DU_LOG("\nMAC: Received Uci Ind is NULL at FapiMacUciInd()");
ret = RFAILED;
}
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macUciInd, sizeof(UciInd));
return ret;
}