//--------------------------------------------------------------------------- // // Function: EplNmtkCalGetNmtState // // Description: return current NMT-State // -> encapsulate access to kernelspace // // // // Parameters: // // // Returns: tEplNmtState = current NMT-State // // // State: // //--------------------------------------------------------------------------- tEplNmtState EplNmtkCalGetNmtState(void) { tEplNmtState NmtState; // for test direkt call for EplNmtkGetNmtState() #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMTK)) != 0) NmtState = EplNmtkGetNmtState(); #else NmtState = 0; #endif return NmtState; }
//--------------------------------------------------------------------------- // // Function: EplNmtuGetNmtState // // Description: returns the actuell NMT-State // // // // Parameters: // // // Returns: tEplNmtState = NMT-State // // // State: // //--------------------------------------------------------------------------- EPLDLLEXPORT tEplNmtState PUBLIC EplNmtuGetNmtState() { tEplNmtState NmtState; // $$$ call function of communication abstraction layer #if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMTK)) != 0) NmtState = EplNmtkGetNmtState(); #else NmtState = 0; #endif return NmtState; }
static int EplLinProcRead(char *pcBuffer_p, char **ppcStart_p, off_t Offset_p, int nBufferSize_p, int *pEof_p, void *pData_p) { int nSize; int Eof; tEplDllkCalStatistics *pDllkCalStats; nSize = 0; Eof = 0; // count calls of this function #ifdef _DBG_TRACE_POINTS_ TgtDbgSignalTracePoint(0); #endif //--------------------------------------------------------------- // generate static information //--------------------------------------------------------------- // ---- Driver information ---- nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "%s %s (c) 2006 %s\n", EPL_PRODUCT_NAME, EPL_PRODUCT_VERSION, EPL_PRODUCT_MANUFACTURER); //--------------------------------------------------------------- // generate process information //--------------------------------------------------------------- // ---- EPL state ---- nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "NMT state: 0x%04X\n", (WORD) EplNmtkGetNmtState()); EplDllkCalGetStatistics(&pDllkCalStats); nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "CurAsyncTxGen=%lu CurAsyncTxNmt=%lu CurAsyncRx=%lu\nMaxAsyncTxGen=%lu MaxAsyncTxNmt=%lu MaxAsyncRx=%lu\n", pDllkCalStats->m_ulCurTxFrameCountGen, pDllkCalStats->m_ulCurTxFrameCountNmt, pDllkCalStats->m_ulCurRxFrameCount, pDllkCalStats->m_ulMaxTxFrameCountGen, pDllkCalStats->m_ulMaxTxFrameCountNmt, pDllkCalStats->m_ulMaxRxFrameCount); #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_NMT_MN)) != 0) // fetch running IdentRequests nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "running IdentRequests: 0x%08lX\n", EplIdentuGetRunningRequests()); // fetch state of NmtMnu module { unsigned int uiMandatorySlaveCount; unsigned int uiSignalSlaveCount; WORD wFlags; EplNmtMnuGetDiagnosticInfo(&uiMandatorySlaveCount, &uiSignalSlaveCount, &wFlags); nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "MN MandSlaveCount: %u SigSlaveCount: %u Flags: 0x%X\n", uiMandatorySlaveCount, uiSignalSlaveCount, wFlags); } #endif // ---- FEC state ---- #ifdef CONFIG_COLDFIRE { // Receive the base address unsigned long base_addr; #if (EDRV_USED_ETH_CTRL == 0) // Set the base address of FEC0 base_addr = FEC_BASE_ADDR_FEC0; #else // Set the base address of FEC1 base_addr = FEC_BASE_ADDR_FEC1; #endif nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "FEC_ECR = 0x%08X FEC_EIR = 0x%08X FEC_EIMR = 0x%08X\nFEC_TCR = 0x%08X FECTFSR = 0x%08X FECRFSR = 0x%08X\n", FEC_ECR(base_addr), FEC_EIR(base_addr), FEC_EIMR(base_addr), FEC_TCR(base_addr), FEC_FECTFSR(base_addr), FEC_FECRFSR(base_addr)); } #endif // ---- DBG: TracePoints ---- #ifdef _DBG_TRACE_POINTS_ { int nNum; nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "DbgTracePoints:\n"); for (nNum = 0; nNum < (sizeof(aatmDbgTracePoint_l) / sizeof(atomic_t)); nNum++) { nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, " TracePoint[%2d]: %d\n", (int)nNum, atomic_read(&aatmDbgTracePoint_l[nNum])); } nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "DbgTraceValues:\n"); for (nNum = 0; nNum < DBG_TRACE_VALUES; nNum++) { if (nNum == uiDbgTraceValuePos_l) { // next value will be stored at that position nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "*%08lX", adwDbgTraceValue_l[nNum]); } else { nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, " %08lX", adwDbgTraceValue_l[nNum]); } if ((nNum & 0x00000007) == 0x00000007) { // 8 values printed -> end of line reached nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "\n"); } } if ((nNum & 0x00000007) != 0x00000007) { // number of values printed is not a multiple of 8 -> print new line nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, "\n"); } } #endif Eof = 1; goto Exit; Exit: *pEof_p = Eof; return (nSize); }