/**
 *  rtnet_init()
 */
int __init rtnet_init(void)
{
    int err = 0;


    printk("\n*** RTnet " RTNET_VERSION " - built on %s, %s ***\n\n",
           __DATE__, __TIME__);
    printk("RTnet: initialising real-time networking\n");

    if ((err = init_crc32()) != 0)
        goto err_out1;

    if ((err = rtskb_pools_init()) != 0)
        goto err_out2;

    /* initialize the Stack-Manager */
    if ((err=rt_stack_mgr_init(&STACK_manager)) != 0)
        goto err_out2;

    /* initialize the RTDEV-Manager */
    if ((err=rt_rtdev_mgr_init(&RTDEV_manager)) != 0)
        goto err_out3;

    rtsockets_init();
    rt_inet_proto_init();
    rtnet_chrdev_init();

    if ((err = rtpc_init()) != 0)
        goto err_out4;

#ifdef CONFIG_PROC_FS
    if ((err = rtnet_proc_register()) != 0)
        goto err_out5;
#endif

    return 0;


err_out5:
    rtpc_cleanup();

err_out4:
    rtnet_chrdev_release();
    rt_inet_proto_release();

    rt_rtdev_mgr_delete(&RTDEV_manager);

err_out3:
    rt_stack_mgr_delete(&STACK_manager);

err_out2:
    rtskb_pools_release();

err_out1:
    cleanup_crc32();

    return err;
}
/**
 *  rtnet_init()
 */
int __init rtnet_init(void)
{
    int err = 0;


    printk("\n*** RTnet " RTNET_PACKAGE_VERSION " - built on " __DATE__ " " __TIME__
           " ***\n\n");
    printk("RTnet: initialising real-time networking\n");

    if ((err = rtskb_pools_init()) != 0)
        goto err_out1;

#ifdef CONFIG_PROC_FS
    if ((err = rtnet_proc_register()) != 0)
        goto err_out2;
#endif

    /* initialize the Stack-Manager */
    if ((err = rt_stack_mgr_init(&STACK_manager)) != 0)
        goto err_out3;

    /* initialize the RTDEV-Manager */
    if ((err = rt_rtdev_mgr_init(&RTDEV_manager)) != 0)
        goto err_out4;

    rtnet_chrdev_init();

    if ((err = rtwlan_init()) != 0)
        goto err_out5;

    if ((err = rtpc_init()) != 0)
        goto err_out6;

    return 0;


err_out6:
    rtwlan_exit();

err_out5:
    rtnet_chrdev_release();
    rt_rtdev_mgr_delete(&RTDEV_manager);

err_out4:
    rt_stack_mgr_delete(&STACK_manager);

err_out3:
#ifdef CONFIG_PROC_FS
    rtnet_proc_unregister();

err_out2:
#endif
    rtskb_pools_release();

err_out1:
    return err;
}
Exemple #3
0
/**
 *  rtnet_init()
 */
int __init rtnet_init(void)
{
    int err = 0;


    printk("\n*** RTnet for Xenomai v" XENO_VERSION_STRING " ***\n\n");
    printk("RTnet: initialising real-time networking\n");

    if ((err = rtskb_pools_init()) != 0)
        goto err_out1;

#ifdef CONFIG_XENO_OPT_VFILE
    if ((err = rtnet_proc_register()) != 0)
        goto err_out2;
#endif

    /* initialize the Stack-Manager */
    if ((err = rt_stack_mgr_init(&STACK_manager)) != 0)
        goto err_out3;

    /* initialize the RTDEV-Manager */
    if ((err = rt_rtdev_mgr_init(&RTDEV_manager)) != 0)
        goto err_out4;

    rtnet_chrdev_init();

    if ((err = rtwlan_init()) != 0)
        goto err_out5;

    if ((err = rtpc_init()) != 0)
        goto err_out6;

    return 0;


err_out6:
    rtwlan_exit();

err_out5:
    rtnet_chrdev_release();
    rt_rtdev_mgr_delete(&RTDEV_manager);

err_out4:
    rt_stack_mgr_delete(&STACK_manager);

err_out3:
#ifdef CONFIG_XENO_OPT_VFILE
    rtnet_proc_unregister();

err_out2:
#endif
    rtskb_pools_release();

err_out1:
    return err;
}
/**
 *      rtnet_mgr_init():       initialize the RTnet
 *
 */
int rtnet_init(void)
{
        int err = 0;

	printk("\n*** RTnet - %s, %s ***\n\n", __DATE__, __TIME__);
        printk("RTnet: init real-time networking\n");
        init_crc32();

        if ( (err=rtskb_pool_init()) )
                return err;

        rtsockets_init();
        rtnet_dev_init();
        rt_inet_proto_init();
        rtnet_chrdev_init();

#ifdef CONFIG_PROC_FS
        err = rtnet_mgr_proc_register ();
#endif

        /* initialise the Stack-Manager */
        if ( (err=rt_stack_mgr_init(&STACK_manager)) )
		goto proc_mgr_err;

        /* initialise the RTDEV-Manager */
        if ( (err=rt_rtdev_mgr_init(&RTDEV_manager)) )
		goto  stack_mgr_err;

        /* initialise the RT-Wakeup-Manager */
        if ( (err=rt_wakeup_mgr_init(&rt_wakeup_manager)) )
		goto rtdev_mgr_err;

        /* initialise the Proxy-Wakeup-Manager */
        if ( (err=proxy_wakeup_mgr_init(&proxy_wakeup_manager)) )
		goto wakeup_mgr_err;

        return 0;

 wakeup_mgr_err:
	rt_wakeup_mgr_delete(&rt_wakeup_manager);
 rtdev_mgr_err:
	rt_rtdev_mgr_delete(&RTDEV_manager);
 stack_mgr_err:
	rt_stack_mgr_delete(&STACK_manager);
 proc_mgr_err:
#ifdef CONFIG_PROC_FS
        rtnet_mgr_proc_unregister ();
#endif
	return err;
}
/**
 *      rtnet_mgr_release():    release the RTnet-Manager
 *
 */
void rtnet_release(void)
{
        rt_printk("RTnet: End real-time networking\n");
	rt_stack_mgr_delete(&STACK_manager);
	rt_rtdev_mgr_delete(&RTDEV_manager);

#ifdef CONFIG_PROC_FS
        rtnet_mgr_proc_unregister ();
#endif
        rtnet_chrdev_release();
        rt_inet_proto_release();
        rtnet_dev_release();
        rtsockets_release();
        rtskb_pool_release();

        cleanup_crc32();
}
/**
 *  rtnet_release()
 */
void rtnet_release(void)
{
#ifdef CONFIG_PROC_FS
    rtnet_proc_unregister();
#endif
    rtnet_chrdev_release();

    rt_stack_mgr_delete(&STACK_manager);
    rt_rtdev_mgr_delete(&RTDEV_manager);

    rt_inet_proto_release();
    rtsockets_release();
    rtskb_pools_release();

    cleanup_crc32();

    printk("RTnet: unloaded\n");
}
/**
 *  rtnet_release()
 */
void __exit rtnet_release(void)
{
    rtpc_cleanup();

    rtwlan_exit();

    rtnet_chrdev_release();

    rt_stack_mgr_delete(&STACK_manager);
    rt_rtdev_mgr_delete(&RTDEV_manager);

    rtskb_pools_release();

#ifdef CONFIG_PROC_FS
    rtnet_proc_unregister();
#endif

    printk("RTnet: unloaded\n");
}
/**
 *  rtnet_release()
 */
void rtnet_release(void)
{
#ifndef CONFIG_RTNET_ETH1394	
    rtpc_cleanup();
#endif
	
    rtnet_chrdev_release();

    rt_stack_mgr_delete(&STACK_manager);
    rt_rtdev_mgr_delete(&RTDEV_manager);

    rt_packet_proto_release();
    rt_inet_proto_release();
    rtskb_pools_release();

#ifdef CONFIG_PROC_FS
    rtnet_proc_unregister();
#endif

    printk("RTnet: unloaded\n");
}