cnic: Convert cnic_local_flags to atomic ops.
[safe/jmp/linux-2.6] / drivers / net / smc-ultra.c
index 3db30cd..d2dd8e6 100644 (file)
@@ -57,7 +57,6 @@
 static const char version[] =
        "smc-ultra.c:v2.02 2/3/98 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -112,7 +111,7 @@ static struct isapnp_device_id ultra_device_ids[] __initdata = {
 MODULE_DEVICE_TABLE(isapnp, ultra_device_ids);
 #endif
 
-\f
+
 #define START_PG               0x00    /* First page of TX buffer */
 
 #define ULTRA_CMDREG   0               /* Offset to ASIC command register. */
@@ -123,12 +122,12 @@ MODULE_DEVICE_TABLE(isapnp, ultra_device_ids);
 #define ULTRA_NIC_OFFSET  16   /* NIC register offset from the base_addr. */
 #define ULTRA_IO_EXTENT 32
 #define EN0_ERWCNT             0x08    /* Early receive warning count. */
-\f
+
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void ultra_poll(struct net_device *dev)
 {
        disable_irq(dev->irq);
-       ei_interrupt(dev->irq, dev, NULL);
+       ei_interrupt(dev->irq, dev);
        enable_irq(dev->irq);
 }
 #endif
@@ -143,11 +142,6 @@ static int __init do_ultra_probe(struct net_device *dev)
        int base_addr = dev->base_addr;
        int irq = dev->irq;
 
-       SET_MODULE_OWNER(dev);
-
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = &ultra_poll;
-#endif
        if (base_addr > 0x1ff)          /* Check a single specified location. */
                return ultra_probe1(dev, base_addr);
        else if (base_addr != 0)        /* Don't probe at all. */
@@ -190,6 +184,22 @@ out:
 }
 #endif
 
+static const struct net_device_ops ultra_netdev_ops = {
+       .ndo_open               = ultra_open,
+       .ndo_stop               = ultra_close_card,
+
+       .ndo_start_xmit         = ei_start_xmit,
+       .ndo_tx_timeout         = ei_tx_timeout,
+       .ndo_get_stats          = ei_get_stats,
+       .ndo_set_multicast_list = ei_set_multicast_list,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_change_mtu         = eth_change_mtu,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = ultra_poll,
+#endif
+};
+
 static int __init ultra_probe1(struct net_device *dev, int ioaddr)
 {
        int i, retval;
@@ -227,10 +237,11 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
 
        model_name = (idreg & 0xF0) == 0x20 ? "SMC Ultra" : "SMC EtherEZ";
 
-       printk("%s: %s at %#3x,", dev->name, model_name, ioaddr);
-
        for (i = 0; i < 6; i++)
-               printk(" %2.2X", dev->dev_addr[i] = inb(ioaddr + 8 + i));
+               dev->dev_addr[i] = inb(ioaddr + 8 + i);
+
+       printk("%s: %s at %#3x, %pM", dev->name, model_name,
+              ioaddr, dev->dev_addr);
 
        /* Switch from the station address to the alternate register set and
           read the useful registers there. */
@@ -302,11 +313,8 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
                ei_status.get_8390_hdr = &ultra_get_8390_hdr;
        }
        ei_status.reset_8390 = &ultra_reset_8390;
-       dev->open = &ultra_open;
-       dev->stop = &ultra_close_card;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = ei_poll;
-#endif
+
+       dev->netdev_ops = &ultra_netdev_ops;
        NS8390_init(dev, 0);
 
        retval = register_netdev(dev);
@@ -413,7 +421,6 @@ ultra_reset_8390(struct net_device *dev)
                outb(0x01, cmd_port + 6);               /* Enable interrupts and memory. */
 
        if (ei_debug > 1) printk("reset done\n");
-       return;
 }
 
 /* Grab the 8390 specific header. Similar to the block_input routine, but
@@ -455,8 +462,7 @@ ultra_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ri
                count -= semi_count;
                memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count);
        } else {
-               /* Packet is in one chunk -- we can copy + cksum. */
-               eth_io_copy_and_sum(skb, xfer_start, count, 0);
+               memcpy_fromio(skb->data, xfer_start, count);
        }
 
        outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET);  /* Disable memory. */
@@ -537,7 +543,7 @@ ultra_close_card(struct net_device *dev)
        return 0;
 }
 
-\f
+
 #ifdef MODULE
 #define MAX_ULTRA_CARDS        4       /* Max number of Ultra cards per module */
 static struct net_device *dev_ultra[MAX_ULTRA_CARDS];
@@ -553,7 +559,7 @@ MODULE_LICENSE("GPL");
 
 /* This is set up so that only a single autoprobe takes place per call.
 ISA device autoprobes on a running machine are not recommended. */
-int
+int __init
 init_module(void)
 {
        struct net_device *dev;
@@ -594,7 +600,7 @@ static void cleanup_card(struct net_device *dev)
        iounmap(ei_status.mem);
 }
 
-void
+void __exit
 cleanup_module(void)
 {
        int this_dev;