+
+ MAC_FREE(configReq, msgLen);
+#endif
+
+}
+
+
+/*******************************************************************
+ *
+ * @brief Builds and Sends RACH indication to MAC
+ *
+ * @details
+ *
+ * Function : l1BuildAndSendRachInd
+ *
+ * Functionality:
+ * Builds and Sends RACH indication to MAC
+ *
+ * @params[in] SFN value
+ * slot value
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t l1BuildAndSendRachInd(uint16_t slot, uint16_t sfn)
+{
+#ifdef FAPI
+ uint8_t rachPduIdx = 0;
+ uint8_t preamIdx = 0;
+ fapi_rach_pdu_t *rachPdu;
+ fapi_rach_indication_t *rachInd;
+
+ /* Building RACH indication */
+ MAC_ALLOC(rachInd, sizeof(fapi_rach_indication_t));
+ if(!rachInd)
+ {
+ printf("\nPHY_STUB: Memory allocation failed for Rach Indication Message");
+ return RFAILED;
+ }
+
+ rachInd->sfn = sfn;
+ rachInd->slot = slot;
+ rachInd->numPdus = 1;
+
+ rachPdu = &rachInd->rachPdu[rachPduIdx];
+ rachPdu->physCellId = NR_PCI;
+ rachPdu->symbolIndex = 0;
+ rachPdu->slotIndex = slot;
+ rachPdu->freqIndex = 0;
+ rachPdu->avgRssi = 0;
+ rachPdu->avgSnr = 0;
+ rachPdu->numPreamble = 1;
+
+ rachPdu->preambleInfo[preamIdx].preambleIndex = 3;
+ rachPdu->preambleInfo[preamIdx].timingAdvance = 0;
+ rachPdu->preambleInfo[preamIdx].premblePwr = 0;
+
+ fillMsgHeader(&rachInd->header, FAPI_RACH_INDICATION, \
+ sizeof(fapi_rach_indication_t));
+
+ /* Sending RACH indication to MAC */
+ DU_LOG("\nPHY STUB: Sending RACH Indication to MAC");
+ handlePhyMessages(rachInd->header.message_type_id, sizeof(fapi_rach_indication_t), (void *)rachInd);
+ MAC_FREE(rachInd, sizeof(fapi_rach_indication_t));
+#endif
+ return ROK;