wlan: Add code to pull firmware logs
The firmware logs should be pulled by host
after receiving an event in the mail box.
This patch adds the code to setup the transaction
to pull the logs and also adds code to push the
logs to the logger thread.
CRs-Fixed: 848291
Change-Id: Ib93eaee16504e8a79abd2b629cf21f288ffdc54a
diff --git a/CORE/DXE/inc/wlan_qct_dxe.h b/CORE/DXE/inc/wlan_qct_dxe.h
index b089ac9..6204aa5 100644
--- a/CORE/DXE/inc/wlan_qct_dxe.h
+++ b/CORE/DXE/inc/wlan_qct_dxe.h
@@ -83,6 +83,8 @@
* Size must be same with Vos Packet Size */
#define WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE (VPKT_SIZE_BUFFER)
+#define WLANDXE_H2H_HEADER_OFFSET (80)
+
/*The maximum number of packets that can be chained in dxe for the Low
priority channel
Note: Increased it to 240 from 128 for Windows(EA) becase Windows is
@@ -185,6 +187,8 @@
===========================================================================*/
typedef WDTS_MbReceiveMsgType WLANDXE_MbReceiveMsgCbType;
+typedef WDTS_RxLogDoneType WLANDXE_RxLogDoneType;
+
/*==========================================================================
@ Type Name
WLANDXE_SetPowerStateCbType
@@ -433,4 +437,14 @@
wpt_uint8 debugFlags
);
+wpt_uint32 WLANDXE_SetupLogTransfer
+(
+ wpt_uint64 bufferAddr,
+ wpt_uint32 bufferLen
+);
+
+wpt_status WLANDXE_StartLogTransfer
+(
+void
+);
#endif /* WLAN_QCT_DXE_H */
diff --git a/CORE/DXE/src/wlan_qct_dxe.c b/CORE/DXE/src/wlan_qct_dxe.c
index e9cbbe0..4e9f1b2 100644
--- a/CORE/DXE/src/wlan_qct_dxe.c
+++ b/CORE/DXE/src/wlan_qct_dxe.c
@@ -1885,6 +1885,10 @@
currentPalPacketBuffer->pBD = NULL;
currentPalPacketBuffer->pBDPhys = NULL;
currentPalPacketBuffer->BDLength = 0;
+
+ if (channelEntry->channelType == WDTS_CHANNEL_RX_FW_LOG)
+ wpalPacketRawTrimHead(currentCtrlBlock->xfrFrame, WLANDXE_H2H_HEADER_OFFSET);
+
status = wpalLockPacketForTransfer(currentPalPacketBuffer);
if(eWLAN_PAL_STATUS_SUCCESS != status)
@@ -2004,6 +2008,73 @@
return status;
}
+static wpt_uint32 dxeRXLogRefillRing
+(
+ WLANDXE_CtrlBlkType *dxeCtxt,
+ WLANDXE_ChannelCBType *channelEntry,
+ wpt_uint64 bufferAddr,
+ wpt_uint32 bufferLen
+)
+{
+ wpt_status status = eWLAN_PAL_STATUS_SUCCESS;
+ WLANDXE_DescCtrlBlkType *currentCtrlBlk = channelEntry->tailCtrlBlk;
+ WLANDXE_DescType *currentDesc = NULL;
+ wpt_uint32 xfrSize, allocatedLen = 0;
+
+ while(bufferLen > 0)
+ {
+ /* Current Control block is free
+ * and associated frame buffer is not linked with control block anymore
+ * allocate new frame buffer for current control block */
+ status = dxeRXFrameSingleBufferAlloc(dxeCtxt,
+ channelEntry,
+ currentCtrlBlk);
+
+ if((eWLAN_PAL_STATUS_SUCCESS != status))
+ {
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN,
+ "%s, out of RX buffer pool, break here",__func__);
+ break;
+ }
+
+ if(eWLAN_PAL_STATUS_E_EXISTS == status)
+ {
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
+ "%s, Descriptor Non-Empty",__func__);
+ }
+
+ currentDesc = currentCtrlBlk->linkedDesc;
+ currentDesc->descCtrl.ctrl = channelEntry->extraConfig.cw_ctrl_read;
+ xfrSize = WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE > bufferLen ?
+ bufferLen : WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE;
+ currentDesc->xfrSize = xfrSize;
+ allocatedLen += xfrSize;
+ bufferLen -= xfrSize;
+ wpalPacketSetRxLength(currentCtrlBlk->xfrFrame,
+ xfrSize);
+
+ currentDesc->dxedesc.dxe_short_desc.srcMemAddrL =
+ WLANDXE_U32_SWAP_ENDIAN((wpt_uint32)(uintptr_t)bufferAddr);
+
+ /* Issue a dummy read from the DXE descriptor DDR location to ensure
+ that any posted writes are reflected in memory before DXE looks at
+ the descriptor. */
+ if(channelEntry->extraConfig.cw_ctrl_read != currentDesc->descCtrl.ctrl)
+ {
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
+ "%s, Descriptor write failed",__func__);
+ ++channelEntry->desc_write_fail_count;
+ }
+
+ currentCtrlBlk = currentCtrlBlk->nextCtrlBlk;
+ --channelEntry->numFreeDesc;
+ bufferAddr += xfrSize;
+ }
+
+ channelEntry->tailCtrlBlk = currentCtrlBlk;
+
+ return allocatedLen;
+}
/*==========================================================================
@ Function Name
dxeRXFrameRouteUpperLayer
@@ -2068,7 +2139,8 @@
currentCtrlBlk->xfrFrame = NULL;
/* Now try to refill the ring with empty Rx buffers to keep DXE busy */
- dxeRXFrameRefillRing(dxeCtxt, channelEntry);
+ if (WDTS_CHANNEL_RX_FW_LOG != channelEntry->channelType)
+ dxeRXFrameRefillRing(dxeCtxt, channelEntry);
/* Test next contorl block
* if valid, this control block also has new RX frame must be handled */
@@ -2721,6 +2793,11 @@
status = dxeRXFrameReady(dxeCtxt,
channelCb,
chLogRxFwStat);
+ if (channelCb->numFreeDesc == channelCb->numDesc)
+ {
+ dxeCtxt->hostInitiatedH2H = 0;
+ dxeCtxt->receiveLogCompleteCB(dxeCtxt->clientCtxt);
+ }
}
}
@@ -4325,6 +4402,7 @@
dxeCtxt->txCompCB = WDTSCb.txCompleteCB;
dxeCtxt->lowResourceCB = WDTSCb.lowResourceCB;
dxeCtxt->receiveMbMsgCB = WDTSCb.receiveMbMsgCB;
+ dxeCtxt->receiveLogCompleteCB = WDTSCb.receiveLogCompleteCB;
dxeCtxt->clientCtxt = userContext;
HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO_LOW,
@@ -5324,3 +5402,42 @@
return;
}
+
+wpt_uint32 WLANDXE_SetupLogTransfer(wpt_uint64 bufferAddr, wpt_uint32 bufferLen)
+{
+ WLANDXE_ChannelCBType *channelEntry;
+
+ channelEntry = &tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_RX_FW_LOG];
+
+
+ return dxeRXLogRefillRing(tempDxeCtrlBlk, channelEntry, bufferAddr,
+ bufferLen);
+}
+
+wpt_status WLANDXE_StartLogTransfer(void)
+{
+ WLANDXE_ChannelCBType *channelEntry;
+ wpt_status status = eWLAN_PAL_STATUS_SUCCESS;
+
+ channelEntry = &tempDxeCtrlBlk->dxeChannel[WDTS_CHANNEL_RX_FW_LOG];
+
+ tempDxeCtrlBlk->hostInitiatedH2H = 1;
+ status = wpalWriteRegister(channelEntry->channelRegister.chDXEDesclRegAddr,
+ channelEntry->headCtrlBlk->linkedDescPhyAddr);
+ if(eWLAN_PAL_STATUS_SUCCESS != status)
+ {
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
+ "%s Write DESC Address register fail", __func__);
+ return status;
+ }
+
+ wpalWriteRegister(channelEntry->channelRegister.chDXECtrlRegAddr,
+ channelEntry->extraConfig.chan_mask);
+ if(eWLAN_PAL_STATUS_SUCCESS != status)
+ {
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
+ "dxeChannelInitProgram Write RX Control register fail");
+ return status;
+ }
+ return status;
+}
diff --git a/CORE/DXE/src/wlan_qct_dxe_cfg_i.c b/CORE/DXE/src/wlan_qct_dxe_cfg_i.c
index 29317e8..3e35183 100644
--- a/CORE/DXE/src/wlan_qct_dxe_cfg_i.c
+++ b/CORE/DXE/src/wlan_qct_dxe_cfg_i.c
@@ -621,8 +621,11 @@
dxeControlRead |= WLANDXE_DESC_CTRL_INT;
/* For ready status, this Control WORD must be VALID */
dxeControlRead |= WLANDXE_DESC_CTRL_VALID;
+
/* Frame Contents Swap */
- dxeControlRead |= WLANDXE_DESC_CTRL_BDT_SWAP;
+ if (WDTS_CHANNEL_RX_FW_LOG != channelEntry->channelType)
+ dxeControlRead |= WLANDXE_DESC_CTRL_BDT_SWAP;
+
/* Host Little Endian */
if((WDTS_CHANNEL_TX_LOW_PRI == channelEntry->channelType) ||
(WDTS_CHANNEL_TX_HIGH_PRI == channelEntry->channelType) ||
diff --git a/CORE/DXE/src/wlan_qct_dxe_i.h b/CORE/DXE/src/wlan_qct_dxe_i.h
index ddfa84d..259862f 100644
--- a/CORE/DXE/src/wlan_qct_dxe_i.h
+++ b/CORE/DXE/src/wlan_qct_dxe_i.h
@@ -678,6 +678,7 @@
WLANDXE_TxCompleteCbType txCompCB;
WLANDXE_LowResourceCbType lowResourceCB;
WLANDXE_MbReceiveMsgCbType receiveMbMsgCB;
+ WLANDXE_RxLogDoneType receiveLogCompleteCB;
WLANDXE_TxCompIntConfigType txCompInt;
void *clientCtxt;
wpt_uint32 interruptPath;
diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h
index 719dcc1..24ed5b8 100644
--- a/CORE/WDA/inc/wlan_qct_wda.h
+++ b/CORE/WDA/inc/wlan_qct_wda.h
@@ -2084,4 +2084,7 @@
===========================================================================*/
void WDA_SetEnableSSR(v_BOOL_t enableSSR);
+
+
+void WDA_FWLoggingDXEdoneInd(void);
#endif
diff --git a/CORE/WDA/src/wlan_qct_wda.c b/CORE/WDA/src/wlan_qct_wda.c
index 959c50b..4908a4c 100644
--- a/CORE/WDA/src/wlan_qct_wda.c
+++ b/CORE/WDA/src/wlan_qct_wda.c
@@ -17183,6 +17183,11 @@
return wdaStatus;
}
+void WDA_FWLoggingDXEdoneInd(void)
+{
+ WDI_FWLoggingDXEdoneInd(NULL);
+}
+
/* FUNCTION WDA_featureCapsExchange
* WDA API to invoke capability exchange between host and FW.
*/
diff --git a/CORE/WDA/src/wlan_qct_wda_ds.c b/CORE/WDA/src/wlan_qct_wda_ds.c
index f57b18c..efe54c6 100644
--- a/CORE/WDA/src/wlan_qct_wda_ds.c
+++ b/CORE/WDA/src/wlan_qct_wda_ds.c
@@ -139,6 +139,12 @@
}
#endif /*WLAN_PERF*/
+void WDA_DS_RxLogCallback(void)
+{
+ WDA_FWLoggingDXEdoneInd();
+ return;
+}
+
/*==========================================================================
FUNCTION WDA_DS_Register
@@ -235,6 +241,7 @@
(WDI_DS_TxCompleteCallback)WDA_DS_TxCompleteCB,
(WDI_DS_RxPacketCallback)pfnRxPacketCallback,
WDA_DS_TxFlowControlCallback,
+ WDA_DS_RxLogCallback,
pvosGCtx );
if ( WDI_STATUS_SUCCESS != wdiStatus )
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi.h b/CORE/WDI/CP/inc/wlan_qct_wdi.h
index 1df38c6..de38c88 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi.h
@@ -11514,6 +11514,11 @@
wpt_uint32 rtsCtsVal
);
+WDI_Status
+WDI_FWLoggingDXEdoneInd
+(
+ WDI_FWLoggingDXEdoneIndInfoType* pwdiFWLoggingDXEdoneInd
+);
#ifdef __cplusplus
}
diff --git a/CORE/WDI/CP/src/wlan_qct_wdi.c b/CORE/WDI/CP/src/wlan_qct_wdi.c
index cd25d64..7fb1aac 100644
--- a/CORE/WDI/CP/src/wlan_qct_wdi.c
+++ b/CORE/WDI/CP/src/wlan_qct_wdi.c
@@ -34482,8 +34482,8 @@
wpt_uint8* pSendBuffer = NULL;
wpt_uint16 usDataOffset = 0;
wpt_uint16 usSendSize = 0;
- WDI_FWLoggingDXEdoneIndInfoType *pwdiFWLoggingDXEdoneInd;
tFWLoggingDxeDoneInd *FWLoggingDxeDoneIndParams;
+ WDI_DS_LoggingSessionType *pLoggingSession;
WDI_Status wdiStatus = WDI_STATUS_SUCCESS;
@@ -34495,24 +34495,25 @@
/*-------------------------------------------------------------------------
Sanity check
-------------------------------------------------------------------------*/
- if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ))
+ if (NULL == pEventData)
{
WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
"%s: Invalid parameters", __func__);
WDI_ASSERT(0);
return WDI_STATUS_E_FAILURE;
}
- pwdiFWLoggingDXEdoneInd =
- (WDI_FWLoggingDXEdoneIndInfoType*)pEventData->pEventData;
+ pLoggingSession = (WDI_DS_LoggingSessionType *)
+ WDI_DS_GetLoggingSession(WDI_DS_GetDatapathContext(
+ (void *)pWDICtx));
/*-----------------------------------------------------------------------
Get message buffer
-----------------------------------------------------------------------*/
if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
WDI_FW_LOGGING_DXE_DONE_IND,
- sizeof(tHalRtsCtsHtvhtIndParams),
+ sizeof(tFWLoggingDxeDoneInd),
&pSendBuffer, &usDataOffset, &usSendSize))||
- ( usSendSize < (usDataOffset + sizeof(tHalRtsCtsHtvhtIndParams) )))
+ ( usSendSize < (usDataOffset + sizeof(tFWLoggingDxeDoneInd) )))
{
WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL,
"Unable to get send buffer in RTS CTS ind %p ",
@@ -34524,11 +34525,13 @@
(tFWLoggingDxeDoneInd*)(pSendBuffer + usDataOffset);
wpalMemoryCopy(&FWLoggingDxeDoneIndParams->logBuffAddress,
- &pwdiFWLoggingDXEdoneInd->logBuffAddress, MAX_NUM_OF_BUFFER *
+ &pLoggingSession->logBuffAddress, MAX_NUM_OF_BUFFER *
sizeof(FWLoggingDxeDoneIndParams->logBuffAddress[0]));
- FWLoggingDxeDoneIndParams->status= pwdiFWLoggingDXEdoneInd->status;
+
+ FWLoggingDxeDoneIndParams->status = eHAL_STATUS_SUCCESS;
+
wpalMemoryCopy(&FWLoggingDxeDoneIndParams->logBuffLength,
- &pwdiFWLoggingDXEdoneInd->logBuffLength, MAX_NUM_OF_BUFFER *
+ &pLoggingSession->logBuffLength, MAX_NUM_OF_BUFFER *
sizeof(FWLoggingDxeDoneIndParams->logBuffLength[0]));
pWDICtx->pReqStatusUserData = NULL;
@@ -34612,6 +34615,10 @@
wdiFWLoggingInitReq->minLogBufferSize;
halFWLoggingInitReq.tFWLoggingInitReqParams.maxLogBuffSize=
wdiFWLoggingInitReq->maxLogBufferSize;
+ halFWLoggingInitReq.tFWLoggingInitReqParams.logMailBoxAddr=
+ (tANI_U64)(uintptr_t)(WDI_DS_GetLoggingMbPhyAddr(pWDICtx));
+ halFWLoggingInitReq.tFWLoggingInitReqParams.logMailBoxVer=
+ MAILBOX_VERSION_V1;
wdiFWLoggingInitRspCb = (WDI_FWLoggingInitRspCb)pEventData->pCBfnc;
diff --git a/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h b/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h
index ad82476..2cc9f56 100644
--- a/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h
+++ b/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h
@@ -184,6 +184,13 @@
} u;
} WDI_DS_MetaInfoType;
+typedef struct
+{
+ wpt_boolean active;
+ wpt_uint64 logBuffAddress[MAX_NUM_OF_BUFFER];
+ wpt_uint32 logBuffLength[MAX_NUM_OF_BUFFER];
+} WDI_DS_LoggingSessionType;
+
WPT_STATIC WPT_INLINE WDI_DS_RxMetaInfoType* WDI_DS_ExtractRxMetaData (wpt_packet *pFrame)
{
WDI_DS_RxMetaInfoType * pRxMetadata =
@@ -203,6 +210,7 @@
typedef void (*WDI_DS_TxCompleteCallback)(void *pContext, wpt_packet *pFrame);
typedef void (*WDI_DS_RxPacketCallback) (void *pContext, wpt_packet *pFrame);
typedef void (*WDI_DS_TxFlowControlCallback)(void *pContext, wpt_uint8 ac_mask);
+typedef void (*WDI_DS_RxLogCallback)(void);
@@ -225,6 +233,7 @@
WDI_DS_TxCompleteCallback pfnTxCompleteCallback,
WDI_DS_RxPacketCallback pfnRxPacketCallback,
WDI_DS_TxFlowControlCallback pfnTxFlowControlCallback,
+ WDI_DS_RxLogCallback pfnRxLogCallback,
void *pCallbackContext);
@@ -371,4 +380,6 @@
void WDI_DS_ClearTrafficStats(void);
void *WDI_DS_GetLoggingMbPhyAddr(void *pContext);
+void *WDI_DS_GetLoggingMbAddr(void *pContext);
+void *WDI_DS_GetLoggingSession(void *pContext);
#endif
diff --git a/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h b/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h
index 9e5a4b3..3a5f53d 100644
--- a/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h
+++ b/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h
@@ -47,7 +47,7 @@
#include "wlan_qct_pal_trace.h"
#include "wlan_qct_wdi_ds.h"
#include "wlan_qct_dxe.h"
-
+#include "wlan_hal_msg.h"
#define WDI_DS_MAX_CHUNK_SIZE 128
#define WDI_802_11_MAX_HEADER_LEN 40
@@ -149,6 +149,7 @@
{
void * pLoggingMbVirtAddress;
void * pLoggingMbPhysAddress;
+ WDI_DS_LoggingSessionType loggingSession;
} WDI_DS_LoggingMbType;
WDI_Status WDI_DS_MemPoolCreate(WDI_DS_BdMemPoolType *memPool, wpt_uint8 chunkSize, wpt_uint8 numChunks);
@@ -169,6 +170,7 @@
WDI_DS_RxPacketCallback receiveFrameCB;
WDI_DS_TxCompleteCallback txCompleteCB;
WDI_DS_TxFlowControlCallback txResourceCB;
+ WDI_DS_RxLogCallback rxLogCB;
WDI_DS_staIdxPerBssIdxType staIdxPerBssIdxTable[WDI_DS_MAX_SUPPORTED_BSS];
WDI_DS_LoggingMbType loggingMbContext;
} WDI_DS_ClientDataType;
diff --git a/CORE/WDI/DP/src/wlan_qct_wdi_bd.c b/CORE/WDI/DP/src/wlan_qct_wdi_bd.c
index ac0817c..b29efa7 100644
--- a/CORE/WDI/DP/src/wlan_qct_wdi_bd.c
+++ b/CORE/WDI/DP/src/wlan_qct_wdi_bd.c
@@ -208,6 +208,20 @@
return pClientData->loggingMbContext.pLoggingMbPhysAddress;
}
+void *WDI_DS_GetLoggingMbAddr(void *pContext)
+{
+ WDI_DS_ClientDataType *pClientData = pContext;
+
+ return pClientData->loggingMbContext.pLoggingMbVirtAddress;
+}
+
+void*WDI_DS_GetLoggingSession(void *pContext)
+{
+ WDI_DS_ClientDataType *pClientData = pContext;
+
+ return &pClientData->loggingMbContext.loggingSession;
+}
+
void WDI_DS_LoggingMbDestroy(WDI_DS_LoggingMbType *pLoggingMailbox)
{
wpalDmaMemoryFree(pLoggingMailbox->pLoggingMbVirtAddress);
diff --git a/CORE/WDI/DP/src/wlan_qct_wdi_ds.c b/CORE/WDI/DP/src/wlan_qct_wdi_ds.c
index 1865ee3..902c0de 100644
--- a/CORE/WDI/DP/src/wlan_qct_wdi_ds.c
+++ b/CORE/WDI/DP/src/wlan_qct_wdi_ds.c
@@ -69,6 +69,7 @@
WDI_DS_TxCompleteCallback pfnTxCompleteCallback,
WDI_DS_RxPacketCallback pfnRxPacketCallback,
WDI_DS_TxFlowControlCallback pfnTxFlowControlCallback,
+ WDI_DS_RxLogCallback pfnRxLogCallback,
void *pCallbackContext)
{
WDI_DS_ClientDataType *pClientData;
@@ -94,6 +95,7 @@
pClientData->receiveFrameCB = pfnRxPacketCallback;
pClientData->txCompleteCB = pfnTxCompleteCallback;
pClientData->txResourceCB = pfnTxFlowControlCallback;
+ pClientData->rxLogCB = pfnRxLogCallback;
pClientData->pCallbackContext = pCallbackContext;
for(bssLoop = 0; bssLoop < WDI_DS_MAX_SUPPORTED_BSS; bssLoop++)
diff --git a/CORE/WDI/TRP/DTS/inc/wlan_qct_wdi_dts.h b/CORE/WDI/TRP/DTS/inc/wlan_qct_wdi_dts.h
index c80af3d..2eccf5c 100644
--- a/CORE/WDI/TRP/DTS/inc/wlan_qct_wdi_dts.h
+++ b/CORE/WDI/TRP/DTS/inc/wlan_qct_wdi_dts.h
@@ -99,6 +99,7 @@
typedef wpt_status (*WDTS_LowResourceCbType)(void *pContext, WDTS_ChannelType channel, wpt_boolean on);
typedef void (*WDTS_SetPSCbType)(wpt_status status, unsigned int dxePhyAddr);
typedef void (*WDTS_MbReceiveMsgType)(void *pContext);
+typedef void (*WDTS_RxLogDoneType)(void *pContext);
/* DTS Set power state ACK callback.
* This callback function should be invoked by the DTS to notify WDI that set
@@ -118,6 +119,7 @@
WDTS_TxCompleteCbType txCompleteCB;
WDTS_LowResourceCbType lowResourceCB;
WDTS_MbReceiveMsgType receiveMbMsgCB;
+ WDTS_RxLogDoneType receiveLogCompleteCB;
}WDTS_ClientCallbacks;
typedef struct {
@@ -133,6 +135,8 @@
wpt_status (*stop) (void *pContext);
wpt_status (*close) (void *pContext);
wpt_uint32 (*getFreeTxDataResNumber) (void *pContext);
+ wpt_uint32 (*setupLogTransfer) (wpt_uint64 bufferAddr, wpt_uint32 bufferSize);
+ wpt_status (*startLogTransfer) (void);
} WDTS_TransportDriverTrype;
typedef struct {
diff --git a/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c b/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
index e823c5b..fc487ba 100644
--- a/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
+++ b/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
@@ -58,7 +58,9 @@
WLANDXE_ChannelDebug,
WLANDXE_Stop,
WLANDXE_Close,
- WLANDXE_GetFreeTxDataResNumber
+ WLANDXE_GetFreeTxDataResNumber,
+ WLANDXE_SetupLogTransfer,
+ WLANDXE_StartLogTransfer
};
static WDTS_SetPowerStateCbInfoType gSetPowerStateCbInfo;
@@ -539,6 +541,14 @@
return eWLAN_PAL_STATUS_E_FAILURE;
}
+ // Normal DMA transfer does not contain RxBD
+ if (WDTS_CHANNEL_RX_FW_LOG == channel)
+ {
+ wpalFwLogPktSerialize(pFrame);
+
+ return eWLAN_PAL_STATUS_SUCCESS;
+ }
+
/*------------------------------------------------------------------------
Extract BD header and check if valid
------------------------------------------------------------------------*/
@@ -837,6 +847,56 @@
void WDTS_MbReceiveMsg(void *pContext)
{
+ tpLoggingMailBox pLoggingMb;
+ WDI_DS_LoggingSessionType *pLoggingSession;
+ wpt_int8 i, noMem = 0;
+ wpt_uint32 totalLen = 0;
+
+ pLoggingMb = (tpLoggingMailBox)WDI_DS_GetLoggingMbAddr(pContext);
+ pLoggingSession = (WDI_DS_LoggingSessionType *)
+ WDI_DS_GetLoggingSession(pContext);
+
+ for(i = 0; i < MAX_NUM_OF_BUFFER; i++)
+ {
+ pLoggingSession->logBuffAddress[i] = pLoggingMb->logBuffAddress[i];
+ if (!noMem)
+ {
+ pLoggingSession->logBuffLength[i] = gTransportDriver.setupLogTransfer(
+ pLoggingMb->logBuffAddress[i],
+ pLoggingMb->logBuffLength[i]);
+ }
+ else
+ {
+ pLoggingSession->logBuffLength[i] = 0;
+ continue;
+ }
+
+ totalLen += pLoggingSession->logBuffLength[i];
+
+ if (pLoggingSession->logBuffLength[i] < pLoggingMb->logBuffLength[i])
+ {
+ noMem = 1;
+ }
+ }
+
+ if (totalLen)
+ {
+ if (gTransportDriver.startLogTransfer() == eWLAN_PAL_STATUS_SUCCESS)
+ return;
+ }
+
+ // Send Done event to upper layers, since we wont be getting any from DXE
+}
+
+void WDTS_LogRxDone(void *pContext)
+{
+ if (NULL == pContext)
+ {
+ return;
+ }
+
+ ((WDI_DS_ClientDataType *)(pContext))->rxLogCB();
+
return;
}
@@ -877,6 +937,7 @@
WDTSCb.txCompleteCB = WDTS_TxPacketComplete;
WDTSCb.lowResourceCB = WDTS_OOResourceNotification;
WDTSCb.receiveMbMsgCB = WDTS_MbReceiveMsg;
+ WDTSCb.receiveLogCompleteCB = WDTS_LogRxDone;
gTransportDriver.register_client(pDTDriverContext, WDTSCb, (void*)pClientData);
/* Create a memory pool for Mgmt BDheaders.*/
diff --git a/CORE/WDI/WPAL/inc/wlan_qct_pal_packet.h b/CORE/WDI/WPAL/inc/wlan_qct_pal_packet.h
index 52408f9..49287a9 100644
--- a/CORE/WDI/WPAL/inc/wlan_qct_pal_packet.h
+++ b/CORE/WDI/WPAL/inc/wlan_qct_pal_packet.h
@@ -429,4 +429,23 @@
(
wpt_packet *pFrame
);
+
+
+/*---------------------------------------------------------------------------
+ wpalFwLogPktSerialize - Serialize Logging data to logger thread
+
+ Param:
+ wpt_packet pFrame - The packet which contains the logging data.
+ This packet has to be a VALID packet, as this
+ API will not do any checks on the validity of
+ the packet.
+
+ Return:
+ NONE
+
+---------------------------------------------------------------------------*/
+void wpalFwLogPktSerialize
+(
+ wpt_packet *pFrame
+);
#endif // __WLAN_QCT_PAL_PACKET_H
diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c b/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c
index 43c4769..b35e550 100644
--- a/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c
+++ b/CORE/WDI/WPAL/src/wlan_qct_pal_packet.c
@@ -1014,3 +1014,24 @@
vos_pkt_return_packet(WPAL_TO_VOS_PKT(pFrame));
}
}
+
+/*---------------------------------------------------------------------------
+ wpalFwLogPktSerialize - Serialize Logging data to logger thread
+
+ Param:
+ wpt_packet pFrame - The packet which contains the logging data.
+ This packet has to be a VALID packet, as this
+ API will not do any checks on the validity of
+ the packet.
+
+ Return:
+ NONE
+
+---------------------------------------------------------------------------*/
+void wpalFwLogPktSerialize
+(
+ wpt_packet *pFrame
+)
+{
+ vos_logger_pkt_serialize(WPAL_TO_VOS_PKT(pFrame),LOG_PKT_TYPE_FW_LOG);
+}