IBMASM: dont use extern in function declarations
[safe/jmp/linux-2.6] / drivers / net / sun3_82586.c
index d5a58fb..b77ab6e 100644 (file)
  * Alphacode 0.82 (96/09/29) for Linux 2.0.0 (or later)
  * Copyrights (c) 1994,1995,1996 by M.Hipp (hippm@informatik.uni-tuebingen.de)
  * --------------------------
- * 
+ *
  * Consult ni52.c for further notes from the original driver.
  *
- * This incarnation currently supports the OBIO version of the i82586 chip 
+ * This incarnation currently supports the OBIO version of the i82586 chip
  * used in certain sun3 models.  It should be fairly doable to expand this
  * to support VME if I should every acquire such a board.
  *
@@ -28,8 +28,6 @@ static int automatic_resume = 0; /* experimental .. better should be zero */
 static int rfdadd = 0; /* rfdadd=1 may be better for 8K MEM cards */
 static int fifo=0x8;   /* don't change */
 
-/* #define REALLY_SLOW_IO */
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -122,7 +120,7 @@ sizeof(nop_cmd) = 8;
      DELAY_16(); DELAY_16(); } }
 
 static int     sun3_82586_probe1(struct net_device *dev,int ioaddr);
-static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr);
+static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id);
 static int     sun3_82586_open(struct net_device *dev);
 static int     sun3_82586_close(struct net_device *dev);
 static int     sun3_82586_send_packet(struct sk_buff *,struct net_device *);
@@ -227,7 +225,7 @@ static int check586(struct net_device *dev,char *where,unsigned size)
                return 0;
 
        iscp_addr = (char *)dvma_btov((unsigned long)where);
-       
+
        p->iscp = (struct iscp_struct *) iscp_addr;
        memset((char *)p->iscp,0, sizeof(struct iscp_struct));
 
@@ -237,7 +235,7 @@ static int check586(struct net_device *dev,char *where,unsigned size)
        sun3_reset586();
        sun3_attn586();
        DELAY(1);       /* wait a while... */
-       
+
        if(p->iscp->busy) /* i82586 clears 'busy' after successful init */
                return 0;
 
@@ -286,7 +284,7 @@ struct net_device * __init sun3_82586_probe(int unit)
        unsigned long ioaddr;
        static int found = 0;
        int err = -ENOMEM;
-       
+
        /* check that this machine has an onboard 82586 */
        switch(idprom->id_machtype) {
        case SM_SUN3|SM_3_160:
@@ -300,12 +298,12 @@ struct net_device * __init sun3_82586_probe(int unit)
 
        if (found)
                return ERR_PTR(-ENODEV);
-       
+
        ioaddr = (unsigned long)ioremap(IE_OBIO, SUN3_82586_TOTAL_SIZE);
        if (!ioaddr)
                return ERR_PTR(-ENOMEM);
        found = 1;
-       
+
        dev = alloc_etherdev(sizeof(struct priv));
        if (!dev)
                goto out;
@@ -330,7 +328,7 @@ out2:
 out1:
        free_netdev(dev);
 out:
-       iounmap((void *)ioaddr);
+       iounmap((void __iomem *)ioaddr);
        return ERR_PTR(err);
 }
 
@@ -379,7 +377,7 @@ static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
                ((struct priv *) dev->priv)->num_recv_buffs = NUM_RECV_BUFFS_32;
 
        printk("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n",dev->mem_start,size, dev->irq);
-       
+
        dev->open               = sun3_82586_open;
        dev->stop               = sun3_82586_close;
        dev->get_stats          = sun3_82586_get_stats;
@@ -479,7 +477,7 @@ static int init586(struct net_device *dev)
        /*
         * TDR, wire check .. e.g. no resistor e.t.c
         */
-        
+
        tdr_cmd = (struct tdr_cmd_struct *)ptr;
 
        tdr_cmd->cmd_status     = 0;
@@ -678,7 +676,7 @@ static void *alloc_rfa(struct net_device *dev,void *ptr)
  * Interrupt Handler ...
  */
 
-static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr)
+static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id)
 {
        struct net_device *dev = dev_id;
        unsigned short stat;
@@ -777,10 +775,9 @@ static void sun3_82586_rcv_int(struct net_device *dev)
                                        skb = (struct sk_buff *) dev_alloc_skb(totlen+2);
                                        if(skb != NULL)
                                        {
-                                               skb->dev = dev;
                                                skb_reserve(skb,2);
                                                skb_put(skb,totlen);
-                                               eth_copy_and_sum(skb,(char *) p->base+swab32((unsigned long) rbd->buffer),totlen,0);
+                                               skb_copy_to_linear_data(skb,(char *) p->base+swab32((unsigned long) rbd->buffer),totlen);
                                                skb->protocol=eth_type_trans(skb,dev);
                                                netif_rx(skb);
                                                p->stats.rx_packets++;
@@ -1026,10 +1023,11 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
        {
                len = skb->len;
                if (len < ETH_ZLEN) {
-                       memset((char *)p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN);
+                       memset((void *)p->xmit_cbuffs[p->xmit_count], 0,
+                              ETH_ZLEN);
                        len = ETH_ZLEN;
                }
-               memcpy((char *)p->xmit_cbuffs[p->xmit_count],(char *)(skb->data),skb->len);
+               skb_copy_from_linear_data(skb, (void *)p->xmit_cbuffs[p->xmit_count], skb->len);
 
 #if (NUM_XMIT_BUFFS == 1)
 #      ifdef NO_NOPCOMMANDS