patch-2.4.2-irda4 (misc fixes 2nd part)
Subsystems (2)
PATCH 1/1 patch-2.4.2-irda4 (misc fixes 2nd part)
Linus,
These are various irda patches (2nd part) to fix various bit of the stack. Please apply to your latest Linux-2.4.2 code. Changes:
o Fix socket stuck in CONN_PEND
o NSC wakeup fix
o Fix for IrDA stack static init
net/irda/irlmp_event.c renamed from net/irda/irlmp_event.d7.c +11 -2
@@ -472,8 +472,6 @@ static int irlmp_state_disconnected(struirlmp_start_watchdog_timer (self,5 *HZ );break ;case LM_CONNECT_INDICATION : -irlmp_next_lsap_state (self,LSAP_CONNECT_PEND ); -if (self->conn_skb) {WARNING (__FUNCTION__"(), busy with another request!\n" );
@@ -481,6 +479,8 @@ static int irlmp_state_disconnected(stru } self->conn_skb = skb; +irlmp_next_lsap_state (self,LSAP_CONNECT_PEND ); +irlmp_do_lap_event (self->lap,LM_LAP_CONNECT_REQUEST ,NULL );break ;default :
@@ -562,6 +562,15 @@ static int irlmp_state_connect_pend(struswitch (event) {case LM_CONNECT_REQUEST :/* Keep state */ +break ; +case LM_CONNECT_INDICATION : +/* Will happen in some rare cases when the socket get stuck, +* the other side retries the connect request. +* We just unstuck the socket - Jean II */ +IRDA_DEBUG (0 , __FUNCTION__"(), LM_CONNECT_INDICATION, " +"LSAP stuck in CONNECT_PEND state...\n" ); +/* Keep state */ +irlmp_do_lap_event (self->lap,LM_LAP_CONNECT_REQUEST ,NULL );break ;case LM_CONNECT_RESPONSE : IRDA_DEBUG(0, __FUNCTION__ "(), LM_CONNECT_RESPONSE, "
drivers/net/irda/nsc-ircc.c renamed from drivers/net/irda/nsc-ircc.j1.c +7 -14
@@ -251,9 +251,14 @@ static int nsc_ircc_open(int i, chipio_tIRDA_DEBUG (2 , __FUNCTION__"()\n" ); +MESSAGE ("%s, Found chip at base=0x%03x\n" , driver_name, + info->cfg_base); +if ((nsc_ircc_setup (info)) ==-1 )return -1 ; +MESSAGE ("%s, driver loaded (Dag Brattli)\n" , driver_name); +/* Allocate new instance of the driver */ self =kmalloc (sizeof (struct nsc_ircc_cb ),GFP_KERNEL );if (self ==NULL ) {
@@ -699,8 +704,6 @@ static int nsc_ircc_setup(chipio_t *infoERROR ("%s, Wrong chip version %02x\n" , driver_name, version);return -1 ; } -MESSAGE ("%s, Found chip at base=0x%03x\n" , driver_name, - info->cfg_base);/* Switch to advanced mode */ switch_bank (iobase,BANK2 );
@@ -729,8 +732,6 @@ static int nsc_ircc_setup(chipio_t *infooutb (0x0d , iobase+2 );/* Set SIR pulse width to 1.6us */ outb (0x2a , iobase+4 );/* Set beginning frag, and preamble length */ -MESSAGE ("%s, driver loaded (Dag Brattli)\n" , driver_name); -/* Enable receive interrupts */ switch_bank (iobase,BANK0 );outb (IER_RXHDL_IE , iobase+IER );
@@ -1859,7 +1860,7 @@ static int nsc_ircc_net_open(struct net_if (request_dma (self->io.dma, dev->name)) {WARNING ("%s, unable to allocate dma=%d\n" , driver_name, self->io.dma); -free_irq (self->io.irq, self); +free_irq (self->io.irq, dev);return -EAGAIN ; }
@@ -2011,18 +2012,10 @@ static void nsc_ircc_suspend(struct nsc_static void nsc_ircc_wakeup (struct nsc_ircc_cb *self) { -int iobase; -if (!self->io.suspended)return ; - iobase = self->io.fir_base; - -/* Switch to advanced mode */ -switch_bank (iobase,BANK2 ); -outb (ECR1_EXT_SL , iobase+ECR1 ); -switch_bank (iobase,BANK0 ); - +nsc_ircc_setup (&self->io);nsc_ircc_net_open (self->netdev);MESSAGE ("%s, Waking up\n" , driver_name);
init/main.c +1 -0
@@ -726,6 +726,7 @@ static void __init do_basic_setup(void)filesystem_setup ();#ifdef CONFIG_IRDA +irda_proto_init ();irda_device_init ();/* Must be done after protocol initialization */ #endif #ifdef CONFIG_PCMCIA
----
Dag Brattli <[email protected]>
My homepage http://www.brattli.net/dag/
Try Linux-IrDA: http://irda.sourceforge.net/ Try Pygmy: http://pygmy.sourceforge.net/