[PARISC]: Fix build after ipv4_is_*() changes.
[safe/jmp/linux-2.6] / drivers / net / arm / ether3.c
index 1cc53ab..67e96ae 100644 (file)
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/interrupt.h>
-#include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
 #include <linux/slab.h>
@@ -69,9 +67,8 @@
 #include <asm/system.h>
 #include <asm/ecard.h>
 #include <asm/io.h>
-#include <asm/irq.h>
 
-static char version[] __initdata = "ether3 ethernet driver (c) 1995-2000 R.M.King v1.17\n";
+static char version[] __devinitdata = "ether3 ethernet driver (c) 1995-2000 R.M.King v1.17\n";
 
 #include "ether3.h"
 
@@ -82,7 +79,7 @@ static int    ether3_rx(struct net_device *dev, unsigned int maxcnt);
 static void    ether3_tx(struct net_device *dev);
 static int     ether3_open (struct net_device *dev);
 static int     ether3_sendpacket (struct sk_buff *skb, struct net_device *dev);
-static irqreturn_t ether3_interrupt (int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t ether3_interrupt (int irq, void *dev_id);
 static int     ether3_close (struct net_device *dev);
 static struct net_device_stats *ether3_getstats (struct net_device *dev);
 static void    ether3_setmulticastlist (struct net_device *dev);
@@ -199,7 +196,7 @@ static inline void ether3_ledon(struct net_device *dev)
  * Read the ethernet address string from the on board rom.
  * This is an ascii string!!!
  */
-static int __init
+static int __devinit
 ether3_addr(char *addr, struct expansion_card *ec)
 {
        struct in_chunk_dir cd;
@@ -224,7 +221,7 @@ ether3_addr(char *addr, struct expansion_card *ec)
 
 /* --------------------------------------------------------------------------- */
 
-static int __init
+static int __devinit
 ether3_ramtest(struct net_device *dev, unsigned char byte)
 {
        unsigned char *buffer = kmalloc(RX_END, GFP_KERNEL);
@@ -273,7 +270,7 @@ ether3_ramtest(struct net_device *dev, unsigned char byte)
 
 /* ------------------------------------------------------------------------------- */
 
-static int __init ether3_init_2(struct net_device *dev)
+static int __devinit ether3_init_2(struct net_device *dev)
 {
        int i;
 
@@ -466,7 +463,7 @@ static void ether3_setmulticastlist(struct net_device *dev)
        if (dev->flags & IFF_PROMISC) {
                /* promiscuous mode */
                priv(dev)->regs.config1 |= CFG1_RECVPROMISC;
-       } else if (dev->flags & IFF_ALLMULTI) {
+       } else if (dev->flags & IFF_ALLMULTI || dev->mc_count) {
                priv(dev)->regs.config1 |= CFG1_RECVSPECBRMULTI;
        } else
                priv(dev)->regs.config1 |= CFG1_RECVSPECBROAD;
@@ -519,8 +516,7 @@ ether3_sendpacket(struct sk_buff *skb, struct net_device *dev)
 
        length = (length + 1) & ~1;
        if (length != skb->len) {
-               skb = skb_padto(skb, length);
-               if (skb == NULL)
+               if (skb_padto(skb, length))
                        goto out;
        }
 
@@ -570,7 +566,7 @@ ether3_sendpacket(struct sk_buff *skb, struct net_device *dev)
 }
 
 static irqreturn_t
-ether3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+ether3_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *)dev_id;
        unsigned int status, handled = IRQ_NONE;
@@ -664,7 +660,6 @@ if (next_ptr < RX_START || next_ptr >= RX_END) {
                        if (skb) {
                                unsigned char *buf;
 
-                               skb->dev = dev;
                                skb_reserve(skb, 2);
                                buf = skb_put(skb, length);
                                ether3_readbuffer(dev, buf + 12, length - 12);
@@ -767,7 +762,7 @@ static void ether3_tx(struct net_device *dev)
        }
 }
 
-static void __init ether3_banner(void)
+static void __devinit ether3_banner(void)
 {
        static unsigned version_printed = 0;
 
@@ -780,7 +775,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
 {
        const struct ether3_data *data = id->data;
        struct net_device *dev;
-       int i, bus_type, ret;
+       int bus_type, ret;
+       DECLARE_MAC_BUF(mac);
 
        ether3_banner();
 
@@ -794,11 +790,9 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
                goto release;
        }
 
-       SET_MODULE_OWNER(dev);
        SET_NETDEV_DEV(dev, &ec->dev);
 
-       priv(dev)->base = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC),
-                                 ecard_resource_len(ec, ECARD_RES_MEMC));
+       priv(dev)->base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
        if (!priv(dev)->base) {
                ret = -ENOMEM;
                goto free;
@@ -865,16 +859,13 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
        if (ret)
                goto free;
 
-       printk("%s: %s in slot %d, ", dev->name, data->name, ec->slot_no);
-       for (i = 0; i < 6; i++)
-               printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
+       printk("%s: %s in slot %d, %s\n",
+              dev->name, data->name, ec->slot_no, print_mac(mac, dev->dev_addr));
 
        ecard_set_drvdata(ec, dev);
        return 0;
 
  free:
-       if (priv(dev)->base)
-               iounmap(priv(dev)->base);
        free_netdev(dev);
  release:
        ecard_release_resources(ec);
@@ -889,7 +880,6 @@ static void __devexit ether3_remove(struct expansion_card *ec)
        ecard_set_drvdata(ec, NULL);
 
        unregister_netdev(dev);
-       iounmap(priv(dev)->base);
        free_netdev(dev);
        ecard_release_resources(ec);
 }