#include "mac_sch_interface.h"
#include "lwr_mac_upr_inf.h"
#include "mac.h"
-#include "lwr_mac_phy.h"
#include "lwr_mac_fsm.h"
+#include "lwr_mac_phy.h"
#include "mac_utils.h"
#include "lwr_mac_utils.h"
+#include "lwr_mac.h"
#ifdef INTEL_FAPI
#include "fapi.h"
#include "fapi_vendor_extension.h"
Pst pst;
Buffer *mBuf;
- DU_LOG("\nLWR MAC: Requesting to start WLS receiver thread");
+ DU_LOG("\nINFO --> LWR MAC : Requesting to start WLS receiver thread");
/* Filling post */
memset(&pst, 0, sizeof(Pst));
if (ODU_GET_MSG_BUF(pst.region, pst.pool, &mBuf) != ROK)
{
- DU_LOG("\nLWR MAC : Memory allocation failed for LwrMacStartWlsRcvr");
+ DU_LOG("\nERROR --> LWR MAC : Memory allocation failed for LwrMacStartWlsRcvr");
return;
}
* ****************************************************************/
void addWlsBlockToFree(void *msg, uint32_t msgLen, uint8_t idx)
{
- CmLList *node;
- WlsBlockToFree *block;
+ CmLList *node = NULLP;
+ WlsBlockToFree *block = NULLP;
MAC_ALLOC(block, sizeof(WlsBlockToFree));
if(block)
{
uint16_t msgType;
uint16_t flag = 0;
p_fapi_api_queue_elem_t currElem = NULLP;
- struct timeval time;
mtGetWlsHdl(&wlsHdlr);
if(WLS_Ready(wlsHdlr) == 0)
continue;
}
- printf("\nLWR_MAC: numMsgToGet %d", numMsgToGet);
+ DU_LOG("\nDEBUG --> LWR_MAC : numMsgToGet %d", numMsgToGet);
while(numMsgToGet--)
{
currElem = NULLP;
#endif /* INTEL_WLS_MEM */
-/*******************************************************************
- *
- * @brief Sends message to PHY Stub
- *
- * @details
- *
- * Function : LwrMacSendToPhy
- * Functionality:
- * -Sends message to PHY Stub
- * -Once super header and vendor specific message is
- * implemented for all FAPI messages, this function
- * can be deleted. LwrMacSendToFapi() should be used.
- *
- * @params[in] Message Type
- * Message Length
- * Messaga Pointer
- *
- * @return void
- *
- * *****************************************************************/
-
-uint8_t LwrMacSendToPhy(uint8_t msgType, uint32_t msgLen, void *msg)
-{
- l1ProcessFapiRequest(msgType, msgLen, msg);
- return ROK;
-} /* LwrMacSendToPhy */
-
-
/*******************************************************************
*
* @brief Send FAPI messages to Intel PHY/Phy stub
*
* @details
*
- * Function : LwrMacSendToFapi
+ * Function : LwrMacSendToL1
*
* Functionality: Send FAPI messages to Intel PHY/Phy stub
*
* RFAILED - failure
*
* ****************************************************************/
-uint8_t LwrMacSendToFapi(void *msg)
+uint8_t LwrMacSendToL1(void *msg)
{
uint8_t ret = ROK;
#ifdef INTEL_FAPI
- uint16_t msgLen;
+ uint16_t msgLen =0;
p_fapi_api_queue_elem_t currMsg = NULLP;
#ifdef INTEL_WLS_MEM
{
currMsg = (p_fapi_api_queue_elem_t)msg;
msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
- addWlsBlockToFree(currMsg, msgLen, (slotIndIdx-1));
+ addWlsBlockToFree(currMsg, msgLen, (lwrMacCb.phySlotIndCntr-1));
if(currMsg->p_next == NULLP)
{
- DU_LOG("\nThere cannot be only one block to send");
+ DU_LOG("\nERROR --> LWR MAC : There cannot be only one block to send");
return RFAILED;
}
ret = WLS_Put(wlsHdlr, WLS_VA2PA(wlsHdlr, currMsg), msgLen, currMsg->msg_type, WLS_SG_FIRST);
if(ret != 0)
{
- DU_LOG("\nFailure in sending message to PHY");
+ DU_LOG("\nERROR --> LWR MAC : Failure in sending message to PHY");
return RFAILED;
}
currMsg = currMsg->p_next;
{
/* Sending the next msg */
msgLen = currMsg->msg_len + sizeof(fapi_api_queue_elem_t);
- addWlsBlockToFree(currMsg, msgLen, (slotIndIdx-1));
+ 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("\nFailure in sending message to PHY");
+ DU_LOG("\nERROR --> LWR MAC : Failure in sending message to PHY");
return RFAILED;
}
currMsg = currMsg->p_next;
ret = WLS_Put(wlsHdlr, WLS_VA2PA(wlsHdlr, currMsg), msgLen, currMsg->msg_type, WLS_SG_LAST);
if(ret != 0)
{
- DU_LOG("\nFailure in sending message to PHY");
+ DU_LOG("\nERROR --> LWR MAC : Failure in sending message to PHY");
return RFAILED;
}
currMsg = NULLP;
}
else
{
- MAC_FREE(currMsg, msgLen);
+ LWR_MAC_FREE(currMsg, msgLen);
}
currMsg = nextMsg;
}