summaryrefslogtreecommitdiffstats
path: root/drivers/net/arcnet
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /drivers/net/arcnet
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (diff)
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'drivers/net/arcnet')
-rw-r--r--drivers/net/arcnet/arc-rimi.c13
-rw-r--r--drivers/net/arcnet/arcnet.c137
-rw-r--r--drivers/net/arcnet/com20020-isa.c7
-rw-r--r--drivers/net/arcnet/com20020-pci.c8
-rw-r--r--drivers/net/arcnet/com90io.c11
-rw-r--r--drivers/net/arcnet/com90xx.c45
-rw-r--r--drivers/net/arcnet/rfc1201.c8
7 files changed, 83 insertions, 146 deletions
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c
index 1fc708ee1..0829bd82e 100644
--- a/drivers/net/arcnet/arc-rimi.c
+++ b/drivers/net/arcnet/arc-rimi.c
@@ -2,7 +2,7 @@
* Linux ARCnet driver - "RIM I" (entirely mem-mapped) cards
*
* Written 1994-1999 by Avery Pennarun.
- * Written 1999 by Martin Mares <mj@suse.cz>.
+ * Written 1999-2000 by Martin Mares <mj@suse.cz>.
* Derived from skeleton.c by Donald Becker.
*
* Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
@@ -325,20 +325,11 @@ void cleanup_module(void)
{
struct net_device *dev = my_dev;
struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
- void *ioaddr = lp->mem_start + 0x800;
-
- if (dev->start)
- dev->stop(dev);
-
- /* Flush TX and disable RX */
- AINTMASK(0); /* disable IRQ's */
- ACOMMAND(NOTXcmd); /* stop transmit */
- ACOMMAND(NORXcmd); /* disable receive */
+ unregister_netdev(dev);
free_irq(dev->irq, dev);
iounmap(lp->mem_start);
release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
- unregister_netdev(dev);
kfree(dev->priv);
kfree(dev);
}
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index 98b2ac4da..1608b8bdd 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -3,7 +3,7 @@
*
* Written 1997 by David Woodhouse.
* Written 1994-1999 by Avery Pennarun.
- * Written 1999 by Martin Mares <mj@suse.cz>.
+ * Written 1999-2000 by Martin Mares <mj@suse.cz>.
* Derived from skeleton.c by Donald Becker.
*
* Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
@@ -41,7 +41,7 @@
* <jojo@repas.de>
*/
-#define VERSION "arcnet: v3.91 BETA 99/12/18 - by Avery Pennarun et al.\n"
+#define VERSION "arcnet: v3.92 BETA 2000/02/13 - by Avery Pennarun et al.\n"
#include <linux/module.h>
#include <linux/config.h>
@@ -97,6 +97,7 @@ EXPORT_SYMBOL(arcnet_interrupt);
static int arcnet_open(struct net_device *dev);
static int arcnet_close(struct net_device *dev);
static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev);
+static void arcnet_timeout(struct net_device *dev);
static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, void *daddr, void *saddr,
unsigned len);
@@ -347,6 +348,7 @@ void arcdev_setup(struct net_device *dev)
dev->addr_len = 1;
dev->tx_queue_len = 30;
dev->broadcast[0] = 0x00; /* for us, broadcasts are address 0 */
+ dev->watchdog_timeo = TX_TIMEOUT;
/* New-style flags. */
dev->flags = IFF_BROADCAST;
@@ -358,6 +360,7 @@ void arcdev_setup(struct net_device *dev)
dev->open = arcnet_open;
dev->stop = arcnet_close;
dev->hard_start_xmit = arcnet_send_packet;
+ dev->tx_timeout = arcnet_timeout;
dev->get_stats = arcnet_get_stats;
dev->hard_header = arcnet_header;
dev->rebuild_header = arcnet_rebuild_header;
@@ -397,10 +400,6 @@ static int arcnet_open(struct net_device *dev)
if (ARCRESET(0) && ARCRESET(1))
return -ENODEV;
- dev->tbusy = 0;
- dev->interrupt = 0;
- dev->start = 0;
-
newmtu = choose_mtu();
if (newmtu < dev->mtu)
dev->mtu = newmtu;
@@ -441,9 +440,6 @@ static int arcnet_open(struct net_device *dev)
if (ASTATUS() & RESETflag)
ACOMMAND(CFLAGScmd | RESETclear);
- /* we're started */
- dev->start = 1;
-
/* make sure we're ready to receive IRQ's. */
AINTMASK(0);
udelay(1); /* give it time to set the mask before
@@ -453,6 +449,8 @@ static int arcnet_open(struct net_device *dev)
lp->intmask = NORXflag | RECONflag;
AINTMASK(lp->intmask);
+ netif_start_queue(dev);
+
return 0;
}
@@ -462,16 +460,14 @@ static int arcnet_close(struct net_device *dev)
{
struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+ netif_stop_queue(dev);
+
/* flush TX and disable RX */
AINTMASK(0);
ACOMMAND(NOTXcmd); /* stop transmit */
ACOMMAND(NORXcmd); /* disable receive */
mdelay(1);
- dev->tbusy = 1;
- dev->start = 0;
- dev->interrupt = 0;
-
/* shut down the card */
ARCOPEN(0);
@@ -584,48 +580,6 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
"transmit requested (status=%Xh, txbufs=%d/%d, len=%d)\n",
ASTATUS(), lp->cur_tx, lp->next_tx, skb->len);
- if (dev->tbusy) {
- /*
- * If we get here, some higher level has decided we are broken.
- * There should really be a "kick me" function call instead.
- */
- unsigned long flags;
- int tickssofar = jiffies - dev->trans_start, status = ASTATUS();
-
- if (tickssofar < TX_TIMEOUT) {
- BUGMSG(D_DURING, "premature kickme! (status=%Xh ticks=%d)\n",
- status, tickssofar);
- return 1; /* means "try again" */
- }
- save_flags(flags);
- cli();
-
- if (status & TXFREEflag) { /* transmit _DID_ finish */
- BUGMSG(D_NORMAL, "tx timeout - missed IRQ? (status=%Xh, ticks=%d, mask=%Xh, dest=%02Xh)\n",
- status, tickssofar, lp->intmask, lp->lasttrans_dest);
- lp->stats.tx_errors++;
- } else {
- BUGMSG(D_EXTRA, "tx timed out (status=%Xh, tickssofar=%d, intmask=%Xh, dest=%02Xh)\n",
- status, tickssofar, lp->intmask, lp->lasttrans_dest);
- lp->stats.tx_errors++;
- lp->stats.tx_aborted_errors++;
-
- ACOMMAND(NOTXcmd | (lp->cur_tx << 3));
- }
-
- /*
- * interrupt handler will set dev->tbusy = 0 when it notices the
- * transmit has been canceled.
- */
-
- /* make sure we didn't miss a TX IRQ */
- AINTMASK(0);
- lp->intmask |= TXFREEflag;
- AINTMASK(lp->intmask);
-
- restore_flags(flags);
- return 1;
- }
pkt = (struct archdr *) skb->data;
soft = &pkt->soft.rfc1201;
proto = arc_proto_map[soft->proto];
@@ -638,18 +592,10 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb(skb);
return 0; /* don't try again */
}
- /*
- * Block a timer-based transmit from overlapping. This could better be
- * done with atomic_swap(1, dev->tbusy), but set_bit() works as well.
- */
- if (test_and_set_bit(0, (int *) &dev->tbusy)) {
- BUGMSG(D_NORMAL, "transmitter called with busy bit set! "
- "(status=%Xh, tickssofar=%ld)\n",
- ASTATUS(), jiffies - dev->trans_start);
- lp->stats.tx_errors++;
- lp->stats.tx_fifo_errors++;
- return 0; /* don't try again */
- }
+
+ /* We're busy transmitting a packet... */
+ netif_stop_queue(dev);
+
AINTMASK(0);
txbuf = get_arcbuf(dev);
@@ -718,6 +664,37 @@ static int go_tx(struct net_device *dev)
}
+/* Called by the kernel when transmit times out */
+static void arcnet_timeout(struct net_device *dev)
+{
+ unsigned long flags;
+ struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+ int status = ASTATUS();
+
+ save_flags(flags);
+ cli();
+
+ if (status & TXFREEflag) { /* transmit _DID_ finish */
+ BUGMSG(D_NORMAL, "tx timeout - missed IRQ? (status=%Xh, mask=%Xh, dest=%02Xh)\n",
+ status, lp->intmask, lp->lasttrans_dest);
+ lp->stats.tx_errors++;
+ } else {
+ BUGMSG(D_EXTRA, "tx timed out (status=%Xh, intmask=%Xh, dest=%02Xh)\n",
+ status, lp->intmask, lp->lasttrans_dest);
+ lp->stats.tx_errors++;
+ lp->stats.tx_aborted_errors++;
+ ACOMMAND(NOTXcmd | (lp->cur_tx << 3));
+ }
+
+ /* make sure we didn't miss a TX IRQ */
+ AINTMASK(0);
+ lp->intmask |= TXFREEflag;
+ AINTMASK(lp->intmask);
+
+ restore_flags(flags);
+}
+
+
/*
* The typical workload of the driver: Handle the network interface
* interrupts. Establish which device needs attention, and call the correct
@@ -743,25 +720,20 @@ void arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)
return;
}
/*
- * RESET flag was enabled - if !dev->start, we must clear it right
+ * RESET flag was enabled - if device is not running, we must clear it right
* away (but nothing else).
*/
- if (!dev->start) {
+ if (!netif_running(dev)) {
if (ASTATUS() & RESETflag)
ACOMMAND(CFLAGScmd | RESETclear);
AINTMASK(0);
return;
}
- if (dev->interrupt) {
- BUGMSG(D_NORMAL, "DRIVER PROBLEM! Nested arcnet interrupts!\n");
- return; /* don't even try. */
- }
- dev->interrupt = 1;
BUGMSG(D_DURING, "in arcnet_inthandler (status=%Xh, intmask=%Xh)\n",
ASTATUS(), lp->intmask);
- boguscount = 3;
+ boguscount = 5;
do {
status = ASTATUS();
didsomething = 0;
@@ -839,17 +811,15 @@ void arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (lp->outgoing.proto->continue_tx(dev, txbuf)) {
/* that was the last segment */
lp->stats.tx_bytes += lp->outgoing.skb->len;
- dev_kfree_skb(lp->outgoing.skb);
+ dev_kfree_skb_irq(lp->outgoing.skb);
lp->outgoing.proto = NULL;
}
lp->next_tx = txbuf;
}
}
/* inform upper layers of idleness, if necessary */
- if (lp->cur_tx == -1) {
- dev->tbusy = 0;
- mark_bh(NET_BH);
- }
+ if (lp->cur_tx == -1)
+ netif_wake_queue(dev);
}
/* now process the received packet, if any */
if (recbuf != -1) {
@@ -922,8 +892,6 @@ void arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)
AINTMASK(0);
udelay(1);
AINTMASK(lp->intmask);
-
- dev->interrupt = 0;
}
@@ -987,11 +955,6 @@ void arcnet_rx(struct net_device *dev, int bufnum)
}
/* call the protocol-specific receiver. */
arc_proto_map[soft->proto]->rx(dev, bufnum, &pkt, length);
-
- /*
- * If any worthwhile packets have been received, a mark_bh(NET_BH) has
- * been done by netif_rx and Linux will handle them after we return.
- */
}
diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c
index 94c68901b..7bd06e2e4 100644
--- a/drivers/net/arcnet/com20020-isa.c
+++ b/drivers/net/arcnet/com20020-isa.c
@@ -3,7 +3,7 @@
*
* Written 1997 by David Woodhouse.
* Written 1994-1999 by Avery Pennarun.
- * Written 1999 by Martin Mares <mj@suse.cz>.
+ * Written 1999-2000 by Martin Mares <mj@suse.cz>.
* Derived from skeleton.c by Donald Becker.
*
* Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
@@ -176,12 +176,9 @@ void cleanup_module(void)
{
struct net_device *dev = my_dev;
- if (dev->start)
- dev->stop(dev);
-
+ unregister_netdev(dev);
free_irq(dev->irq, dev);
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
- unregister_netdev(dev);
kfree(dev->priv);
kfree(dev);
}
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index 585308c27..b88203f54 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -3,7 +3,7 @@
*
* Written 1994-1999 by Avery Pennarun,
* based on an ISA version by David Woodhouse.
- * Written 1999 by Martin Mares <mj@suse.cz>.
+ * Written 1999-2000 by Martin Mares <mj@suse.cz>.
* Derived from skeleton.c by Donald Becker.
*
* Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
@@ -148,13 +148,9 @@ void cleanup_module(void)
for (count = 0; count < numcards; count++) {
dev = cards[count];
-
- if (dev->start)
- dev->stop(dev);
-
+ unregister_netdev(dev);
free_irq(dev->irq, dev);
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
- unregister_netdev(dev);
kfree(dev->priv);
kfree(dev);
}
diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c
index edd92ff25..79800883f 100644
--- a/drivers/net/arcnet/com90io.c
+++ b/drivers/net/arcnet/com90io.c
@@ -3,7 +3,7 @@
*
* Written 1997 by David Woodhouse.
* Written 1994-1999 by Avery Pennarun.
- * Written 1999 by Martin Mares <mj@suse.cz>.
+ * Written 1999-2000 by Martin Mares <mj@suse.cz>.
* Derived from skeleton.c by Donald Becker.
*
* Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
@@ -406,20 +406,13 @@ void cleanup_module(void)
struct net_device *dev = my_dev;
int ioaddr = dev->base_addr;
- if (dev->start)
- dev->stop(dev);
-
- /* Flush TX and disable RX */
- AINTMASK(0); /* disable IRQ's */
- ACOMMAND(NOTXcmd); /* stop transmit */
- ACOMMAND(NORXcmd); /* disable receive */
+ unregister_netdev(dev);
/* Set the thing back to MMAP mode, in case the old driver is loaded later */
outb((inb(_CONFIG) & ~IOMAPflag), _CONFIG);
free_irq(dev->irq, dev);
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
- unregister_netdev(dev);
kfree(dev->priv);
kfree(dev);
}
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
index 843115609..ac8790ef0 100644
--- a/drivers/net/arcnet/com90xx.c
+++ b/drivers/net/arcnet/com90xx.c
@@ -143,7 +143,7 @@ int __init com90xx_probe(struct net_device *dev)
numprint %= 8;
if (!numprint) {
BUGMSG2(D_INIT, "\n");
- BUGMSG(D_INIT, "S1: ");
+ BUGMSG2(D_INIT, "S1: ");
}
BUGMSG2(D_INIT, "%Xh ", *port);
@@ -151,7 +151,7 @@ int __init com90xx_probe(struct net_device *dev)
if (check_region(*port, ARCNET_TOTAL_SIZE)) {
BUGMSG2(D_INIT_REASONS, "(check_region)\n");
- BUGMSG(D_INIT_REASONS, "S1: ");
+ BUGMSG2(D_INIT_REASONS, "S1: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
*port = ports[numports - 1];
numports--;
@@ -160,7 +160,7 @@ int __init com90xx_probe(struct net_device *dev)
}
if (ASTATUS() == 0xFF) {
BUGMSG2(D_INIT_REASONS, "(empty)\n");
- BUGMSG(D_INIT_REASONS, "S1: ");
+ BUGMSG2(D_INIT_REASONS, "S1: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
*port = ports[numports - 1];
numports--;
@@ -170,13 +170,13 @@ int __init com90xx_probe(struct net_device *dev)
inb(_RESET); /* begin resetting card */
BUGMSG2(D_INIT_REASONS, "\n");
- BUGMSG(D_INIT_REASONS, "S1: ");
+ BUGMSG2(D_INIT_REASONS, "S1: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
}
BUGMSG2(D_INIT, "\n");
if (!numports) {
- BUGMSG(D_NORMAL, "S1: No ARCnet cards found.\n");
+ BUGMSG2(D_NORMAL, "S1: No ARCnet cards found.\n");
return -ENODEV;
}
/* Stage 2: we have now reset any possible ARCnet cards, so we can't
@@ -189,7 +189,7 @@ int __init com90xx_probe(struct net_device *dev)
numprint %= 8;
if (!numprint) {
BUGMSG2(D_INIT, "\n");
- BUGMSG(D_INIT, "S2: ");
+ BUGMSG2(D_INIT, "S2: ");
}
BUGMSG2(D_INIT, "%Xh ", *port);
}
@@ -207,13 +207,13 @@ int __init com90xx_probe(struct net_device *dev)
numprint %= 8;
if (!numprint) {
BUGMSG2(D_INIT, "\n");
- BUGMSG(D_INIT, "S3: ");
+ BUGMSG2(D_INIT, "S3: ");
}
BUGMSG2(D_INIT, "%lXh ", *shmem);
if (check_mem_region(*shmem, BUFFER_SIZE)) {
BUGMSG2(D_INIT_REASONS, "(check_mem_region)\n");
- BUGMSG(D_INIT_REASONS, "Stage 3: ");
+ BUGMSG2(D_INIT_REASONS, "Stage 3: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
*shmem = shmems[numshmems - 1];
numshmems--;
@@ -223,7 +223,7 @@ int __init com90xx_probe(struct net_device *dev)
if (isa_readb(ptr) != TESTvalue) {
BUGMSG2(D_INIT_REASONS, "(%02Xh != %02Xh)\n",
isa_readb(ptr), TESTvalue);
- BUGMSG(D_INIT_REASONS, "S3: ");
+ BUGMSG2(D_INIT_REASONS, "S3: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
*shmem = shmems[numshmems - 1];
numshmems--;
@@ -238,20 +238,20 @@ int __init com90xx_probe(struct net_device *dev)
isa_writeb(0x42, ptr);
if (isa_readb(ptr) != 0x42) {
BUGMSG2(D_INIT_REASONS, "(read only)\n");
- BUGMSG(D_INIT_REASONS, "S3: ");
+ BUGMSG2(D_INIT_REASONS, "S3: ");
*shmem = shmems[numshmems - 1];
numshmems--;
shmem--;
continue;
}
BUGMSG2(D_INIT_REASONS, "\n");
- BUGMSG(D_INIT_REASONS, "S3: ");
+ BUGMSG2(D_INIT_REASONS, "S3: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
}
BUGMSG2(D_INIT, "\n");
if (!numshmems) {
- BUGMSG(D_NORMAL, "S3: No ARCnet cards found.\n");
+ BUGMSG2(D_NORMAL, "S3: No ARCnet cards found.\n");
return -ENODEV;
}
/* Stage 4: something of a dummy, to report the shmems that are
@@ -263,7 +263,7 @@ int __init com90xx_probe(struct net_device *dev)
numprint %= 8;
if (!numprint) {
BUGMSG2(D_INIT, "\n");
- BUGMSG(D_INIT, "S4: ");
+ BUGMSG2(D_INIT, "S4: ");
}
BUGMSG2(D_INIT, "%lXh ", *shmem);
}
@@ -282,7 +282,7 @@ int __init com90xx_probe(struct net_device *dev)
numprint %= 8;
if (!numprint) {
BUGMSG2(D_INIT, "\n");
- BUGMSG(D_INIT, "S5: ");
+ BUGMSG2(D_INIT, "S5: ");
}
BUGMSG2(D_INIT, "%Xh ", *port);
@@ -292,7 +292,7 @@ int __init com90xx_probe(struct net_device *dev)
if ((status & 0x9D)
!= (NORXflag | RECONflag | TXFREEflag | RESETflag)) {
BUGMSG2(D_INIT_REASONS, "(status=%Xh)\n", status);
- BUGMSG(D_INIT_REASONS, "S5: ");
+ BUGMSG2(D_INIT_REASONS, "S5: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
*port = ports[numports - 1];
numports--;
@@ -304,7 +304,7 @@ int __init com90xx_probe(struct net_device *dev)
if (status & RESETflag) {
BUGMSG2(D_INIT_REASONS, " (eternal reset, status=%Xh)\n",
status);
- BUGMSG(D_INIT_REASONS, "S5: ");
+ BUGMSG2(D_INIT_REASONS, "S5: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
*port = ports[numports - 1];
numports--;
@@ -327,7 +327,7 @@ int __init com90xx_probe(struct net_device *dev)
if (airq <= 0) {
BUGMSG2(D_INIT_REASONS, "(airq=%d)\n", airq);
- BUGMSG(D_INIT_REASONS, "S5: ");
+ BUGMSG2(D_INIT_REASONS, "S5: ");
BUGLVL(D_INIT_REASONS) numprint = 0;
*port = ports[numports - 1];
numports--;
@@ -398,7 +398,7 @@ int __init com90xx_probe(struct net_device *dev)
isa_writeb(TESTvalue, *shmem);
if (retval && dev && !numcards)
- BUGMSG(D_NORMAL, "S5: No ARCnet cards found.\n");
+ BUGMSG2(D_NORMAL, "S5: No ARCnet cards found.\n");
return retval;
}
@@ -416,7 +416,7 @@ static int __init com90xx_found(struct net_device *dev0, int ioaddr, int airq,
/* allocate struct net_device if we don't have one yet */
if (!dev && !(dev = dev_alloc("arc%d", &err))) {
- BUGMSG(D_NORMAL, "Can't allocate device!\n");
+ BUGMSG2(D_NORMAL, "com90xx: Can't allocate device!\n");
return err;
}
lp = dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
@@ -546,8 +546,7 @@ int com90xx_reset(struct net_device *dev, int really_reset)
struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
short ioaddr = dev->base_addr;
- BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n",
- dev->name, ASTATUS());
+ BUGMSG(D_INIT, "Resetting (status=%02Xh)\n", ASTATUS());
if (really_reset) {
/* reset the card */
@@ -653,13 +652,11 @@ void cleanup_module(void)
dev = cards[count];
lp = (struct arcnet_local *) dev->priv;
- if (dev->start)
- dev->stop(dev);
+ unregister_netdev(dev);
free_irq(dev->irq, dev);
iounmap(lp->mem_start);
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
- unregister_netdev(dev);
kfree(dev->priv);
kfree(dev);
}
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c
index 759263ca0..92d026ec8 100644
--- a/drivers/net/arcnet/rfc1201.c
+++ b/drivers/net/arcnet/rfc1201.c
@@ -171,7 +171,7 @@ static void rx(struct net_device *dev, int bufnum,
BUGMSG(D_EXTRA, "aborting assembly (seq=%d) for unsplit packet (splitflag=%d, seq=%d)\n",
in->sequence, soft->split_flag, soft->sequence);
lp->rfc1201.aborted_seq = soft->sequence;
- kfree_skb(in->skb);
+ dev_kfree_skb_irq(in->skb);
lp->stats.rx_errors++;
lp->stats.rx_missed_errors++;
in->skb = NULL;
@@ -255,7 +255,7 @@ static void rx(struct net_device *dev, int bufnum,
BUGMSG(D_EXTRA, "wrong seq number (saddr=%d, expected=%d, seq=%d, splitflag=%d)\n",
saddr, in->sequence, soft->sequence,
soft->split_flag);
- kfree_skb(in->skb);
+ dev_kfree_skb_irq(in->skb);
in->skb = NULL;
lp->stats.rx_errors++;
lp->stats.rx_missed_errors++;
@@ -271,7 +271,7 @@ static void rx(struct net_device *dev, int bufnum,
soft->sequence);
lp->stats.rx_errors++;
lp->stats.rx_missed_errors++;
- kfree_skb(in->skb);
+ dev_kfree_skb_irq(in->skb);
}
in->sequence = soft->sequence;
in->numpackets = ((unsigned) soft->split_flag >> 1) + 2;
@@ -332,7 +332,7 @@ static void rx(struct net_device *dev, int bufnum,
"(seq=%d) aborted (splitflag=%d, seq=%d)\n",
in->sequence, soft->split_flag, soft->sequence);
lp->rfc1201.aborted_seq = soft->sequence;
- kfree_skb(in->skb);
+ dev_kfree_skb_irq(in->skb);
in->skb = NULL;
lp->stats.rx_errors++;
lp->stats.rx_missed_errors++;