kernels/linux-2.4.0/net/irda/irnet/irnet_irda.c
/*------------------------------------------------------------------*/
/*
 * Function irda_open_tsap (self)
 *
 *    Open local Transport Service Access Point (TSAP)
 *
 * Create a IrTTP instance for us and set all the IrTTP callbacks.
 */
Function irda_open_tsap (self)
Open local Transport Service Access Point (TSAP)

Create a IrTTP instance for us and set all the IrTTP callbacks.
Function irda_open_tsap ( self ) Open local Transport Service Access Point ( TSAP ) Create a IrTTP instance for us and set all the IrTTP callbacks .
static inline int
irnet_open_tsap(irnet_socket *	self)
{
  notify_t	notify;		
  DENTER(IRDA_SR_TRACE, "(self=0x%X)\n", (unsigned int) self);
  DABORT(self->tsap != NULL, -EBUSY, IRDA_SR_ERROR, "Already busy !\n");
  irda_notify_init(&notify);
  notify.connect_confirm	= irnet_connect_confirm;
  notify.connect_indication	= irnet_connect_indication;
  notify.disconnect_indication	= irnet_disconnect_indication;
  notify.data_indication	= irnet_data_indication;
  notify.flow_indication	= irnet_flow_indication;
  notify.status_indication	= irnet_status_indication;
  notify.instance		= self;
  strncpy(notify.name, IRNET_NOTIFY_NAME, NOTIFY_MAX_NAME);
  self->tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT,
			       &notify);	
  DABORT(self->tsap == NULL, -ENOMEM,
	 IRDA_SR_ERROR, "Unable to allocate TSAP !\n");
  self->stsap_sel = self->tsap->stsap_sel;
  DEXIT(IRDA_SR_TRACE, " - tsap=0x%X, sel=0x%X\n",
	(unsigned int) self->tsap, self->stsap_sel);
  return 0;
}
static inline int irnet_open_tsap ( irnet_socket * self ) { notify_t notify ; DENTER ( IRDA_SR_TRACE , " \n " , ( unsigned int ) self ) ; DABORT ( self -> tsap != NULL , - EBUSY , IRDA_SR_ERROR , " \n " ) ; irda_notify_init ( & notify ) ; notify . connect_confirm = irnet_connect_confirm ; notify . connect_indication = irnet_connect_indication ; notify . disconnect_indication = irnet_disconnect_indication ; notify . data_indication = irnet_data_indication ; notify . flow_indication = irnet_flow_indication ; notify . status_indication = irnet_status_indication ; notify . instance = self ; strncpy ( notify . name , IRNET_NOTIFY_NAME , NOTIFY_MAX_NAME ) ; self -> tsap = irttp_open_tsap ( LSAP_ANY , DEFAULT_INITIAL_CREDIT , & notify ) ; DABORT ( self -> tsap == NULL , - ENOMEM , IRDA_SR_ERROR , " \n " ) ; self -> stsap_sel = self -> tsap -> stsap_sel ; DEXIT ( IRDA_SR_TRACE , " \n " , ( unsigned int ) self -> tsap , self -> stsap_sel ) ; return 0 ; }
Function irda_open_tsap (self)
    Open local Transport Service Access Point (TSAP)
Function irda_open_tsap ( self ) Open local Transport Service Access Point ( TSAP )
/* Callback structure */ /* Initialize IrTTP callbacks to be used by the IrDA stack */ /*notify.udata_indication	= NULL;*/ /* Open an IrTTP instance */ /* Remember which TSAP selector we actually got */