Beispiel #1
0
tEplKernel EplDllkCalGetStatistics(tEplDllkCalStatistics ** ppStatistics)
{
tEplKernel  Ret = kEplSuccessful;
#if EPL_USE_SHAREDBUFF != FALSE
tShbError   ShbError;

    ShbError = ShbCirGetReadBlockCount (EplDllkCalInstance_g.m_ShbInstanceTxNmt, &EplDllkCalInstance_g.m_Statistics.m_ulCurTxFrameCountNmt);
    ShbError = ShbCirGetReadBlockCount (EplDllkCalInstance_g.m_ShbInstanceTxGen, &EplDllkCalInstance_g.m_Statistics.m_ulCurTxFrameCountGen);
//    ShbError = ShbCirGetReadBlockCount (EplDllkCalInstance_g.m_ShbInstanceRx, &EplDllkCalInstance_g.m_Statistics.m_ulCurRxFrameCount);

#else
    if (EplDllkCalInstance_g.m_uiFrameSizeNmt > 0)
    {
        EplDllkCalInstance_g.m_Statistics.m_ulCurTxFrameCountNmt = 1;
    }
    else
    {
        EplDllkCalInstance_g.m_Statistics.m_ulCurTxFrameCountNmt = 0;
    }
    if (EplDllkCalInstance_g.m_uiFrameSizeGen > 0)
    {
        EplDllkCalInstance_g.m_Statistics.m_ulCurTxFrameCountGen = 1;
    }
    else
    {
        EplDllkCalInstance_g.m_Statistics.m_ulCurTxFrameCountGen = 0;
    }
#endif

    *ppStatistics = &EplDllkCalInstance_g.m_Statistics;
    return Ret;
}
static tEplKernel EplApiProcessImageFetchCopyJob(
    unsigned int uiPriority_p,
    tEplApiProcessImageCopyJobInt* pCopyJob_p)
{
    tEplKernel      Ret = kEplSuccessful;
    tShbError       ShbError;
    tShbInstance    ShbInstance;
    unsigned long   ulCopyJobCount = 0;
    unsigned long   ulCopyJobSize = 0;

    if (pCopyJob_p == NULL)
    {
        Ret = kEplApiInvalidParam;
        goto Exit;
    }

    if (uiPriority_p == 0)
    {
        ShbInstance = EplApiProcessImageInstance_g.m_ShbInstanceJobQueueHi;
    }
    else
    {
        ShbInstance = EplApiProcessImageInstance_g.m_ShbInstanceJobQueueLo;
    }

    ShbError = ShbCirGetReadBlockCount(ShbInstance, &ulCopyJobCount);
    if (ShbError != kShbOk)
    {
        Ret = kEplNoResource;
        goto Exit;
    }
    if (ulCopyJobCount > 0)
    {
        ShbError = ShbCirReadDataBlock (ShbInstance, pCopyJob_p, sizeof (*pCopyJob_p), &ulCopyJobSize);
        if (ShbError != kShbOk)
        {
            Ret = kEplNoResource;
            goto Exit;
        }
        if (sizeof (*pCopyJob_p) != ulCopyJobSize)
        {
            Ret = kEplApiPIInvalidJobSize;
            goto Exit;
        }
    }
    else
    {
        Ret = kEplApiPIJobQueueEmpty;
    }

Exit:
    return Ret;
}
Beispiel #3
0
tEplKernel EplDllkCalAsyncGetTxCount(tEplDllAsyncReqPriority * pPriority_p, unsigned int * puiCount_p)
{
tEplKernel  Ret = kEplSuccessful;
#if EPL_USE_SHAREDBUFF != FALSE
tShbError       ShbError;
unsigned long   ulFrameCount;

    // get frame count of Tx FIFO with NMT request priority
    ShbError = ShbCirGetReadBlockCount (EplDllkCalInstance_g.m_ShbInstanceTxNmt, &ulFrameCount);
    // returns kShbOk, kShbInvalidArg

    // error handling
    if (ShbError != kShbOk)
    {
        Ret = kEplNoResource;
        goto Exit;
    }

    if (ulFrameCount > EplDllkCalInstance_g.m_Statistics.m_ulMaxTxFrameCountNmt)
    {
        EplDllkCalInstance_g.m_Statistics.m_ulMaxTxFrameCountNmt = ulFrameCount;
    }

    if (ulFrameCount != 0)
    {   // NMT requests are in queue
        *pPriority_p = kEplDllAsyncReqPrioNmt;
        *puiCount_p = (unsigned int) ulFrameCount;
        goto Exit;
    }

    // get frame count of Tx FIFO with generic priority
    ShbError = ShbCirGetReadBlockCount (EplDllkCalInstance_g.m_ShbInstanceTxGen, &ulFrameCount);
    // returns kShbOk, kShbInvalidArg

    // error handling
    if (ShbError != kShbOk)
    {
        Ret = kEplNoResource;
        goto Exit;
    }

    if (ulFrameCount > EplDllkCalInstance_g.m_Statistics.m_ulMaxTxFrameCountGen)
    {
        EplDllkCalInstance_g.m_Statistics.m_ulMaxTxFrameCountGen = ulFrameCount;
    }

    *pPriority_p = kEplDllAsyncReqPrioGeneric;
    *puiCount_p = (unsigned int) ulFrameCount;

Exit:
#else
    if (EplDllkCalInstance_g.m_uiFrameSizeNmt > 0)
    {
        *pPriority_p = kEplDllAsyncReqPrioNmt;
        *puiCount_p = 1;
    }
    else if (EplDllkCalInstance_g.m_uiFrameSizeGen > 0)
    {
        *pPriority_p = kEplDllAsyncReqPrioGeneric;
        *puiCount_p = 1;
    }
    else
    {
        *pPriority_p = kEplDllAsyncReqPrioGeneric;
        *puiCount_p = 0;
    }
#endif

    return Ret;
}