"Bj�rn Mork" <[EMAIL PROTECTED]> writes:

> Dag Brattli <[EMAIL PROTECTED]> writes:
> 
> > "Bj�rn Mork" <[EMAIL PROTECTED]> writes:
> > 
> > > Old habit. I've just used irport lately. I will give irtty a try, too.
> > 
> > I'm compiling 2.3.19 myself now since 2.3.22 is very unstable. The irda
> > patch works just as well for 2.3.19. I think the reason why 2.3.22 is very
> > unstable is that the various Linux developers are afraid of code-freeze
> > (including me). That is the reason why we are now throwing not so well
> > tested patches for inclusion with the kernel. I know I can fix the various
> > bugs in the drivers, and if I wait a couple of weeks, then it might be to
> > late.
> 
> I tried 2.3.19 too, with about the same results. ifconfig doesn't 
> segfault when using irtty, so this must be related to irport. But I 
> noticed that ifconfig reported "Interrupt:28" for irda0 before 
> bringing the interface up (when using irtty). Bringing the interface 
> up brings my PC down, so I have no idea what it will say then.
> 
> Not much useful feedback this time, I am afraid. I got a few checkdisk
> runs, and a few files less. But that's as expected ;-)

I found the bug. The problem is that dev_alloc() in net/core/dev.c does not 
clear the struct it allocated, so this must be done by the calling
function. The problem is that dev_alloc inits the name which we must not
clear, so here's the patch (for irtty, irport, etc):

        if (!(dev = dev_alloc("irda%d", &err))) {
                ERROR(__FUNCTION__ "(), dev_alloc() failed!\n");
                return -ENOMEM;
        }
+       /* dev_alloc doesn't clear the struct, so lets do a little hack */
+       memset(((__u8*)dev)+sizeof(char*),0,sizeof(struct net_device)-sizeof(char*));

I had sent a patch for this to alan a couple of weeks ago, but I guess he
forgot about it. So this code was not included in my sources, only in my
own tree.

There are a few other bugs as well, so I'll build a new patch ;-) So just
stay away from the patch-2.3.22-irda2, it will break your machine even when 
using irtty (just start irdadump, and watch your machine reboot ;-)

-- Dag

-- 
   / Dag Brattli                   | The Linux-IrDA Project               /
  // University of Tromsoe, Norway | Infrared communication for Linux    //
 /// http://www.cs.uit.no/~dagb    | http://www.cs.uit.no/linux-irda/   ///

_______________________________________________
Linux-IrDA mailing list  -  [EMAIL PROTECTED]
http://www4.pasta.cs.UiT.No/mailman/listinfo/linux-irda

Reply via email to