netdev: bfin_mac: add support for wake-on-lan magic packets
[safe/jmp/linux-2.6] / drivers / net / lib8390.c
index d6be360..316bb70 100644 (file)
@@ -257,7 +257,7 @@ static void __ei_tx_timeout(struct net_device *dev)
 {
        unsigned long e8390_base = dev->base_addr;
        struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
-       int txsr, isr, tickssofar = jiffies - dev->trans_start;
+       int txsr, isr, tickssofar = jiffies - dev_trans_start(dev);
        unsigned long flags;
 
        dev->stats.tx_errors++;
@@ -299,7 +299,8 @@ static void __ei_tx_timeout(struct net_device *dev)
  * Sends a packet to an 8390 network device.
  */
 
-static int __ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t __ei_start_xmit(struct sk_buff *skb,
+                                  struct net_device *dev)
 {
        unsigned long e8390_base = dev->base_addr;
        struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
@@ -385,7 +386,6 @@ static int __ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
        {
                ei_local->txing = 1;
                NS8390_trigger_send(dev, send_length, output_page);
-               dev->trans_start = jiffies;
                if (output_page == ei_local->tx_start_page)
                {
                        ei_local->tx1 = -1;
@@ -444,14 +444,14 @@ static irqreturn_t __ei_interrupt(int irq, void *dev_id)
 
        if (ei_local->irqlock)
        {
-#if 1 /* This might just be an interrupt for a PCI device sharing this line */
-               /* The "irqlock" check is only for testing. */
-               printk(ei_local->irqlock
-                          ? "%s: Interrupted while interrupts are masked! isr=%#2x imr=%#2x.\n"
-                          : "%s: Reentering the interrupt handler! isr=%#2x imr=%#2x.\n",
+               /*
+                * This might just be an interrupt for a PCI device sharing
+                * this line
+                */
+               printk("%s: Interrupted while interrupts are masked!"
+                          " isr=%#2x imr=%#2x.\n",
                           dev->name, ei_inb_p(e8390_base + EN0_ISR),
                           ei_inb_p(e8390_base + EN0_IMR));
-#endif
                spin_unlock(&ei_local->page_lock);
                return IRQ_NONE;
        }
@@ -463,8 +463,8 @@ static irqreturn_t __ei_interrupt(int irq, void *dev_id)
                           ei_inb_p(e8390_base + EN0_ISR));
 
        /* !!Assumption!! -- we stay in page 0.  Don't break this. */
-       while ((interrupts = ei_inb_p(e8390_base + EN0_ISR)) != 0
-                  && ++nr_serviced < MAX_SERVICE)
+       while ((interrupts = ei_inb_p(e8390_base + EN0_ISR)) != 0 &&
+              ++nr_serviced < MAX_SERVICE)
        {
                if (!netif_running(dev)) {
                        printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name);
@@ -720,10 +720,10 @@ static void ei_receive(struct net_device *dev)
                /* Check for bogosity warned by 3c503 book: the status byte is never
                   written.  This happened a lot during testing! This code should be
                   cleaned up someday. */
-               if (rx_frame.next != next_frame
-                       && rx_frame.next != next_frame + 1
-                       && rx_frame.next != next_frame - num_rx_pages
-                       && rx_frame.next != next_frame + 1 - num_rx_pages) {
+               if (rx_frame.next != next_frame &&
+                   rx_frame.next != next_frame + 1 &&
+                   rx_frame.next != next_frame - num_rx_pages &&
+                   rx_frame.next != next_frame + 1 - num_rx_pages) {
                        ei_local->current_page = rxing_page;
                        ei_outb(ei_local->current_page-1, e8390_base+EN0_BOUNDARY);
                        dev->stats.rx_errors++;
@@ -791,7 +791,6 @@ static void ei_receive(struct net_device *dev)
        /* We used to also ack ENISR_OVER here, but that would sometimes mask
           a real overrun, leaving the 8390 in a stopped state with rec'vr off. */
        ei_outb_p(ENISR_RX+ENISR_RX_ERR, e8390_base+EN0_ISR);
-       return;
 }
 
 /**
@@ -904,17 +903,10 @@ static struct net_device_stats *__ei_get_stats(struct net_device *dev)
 
 static inline void make_mc_bits(u8 *bits, struct net_device *dev)
 {
-       struct dev_mc_list *dmi;
+       struct netdev_hw_addr *ha;
 
-       for (dmi=dev->mc_list; dmi; dmi=dmi->next)
-       {
-               u32 crc;
-               if (dmi->dmi_addrlen != ETH_ALEN)
-               {
-                       printk(KERN_INFO "%s: invalid multicast address length given.\n", dev->name);
-                       continue;
-               }
-               crc = ether_crc(ETH_ALEN, dmi->dmi_addr);
+       netdev_for_each_mc_addr(ha, dev) {
+               u32 crc = ether_crc(ETH_ALEN, ha->addr);
                /*
                 * The 8390 uses the 6 most significant bits of the
                 * CRC to index the multicast table.
@@ -940,7 +932,7 @@ static void do_set_multicast_list(struct net_device *dev)
        if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI)))
        {
                memset(ei_local->mcfilter, 0, 8);
-               if (dev->mc_list)
+               if (!netdev_mc_empty(dev))
                        make_mc_bits(ei_local->mcfilter, dev);
        }
        else
@@ -974,7 +966,7 @@ static void do_set_multicast_list(struct net_device *dev)
 
        if(dev->flags&IFF_PROMISC)
                ei_outb_p(E8390_RXCONFIG | 0x18, e8390_base + EN0_RXCR);
-       else if(dev->flags&IFF_ALLMULTI || dev->mc_list)
+       else if (dev->flags & IFF_ALLMULTI || !netdev_mc_empty(dev))
                ei_outb_p(E8390_RXCONFIG | 0x08, e8390_base + EN0_RXCR);
        else
                ei_outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR);