arcnet: Use include/linux path for asm
[cascardo/linux.git] / drivers / net / arcnet / com90xx.c
index b80fbe4..0b7bc86 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Linux ARCnet driver - COM90xx chipset (memory-mapped buffers)
- * 
+ *
  * Written 1994-1999 by Avery Pennarun.
  * Written 1999 by Martin Mares <mj@ucw.cz>.
  * Derived from skeleton.c by Donald Becker.
 #include <linux/delay.h>
 #include <linux/netdevice.h>
 #include <linux/slab.h>
-#include <asm/io.h>
+#include <linux/io.h>
 #include <linux/arcdevice.h>
 
-
 #define VERSION "arcnet: COM90xx chipset support\n"
 
-
 /* Define this to speed up the autoprobe by assuming if only one io port and
  * shmem are left in the list at Stage 5, they must correspond to each
  * other.
@@ -53,7 +51,6 @@
  */
 #undef FAST_PROBE
 
-
 /* Internal function declarations */
 static int com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem *);
 static void com90xx_command(struct net_device *dev, int command);
@@ -77,26 +74,25 @@ static int numcards;
 
 /* Amount of I/O memory used by the card */
 #define BUFFER_SIZE (512)
-#define MIRROR_SIZE (BUFFER_SIZE*4)
+#define MIRROR_SIZE (BUFFER_SIZE * 4)
 
 /* COM 9026 controller chip --> ARCnet register addresses */
-#define _INTMASK (ioaddr+0)    /* writable */
-#define _STATUS  (ioaddr+0)    /* readable */
-#define _COMMAND (ioaddr+1)    /* writable, returns random vals on read (?) */
-#define _CONFIG  (ioaddr+2)    /* Configuration register */
-#define _RESET   (ioaddr+8)    /* software reset (on read) */
-#define _MEMDATA (ioaddr+12)   /* Data port for IO-mapped memory */
-#define _ADDR_HI (ioaddr+15)   /* Control registers for said */
-#define _ADDR_LO (ioaddr+14)
+#define _INTMASK       (ioaddr + 0)    /* writable */
+#define _STATUS                (ioaddr + 0)    /* readable */
+#define _COMMAND       (ioaddr + 1)    /* writable, returns random vals on read (?) */
+#define _CONFIG                (ioaddr + 2)    /* Configuration register */
+#define _RESET         (ioaddr + 8)    /* software reset (on read) */
+#define _MEMDATA       (ioaddr + 12)   /* Data port for IO-mapped memory */
+#define _ADDR_HI       (ioaddr + 15)   /* Control registers for said */
+#define _ADDR_LO       (ioaddr + 14)
 
 #undef ASTATUS
 #undef ACOMMAND
 #undef AINTMASK
 
 #define ASTATUS()      inb(_STATUS)
-#define ACOMMAND(cmd)  outb((cmd),_COMMAND)
-#define AINTMASK(msk)  outb((msk),_INTMASK)
-
+#define ACOMMAND(cmd)  outb((cmd), _COMMAND)
+#define AINTMASK(msk)  outb((msk), _INTMASK)
 
 static int com90xx_skip_probe __initdata = 0;
 
@@ -116,8 +112,7 @@ static void __init com90xx_probe(void)
 {
        int count, status, ioaddr, numprint, airq, openparen = 0;
        unsigned long airqmask;
-       int ports[(0x3f0 - 0x200) / 16 + 1] =
-       {0};
+       int ports[(0x3f0 - 0x200) / 16 + 1] = { 0 };
        unsigned long *shmems;
        void __iomem **iomem;
        int numports, numshmems, *port;
@@ -127,12 +122,12 @@ static void __init com90xx_probe(void)
        if (!io && !irq && !shmem && !*device && com90xx_skip_probe)
                return;
 
-       shmems = kzalloc(((0x100000-0xa0000) / 0x800) * sizeof(unsigned long),
+       shmems = kzalloc(((0x100000 - 0xa0000) / 0x800) * sizeof(unsigned long),
                         GFP_KERNEL);
        if (!shmems)
                return;
-       iomem = kzalloc(((0x100000-0xa0000) / 0x800) * sizeof(void __iomem *),
-                        GFP_KERNEL);
+       iomem = kzalloc(((0x100000 - 0xa0000) / 0x800) * sizeof(void __iomem *),
+                       GFP_KERNEL);
        if (!iomem) {
                kfree(shmems);
                return;
@@ -308,6 +303,7 @@ static void __init com90xx_probe(void)
        numprint = -1;
        for (port = &ports[0]; port < ports + numports; port++) {
                int found = 0;
+
                numprint++;
                numprint %= 8;
                if (!numprint) {
@@ -529,8 +525,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem
 
        dev->base_addr = ioaddr;
 
-       BUGMSG(D_NORMAL, "COM90xx station %02Xh found at %03lXh, IRQ %d, "
-              "ShMem %lXh (%ld*%xh).\n",
+       BUGMSG(D_NORMAL, "COM90xx station %02Xh found at %03lXh, IRQ %d, ShMem %lXh (%ld*%xh).\n",
               dev->dev_addr[0],
               dev->base_addr, dev->irq, dev->mem_start,
         (dev->mem_end - dev->mem_start + 1) / mirror_size, mirror_size);
@@ -552,7 +547,6 @@ err_free_dev:
        return -EIO;
 }
 
-
 static void com90xx_command(struct net_device *dev, int cmd)
 {
        short ioaddr = dev->base_addr;
@@ -560,7 +554,6 @@ static void com90xx_command(struct net_device *dev, int cmd)
        ACOMMAND(cmd);
 }
 
-
 static int com90xx_status(struct net_device *dev)
 {
        short ioaddr = dev->base_addr;
@@ -568,7 +561,6 @@ static int com90xx_status(struct net_device *dev)
        return ASTATUS();
 }
 
-
 static void com90xx_setmask(struct net_device *dev, int mask)
 {
        short ioaddr = dev->base_addr;
@@ -576,10 +568,9 @@ static void com90xx_setmask(struct net_device *dev, int mask)
        AINTMASK(mask);
 }
 
-
 /*
  * Do a hardware reset on the card, and set up necessary registers.
- * 
+ *
  * This should be called as little as possible, because it disrupts the
  * token on the network (causes a RECON) and requires a significant delay.
  *
@@ -625,19 +616,19 @@ static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset,
 {
        struct arcnet_local *lp = netdev_priv(dev);
        void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
+
        TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count));
 }
 
-
 static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset,
                                   void *buf, int count)
 {
        struct arcnet_local *lp = netdev_priv(dev);
        void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
+
        TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count));
 }
 
-
 MODULE_LICENSE("GPL");
 
 static int __init com90xx_init(void)