looking for testers for a patch to 3c509.c

Oliver Neukum (neukum@fachschaft.org.chemie.uni-muenchen.de)
Tue, 14 Jul 1998 23:55:06 +0200 (CEST)


Hello,
i am looking for testers of a patch to 3c509.c.
The patch is against 2.1.108. It has passed the Torvaldts-Test.
(compiled and booted). I lack the hardware to test. The patch
adds __initfunc where possible and replaces cli/restore_flags
by spinlocks. An SMP test would be most welcome. There is no
maintainer in the list. I hope to step on nobody's toes.
TIA
Oliver Neukum

-----------------------------------------------------

--- Desktop/3c509.c Tue Jul 14 22:48:34 1998
+++ linux/drivers/net/3c509.c Tue Jul 14 23:19:37 1998
@@ -60,6 +60,7 @@
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h> /* for udelay() */
+#include <linux/init.h> /* for __initfunc */

#include <asm/bitops.h>
#include <asm/io.h>
@@ -131,8 +132,8 @@
static int id_port = 0x100;
static struct device *el3_root_dev = NULL;

-static ushort id_read_eeprom(int index);
-static ushort read_eeprom(short ioaddr, int index);
+__initfunc(static ushort id_read_eeprom(int index));
+__initfunc(static ushort read_eeprom(short ioaddr, int index));
static int el3_open(struct device *dev);
static int el3_start_xmit(struct sk_buff *skb, struct device *dev);
static void el3_interrupt(int irq, void *dev_id, struct pt_regs *regs);
@@ -142,9 +143,9 @@
static int el3_close(struct device *dev);
static void set_multicast_list(struct device *dev);

-
+spinlock_t lock_3c509 = SPIN_LOCK_UNLOCKED;

-int el3_probe(struct device *dev)
+__initfunc (int el3_probe(struct device *dev))
{
short lrs_state = 0xff, i;
ushort ioaddr, irq, if_port;
@@ -322,7 +323,7 @@
/* Read a word from the EEPROM using the regular EEPROM access register.
Assume that we are in register window zero.
*/
-static ushort read_eeprom(short ioaddr, int index)
+__initfunc (static ushort read_eeprom(short ioaddr, int index))
{
outw(EEPROM_READ + index, ioaddr + 10);
/* Pause for at least 162 us. for the read to take place. */
@@ -331,7 +332,7 @@
}

/* Read a word from the EEPROM when in the ISA ID probe state. */
-static ushort id_read_eeprom(int index)
+__initfunc (static ushort id_read_eeprom(int index))
{
int bit, word = 0;

@@ -600,10 +601,9 @@
struct el3_private *lp = (struct el3_private *)dev->priv;
unsigned long flags;

- save_flags(flags);
- cli();
+ spin_lock_irqsave(&lock_3c509, flags);
update_stats(dev->base_addr, dev);
- restore_flags(flags);
+ spin_unlock_irqrestore(&lock_3c509, flags);
return &lp->stats;
}

@@ -682,7 +682,6 @@
insl(ioaddr + RX_FIFO, skb_put(skb,pkt_len),
(pkt_len + 3) >> 2);
#endif
-
skb->protocol = eth_type_trans(skb,dev);
netif_rx(skb);
outw(RxDiscard, ioaddr + EL3_CMD); /* Pop top Rx packet. */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html