+#endif /* INTEL_WLS_MEM */
+
+/*******************************************************************
+ *
+ * @brief Send FAPI messages to Intel PHY/Phy stub
+ *
+ * @details
+ *
+ * Function : LwrMacSendToL1
+ *
+ * Functionality: Send FAPI messages to Intel PHY/Phy stub
+ *
+ * @params[in] Message pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t LwrMacSendToL1(void *msg)
+{
+ uint8_t ret = ROK;
+#ifdef INTEL_FAPI
+ uint16_t msgLen =0;
+ p_fapi_api_queue_elem_t currMsg = NULLP;
+
+#ifdef CALL_FLOW_DEBUG_LOG
+ char message[100];
+
+ currMsg = (p_fapi_api_queue_elem_t)msg;
+ while(currMsg)
+ {
+ switch(currMsg->msg_type)
+ {
+ case FAPI_PARAM_REQUEST:
+ strcpy(message, "FAPI_PARAM_REQUEST");
+ break;
+ case FAPI_CONFIG_REQUEST:
+ strcpy(message, "FAPI_CONFIG_REQUEST");
+ break;
+ case FAPI_START_REQUEST:
+ strcpy(message, "FAPI_START_REQUEST");
+ break;
+ case FAPI_DL_TTI_REQUEST:
+ strcpy(message, "FAPI_DL_TTI_REQUEST");
+ break;
+ case FAPI_TX_DATA_REQUEST:
+ strcpy(message, "FAPI_TX_DATA_REQUEST");
+ break;
+ case FAPI_UL_TTI_REQUEST:
+ strcpy(message, "FAPI_UL_TTI_REQUEST");
+ break;
+ case FAPI_STOP_REQUEST:
+ strcpy(message, "FAPI_STOP_REQUEST");
+ break;
+ case FAPI_UL_DCI_REQUEST:
+ strcpy(message, "FAPI_UL_DCI_REQUEST");
+ break;
+ default:
+ strcpy(message, "INVALID_MSG");
+ break;
+ }
+ DU_LOG("\nCall Flow: ENTLWRMAC -> PHY : %s\n",message);
+ currMsg = currMsg->p_next;
+ }
+#endif
+
+
+#ifdef INTEL_WLS_MEM
+ void * wlsHdlr = NULLP;
+
+ mtGetWlsHdl(&wlsHdlr);
+ if(msg)
+ {
+ currMsg = (p_fapi_api_queue_elem_t)msg;
+ msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
+ addWlsBlockToFree(currMsg, msgLen, (lwrMacCb.phySlotIndCntr-1));
+ if(currMsg->p_next == NULLP)
+ {
+ DU_LOG("\nERROR --> LWR MAC : There cannot be only one block to send");
+ return RFAILED;
+ }
+
+ /* Sending first block */
+ ret = WLS_Put(wlsHdlr, WLS_VA2PA(wlsHdlr, currMsg), msgLen, currMsg->msg_type, WLS_SG_FIRST);
+ if(ret != 0)
+ {
+ DU_LOG("\nERROR --> LWR MAC : Failure in sending message to PHY");
+ return RFAILED;
+ }
+ currMsg = currMsg->p_next;
+
+ while(currMsg)
+ {
+ /* Sending the next msg */
+ msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
+ addWlsBlockToFree(currMsg, msgLen, (lwrMacCb.phySlotIndCntr-1));
+ if(currMsg->p_next != NULLP)
+ {
+ ret = WLS_Put(wlsHdlr, WLS_VA2PA(wlsHdlr, currMsg), msgLen, currMsg->msg_type, WLS_SG_NEXT);
+ if(ret != 0)
+ {
+ DU_LOG("\nERROR --> LWR MAC : Failure in sending message to PHY");
+ return RFAILED;
+ }
+ currMsg = currMsg->p_next;
+ }
+ else
+ {
+ /* Sending last msg */
+ ret = WLS_Put(wlsHdlr, WLS_VA2PA(wlsHdlr, currMsg), msgLen, currMsg->msg_type, WLS_SG_LAST);
+ if(ret != 0)
+ {
+ DU_LOG("\nERROR --> LWR MAC : Failure in sending message to PHY");
+ return RFAILED;
+ }
+ currMsg = NULLP;
+ }
+ }
+ }
+#else
+ p_fapi_api_queue_elem_t nextMsg = NULLP;
+
+ /* FAPI header and vendor specific msgs are freed here. Only
+ * the main FAPI messages are sent to phy stub */
+ currMsg = (p_fapi_api_queue_elem_t)msg;
+ while(currMsg)
+ {
+ nextMsg = currMsg->p_next;
+ msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
+ if((currMsg->msg_type != FAPI_VENDOR_MSG_HEADER_IND) && \
+ (currMsg->msg_type != FAPI_VENDOR_MESSAGE))
+ {
+ l1ProcessFapiRequest(currMsg->msg_type, msgLen, currMsg);
+ }
+ else
+ {
+ LWR_MAC_FREE(currMsg, msgLen);
+ }
+ currMsg = nextMsg;
+ }
+#endif