I sent this patch some days ago but received no reply. Regards, Angelo diff -Naurp linux-2.5.75/drivers/net/3c527.c linux-2.5.75-3C/drivers/net/3c527.c --- linux-2.5.75/drivers/net/3c527.c 2003-06-17 06:20:03.000000000 +0200 +++ linux-2.5.75-3C/drivers/net/3c527.c 2003-06-27 22:41:14.000000000 +0200 @@ -100,6 +100,8 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELD #include <linux/string.h> #include <linux/wait.h> #include <linux/ethtool.h> +#include <linux/sched.h> +#include <linux/spinlock.h> #include <asm/uaccess.h> #include <asm/system.h> @@ -178,7 +180,8 @@ struct mc32_local u16 tx_ring_tail; /* index to tx de-queue end */ u16 tx_ring_head; /* index to tx en-queue end */ - u16 rx_ring_tail; /* index to rx de-queue end */ + u16 rx_ring_tail; /* index to rx de-queue end */ + spinlock_t lock; }; /* The station (ethernet) address prefix, used for a sanity check. */ @@ -497,6 +500,7 @@ static int __init mc32_probe1(struct net lp->rx_len = lp->exec_box->data[11]; /* Receive list count */ init_waitqueue_head(&lp->event); + spin_lock_init(&lp->lock); printk("%s: Firmware Rev %d. %d RX buffers, %d TX buffers. Base of 0x%08X.\n", dev->name, lp->exec_box->data[12], lp->rx_len, lp->tx_len, lp->base); @@ -622,19 +626,17 @@ static int mc32_command(struct net_devic * Wait for a command */ - save_flags(flags); - cli(); - - while(lp->exec_pending) - sleep_on(&lp->event); - + spin_lock_irqsave(&lp->lock, flags); + + wait_event(lp->event, (lp->exec_pending == 0)); + /* * Issue mine */ lp->exec_pending=1; - restore_flags(flags); + spin_unlock_irqrestore(&lp->lock, flags); lp->exec_box->mbox=0; lp->exec_box->mbox=cmd; @@ -645,13 +647,12 @@ static int mc32_command(struct net_devic while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR)); outb(1<<6, ioaddr+HOST_CMD); - save_flags(flags); - cli(); + spin_lock_irqsave(&lp->lock, flags); - while(lp->exec_pending!=2) - sleep_on(&lp->event); + wait_event(lp->event, (lp->exec_pending == 2)); lp->exec_pending=0; - restore_flags(flags); + + spin_unlock_irqrestore(&lp->lock, flags); if(lp->exec_box->mbox&(1<<13)) ret = -1; @@ -735,14 +736,12 @@ static void mc32_halt_transceiver(struct outb(HOST_CMD_SUSPND_RX, ioaddr+HOST_CMD); mc32_ready_poll(dev); outb(HOST_CMD_SUSPND_TX, ioaddr+HOST_CMD); - - save_flags(flags); - cli(); - - while(lp->xceiver_state!=HALTED) - sleep_on(&lp->event); - - restore_flags(flags); + + spin_lock_irqsave(&lp->lock, flags); + + wait_event(lp->event, (lp->xceiver_state == HALTED)); + + spin_unlock_irqrestore(&lp->lock, flags); } @@ -1062,12 +1061,11 @@ static int mc32_send_packet(struct sk_bu netif_stop_queue(dev); - save_flags(flags); - cli(); + spin_lock_irqsave(&lp->lock, flags); if(atomic_read(&lp->tx_count)==0) { - restore_flags(flags); + spin_unlock_irqrestore(&lp->lock, flags); return 1; } @@ -1098,7 +1096,7 @@ static int mc32_send_packet(struct sk_bu p->control &= ~CONTROL_EOL; /* Clear EOL on p */ out: - restore_flags(flags); + spin_unlock_irqrestore(&lp->lock, flags); netif_wake_queue(dev); return 0; - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html