+ * - fills the RAR TX-DATA request message
+ *
+ * @params[in] fapi_tx_pdu_desc_t *pduDesc
+ * @params[in] RarInfo *rarInfo
+ * @params[in] uint32_t *msgLen
+ * @params[in] uint16_t pduIndex
+ * @return ROK
+ *
+ * ********************************************************************/
+uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, RarInfo *rarInfo,
+ uint16_t pduIndex)
+{
+ uint32_t pduLen = 0;
+ uint8_t *rarTxdataValue = NULLP;
+
+ pduDesc[pduIndex].pdu_index = pduIndex;
+ pduDesc[pduIndex].num_tlvs = 1;
+
+ /* fill the TLV */
+ /* as of now, memory is allocated from SSI, later WLS memory needs to be taken */
+ pduDesc[pduIndex].tlvs[0].tl.tag = 1; /* pointer to be sent */
+ pduDesc[pduIndex].tlvs[0].tl.length = rarInfo->rarPduLen;
+ LWR_MAC_ALLOC(rarTxdataValue,rarInfo->rarPduLen);
+ if(rarTxdataValue == NULLP)
+ {
+ return RFAILED;
+ }
+ memcpy(rarTxdataValue,rarInfo->rarPdu,rarInfo->rarPduLen);
+ pduDesc[pduIndex].tlvs[0].value = rarTxdataValue;
+
+ /* The total length of the PDU description and PDU data */
+ pduLen += 8; /* size of PDU length 2 bytes, PDU index 2 bytes, numTLV 4 bytes */
+ pduLen += sizeof(fapi_uint8_ptr_tlv_t); /* only 1 TLV is present */
+ pduDesc[pduIndex].pdu_length = pduLen;
+
+ /* TODO: The pointer value which was stored, needs to be free-ed at PHY *
+ * But since we did not implement WLS, this has to be done here
+ */
+#ifndef INTEL_WLS
+ MAC_FREE(rarTxdataValue,rarInfo->rarPduLen);
+#endif
+
+ return ROK;
+}
+
+/***********************************************************************
+ *
+ * @brief fills the DL dedicated Msg TX-DATA request message
+ *
+ * @details
+ *
+ * Function : fillDlMsgTxDataReq
+ *
+ * Functionality:
+ * - fills the Dl Dedicated Msg TX-DATA request message
+ *
+ * @params[in] fapi_tx_pdu_desc_t *pduDesc
+ * @params[in] DlMsgInfo *dlMsgInfo
+ * @params[in] uint32_t *msgLen
+ * @params[in] uint16_t pduIndex
+ * @return ROK
+ *
+ * ********************************************************************/
+uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, DlMsgInfo *dlMsgInfo,
+ uint16_t pduIndex)
+{
+ uint32_t pduLen = 0;
+ uint8_t *dedMsgTxDataValue = NULLP;
+
+ pduDesc[pduIndex].pdu_index = pduIndex;
+ pduDesc[pduIndex].num_tlvs = 1;
+
+ /* fill the TLV */
+ /* as of now, memory is allocated from SSI, later WLS memory needs to be taken */
+ pduDesc[pduIndex].tlvs[0].tl.tag = 1; /* pointer to be sent */
+ pduDesc[pduIndex].tlvs[0].tl.length = dlMsgInfo->dlMsgPduLen;
+ LWR_MAC_ALLOC(dedMsgTxDataValue, dlMsgInfo->dlMsgPduLen);
+ if(dedMsgTxDataValue == NULLP)
+ {
+ return RFAILED;
+ }
+ memcpy(dedMsgTxDataValue, dlMsgInfo->dlMsgPdu, dlMsgInfo->dlMsgPduLen);
+ pduDesc[pduIndex].tlvs[0].value = dedMsgTxDataValue;
+
+ /* The total length of the PDU description and PDU data */
+ pduLen += 8; /* size of PDU length 2 bytes, PDU index 2 bytes, numTLV 4 bytes */
+ pduLen += sizeof(fapi_uint8_ptr_tlv_t); /* only 1 TLV is present */
+ pduDesc[pduIndex].pdu_length = pduLen;
+
+ /* TODO: The pointer value which was stored, needs to be free-ed at PHY *
+ * But since we did not implement WLS, this has to be done here
+ */
+#ifndef INTEL_WLS
+ MAC_FREE(dedMsgTxDataValue, dlMsgInfo->dlMsgPduLen);
+#endif
+
+ return ROK;
+}
+
+
+#endif /* FAPI */
+/*******************************************************************
+ *
+ * @brief Sends DL TTI Request to PHY
+ *
+ * @details
+ *
+ * Function : fillDlTtiReq
+ *
+ * Functionality:
+ * -Sends FAPI DL TTI req to PHY
+ *
+ * @params[in] timing info
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo)
+{
+#ifdef INTEL_FAPI
+ uint8_t idx;
+ uint8_t nPdu = 0;
+ uint8_t numPduEncoded = 0;
+ uint16_t cellIdx;
+ uint16_t pduIndex = 0;
+ uint32_t msgLen = 0;
+
+ fapi_dl_tti_req_t *dlTtiReq = NULLP;
+ SlotIndInfo dlTtiReqTimingInfo;
+
+ MacDlSlot *currDlSlot = NULLP;
+ MacCellCfg macCellCfg;
+ memset(&macCellCfg, 0, sizeof(MacCellCfg));
+ RntiType rntiType;
+
+ if(lwrMacCb.phyState == PHY_STATE_RUNNING)
+ {
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
+ /* consider phy delay */
+ ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,PHY_DELTA);
+
+ macCellCfg = macCb.macCell[cellIdx]->macCellCfg;
+
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlTtiReqTimingInfo.slot];
+ nPdu = calcDlTtiReqPduCount(&currDlSlot->dlInfo);
+ LWR_MAC_ALLOC(dlTtiReq, sizeof(fapi_dl_tti_req_t));
+ if(dlTtiReq != NULLP)
+ {
+ memset(dlTtiReq, 0, sizeof(fapi_dl_tti_req_t));
+ dlTtiReq->sfn = dlTtiReqTimingInfo.sfn;
+ dlTtiReq->slot = dlTtiReqTimingInfo.slot;
+ dlTtiReq->nPdus = calcDlTtiReqPduCount(&currDlSlot->dlInfo); /* get total Pdus */
+ nPdu = dlTtiReq->nPdus;
+ dlTtiReq->nGroup = 0;
+
+ if(dlTtiReq->nPdus > 0)
+ {
+ if(currDlSlot->dlInfo.isBroadcastPres)
+ {
+ if(currDlSlot->dlInfo.brdcstAlloc.ssbTrans)
+ {
+ if(dlTtiReq->pdus != NULLP)
+ {
+ for(idx = 0; idx < currDlSlot->dlInfo.brdcstAlloc.ssbIdxSupported; idx++)
+ {
+ fillSsbPdu(&dlTtiReq->pdus[numPduEncoded], &macCellCfg,\
+ currDlSlot, idx, dlTtiReq->sfn);
+ numPduEncoded++;
+ }
+ }
+ printf("\033[1;31m");
+ DU_LOG("\nLWR_MAC: MIB sent..");
+ printf("\033[0m");
+ }
+ if(currDlSlot->dlInfo.brdcstAlloc.sib1Trans)
+ {
+ /* Filling SIB1 param */
+ if(numPduEncoded != nPdu)
+ {
+ rntiType = SI_RNTI_TYPE;
+ fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded],&currDlSlot->dlInfo,\
+ rntiType, CORESET_TYPE0);
+ numPduEncoded++;
+ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
+ &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg,
+ currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp,
+ pduIndex);
+ pduIndex++;
+ numPduEncoded++;
+ }
+ printf("\033[1;34m");
+ DU_LOG("\nLWR_MAC: SIB1 sent...");
+ printf("\033[0m");
+ }
+ }
+ if(currDlSlot->dlInfo.rarAlloc != NULLP)
+ {
+ /* Filling RAR param */
+ rntiType = RA_RNTI_TYPE;
+ fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
+ &currDlSlot->dlInfo, rntiType, CORESET_TYPE0);
+ numPduEncoded++;
+ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
+ &currDlSlot->dlInfo.rarAlloc->rarPdschCfg,
+ currDlSlot->dlInfo.rarAlloc->bwp,
+ pduIndex);
+ numPduEncoded++;
+ pduIndex++;
+
+ printf("\033[1;32m");
+ DU_LOG("\nLWR_MAC: RAR sent...");
+ printf("\033[0m");
+ }
+ if(currDlSlot->dlInfo.dlMsgAlloc != NULLP)
+ {
+ if(currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu != NULLP)
+ {
+ /* Filling Msg4 param */
+ printf("\033[1;32m");
+ if(currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.isMsg4Pdu)
+ {
+ rntiType = TC_RNTI_TYPE;
+ fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
+ &currDlSlot->dlInfo, rntiType, CORESET_TYPE0);
+ DU_LOG("\nLWR_MAC: MSG4 sent...");
+ }
+ else
+ {
+ /* Filling other DL msg params */
+ rntiType = C_RNTI_TYPE;
+ fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
+ &currDlSlot->dlInfo, rntiType, CORESET_TYPE1);
+ DU_LOG("\nLWR_MAC: DL MSG sent...");
+ }
+ printf("\033[0m");
+
+ numPduEncoded++;
+ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
+ &currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg,
+ currDlSlot->dlInfo.dlMsgAlloc->bwp,
+ pduIndex);
+ numPduEncoded++;
+ pduIndex++;
+ }
+ else
+ {
+ MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc, sizeof(DlMsgAlloc));
+ currDlSlot->dlInfo.dlMsgAlloc = NULLP;
+ }
+ }
+
+ msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
+ LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), \
+ (void *)dlTtiReq);
+
+ /* send Tx-DATA req message */
+ sendTxDataReq(currTimingInfo, &currDlSlot->dlInfo);
+ }
+ else
+ {
+ msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
+ LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), (void *)dlTtiReq);
+ }
+ memset(currDlSlot, 0, sizeof(MacDlSlot));
+ return ROK;
+ }
+ else
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for DL TTI Request");
+ memset(currDlSlot, 0, sizeof(MacDlSlot));
+ return RFAILED;
+ }
+ }
+ else
+ {
+ lwr_mac_procInvalidEvt(&currTimingInfo);
+ return RFAILED;
+ }
+#endif
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Sends TX data Request to PHY
+ *
+ * @details
+ *
+ * Function : sendTxDataReq
+ *
+ * Functionality:
+ * -Sends FAPI TX data req to PHY
+ *
+ * @params[in] timing info
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t sendTxDataReq(SlotIndInfo currTimingInfo, DlSchedInfo *dlInfo)
+{
+#ifdef INTEL_FAPI
+ uint8_t nPdu = 0;
+ uint16_t cellIdx;
+ uint32_t msgLen = 0;
+ uint16_t pduIndex = 0;
+ uint32_t txDataReqMsgSize = 0;
+ fapi_tx_data_req_t *txDataReq = NULLP;
+
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
+
+ /* send TX_Data request message */
+ nPdu = calcTxDataReqPduCount(dlInfo);
+ if(nPdu > 0)
+ {
+ txDataReqMsgSize = sizeof(fapi_tx_data_req_t);
+ if(dlInfo->brdcstAlloc.sib1Trans)
+ {
+ txDataReqMsgSize += macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen;
+ }
+ if(dlInfo->rarAlloc != NULLP)
+ {
+ txDataReqMsgSize += dlInfo->rarAlloc->rarInfo.rarPduLen;
+ }
+ if(dlInfo->dlMsgAlloc != NULLP)
+ {
+ txDataReqMsgSize += dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPduLen;
+ }
+
+ LWR_MAC_ALLOC(txDataReq, txDataReqMsgSize);
+ if(txDataReq == NULLP)
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for TX data Request");
+ return RFAILED;
+ }
+
+ memset(txDataReq, 0, txDataReqMsgSize);
+ txDataReq->sfn = currTimingInfo.sfn;
+ txDataReq->slot = currTimingInfo.slot;
+ if(dlInfo->brdcstAlloc.sib1Trans)
+ {
+ fillSib1TxDataReq(txDataReq->pdu_desc,
+ &macCb.macCell[cellIdx]->macCellCfg, pduIndex);
+ pduIndex++;
+ txDataReq->num_pdus++;
+ }
+ if(dlInfo->rarAlloc != NULLP)
+ {
+ fillRarTxDataReq(txDataReq->pdu_desc, &dlInfo->rarAlloc->rarInfo, pduIndex);
+ pduIndex++;
+ txDataReq->num_pdus++;
+
+ MAC_FREE(dlInfo->rarAlloc,sizeof(RarAlloc));
+ dlInfo->rarAlloc = NULLP;
+ }
+ if(dlInfo->dlMsgAlloc != NULLP)
+ {
+ fillDlMsgTxDataReq(txDataReq->pdu_desc, \
+ &dlInfo->dlMsgAlloc->dlMsgInfo, pduIndex);
+ pduIndex++;
+ txDataReq->num_pdus++;
+
+ MAC_FREE(dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPdu,\
+ dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPduLen);
+ dlInfo->dlMsgAlloc->dlMsgInfo.dlMsgPdu = NULLP;
+ MAC_FREE(dlInfo->dlMsgAlloc, sizeof(DlMsgAlloc));
+ dlInfo->dlMsgAlloc = NULLP;
+ }
+
+ msgLen = txDataReqMsgSize - sizeof(fapi_msg_t);
+ fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, msgLen);
+ LwrMacSendToPhy(txDataReq->header.msg_id, txDataReqMsgSize, \
+ (void *)txDataReq);
+ }
+#endif
+ return ROK;
+}
+
+/***********************************************************************
+ *
+ * @brief calculates the total size to be allocated for UL TTI Req
+ *
+ * @details
+ *
+ * Function : getnPdus
+ *
+ * Functionality:
+ * -calculates the total pdu count to be allocated for UL TTI Req
+ *
+ * @params[in] Pointer to fapi Ul TTI Req
+ * Pointer to CurrUlSlot
+ * @return count
+ * ********************************************************************/
+#ifdef INTEL_FAPI
+uint8_t getnPdus(fapi_ul_tti_req_t *ulTtiReq, MacUlSlot *currUlSlot)
+{
+ uint8_t pduCount = 0;
+
+ if(ulTtiReq && currUlSlot)
+ {
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH)
+ {
+ pduCount++;
+ ulTtiReq->rachPresent++;
+ }
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH)
+ {
+ pduCount++;
+ ulTtiReq->nUlsch++;
+ }
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH_UCI)
+ {
+ pduCount++;
+ ulTtiReq->nUlsch++;
+ }
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI)
+ {
+ pduCount++;
+ ulTtiReq->nUlcch++;
+ }
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_SRS)
+ {
+ pduCount++;
+ }
+ }
+ return pduCount;
+}
+#endif
+
+/***********************************************************************
+ *
+ * @brief Set the value of zero correlation config in PRACH PDU
+ *
+ * @details
+ *
+ * Function : setNumCs
+ *
+ * Functionality:
+ * -Set the value of zero correlation config in PRACH PDU
+ *
+ * @params[in] Pointer to zero correlation config
+ * Pointer to MacCellCfg
+ * ********************************************************************/
+
+void setNumCs(uint16_t *numCs, MacCellCfg *macCellCfg)
+{
+#ifdef INTEL_FAPI
+ uint8_t idx;
+ if(macCellCfg != NULLP)
+ {
+ idx = macCellCfg->prachCfg.fdm[0].zeroCorrZoneCfg;
+ *numCs = UnrestrictedSetNcsTable[idx];
+ }
+#endif
+}
+
+/***********************************************************************
+ *
+ * @brief Fills the PRACH PDU in UL TTI Request
+ *
+ * @details
+ *
+ * Function : fillPrachPdu
+ *
+ * Functionality:
+ * -Fills the PRACH PDU in UL TTI Request
+ *
+ * @params[in] Pointer to Prach Pdu
+ * Pointer to CurrUlSlot
+ * Pointer to macCellCfg
+ * Pointer to msgLen
+ * ********************************************************************/
+
+#ifdef INTEL_FAPI
+void fillPrachPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg, MacUlSlot *currUlSlot)
+{
+ if(ulTtiReqPdu != NULLP)
+ {
+ ulTtiReqPdu->pduType = PRACH_PDU_TYPE;
+ ulTtiReqPdu->pdu.prach_pdu.physCellId = macCellCfg->phyCellId;
+ ulTtiReqPdu->pdu.prach_pdu.numPrachOcas = \
+ currUlSlot->ulInfo.prachSchInfo.numPrachOcas;
+ ulTtiReqPdu->pdu.prach_pdu.prachFormat = \
+ currUlSlot->ulInfo.prachSchInfo.prachFormat;
+ ulTtiReqPdu->pdu.prach_pdu.numRa = currUlSlot->ulInfo.prachSchInfo.numRa;
+ ulTtiReqPdu->pdu.prach_pdu.prachStartSymbol = \
+ currUlSlot->ulInfo.prachSchInfo.prachStartSymb;
+ setNumCs(&ulTtiReqPdu->pdu.prach_pdu.numCs, macCellCfg);
+ ulTtiReqPdu->pdu.prach_pdu.beamforming.numPrgs = 0;
+ ulTtiReqPdu->pdu.prach_pdu.beamforming.prgSize = 0;
+ ulTtiReqPdu->pdu.prach_pdu.beamforming.digBfInterface = 0;
+ ulTtiReqPdu->pdu.prach_pdu.beamforming.rx_bfi[0].beamIdx[0].beamidx = 0;
+ ulTtiReqPdu->pduSize = sizeof(fapi_ul_prach_pdu_t);
+ }
+}
+
+void fillPuschPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg, MacUlSlot *currUlSlot)
+{
+ if(ulTtiReqPdu != NULLP)
+ {
+ ulTtiReqPdu->pduType = PUSCH_PDU_TYPE;
+ memset(&ulTtiReqPdu->pdu.pusch_pdu, 0, sizeof(fapi_ul_pusch_pdu_t));
+ ulTtiReqPdu->pdu.pusch_pdu.pduBitMap = 1;
+ ulTtiReqPdu->pdu.pusch_pdu.rnti = currUlSlot->ulInfo.crnti;
+ /* TODO : Fill handle in raCb when scheduling pusch and access here */
+ ulTtiReqPdu->pdu.pusch_pdu.handle = 100;
+ ulTtiReqPdu->pdu.pusch_pdu.bwpSize = macCellCfg->initialUlBwp.bwp.numPrb;
+ ulTtiReqPdu->pdu.pusch_pdu.bwpStart = macCellCfg->initialUlBwp.bwp.firstPrb;
+ ulTtiReqPdu->pdu.pusch_pdu.subCarrierSpacing = \
+ macCellCfg->initialUlBwp.bwp.scs;
+ ulTtiReqPdu->pdu.pusch_pdu.cyclicPrefix = \
+ macCellCfg->initialUlBwp.bwp.cyclicPrefix;
+ ulTtiReqPdu->pdu.pusch_pdu.targetCodeRate = 308;
+ ulTtiReqPdu->pdu.pusch_pdu.qamModOrder = 2;
+ ulTtiReqPdu->pdu.pusch_pdu.mcsIndex = \
+ currUlSlot->ulInfo.schPuschInfo.tbInfo.mcs;
+ ulTtiReqPdu->pdu.pusch_pdu.mcsTable = 0;
+ ulTtiReqPdu->pdu.pusch_pdu.transformPrecoding = 1;
+ ulTtiReqPdu->pdu.pusch_pdu.dataScramblingId = currUlSlot->ulInfo.cellId;
+ ulTtiReqPdu->pdu.pusch_pdu.nrOfLayers = 1;
+ ulTtiReqPdu->pdu.pusch_pdu.ulDmrsSymbPos = 4;
+ ulTtiReqPdu->pdu.pusch_pdu.dmrsConfigType = 0;
+ ulTtiReqPdu->pdu.pusch_pdu.ulDmrsScramblingId = currUlSlot->ulInfo.cellId;
+ ulTtiReqPdu->pdu.pusch_pdu.scid = 0;
+ ulTtiReqPdu->pdu.pusch_pdu.numDmrsCdmGrpsNoData = 1;
+ ulTtiReqPdu->pdu.pusch_pdu.dmrsPorts = 0;
+ ulTtiReqPdu->pdu.pusch_pdu.resourceAlloc = \
+ currUlSlot->ulInfo.schPuschInfo.resAllocType;
+ ulTtiReqPdu->pdu.pusch_pdu.rbStart = \
+ currUlSlot->ulInfo.schPuschInfo.fdAlloc.startPrb;
+ ulTtiReqPdu->pdu.pusch_pdu.rbSize = \
+ currUlSlot->ulInfo.schPuschInfo.fdAlloc.numPrb;
+ ulTtiReqPdu->pdu.pusch_pdu.vrbToPrbMapping = 0;
+ ulTtiReqPdu->pdu.pusch_pdu.frequencyHopping = 0;
+ ulTtiReqPdu->pdu.pusch_pdu.txDirectCurrentLocation = 0;
+ ulTtiReqPdu->pdu.pusch_pdu.uplinkFrequencyShift7p5khz = 0;
+ ulTtiReqPdu->pdu.pusch_pdu.startSymbIndex = \
+ currUlSlot->ulInfo.schPuschInfo.tdAlloc.startSymb;
+ ulTtiReqPdu->pdu.pusch_pdu.nrOfSymbols = \
+ currUlSlot->ulInfo.schPuschInfo.tdAlloc.numSymb;
+ ulTtiReqPdu->pdu.pusch_pdu.mappingType = \
+ currUlSlot->ulInfo.schPuschInfo.dmrsMappingType;
+ ulTtiReqPdu->pdu.pusch_pdu.nrOfDmrsSymbols = \
+ currUlSlot->ulInfo.schPuschInfo.nrOfDmrsSymbols;
+ ulTtiReqPdu->pdu.pusch_pdu.dmrsAddPos = \
+ currUlSlot->ulInfo.schPuschInfo.dmrsAddPos;
+ ulTtiReqPdu->pdu.pusch_pdu.puschData.rvIndex = \
+ currUlSlot->ulInfo.schPuschInfo.tbInfo.rv;
+ ulTtiReqPdu->pdu.pusch_pdu.puschData.harqProcessId = \
+ currUlSlot->ulInfo.schPuschInfo.harqProcId;
+ ulTtiReqPdu->pdu.pusch_pdu.puschData.newDataIndicator = \
+ currUlSlot->ulInfo.schPuschInfo.tbInfo.ndi;
+ ulTtiReqPdu->pdu.pusch_pdu.puschData.tbSize = \
+ currUlSlot->ulInfo.schPuschInfo.tbInfo.tbSize;
+ /* numCb is 0 for new transmission */
+ ulTtiReqPdu->pdu.pusch_pdu.puschData.numCb = 0;
+
+ ulTtiReqPdu->pduSize = sizeof(fapi_ul_pusch_pdu_t);
+ }
+}
+
+void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg,\
+ MacUlSlot *currUlSlot)
+{
+ if(ulTtiReqPdu != NULLP)
+ {
+ ulTtiReqPdu->pduType = PUCCH_PDU_TYPE;
+ memset(&ulTtiReqPdu->pdu.pucch_pdu, 0, sizeof(fapi_ul_pucch_pdu_t));
+ ulTtiReqPdu->pdu.pucch_pdu.rnti = currUlSlot->ulInfo.schPucchInfo.rnti;
+ /* TODO : Fill handle in raCb when scheduling pucch and access here */
+ ulTtiReqPdu->pdu.pucch_pdu.handle = 100;
+ ulTtiReqPdu->pdu.pucch_pdu.bwpSize = macCellCfg->initialUlBwp.bwp.numPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.bwpStart = macCellCfg->initialUlBwp.bwp.firstPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.subCarrierSpacing = macCellCfg->initialUlBwp.bwp.scs;
+ ulTtiReqPdu->pdu.pucch_pdu.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix;
+ ulTtiReqPdu->pdu.pucch_pdu.formatType = currUlSlot->ulInfo.schPucchInfo.pucchFormat; /* Supporting PUCCH Format 0 */
+ ulTtiReqPdu->pdu.pucch_pdu.multiSlotTxIndicator = 0; /* No Multi Slot transmission */
+ ulTtiReqPdu->pdu.pucch_pdu.pi2Bpsk = 0; /* Disabled */
+ ulTtiReqPdu->pdu.pucch_pdu.prbStart = currUlSlot->ulInfo.schPucchInfo.fdAlloc.startPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.prbSize = currUlSlot->ulInfo.schPucchInfo.fdAlloc.numPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.startSymbolIndex = currUlSlot->ulInfo.schPucchInfo.tdAlloc.startSymb;
+ ulTtiReqPdu->pdu.pucch_pdu.nrOfSymbols = currUlSlot->ulInfo.schPucchInfo.tdAlloc.numSymb;
+ ulTtiReqPdu->pdu.pucch_pdu.freqHopFlag = 0; /* Disabled */
+ ulTtiReqPdu->pdu.pucch_pdu.secondHopPrb = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.groupHopFlag = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.sequenceHopFlag = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.hoppingId = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.initialCyclicShift = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.dataScramblingId = 0; /* Valid for Format 2, 3, 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.timeDomainOccIdx = 0; /* Valid for Format 1 */
+ ulTtiReqPdu->pdu.pucch_pdu.preDftOccIdx = 0; /* Valid for Format 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.preDftOccLen = 0; /* Valid for Format 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.addDmrsFlag = 0; /* Valid for Format 3, 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.dmrsScramblingId = 0; /* Valid for Format 2 */
+ ulTtiReqPdu->pdu.pucch_pdu.dmrsCyclicShift = 0; /* Valid for Format 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.srFlag = currUlSlot->ulInfo.schPucchInfo.srFlag;
+ ulTtiReqPdu->pdu.pucch_pdu.bitLenHarq = currUlSlot->ulInfo.schPucchInfo.numHarqBits;
+ ulTtiReqPdu->pdu.pucch_pdu.bitLenCsiPart1 = 0; /* Valid for Format 2, 3, 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.bitLenCsiPart2 = 0; /* Valid for Format 2, 3, 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.beamforming.numPrgs = 0; /* Not Supported */
+ ulTtiReqPdu->pdu.pucch_pdu.beamforming.prgSize = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.beamforming.digBfInterface = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.beamforming.rx_bfi[0].beamIdx[0].beamidx = 0;
+
+ ulTtiReqPdu->pduSize = sizeof(fapi_ul_pucch_pdu_t);
+ }
+}
+
+#endif
+
+/*******************************************************************
+ *
+ * @brief Sends UL TTI Request to PHY
+ *
+ * @details
+ *
+ * Function : fillUlTtiReq
+ *
+ * Functionality:
+ * -Sends FAPI Param req to PHY
+ *
+ * @params[in] Pointer to CmLteTimingInfo
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/
+uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo)
+{
+#ifdef INTEL_FAPI
+ uint16_t cellIdx;
+ uint8_t pduIdx = -1;
+ uint32_t msgLen = 0;
+ uint32_t msgSize = 0;
+
+ fapi_ul_tti_req_t *ulTtiReq = NULLP;
+ SlotIndInfo ulTtiReqTimingInfo;
+
+ MacUlSlot *currUlSlot = NULLP;
+ MacCellCfg macCellCfg;
+
+ if(lwrMacCb.phyState == PHY_STATE_RUNNING)
+ {
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
+ macCellCfg = macCb.macCell[cellIdx]->macCellCfg;
+
+ /* add PHY delta */
+ ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA);
+
+ currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOT_SUPPORTED];
+ msgSize = sizeof(fapi_ul_tti_req_t);
+ LWR_MAC_ALLOC(ulTtiReq, msgSize);
+
+ if(ulTtiReq != NULLP)
+ {
+ memset(ulTtiReq, 0, msgSize);
+ ulTtiReq->sfn = ulTtiReqTimingInfo.sfn;
+ ulTtiReq->slot = ulTtiReqTimingInfo.slot;
+ ulTtiReq->nPdus = getnPdus(ulTtiReq, currUlSlot);
+ ulTtiReq->nGroup = 0;
+ if(ulTtiReq->nPdus > 0)
+ {
+ /* Fill Prach Pdu */
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH)
+ {
+ pduIdx++;
+ fillPrachPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
+ }
+
+ /* Fill PUSCH PDU */
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH)
+ {
+ pduIdx++;
+ fillPuschPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
+ }
+ /* Fill PUCCH PDU */
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI)
+ {
+ pduIdx++;
+ fillPucchPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
+ }
+ }
+ msgLen = sizeof(fapi_ul_tti_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, msgLen);
+
+ DU_LOG("\nLWR_MAC: Sending UL TTI Request");
+ LwrMacSendToPhy(ulTtiReq->header.msg_id, msgSize, (void *)ulTtiReq);
+
+ memset(currUlSlot, 0, sizeof(MacUlSlot));
+ return ROK;
+ }
+ else
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for UL TTI Request");
+ memset(currUlSlot, 0, sizeof(MacUlSlot));
+ return RFAILED;
+ }
+ }
+ else
+ {
+ lwr_mac_procInvalidEvt(&currTimingInfo);
+ }
+#endif
+ return ROK;
+}
+
+#ifdef INTEL_FAPI
+/*******************************************************************
+ *
+ * @brief fills bsr Ul DCI PDU required for UL DCI Request to PHY
+ *
+ * @details
+ *
+ * Function : fillUlDciPdu
+ *
+ * Functionality:
+ * -Fills the Ul DCI PDU, spec Ref:38.212, Table 7.3.1-1
+ *
+ * @params[in] Pointer to fapi_dl_dci_t
+ * Pointer to DciInfo
+ * @return ROK
+ *
+ ******************************************************************/
+void fillUlDciPdu(fapi_dl_dci_t *ulDciPtr, DciInfo *schDciInfo)
+{
+ if(ulDciPtr != NULLP)
+ {
+ uint8_t numBytes;
+ uint8_t bytePos;
+ uint8_t bitPos;
+
+ uint8_t coreset1Size = 0;
+ uint16_t rbStart = 0;
+ uint16_t rbLen = 0;
+ uint8_t dciFormatId = 0;
+ uint32_t freqDomResAssign;
+ uint8_t timeDomResAssign;
+ uint8_t freqHopFlag;
+ uint8_t modNCodScheme;
+ uint8_t ndi;
+ uint8_t redundancyVer = 0;
+ uint8_t harqProcessNum = 0;
+ uint8_t puschTpc = 0;
+ uint8_t ul_SlInd = 0;
+
+ /* Size(in bits) of each field in DCI format 0_0 */
+ uint8_t dciFormatIdSize = 1;
+ uint8_t freqDomResAssignSize = 0;
+ uint8_t timeDomResAssignSize = 4;
+ uint8_t freqHopFlagSize = 1;
+ uint8_t modNCodSchemeSize = 5;
+ uint8_t ndiSize = 1;
+ uint8_t redundancyVerSize = 2;
+ uint8_t harqProcessNumSize = 4;
+ uint8_t puschTpcSize = 2;
+ uint8_t ul_SlIndSize = 1;
+
+ ulDciPtr->rnti = schDciInfo->dciInfo.rnti;
+ ulDciPtr->scramblingId = schDciInfo->dciInfo.scramblingId;
+ ulDciPtr->scramblingRnti = schDciInfo->dciInfo.scramblingRnti;
+ ulDciPtr->cceIndex = schDciInfo->dciInfo.cceIndex;
+ ulDciPtr->aggregationLevel = schDciInfo->dciInfo.aggregLevel;
+ ulDciPtr->pc_and_bform.numPrgs = schDciInfo->dciInfo.beamPdcchInfo.numPrgs;
+ ulDciPtr->pc_and_bform.prgSize = schDciInfo->dciInfo.beamPdcchInfo.prgSize;
+ ulDciPtr->pc_and_bform.digBfInterfaces = schDciInfo->dciInfo.beamPdcchInfo.digBfInterfaces;
+ ulDciPtr->pc_and_bform.pmi_bfi[0].pmIdx = schDciInfo->dciInfo.beamPdcchInfo.prg[0].pmIdx;
+ ulDciPtr->pc_and_bform.pmi_bfi[0].beamIdx[0].beamidx = schDciInfo->dciInfo.beamPdcchInfo.prg[0].beamIdx[0];
+ ulDciPtr->beta_pdcch_1_0 = schDciInfo->dciInfo.txPdcchPower.powerValue;
+ ulDciPtr->powerControlOfssetSS = schDciInfo->dciInfo.txPdcchPower.powerControlOffsetSS;
+
+ /* Calculating freq domain resource allocation field value and size
+ * coreset1Size = Size of coreset 1
+ * RBStart = Starting Virtual Rsource block
+ * RBLen = length of contiguously allocted RBs
+ * Spec 38.214 Sec 5.1.2.2.2
+ */
+ if(schDciInfo->formatType == FORMAT0_0)
+ {
+ coreset1Size = schDciInfo->coresetCfg.coreSetSize;
+ rbLen = schDciInfo->format.format0_0.freqAlloc.numPrb;
+ rbStart = schDciInfo->format.format0_0.freqAlloc.startPrb;
+
+ if((rbLen >=1) && (rbLen <= coreset1Size - rbStart))
+ {
+ if((rbLen - 1) <= floor(coreset1Size / 2))
+ freqDomResAssign = (coreset1Size * (rbLen-1)) + rbStart;
+ else
+ freqDomResAssign = (coreset1Size * (coreset1Size - rbLen + 1)) \
+ + (coreset1Size - 1 - rbStart);
+
+ freqDomResAssignSize = ceil(log2(coreset1Size * (coreset1Size + 1) / 2));
+ }
+ /* Fetching DCI field values */
+ dciFormatId = schDciInfo->formatType; /* DCI indentifier for UL DCI */
+ timeDomResAssign = schDciInfo->format.format0_0.rowIndex;
+ freqHopFlag = schDciInfo->format.format0_0.freqHopFlag;
+ modNCodScheme = schDciInfo->format.format0_0.mcs;
+ ndi = schDciInfo->format.format0_0.ndi;
+ redundancyVer = schDciInfo->format.format0_0.rv;
+ harqProcessNum = schDciInfo->format.format0_0.harqProcId;
+ puschTpc = schDciInfo->format.format0_0.tpcCmd;
+ ul_SlInd = schDciInfo->format.format0_0.sUlCfgd;
+
+ /* Reversing bits in each DCI field */
+ dciFormatId = reverseBits(dciFormatId, dciFormatIdSize);
+ freqDomResAssign = reverseBits(freqDomResAssign, freqDomResAssignSize);
+ timeDomResAssign = reverseBits(timeDomResAssign, timeDomResAssignSize);
+ modNCodScheme = reverseBits(modNCodScheme, modNCodSchemeSize);
+ redundancyVer = reverseBits(redundancyVer, redundancyVerSize);
+ harqProcessNum = reverseBits(harqProcessNum, harqProcessNumSize);
+ puschTpc = reverseBits(puschTpc, puschTpcSize);
+ ul_SlInd = reverseBits(ul_SlInd, ul_SlIndSize);
+ }
+ /* Calulating total number of bytes in buffer */
+ ulDciPtr->payloadSizeBits = (dciFormatIdSize + freqDomResAssignSize\
+ + timeDomResAssignSize + freqHopFlagSize + modNCodSchemeSize + ndi \
+ + redundancyVerSize + harqProcessNumSize + puschTpcSize + ul_SlIndSize);
+
+ numBytes = ulDciPtr->payloadSizeBits / 8;
+ if(ulDciPtr->payloadSizeBits % 8)
+ numBytes += 1;
+
+ if(numBytes > FAPI_DCI_PAYLOAD_BYTE_LEN)
+ {
+ DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
+ return;
+ }
+
+ /* Initialize buffer */
+ for(bytePos = 0; bytePos < numBytes; bytePos++)
+ ulDciPtr->payload[bytePos] = 0;
+
+ bytePos = numBytes - 1;
+ bitPos = 0;
+
+ /* Packing DCI format fields */
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ dciFormatId, dciFormatIdSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ freqDomResAssign, freqDomResAssignSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ timeDomResAssign, timeDomResAssignSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ freqHopFlag, freqHopFlagSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ modNCodScheme, modNCodSchemeSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ ndi, ndiSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ redundancyVer, redundancyVerSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ harqProcessNum, harqProcessNumSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ puschTpc, puschTpcSize);
+ fillDlDciPayload(ulDciPtr->payload, &bytePos, &bitPos,\
+ ul_SlInd, ul_SlIndSize);
+ }
+} /* fillUlDciPdu */
+
+/*******************************************************************
+ *
+ * @brief fills PDCCH PDU required for UL DCI REQ to PHY
+ *
+ * @details
+ *
+ * Function : fillUlDciPdcchPdu
+ *
+ * Functionality:
+ * -Fills the Pdcch PDU info
+ *
+ * @params[in] Pointer to FAPI DL TTI Req
+ * Pointer to PdcchCfg
+ * @return ROK
+ *
+ ******************************************************************/
+uint8_t fillUlDciPdcchPdu(fapi_dci_pdu_t *ulDciReqPdu, DlSchedInfo *dlInfo, uint8_t coreSetType)
+{
+ if(ulDciReqPdu != NULLP)
+ {
+ memset(&ulDciReqPdu->pdcchPduConfig, 0, sizeof(fapi_dl_pdcch_pdu_t));
+ fillUlDciPdu(ulDciReqPdu->pdcchPduConfig.dlDci, dlInfo->ulGrant);
+ ulDciReqPdu->pduType = PDCCH_PDU_TYPE;
+ ulDciReqPdu->pdcchPduConfig.bwpSize = dlInfo->ulGrant->bwpCfg.freqAlloc.numPrb;
+ ulDciReqPdu->pdcchPduConfig.bwpStart = dlInfo->ulGrant->bwpCfg.freqAlloc.startPrb;
+ ulDciReqPdu->pdcchPduConfig.subCarrierSpacing = dlInfo->ulGrant->bwpCfg.subcarrierSpacing;
+ ulDciReqPdu->pdcchPduConfig.cyclicPrefix = dlInfo->ulGrant->bwpCfg.cyclicPrefix;
+ ulDciReqPdu->pdcchPduConfig.startSymbolIndex = dlInfo->ulGrant->coresetCfg.startSymbolIndex;
+ ulDciReqPdu->pdcchPduConfig.durationSymbols = dlInfo->ulGrant->coresetCfg.durationSymbols;
+ memcpy(ulDciReqPdu->pdcchPduConfig.freqDomainResource, dlInfo->ulGrant->coresetCfg.freqDomainResource, 6);
+ ulDciReqPdu->pdcchPduConfig.cceRegMappingType = dlInfo->ulGrant->coresetCfg.cceRegMappingType;
+ ulDciReqPdu->pdcchPduConfig.regBundleSize = dlInfo->ulGrant->coresetCfg.regBundleSize;
+ ulDciReqPdu->pdcchPduConfig.interleaverSize = dlInfo->ulGrant->coresetCfg.interleaverSize;
+ ulDciReqPdu->pdcchPduConfig.coreSetSize = dlInfo->ulGrant->coresetCfg.coreSetType;
+ ulDciReqPdu->pdcchPduConfig.shiftIndex = dlInfo->ulGrant->coresetCfg.shiftIndex;
+ ulDciReqPdu->pdcchPduConfig.precoderGranularity = dlInfo->ulGrant->coresetCfg.precoderGranularity;
+ ulDciReqPdu->pdcchPduConfig.numDlDci = 1;
+ ulDciReqPdu->pdcchPduConfig.coreSetType = coreSetType;
+
+ /* Calculating PDU length. Considering only one Ul dci pdu for now */
+ ulDciReqPdu->pduSize = sizeof(fapi_dl_pdcch_pdu_t);
+ }
+ return ROK;
+}
+#endif
+/*******************************************************************
+ *
+ * @brief Sends UL DCI Request to PHY
+ *
+ * @details
+ *
+ * Function : fillUlDciReq
+ *
+ * Functionality:
+ * -Sends FAPI Ul Dci req to PHY
+ *
+ * @params[in] Pointer to CmLteTimingInfo
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ******************************************************************/
+uint16_t fillUlDciReq(SlotIndInfo currTimingInfo)
+{
+#ifdef INTEL_FAPI
+ uint8_t cellIdx;
+ uint8_t numPduEncoded = 0;
+ uint32_t msgLen = 0;
+ uint32_t msgSize = 0;
+
+ fapi_ul_dci_req_t *ulDciReq = NULLP;
+ SlotIndInfo ulDciReqTimingInfo;
+
+ MacDlSlot *currDlSlot = NULLP;
+
+ if(lwrMacCb.phyState == PHY_STATE_RUNNING)
+ {
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
+ memcpy(&ulDciReqTimingInfo, &currTimingInfo, sizeof(SlotIndInfo));
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[ulDciReqTimingInfo.slot % MAX_SLOT_SUPPORTED];
+
+ if(currDlSlot->dlInfo.ulGrant != NULLP)
+ {
+ msgSize = sizeof(fapi_ul_dci_req_t);
+ LWR_MAC_ALLOC(ulDciReq, msgSize);
+ if(ulDciReq != NULLP)
+ {
+ memset(ulDciReq, 0, msgSize);
+ ulDciReq->sfn = ulDciReqTimingInfo.sfn;
+ ulDciReq->slot = ulDciReqTimingInfo.slot;
+ ulDciReq->numPdus = 1; // No. of PDCCH PDUs
+ if(ulDciReq->numPdus > 0)
+ {
+ /* Fill PDCCH configuration Pdu */
+ fillUlDciPdcchPdu(&ulDciReq->pdus[numPduEncoded], &currDlSlot->dlInfo, CORESET_TYPE1);
+ numPduEncoded++;
+ /* free UL GRANT at SCH */
+ MAC_FREE(currDlSlot->dlInfo.ulGrant, sizeof(DciInfo));
+ currDlSlot->dlInfo.ulGrant = NULLP;
+ /* send UL DCI to PHY */
+ msgLen = sizeof(fapi_ul_dci_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&ulDciReq->header, FAPI_UL_DCI_REQUEST, msgLen);
+ LwrMacSendToPhy(ulDciReq->header.msg_id, sizeof(fapi_ul_dci_req_t), (void *)ulDciReq);
+ }
+
+ }
+ else
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for UL DCI Request");
+ memset(currDlSlot, 0, sizeof(MacDlSlot));
+ return RFAILED;
+ }
+ }
+ }
+ else
+ {
+ lwr_mac_procInvalidEvt(&currTimingInfo);
+ }
+#endif
+ return ROK;
+}
+
+lwrMacFsmHdlr fapiEvtHdlr[MAX_STATE][MAX_EVENT] =
+{
+ {
+ /* PHY_STATE_IDLE */
+ lwr_mac_procParamReqEvt,
+ lwr_mac_procParamRspEvt,
+ lwr_mac_procConfigReqEvt,
+ lwr_mac_procConfigRspEvt,
+ lwr_mac_procInvalidEvt,
+ lwr_mac_procInvalidEvt,
+ },
+ {
+ /* PHY_STATE_CONFIGURED */
+ lwr_mac_procParamReqEvt,
+ lwr_mac_procParamRspEvt,
+ lwr_mac_procConfigReqEvt,
+ lwr_mac_procConfigRspEvt,
+ lwr_mac_procStartReqEvt,
+ lwr_mac_procInvalidEvt,
+ },
+ {
+ /* PHY_STATE_RUNNING */
+ lwr_mac_procInvalidEvt,
+ lwr_mac_procInvalidEvt,
+ lwr_mac_procConfigReqEvt,
+ lwr_mac_procConfigRspEvt,
+ lwr_mac_procInvalidEvt,
+ lwr_mac_procStopReqEvt,
+ }
+};
+
+/*******************************************************************
+ *
+ * @brief Sends message to LWR_MAC Fsm Event Handler
+ *
+ * @details
+ *
+ * Function : sendToLowerMac
+ *
+ * Functionality:
+ * -Sends message to LowerMac