+/*******************************************************************
+ *
+ * @brief Processes Rach Indication from PHY and sends to MAC
+ *
+ * @details
+ *
+ * Function : procRachInd
+ *
+ * Functionality:
+ * Processes Rach Indication from PHY and sends to MAC
+ *
+ * @params[in] fapi_rach_indication_t pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t procRachInd(fapi_rach_indication_t *fapiRachInd)
+{
+ Pst pst;
+ uint8_t pduIdx;
+ uint8_t prmbleIdx;
+ RachPduInfo *rachPdu = NULLP;
+ RachInd *rachInd = NULLP;
+
+ MAC_ALLOC_SHRABL_BUF(rachInd, sizeof(RachInd));
+ if(!rachInd)
+ {
+ printf("\nLWR_MAC: Memory Allocation failed in procRachInd");
+ return RFAILED;
+ }
+
+ rachInd->cellId = lwrMacCb.cellCb[0].cellId;
+ rachInd->timingInfo.sfn = fapiRachInd->sfn;
+ rachInd->timingInfo.slot = fapiRachInd->slot;
+ rachInd->numPdu = fapiRachInd->numPdus;
+ for(pduIdx=0; pduIdx < rachInd->numPdu; pduIdx++)
+ {
+ rachPdu = &rachInd->rachPdu[pduIdx];
+ rachPdu->pci = fapiRachInd->rachPdu[pduIdx].phyCellId;
+ rachPdu->symbolIdx = fapiRachInd->rachPdu[pduIdx].symbolIndex;
+ rachPdu->slotIdx = fapiRachInd->rachPdu[pduIdx].slotIndex;
+ rachPdu->freqIdx = fapiRachInd->rachPdu[pduIdx].freqIndex;
+ rachPdu->numPream = fapiRachInd->rachPdu[pduIdx].numPreamble;
+ for(prmbleIdx=0; prmbleIdx<rachPdu->numPream; prmbleIdx++)
+ {
+ rachPdu->preamInfo[prmbleIdx].preamIdx = \
+ fapiRachInd->rachPdu[pduIdx].preambleInfo[prmbleIdx].preambleIndex;
+ rachPdu->preamInfo[prmbleIdx].timingAdv = \
+ fapiRachInd->rachPdu[pduIdx].preambleInfo[prmbleIdx].timingAdvance;
+ }
+ }
+
+ /* Fill post and sent to MAC */
+ FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_RACH_IND_TO_MAC);
+ return (*sendRachIndOpts[pst.selector])(&pst, rachInd);
+
+}/* handleRachInd */
+
+/*******************************************************************
+ *
+ * @brief Handles CRC indication from PHY and sends to MAC
+ *
+ * @details
+ *
+ * Function : procCrcInd
+ *
+ * Functionality:
+ * Handles CRC indication from PHY and sends to MAC
+ *
+ * @params[in] fapi_crc_ind_t message pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t procCrcInd(fapi_crc_ind_t *fapiCrcInd)
+{
+ Pst pst;
+ uint8_t crcInfoIdx;
+ uint8_t crcStatusIdx;
+ CrcInfo *crcIndInfo = NULLP;
+ CrcInd *crcInd = NULLP;
+
+ MAC_ALLOC_SHRABL_BUF(crcInd, sizeof(CrcInd));
+ if(!crcInd)
+ {
+ printf("\nLWR_MAC: Memory Allocation failed in procCrcInd");
+ return RFAILED;
+ }
+
+ 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)