Example #1
0
//------------------------------------------------------------------------------
tOplkError drv_storeInitParam(const tCtrlInitParam* pInitParam_p)
{
    if (pInitParam_p == NULL)
        return kErrorInvalidOperation;

    ctrlkcal_storeInitParam(pInitParam_p);

    return kErrorOk;
}
Example #2
0
//------------------------------------------------------------------------------
static tOplkError initStack(void)
{
    tOplkError          ret;
    tEdrvInitParam      edrvInitParam;

    ctrlkcal_readInitParam(&instance_l.initParam);

    if ((ret = eventk_init()) != kErrorOk)
        return ret;

    if ((ret = nmtk_init()) != kErrorOk)
        return ret;

    //jba able to work without hresk?
#if CONFIG_TIMER_USE_HIGHRES != FALSE
    if ((ret = hrestimer_init()) != kErrorOk)
        return ret;
#endif

#if (CONFIG_DLL_PROCESS_SYNC == DLL_PROCESS_SYNC_ON_TIMER)
    if ((ret = synctimer_init()) != kErrorOk)
        return ret;
#endif

    ret = dllk_init();
    if (ret != kErrorOk)
        return ret;

    // initialize Edrv
    OPLK_MEMCPY(edrvInitParam.aMacAddr, instance_l.initParam.aMacAddress, 6);
    edrvInitParam.hwParam.devNum = instance_l.initParam.ethDevNumber;
    edrvInitParam.hwParam.pDevName = instance_l.initParam.szEthDevName;
    edrvInitParam.pfnRxHandler = dllkframe_processFrameReceived;
    if ((ret = edrv_init(&edrvInitParam)) != kErrorOk)
        return ret;

    // copy local MAC address from Ethernet driver back to init parameters
    // because Ethernet driver may have read it from controller EEPROM
    OPLK_MEMCPY(instance_l.initParam.aMacAddress, edrv_getMacAddr(), 6);
    ctrlkcal_storeInitParam(&instance_l.initParam);

    // initialize Edrvcyclic
#if defined(CONFIG_INCLUDE_NMT_MN)
    if ((ret = edrvcyclic_init()) != kErrorOk)
        return ret;

    if ((ret = edrvcyclic_regErrorHandler(dllk_cbCyclicError)) != kErrorOk)
        return ret;
#endif

    if ((ret = timesynck_init()) != kErrorOk)
        return ret;

    dllk_regSyncHandler(timesynck_sendSyncEvent);

    // initialize dllkcal module
    if ((ret = dllkcal_init()) != kErrorOk)
        return ret;

#if defined(CONFIG_INCLUDE_PDO)
    if ((ret = pdok_init()) != kErrorOk)
        return ret;
#endif

#if defined(CONFIG_INCLUDE_LEDK)
    ret = ledk_init();
#endif

    // initialize Virtual Ethernet Driver
#if defined(CONFIG_INCLUDE_VETH)
    if ((ret = veth_init(instance_l.initParam.aMacAddress)) != kErrorOk)
        return ret;
#endif

    ret = errhndk_init();

    return ret;
}