From: Dan A. <da...@gm...> - 2004-02-08 21:36:30
|
On Sun, Feb 08, 2004 at 11:28:30PM +0200, Dan Aloni wrote: > Hello, > > It turns out that sending network interrupts before the conet driver is > initialized causes it to malfunction. That's why in 0.5.3-pre1 you > sometimes can't ping the machine, since colinux-net-daemon starts sending > ethernet frames to Linux before conet is initialized. > > I got this fixed quite easily, by making co_handle_device_interrupt() > aware to the initialization status of conet, not sending the interrupts > when it is not initialized. A patch, for those of you who compile vmlinux from sources. Apply this after patch/linux. diff -u linux/arch/i386/kernel/cooperative.c linux/arch/i386/kernel/cooperative.c --- linux/arch/i386/kernel/cooperative.c 2004-02-07 23:41:53.000000000 +0200 +++ linux/arch/i386/kernel/cooperative.c 2004-02-08 23:18:32.000000000 +0200 @@ -29,6 +29,7 @@ unsigned char kbd_scancode = 0; unsigned char conet_frame[1600] = {0, }; unsigned long conet_frame_len = 0; +unsigned long conet_enabled = 0; void co_handle_device_interrupt(co_linux_message_t *message) { @@ -75,6 +76,9 @@ break; } + if (!conet_enabled) + break; + if (conet_frame_len == 0) { conet_frame_len = message->size; memcpy(conet_frame, message->data, conet_frame_len); diff -u linux/drivers/net/conet.c linux/drivers/net/conet.c --- linux/drivers/net/conet.c 2004-02-07 19:42:19.000000000 +0200 +++ linux/drivers/net/conet.c 2004-02-08 23:18:09.000000000 +0200 @@ -19,6 +19,10 @@ struct net_device conet_dev; +extern unsigned char conet_frame[1600]; +extern unsigned long conet_frame_len; +extern unsigned long conet_enabled; + void conet_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr); int conet_open(struct net_device *dev) @@ -33,6 +37,8 @@ printk("conet: initialized\n"); + conet_enabled = 1; + netif_start_queue(dev); return 0; @@ -44,6 +50,8 @@ netif_stop_queue(dev); /* can't transmit any more */ + conet_enabled = 0; + MOD_DEC_USE_COUNT; return 0; @@ -73,9 +81,6 @@ return 0; } -extern unsigned char conet_frame[1600]; -extern unsigned long conet_frame_len; - void conet_rx(struct net_device *dev) { struct sk_buff *skb; -- Dan Aloni da...@gm... |