+/*******************************************************************
+ *
+ * @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;
+ RachInd rachInd;
+
+ 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_PST_LWR_MAC_TO_MAC(pst, EVENT_RACH_IND_TO_MAC);
+
+ (*sendRachIndOpts[pst.selector])(&pst, &rachInd);
+ return ROK;