]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/ne-h8300.c
PCI: fix ARI code to be compatible with mixed ARI/non-ARI systems
[linux-2.6-omap-h63xx.git] / drivers / net / ne-h8300.c
index eb893d7e8834fac23162ca89a7b63c5a91d2b61c..fbc7531d3c7d8aed647056c905e4aa74a476b0e8 100644 (file)
@@ -33,6 +33,8 @@ static const char version1[] =
 #include <asm/io.h>
 #include <asm/irq.h>
 
+#define EI_SHIFT(x)    (ei_local->reg_offset[x])
+
 #include "8390.h"
 
 #define DRV_NAME "ne-h8300"
@@ -52,6 +54,11 @@ static const char version1[] =
 
 /* ---- No user-serviceable parts below ---- */
 
+static const char version[] =
+    "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
+
+#include "lib8390.c"
+
 #define NE_BASE         (dev->base_addr)
 #define NE_CMD         0x00
 #define NE_DATAPORT    (ei_status.word16?0x20:0x10)    /* NatSemi-defined port window offset. */
@@ -86,7 +93,7 @@ static int __init init_reg_offset(struct net_device *dev,unsigned long base_addr
        bus_width = *(volatile unsigned char *)ABWCR;
        bus_width &= 1 << ((base_addr >> 21) & 7);
 
-       for (i = 0; i < sizeof(reg_offset) / sizeof(u32); i++)
+       for (i = 0; i < ARRAY_SIZE(reg_offset); i++)
                if (bus_width == 0)
                        reg_offset[i] = i * 2 + 1;
                else
@@ -108,7 +115,7 @@ static int h8300_ne_irq[] = {EXT_IRQ5};
 
 static inline int init_dev(struct net_device *dev)
 {
-       if (h8300_ne_count < (sizeof(h8300_ne_base) / sizeof(unsigned long))) {
+       if (h8300_ne_count < ARRAY_SIZE(h8300_ne_base)) {
                dev->base_addr = h8300_ne_base[h8300_ne_count];
                dev->irq       = h8300_ne_irq[h8300_ne_count];
                h8300_ne_count++;
@@ -142,8 +149,6 @@ static int __init do_ne_probe(struct net_device *dev)
 {
        unsigned int base_addr = dev->base_addr;
 
-       SET_MODULE_OWNER(dev);
-
        /* First check any supplied i/o locations. User knows best. <cough> */
        if (base_addr > 0x1ff)  /* Check a single specified location. */
                return ne_probe1(dev, base_addr);
@@ -162,7 +167,7 @@ static void cleanup_card(struct net_device *dev)
 #ifndef MODULE
 struct net_device * __init ne_probe(int unit)
 {
-       struct net_device *dev = alloc_ei_netdev();
+       struct net_device *dev = ____alloc_ei_netdev(0);
        int err;
 
        if (!dev)
@@ -199,6 +204,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
        static unsigned version_printed;
        struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
        unsigned char bus_width;
+       DECLARE_MAC_BUF(mac);
 
        if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
                return -EBUSY;
@@ -252,7 +258,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
                        {E8390_RREAD+E8390_START, E8390_CMD},
                };
 
-               for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
+               for (i = 0; i < ARRAY_SIZE(program_seq); i++)
                        outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
 
        }
@@ -283,7 +289,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
 
        /* Snarf the interrupt now.  There's no point in waiting since we cannot
           share and the board will usually be enabled. */
-       ret = request_irq(dev->irq, ei_interrupt, 0, name, dev);
+       ret = request_irq(dev->irq, __ei_interrupt, 0, name, dev);
        if (ret) {
                printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
                goto err_out;
@@ -291,12 +297,11 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
 
        dev->base_addr = ioaddr;
 
-       for(i = 0; i < ETHER_ADDR_LEN; i++) {
-               printk(" %2.2x", SA_prom[i]);
+       for(i = 0; i < ETHER_ADDR_LEN; i++)
                dev->dev_addr[i] = SA_prom[i];
-       }
+       printk(" %s\n", print_mac(mac, dev->dev_addr));
 
-       printk("\n%s: %s found at %#x, using IRQ %d.\n",
+       printk("%s: %s found at %#x, using IRQ %d.\n",
                dev->name, name, ioaddr, dev->irq);
 
        ei_status.name = name;
@@ -318,9 +323,9 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
        dev->open = &ne_open;
        dev->stop = &ne_close;
 #ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = ei_poll;
+       dev->poll_controller = __ei_poll;
 #endif
-       NS8390_init(dev, 0);
+       __NS8390_init(dev, 0);
 
        ret = register_netdev(dev);
        if (ret)
@@ -335,7 +340,7 @@ err_out:
 
 static int ne_open(struct net_device *dev)
 {
-       ei_open(dev);
+       __ei_open(dev);
        return 0;
 }
 
@@ -343,7 +348,7 @@ static int ne_close(struct net_device *dev)
 {
        if (ei_debug > 1)
                printk(KERN_DEBUG "%s: Shutting down ethercard.\n", dev->name);
-       ei_close(dev);
+       __ei_close(dev);
        return 0;
 }
 
@@ -584,7 +589,7 @@ retry:
                if (time_after(jiffies, dma_start + 2*HZ/100)) {                /* 20ms */
                        printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
                        ne_reset_8390(dev);
-                       NS8390_init(dev,1);
+                       __NS8390_init(dev,1);
                        break;
                }
 
@@ -620,7 +625,7 @@ int init_module(void)
        int err;
 
        for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
-               struct net_device *dev = alloc_ei_netdev();
+               struct net_device *dev = ____alloc_ei_netdev(0);
                if (!dev)
                        break;
                if (io[this_dev]) {