示例#1
0
文件: iriap.c 项目: CSCLOG/beaglebone
/*
 * Function iriap_cleanup (void)
 *
 *    Initializes the IrIAP layer, called by the module cleanup code in
 *    irmod.c
 */
void iriap_cleanup(void)
{
	irlmp_unregister_service(service_handle);

	hashbin_delete(iriap, (FREE_FUNC) __iriap_close);
	hashbin_delete(irias_objects, (FREE_FUNC) __irias_delete_object);
}
示例#2
0
void irda_device_cleanup(void)
{
	IRDA_DEBUG(4, __FUNCTION__ "()\n");

	hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete);
	hashbin_delete(dongles, NULL);
}
示例#3
0
文件: irda_device.c 项目: 7799/linux
void irda_device_cleanup(void)
{
	IRDA_DEBUG(4, "%s()\n", __func__);

	hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete);

	hashbin_delete(dongles, leftover_dongle);
}
示例#4
0
文件: iriap.c 项目: CSCLOG/beaglebone
/*
 * Function iriap_init (void)
 *
 *    Initializes the IrIAP layer, called by the module initialization code
 *    in irmod.c
 */
int __init iriap_init(void)
{
	struct ias_object *obj;
	struct iriap_cb *server;
	__u8 oct_seq[6];
	__u16 hints;

	/* Allocate master array */
	iriap = hashbin_new(HB_LOCK);
	if (!iriap)
		return -ENOMEM;

	/* Object repository - defined in irias_object.c */
	irias_objects = hashbin_new(HB_LOCK);
	if (!irias_objects) {
		IRDA_WARNING("%s: Can't allocate irias_objects hashbin!\n",
			     __func__);
		hashbin_delete(iriap, NULL);
		return -ENOMEM;
	}

	lockdep_set_class_and_name(&irias_objects->hb_spinlock, &irias_objects_key,
				   "irias_objects");

	/*
	 *  Register some default services for IrLMP
	 */
	hints  = irlmp_service_to_hint(S_COMPUTER);
	service_handle = irlmp_register_service(hints);

	/* Register the Device object with LM-IAS */
	obj = irias_new_object("Device", IAS_DEVICE_ID);
	irias_add_string_attrib(obj, "DeviceName", "Linux", IAS_KERNEL_ATTR);

	oct_seq[0] = 0x01;  /* Version 1 */
	oct_seq[1] = 0x00;  /* IAS support bits */
	oct_seq[2] = 0x00;  /* LM-MUX support bits */
#ifdef CONFIG_IRDA_ULTRA
	oct_seq[2] |= 0x04; /* Connectionless Data support */
#endif
	irias_add_octseq_attrib(obj, "IrLMPSupport", oct_seq, 3,
				IAS_KERNEL_ATTR);
	irias_insert_object(obj);

	/*
	 *  Register server support with IrLMP so we can accept incoming
	 *  connections
	 */
	server = iriap_open(LSAP_IAS, IAS_SERVER, NULL, NULL);
	if (!server) {
		IRDA_DEBUG(0, "%s(), unable to open server\n", __func__);
		return -1;
	}
	iriap_register_lsap(server, LSAP_IAS, IAS_SERVER);

	return 0;
}
static void __exit ircomm_cleanup(void)
{
    IRDA_DEBUG(2, "%s()\n", __func__ );

    hashbin_delete(ircomm, (FREE_FUNC) __ircomm_close);

#ifdef CONFIG_PROC_FS
    remove_proc_entry("ircomm", proc_irda);
#endif
}
示例#6
0
void ircomm_cleanup(void)
{
	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);

	hashbin_delete(ircomm, (FREE_FUNC) __ircomm_close);

#ifdef CONFIG_PROC_FS
	remove_proc_entry("ircomm", proc_irda);
#endif /* CONFIG_PROC_FS */
}
示例#7
0
static void irtty_cleanup(void) 
{
	int ret;
	
	/*
	 *  Unregister tty line-discipline
	 */
	if (( ret = tty_register_ldisc( N_IRDA, NULL))) {
		printk( KERN_ERR 
			"IrTTY: can't unregister line discipline (err = %d)\n",
 			ret);
	}

	/*
	 *  The TTY should care of deallocating the instances by using the
	 *  callback to irtty_close(), therefore we do give any deallocation
	 *  function to hashbin_destroy().
	 */
	hashbin_delete( irtty, NULL);
	hashbin_delete( dongles, NULL);
}
示例#8
0
文件: irda_device.c 项目: 7799/linux
int __init irda_device_init( void)
{
	dongles = hashbin_new(HB_NOLOCK);
	if (dongles == NULL) {
		IRDA_WARNING("IrDA: Can't allocate dongles hashbin!\n");
		return -ENOMEM;
	}
	spin_lock_init(&dongles->hb_spinlock);

	tasks = hashbin_new(HB_LOCK);
	if (tasks == NULL) {
		IRDA_WARNING("IrDA: Can't allocate tasks hashbin!\n");
		hashbin_delete(dongles, NULL);
		return -ENOMEM;
	}

	/* We no longer initialise the driver ourselves here, we let
	 * the system do it for us... - Jean II */

	return 0;
}
示例#9
0
void irda_device_cleanup(void)
{
	hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete);

	hashbin_delete(dongles, leftover_dongle);
}