NET: am79c961: fix assembler warnings
[linux-2.6.git] / drivers / net / sun3_82586.c
index efedc25..b6ae53b 100644 (file)
@@ -33,7 +33,6 @@ static int fifo=0x8;  /* don't change */
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -143,7 +142,6 @@ static void    sun3_82586_rnr_int(struct net_device *dev);
 
 struct priv
 {
-       struct net_device_stats stats;
        unsigned long base;
        char *memtop;
        long int lock;
@@ -413,7 +411,7 @@ static int init586(struct net_device *dev)
        volatile struct iasetup_cmd_struct *ias_cmd;
        volatile struct tdr_cmd_struct *tdr_cmd;
        volatile struct mcsetup_cmd_struct *mc_cmd;
-       struct dev_mc_list *dmi=dev->mc_list;
+       struct netdev_hw_addr *ha;
        int num_addrs=netdev_mc_count(dev);
 
        ptr = (void *) ((char *)p->scb + sizeof(struct scb_struct));
@@ -536,8 +534,10 @@ static int init586(struct net_device *dev)
                mc_cmd->cmd_link = 0xffff;
                mc_cmd->mc_cnt = swab16(num_addrs * 6);
 
-               for(i=0;i<num_addrs;i++,dmi=dmi->next)
-                       memcpy((char *) mc_cmd->mc_list[i], dmi->dmi_addr,6);
+               i = 0;
+               netdev_for_each_mc_addr(ha, dev)
+                       memcpy((char *) mc_cmd->mc_list[i++],
+                              ha->addr, ETH_ALEN);
 
                p->scb->cbl_offset = make16(mc_cmd);
                p->scb->cmd_cuc = CUC_START;
@@ -787,10 +787,10 @@ static void sun3_82586_rcv_int(struct net_device *dev)
                                                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++;
+                                               dev->stats.rx_packets++;
                                        }
                                        else
-                                               p->stats.rx_dropped++;
+                                               dev->stats.rx_dropped++;
                                }
                                else
                                {
@@ -811,13 +811,13 @@ static void sun3_82586_rcv_int(struct net_device *dev)
                                        totlen += rstat & RBD_MASK;
                                        rbd->status = 0;
                                        printk("%s: received oversized frame! length: %d\n",dev->name,totlen);
-                                       p->stats.rx_dropped++;
+                                       dev->stats.rx_dropped++;
                         }
                }
                else /* frame !(ok), only with 'save-bad-frames' */
                {
                        printk("%s: oops! rfd-error-status: %04x\n",dev->name,status);
-                       p->stats.rx_errors++;
+                       dev->stats.rx_errors++;
                }
                p->rfd_top->stat_high = 0;
                p->rfd_top->last = RFD_SUSP; /* maybe exchange by RFD_LAST */
@@ -884,7 +884,7 @@ static void sun3_82586_rnr_int(struct net_device *dev)
 {
        struct priv *p = netdev_priv(dev);
 
-       p->stats.rx_errors++;
+       dev->stats.rx_errors++;
 
        WAIT_4_SCB_CMD();               /* wait for the last cmd, WAIT_4_FULLSTAT?? */
        p->scb->cmd_ruc = RUC_ABORT; /* usually the RU is in the 'no resource'-state .. abort it now. */
@@ -917,29 +917,29 @@ static void sun3_82586_xmt_int(struct net_device *dev)
 
        if(status & STAT_OK)
        {
-               p->stats.tx_packets++;
-               p->stats.collisions += (status & TCMD_MAXCOLLMASK);
+               dev->stats.tx_packets++;
+               dev->stats.collisions += (status & TCMD_MAXCOLLMASK);
        }
        else
        {
-               p->stats.tx_errors++;
+               dev->stats.tx_errors++;
                if(status & TCMD_LATECOLL) {
                        printk("%s: late collision detected.\n",dev->name);
-                       p->stats.collisions++;
+                       dev->stats.collisions++;
                }
                else if(status & TCMD_NOCARRIER) {
-                       p->stats.tx_carrier_errors++;
+                       dev->stats.tx_carrier_errors++;
                        printk("%s: no carrier detected.\n",dev->name);
                }
                else if(status & TCMD_LOSTCTS)
                        printk("%s: loss of CTS detected.\n",dev->name);
                else if(status & TCMD_UNDERRUN) {
-                       p->stats.tx_fifo_errors++;
+                       dev->stats.tx_fifo_errors++;
                        printk("%s: DMA underrun detected.\n",dev->name);
                }
                else if(status & TCMD_MAXCOLL) {
                        printk("%s: Max. collisions exceeded.\n",dev->name);
-                       p->stats.collisions += 16;
+                       dev->stats.collisions += 16;
                }
        }
 
@@ -984,7 +984,7 @@ static void sun3_82586_timeout(struct net_device *dev)
                p->scb->cmd_cuc = CUC_START;
                sun3_attn586();
                WAIT_4_SCB_CMD();
-               dev->trans_start = jiffies;
+               dev->trans_start = jiffies; /* prevent tx timeout */
                return 0;
        }
 #endif
@@ -997,7 +997,7 @@ static void sun3_82586_timeout(struct net_device *dev)
                sun3_82586_close(dev);
                sun3_82586_open(dev);
        }
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
 }
 
 /******************************************************
@@ -1061,7 +1061,6 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
                        }
 
                        sun3_attn586();
-                       dev->trans_start = jiffies;
                        if(!i)
                                dev_kfree_skb(skb);
                        WAIT_4_SCB_CMD();
@@ -1081,7 +1080,6 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
                p->xmit_cmds[0]->cmd_status = p->nop_cmds[next_nop]->cmd_status = 0;
 
                p->nop_cmds[p->nop_point]->cmd_link = make16((p->xmit_cmds[0]));
-               dev->trans_start = jiffies;
                p->nop_point = next_nop;
                dev_kfree_skb(skb);
 #      endif
@@ -1096,7 +1094,6 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
                p->nop_cmds[next_nop]->cmd_status = 0;
 
                p->nop_cmds[p->xmit_count]->cmd_link = make16((p->xmit_cmds[p->xmit_count]));
-               dev->trans_start = jiffies;
                p->xmit_count = next_nop;
 
                {
@@ -1131,12 +1128,12 @@ static struct net_device_stats *sun3_82586_get_stats(struct net_device *dev)
        ovrn = swab16(p->scb->ovrn_errs);
        p->scb->ovrn_errs = 0;
 
-       p->stats.rx_crc_errors += crc;
-       p->stats.rx_fifo_errors += ovrn;
-       p->stats.rx_frame_errors += aln;
-       p->stats.rx_dropped += rsc;
+       dev->stats.rx_crc_errors += crc;
+       dev->stats.rx_fifo_errors += ovrn;
+       dev->stats.rx_frame_errors += aln;
+       dev->stats.rx_dropped += rsc;
 
-       return &p->stats;
+       return &dev->stats;
 }
 
 /********************************************************