Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[safe/jmp/linux-2.6] / drivers / net / eexpress.c
index 2eb82ab..1686dca 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Many modifications, and currently maintained, by
  *  Philip Blundell <philb@gnu.org>
- * Added the Compaq LTE  Alan Cox <alan@redhat.com>
+ * Added the Compaq LTE  Alan Cox <alan@lxorguk.ukuu.org.uk>
  * Added MCA support Adam Fritzler
  *
  * Note - this driver is experimental still - it has problems on faster
@@ -202,7 +202,7 @@ static unsigned short start_code[] = {
        0x0000,Cmd_MCast,
        0x0076,                 /* link to next command */
 #define CONF_NR_MULTICAST 0x44
-       0x0000,                 /* number of multicast addresses */
+       0x0000,                 /* number of bytes in multicast address(es) */
 #define CONF_MULTICAST 0x46
        0x0000, 0x0000, 0x0000, /* some addresses */
        0x0000, 0x0000, 0x0000,
@@ -967,7 +967,6 @@ static void eexp_hw_rx_pio(struct net_device *dev)
                                insw(ioaddr+DATAPORT, skb_put(skb,pkt_len),(pkt_len+1)>>1);
                                skb->protocol = eth_type_trans(skb,dev);
                                netif_rx(skb);
-                               dev->last_rx = jiffies;
                                dev->stats.rx_packets++;
                                dev->stats.rx_bytes += pkt_len;
                        }
@@ -1044,10 +1043,21 @@ static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf,
        lp->last_tx = jiffies;
 }
 
+static const struct net_device_ops eexp_netdev_ops = {
+       .ndo_open               = eexp_open,
+       .ndo_stop               = eexp_close,
+       .ndo_start_xmit         = eexp_xmit,
+       .ndo_set_multicast_list = eexp_set_multicast,
+       .ndo_tx_timeout         = eexp_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 /*
  * Sanity check the suspected EtherExpress card
  * Read hardware address, reset card, size memory and initialize buffer
- * memory pointers. These are held in dev->priv, in case someone has more
+ * memory pointers. These are held in netdev_priv(), in case someone has more
  * than one card in a machine.
  */
 
@@ -1164,11 +1174,7 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
        lp->rx_buf_start = TX_BUF_START + (lp->num_tx_bufs*TX_BUF_SIZE);
        lp->width = buswidth;
 
-       dev->open = eexp_open;
-       dev->stop = eexp_close;
-       dev->hard_start_xmit = eexp_xmit;
-       dev->set_multicast_list = &eexp_set_multicast;
-       dev->tx_timeout = eexp_timeout;
+       dev->netdev_ops = &eexp_netdev_ops;
        dev->watchdog_timeo = 2*HZ;
 
        return register_netdev(dev);
@@ -1569,7 +1575,7 @@ static void eexp_hw_init586(struct net_device *dev)
 
 static void eexp_setup_filter(struct net_device *dev)
 {
-       struct dev_mc_list *dmi = dev->mc_list;
+       struct dev_mc_list *dmi;
        unsigned short ioaddr = dev->base_addr;
        int count = dev->mc_count;
        int i;
@@ -1580,9 +1586,9 @@ static void eexp_setup_filter(struct net_device *dev)
        }
 
        outw(CONF_NR_MULTICAST & ~31, ioaddr+SM_PTR);
-       outw(count, ioaddr+SHADOW(CONF_NR_MULTICAST));
-       for (i = 0; i < count; i++) {
-               unsigned short *data = (unsigned short *)dmi->dmi_addr;
+       outw(6*count, ioaddr+SHADOW(CONF_NR_MULTICAST));
+       for (i = 0, dmi = dev->mc_list; i < count; i++, dmi = dmi->next) {
+               unsigned short *data;
                if (!dmi) {
                        printk(KERN_INFO "%s: too few multicast addresses\n", dev->name);
                        break;
@@ -1591,6 +1597,7 @@ static void eexp_setup_filter(struct net_device *dev)
                        printk(KERN_INFO "%s: invalid multicast address length given.\n", dev->name);
                        continue;
                }
+               data = (unsigned short *)dmi->dmi_addr;
                outw((CONF_MULTICAST+(6*i)) & ~31, ioaddr+SM_PTR);
                outw(data[0], ioaddr+SHADOW(CONF_MULTICAST+(6*i)));
                outw((CONF_MULTICAST+(6*i)+2) & ~31, ioaddr+SM_PTR);