patch-2.4.20 linux-2.4.20/drivers/net/hplance.c

Next file: linux-2.4.20/drivers/net/irda/Config.in
Previous file: linux-2.4.20/drivers/net/hp100.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/drivers/net/hplance.c linux-2.4.20/drivers/net/hplance.c
@@ -58,9 +58,9 @@
 static int hplance_init(struct net_device *dev, int scode);
 static int hplance_open(struct net_device *dev);
 static int hplance_close(struct net_device *dev);
-static void hplance_writerap(struct hplance_private *lp, unsigned short value);
-static void hplance_writerdp(struct hplance_private *lp, unsigned short value);
-static unsigned short hplance_readrdp(struct hplance_private *lp);
+static void hplance_writerap(void *priv, unsigned short value);
+static void hplance_writerdp(void *priv, unsigned short value);
+static unsigned short hplance_readrdp(void *priv);
 
 #ifdef MODULE
 static struct hplance_private *root_hplance_dev;
@@ -100,8 +100,7 @@
 /* Initialise a single lance board at the given select code */
 static int __init hplance_init(struct net_device *dev, int scode)
 {
-        /* const char *name = dio_scodetoname(scode); */
-        static const char name[] = "HP LANCE";
+        const char *name = dio_scodetoname(scode);
         void *va = dio_scodetoviraddr(scode);
         struct hplance_private *lp;
         int i;
@@ -118,10 +117,10 @@
 #endif
 	SET_MODULE_OWNER(dev);
 
-        printk("%s: HP LANCE; select code %d, addr", dev->name, scode);
+        printk("%s: %s; select code %d, addr", dev->name, name, scode);
 
         /* reset the board */
-        writeb(0xff,va+DIO_IDOFF);
+        out_8(va+DIO_IDOFF, 0xff);
         udelay(100);                              /* ariba! ariba! udelay! udelay! */
 
         /* Fill the dev fields */
@@ -138,8 +137,8 @@
                 /* The NVRAM holds our ethernet address, one nibble per byte,
                  * at bytes NVRAMOFF+1,3,5,7,9...
                  */
-                dev->dev_addr[i] = ((readb(va + HPLANCE_NVRAMOFF + i*4 + 1) & 0xF) << 4)
-                        | (readb(va + HPLANCE_NVRAMOFF + i*4 + 3) & 0xF);
+                dev->dev_addr[i] = ((in_8(va + HPLANCE_NVRAMOFF + i*4 + 1) & 0xF) << 4)
+                        | (in_8(va + HPLANCE_NVRAMOFF + i*4 + 3) & 0xF);
                 printk("%c%2.2x", i == 0 ? ' ' : ':', dev->dev_addr[i]);
         }
         
@@ -175,25 +174,28 @@
 /* This is disgusting. We have to check the DIO status register for ack every
  * time we read or write the LANCE registers.
  */
-static void hplance_writerap(struct hplance_private *lp, unsigned short value)
+static void hplance_writerap(void *priv, unsigned short value)
 {
+	struct hplance_private *lp = (struct hplance_private *)priv;
         struct hplance_reg *hpregs = (struct hplance_reg *)lp->base;
         do {
                 lp->lance.ll->rap = value;
         } while ((hpregs->status & LE_ACK) == 0);
 }
 
-static void hplance_writerdp(struct hplance_private *lp, unsigned short value)
+static void hplance_writerdp(void *priv, unsigned short value)
 {
+	struct hplance_private *lp = (struct hplance_private *)priv;
         struct hplance_reg *hpregs = (struct hplance_reg *)lp->base;
         do {
                 lp->lance.ll->rdp = value;
         } while ((hpregs->status & LE_ACK) == 0);
 }
 
-static unsigned short hplance_readrdp(struct hplance_private *lp)
+static unsigned short hplance_readrdp(void *priv)
 {
         unsigned short val;
+	struct hplance_private *lp = (struct hplance_private *)priv;
         struct hplance_reg *hpregs = (struct hplance_reg *)lp->base;
         do {
                 val = lp->lance.ll->rdp;
@@ -211,7 +213,7 @@
         if (status)
                 return status;
         /* enable interrupts at board level. */
-        writeb(LE_IE, &(hpregs->status));
+        out_8(&(hpregs->status), LE_IE);
 
         return 0;
 }
@@ -220,7 +222,7 @@
 {
         struct hplance_private *lp = (struct hplance_private *)dev->priv;
         struct hplance_reg *hpregs = (struct hplance_reg *)lp->base;
-        writeb(0,&(hpregs->status));              /* disable interrupts at boardlevel */
+        out_8(&(hpregs->status), 8);              /* disable interrupts at boardlevel */
         lance_close(dev);
         return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)