+ Pst pst;
+ uint8_t crcInfoIdx;
+ uint8_t crcStatusIdx;
+ CrcInfo *crcIndInfo = NULLP;
+ CrcInd *crcInd = NULLP;
+
+ MAC_ALLOC_SHRABL_BUF(crcInd, sizeof(CrcInd));
+ if(!crcInd)
+ {
+ DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procCrcInd");
+ return RFAILED;
+ }
+ if(!fapiCrcInd->numCrcs)
+ {
+ DU_LOG("\nDEBUG --> LWR_MAC : No CRC PDUs in CRC.indication at [%d, %d]", fapiCrcInd->sfn, fapiCrcInd->slot);
+ return ROK;
+ }
+
+ crcInd->cellId = lwrMacCb.cellCb[0].cellId;
+ crcInd->timingInfo.sfn = fapiCrcInd->sfn;
+ crcInd->timingInfo.slot = fapiCrcInd->slot;
+ crcInd->numCrc = fapiCrcInd->numCrcs;
+
+ for(crcInfoIdx = 0; crcInfoIdx < crcInd->numCrc; crcInfoIdx++)
+ {
+ crcIndInfo = &crcInd->crcInfo[crcInfoIdx];
+ crcIndInfo->handle = fapiCrcInd->crc[crcInfoIdx].handle;
+ crcIndInfo->rnti = fapiCrcInd->crc[crcInfoIdx].rnti;
+ crcIndInfo->harqId = fapiCrcInd->crc[crcInfoIdx].harqId;
+ crcIndInfo->tbCrcStatus = fapiCrcInd->crc[crcInfoIdx].tbCrcStatus;
+ crcIndInfo->numCb = fapiCrcInd->crc[crcInfoIdx].numCb;
+ for(crcStatusIdx = 0; crcStatusIdx < crcIndInfo->numCb; crcStatusIdx++)
+ {
+ crcIndInfo->cbCrcStatus[crcStatusIdx] = \
+ fapiCrcInd->crc[crcInfoIdx].cbCrcStatus[crcStatusIdx];
+ }
+ crcIndInfo->ul_cqi = fapiCrcInd->crc[crcInfoIdx].ul_cqi;
+ crcIndInfo->timingAdvance = fapiCrcInd->crc[crcInfoIdx].timingAdvance;
+ crcIndInfo->rssi = fapiCrcInd->crc[crcInfoIdx].rssi;
+ }
+
+ /* Fill post and sent to MAC */
+ FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_CRC_IND_TO_MAC);
+ return (*sendCrcIndOpts[pst.selector])(&pst, crcInd);
+} /* handleCrcInd */
+
+/*******************************************************************
+ *
+ * @brief Handles Rx Data indication from PHY and sends to MAC
+ *
+ * @details
+ *
+ * Function : procRxDataInd
+ *
+ * Functionality:
+ * Handles Rx Data indication from PHY and sends to MAC
+ *
+ * @params[in] fapi_rx_data_indication_t message pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t procRxDataInd(fapi_rx_data_indication_t *fapiRxDataInd)
+{
+ Pst pst;
+ uint8_t pduIdx =0;
+ RxDataInd *rxDataInd = NULLP;
+ RxDataIndPdu *pdu = NULLP;
+
+ MAC_ALLOC_SHRABL_BUF(rxDataInd, sizeof(RxDataInd));
+ if(!rxDataInd)
+ {
+ DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procRxDataInd");
+ return RFAILED;
+ }
+ if(!fapiRxDataInd->numPdus)
+ {
+ DU_LOG("\nDEBUG --> LWR_MAC : No PDU in RX_Data.indication at [%d, %d]", fapiRxDataInd->sfn, fapiRxDataInd->slot);
+ return ROK;
+ }
+
+ rxDataInd->cellId = lwrMacCb.cellCb[0].cellId;
+ rxDataInd->timingInfo.sfn = fapiRxDataInd->sfn;
+ rxDataInd->timingInfo.slot = fapiRxDataInd->slot;
+ rxDataInd->numPdus = fapiRxDataInd->numPdus;
+
+ for(pduIdx = 0; pduIdx < rxDataInd->numPdus; pduIdx++)
+ {
+ pdu = &rxDataInd->pdus[pduIdx];
+ pdu->handle = fapiRxDataInd->pdus[pduIdx].handle;
+ pdu->rnti = fapiRxDataInd->pdus[pduIdx].rnti;
+ pdu->harqId = fapiRxDataInd->pdus[pduIdx].harqId;
+ pdu->pduLength = fapiRxDataInd->pdus[pduIdx].pdu_length;
+ pdu->ul_cqi = fapiRxDataInd->pdus[pduIdx].ul_cqi;
+ pdu->timingAdvance = fapiRxDataInd->pdus[pduIdx].timingAdvance;
+ pdu->rssi = fapiRxDataInd->pdus[pduIdx].rssi;
+
+ MAC_ALLOC_SHRABL_BUF(pdu->pduData, pdu->pduLength);
+ memcpy(pdu->pduData, fapiRxDataInd->pdus[pduIdx].pduData, pdu->pduLength);
+#ifdef INTEL_WLS_MEM
+ /* Free WLS memory allocated for Rx PDU */
+ WLS_MEM_FREE(fapiRxDataInd->pdus[pduIdx].pduData, LWR_MAC_WLS_BUF_SIZE);
+#endif
+ }
+
+ /* Fill post and sent to MAC */
+ FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_RX_DATA_IND_TO_MAC);
+ return (*sendRxDataIndOpts[pst.selector])(&pst, rxDataInd);