+/*******************************************************************
+ *
+ * @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(CmLteTimingInfo *currTimingInfo, DlAlloc *dlInfo)
+{
+#ifdef FAPI
+ uint8_t nPdu = 0;
+ uint32_t msgLen = 0;
+ uint16_t pduIndex = 0;
+ fapi_tx_data_req_t *txDataReq = NULLP;
+ Inst inst = 0;
+
+ /* send TX_Data request message */
+ nPdu = calcTxDataReqPduCount(dlInfo);
+ if(nPdu > 0)
+ {
+ LWR_MAC_ALLOC(txDataReq,sizeof(fapi_tx_data_req_t));
+ if(txDataReq == NULLP)
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for TX data Request");
+ return RFAILED;
+ }
+ txDataReq->sfn = currTimingInfo->sfn;
+ txDataReq->slot = currTimingInfo->slot;
+ LWR_MAC_ALLOC(txDataReq->pduDesc,nPdu*sizeof(fapi_tx_pdu_desc_t));
+ if(txDataReq->pduDesc == NULLP)
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for pduDesc TX data Request");
+ return RFAILED;
+ }
+
+ if(dlInfo->brdcstAlloc.sib1Trans)
+ {
+ fillSib1TxDataReq(txDataReq->pduDesc,
+ &rgCb[inst].cell->macCellCfg, &msgLen, pduIndex);
+ pduIndex++;
+ txDataReq->numPdus++;
+ }
+ if(dlInfo->isRarPres)
+ {
+ /* mux and form RAR pdu */
+ //fillRarPdu(&dlInfo->rarAlloc.rarInfo);
+ fillRarTxDataReq(txDataReq->pduDesc,
+ &dlInfo->rarAlloc.rarInfo, &msgLen, pduIndex);
+ pduIndex++;
+ txDataReq->numPdus++;
+ }
+
+ msgLen += sizeof(fapi_tx_data_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, msgLen);
+ LwrMacSendToPhy(txDataReq->header.message_type_id, msgLen,(void *)txDataReq);
+ }
+#endif
+ return ROK;
+}
+