kernels/linux-2.4.0/net/irda/irnet/irnet_irda.c
/*------------------------------------------------------------------*/
/*
 * Prepare the IrNET layer for operation...
 */
Prepare the IrNET layer for operation
Prepare the IrNET layer for operation
int
irda_irnet_init(void)
{
  int		err = 0;
  DENTER(MODULE_TRACE, "()\n");
  memset(&irnet_server, 0, sizeof(struct irnet_root));
  irnet_server.list = hashbin_new(HB_LOCAL); 
  DABORT(irnet_server.list == NULL, -ENOMEM,
	 MODULE_ERROR, "Can't allocate hashbin!\n");
  spin_lock_init(&irnet_server.spinlock);
  init_waitqueue_head(&irnet_events.rwait);
  irnet_events.index = 0;
  spin_lock_init(&irnet_events.spinlock);
#ifdef CONFIG_PROC_FS
  create_proc_info_entry("irnet", 0, proc_irda, irnet_proc_read);
#endif 
  err = irnet_setup_server();
  if(!err)
    irnet_server.running = 1;
  DEXIT(MODULE_TRACE, "\n");
  return err;
}
int irda_irnet_init ( void ) { int err = 0 ; DENTER ( MODULE_TRACE , " \n " ) ; memset ( & irnet_server , 0 , sizeof ( struct irnet_root ) ) ; irnet_server . list = hashbin_new ( HB_LOCAL ) ; DABORT ( irnet_server . list == NULL , - ENOMEM , MODULE_ERROR , " \n " ) ; spin_lock_init ( & irnet_server . spinlock ) ; init_waitqueue_head ( & irnet_events . rwait ) ; irnet_events . index = 0 ; spin_lock_init ( & irnet_events . spinlock ) ; #ifdef CONFIG_PROC_FS create_proc_info_entry ( " " , 0 , proc_irda , irnet_proc_read ) ; #endif err = irnet_setup_server ( ) ; if ( ! err ) irnet_server . running = 1 ; DEXIT ( MODULE_TRACE , " \n " ) ; return err ; }
Prepare the IrNET layer for operation...
Prepare the IrNET layer for operation ...
/* Pure paranoia - should be redundant */ /* Setup start of irnet instance list */ /* Init spinlock for instance list */ /* Initialise control channel */ /* Init spinlock for event logging */ /* Add a /proc file for irnet infos */ /* CONFIG_PROC_FS */ /* Setup the IrNET server */ /* We are no longer functional... */