Exemplo n.º 1
0
/*
 * Function irda_init (void)
 *
 *  Protocol stack initialisation entry point.
 *  Initialise the various components of the IrDA stack
 */
int __init irda_init(void)
{
	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);

	/* Lower layer of the stack */
 	irlmp_init();
	irlap_init();
	
	/* Higher layers of the stack */
	iriap_init();
 	irttp_init();
	irsock_init();
	
	/* Add IrDA packet type (Start receiving packets) */
        dev_add_pack(&irda_packet_type);

	/* External APIs */
#ifdef CONFIG_PROC_FS
	irda_proc_register();
#endif
#ifdef CONFIG_SYSCTL
	irda_sysctl_register();
#endif

	/* Driver/dongle support */
 	irda_device_init();

	return 0;
}
Exemplo n.º 2
0
/*
 * Function irda_init (void)
 *
 *  Protocol stack initialisation entry point.
 *  Initialise the various components of the IrDA stack
 */
static int __init irda_init(void)
{
	int ret = 0;

	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);

	/* Lower layer of the stack */
	irlmp_init();
	irlap_init();

	/* Driver/dongle support */
	irda_device_init();

	/* Higher layers of the stack */
	iriap_init();
	irttp_init();
	ret = irsock_init();
	if (ret < 0)
		goto out_err_1;

	/* Add IrDA packet type (Start receiving packets) */
	dev_add_pack(&irda_packet_type);

	/* External APIs */
#ifdef CONFIG_PROC_FS
	irda_proc_register();
#endif
#ifdef CONFIG_SYSCTL
	ret = irda_sysctl_register();
	if (ret < 0)
		goto out_err_2;
#endif

	ret = irda_nl_register();
	if (ret < 0)
		goto out_err_3;

	return 0;

 out_err_3:
#ifdef CONFIG_SYSCTL
	irda_sysctl_unregister();
 out_err_2:
#endif
#ifdef CONFIG_PROC_FS
	irda_proc_unregister();
#endif

	/* Remove IrDA packet type (stop receiving packets) */
	dev_remove_pack(&irda_packet_type);

	/* Remove higher layers */
	irsock_cleanup();
 out_err_1:
	irttp_cleanup();
	iriap_cleanup();

	/* Remove lower layers */
	irda_device_cleanup();
	irlap_cleanup(); /* Must be done before irlmp_cleanup()! DB */

	/* Remove middle layer */
	irlmp_cleanup();


	return ret;
}