+ return ret;
+}
+
+/*******************************************************************
+ *
+ * @brief Handles stop indication recived from PHY
+ *
+ * @details
+ *
+ * Function : handleStopInd
+ *
+ * Functionality:
+ * Handles Stop Indication received from PHY
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t handleStopInd()
+{
+ uint8_t ret;
+ Pst pst;
+
+ clGlobalCp.phyState = PHY_STATE_CONFIGURED;
+ DU_LOG("\nLWR_MAC: PHY has moved to configured state");
+
+ fillLwrMacToMacPst(&pst);
+ pst.event = EVENT_STOP_IND_TO_MAC;
+
+ ret = (*sendStopIndOpts[pst.selector])(&pst);
+ return ret;
+}
+/*******************************************************************
+ *
+ * @brief Processes Rach Indication from PHY and sends to MAC
+ *
+ * @details
+ *
+ * Function : handleRachInd
+ *
+ * Functionality:
+ * Processes Rach Indication from PHY and sends to MAC
+ *
+ * @params[in] fapi_rach_indication_t pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t handleRachInd(fapi_rach_indication_t *fapiRachInd)
+{
+ Pst pst;
+ uint8_t pduIdx;
+ uint8_t prmbleIdx;
+ RachPduInfo *rachPdu;
+ RachInd rachInd;
+
+ 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].physCellId;
+ 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;
+ }
+ }
+ fillLwrMacToMacPst(&pst);
+ pst.event = EVENT_RACH_IND_TO_MAC;
+
+ (*sendRachIndOpts[pst.selector])(&pst, &rachInd);
+ return ROK;
+
+}/* handleRachInd */
+
+/*******************************************************************
+ *
+ * @brief Handles CRC indication from PHY and sends to MAC
+ *
+ * @details
+ *
+ * Function : handleCrcInd
+ *
+ * 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 handleCrcInd(fapi_crc_ind_t *fapiCrcInd)
+{
+ Pst pst;
+ uint8_t crcInfoIdx;
+ uint8_t crcStatusIdx;
+ CrcInfo *crcIndInfo;
+ CrcInd crcInd;
+
+ 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;
+ }
+
+ fillLwrMacToMacPst(&pst);
+ pst.event = EVENT_CRC_IND_TO_MAC;
+
+ (*sendCrcIndOpts[pst.selector])(&pst, &crcInd);
+ return ROK;
+
+} /* handleCrcInd */
+
+/*******************************************************************
+ *
+ * @brief Handles Rx Data indication from PHY and sends to MAC
+ *
+ * @details
+ *
+ * Function : handleRxDataInd
+ *
+ * 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 handleRxDataInd(fapi_rx_data_indication_t *fapiRxDataInd)
+{
+ Pst pst;
+ uint8_t pduIdx;
+ RxDataInd rxDataInd;
+ RxDataIndPdu *pdu;
+
+ 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].pduLength;
+ pdu->ul_cqi = fapiRxDataInd->pdus[pduIdx].ul_cqi;
+ pdu->timingAdvance = fapiRxDataInd->pdus[pduIdx].timingAdvance;
+ pdu->rssi = fapiRxDataInd->pdus[pduIdx].rssi;
+
+ MAC_ALLOC(pdu->pduData, pdu->pduLength);
+ memcpy(pdu->pduData, fapiRxDataInd->pdus[pduIdx].pduData, pdu->pduLength);
+ }
+
+ fillLwrMacToMacPst(&pst);
+ pst.event = EVENT_RX_DATA_IND_TO_MAC;
+
+ (*sendRxDataIndOpts[pst.selector])(&pst, &rxDataInd);
+ return ROK;
+}
+
+#endif /* FAPI */
+
+void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg)