niu: Refinements to kernel logging.
[safe/jmp/linux-2.6] / drivers / net / ac3200.c
index 7952dc6..eac7338 100644 (file)
@@ -45,7 +45,7 @@ static const char version[] =
 #define AC_NIC_BASE    0x00
 #define AC_SA_PROM     0x16                    /* The station address PROM. */
 #define AC_ADDR0       0x00                    /* Prefix station address values. */
-#define AC_ADDR1       0x40                    
+#define AC_ADDR1       0x40
 #define AC_ADDR2       0x90
 #define AC_ID_PORT     0xC80
 #define AC_EISA_ID     0x0110d305
@@ -89,7 +89,7 @@ static void ac_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
                                        int ring_page);
 
 static int ac_close_card(struct net_device *dev);
-\f
+
 
 /*     Probe for the AC3200.
 
@@ -103,8 +103,6 @@ static int __init do_ac3200_probe(struct net_device *dev)
        int irq = dev->irq;
        int mem_start = dev->mem_start;
 
-       SET_MODULE_OWNER(dev);
-
        if (ioaddr > 0x1ff)             /* Check a single specified location. */
                return ac_probe1(ioaddr, dev);
        else if (ioaddr > 0)            /* Don't probe at all. */
@@ -145,6 +143,22 @@ out:
 }
 #endif
 
+static const struct net_device_ops ac_netdev_ops = {
+       .ndo_open               = ac_open,
+       .ndo_stop               = ac_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    = ei_poll,
+#endif
+};
+
 static int __init ac_probe1(int ioaddr, struct net_device *dev)
 {
        int i, retval;
@@ -169,10 +183,11 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
                   inb(ioaddr + AC_ID_PORT + 2), inb(ioaddr + AC_ID_PORT + 3));
 #endif
 
-       printk("AC3200 in EISA slot %d, node", ioaddr/0x1000);
-       for(i = 0; i < 6; i++)
-               printk(" %02x", dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i));
+       for (i = 0; i < 6; i++)
+               dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i);
 
+       printk(KERN_DEBUG "AC3200 in EISA slot %d, node %pM",
+              ioaddr/0x1000, dev->dev_addr);
 #if 0
        /* Check the vendor ID/prefix. Redundant after checking the EISA ID */
        if (inb(ioaddr + AC_SA_PROM + 0) != AC_ADDR0
@@ -217,7 +232,7 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
        dev->if_port = inb(ioaddr + AC_CONFIG) >> 6;
        dev->mem_start = config2mem(inb(ioaddr + AC_CONFIG));
 
-       printk("%s: AC3200 at %#3x with %dkB memory at physical address %#lx.\n", 
+       printk("%s: AC3200 at %#3x with %dkB memory at physical address %#lx.\n",
                        dev->name, ioaddr, AC_STOP_PG/4, dev->mem_start);
 
        /*
@@ -254,11 +269,7 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
        ei_status.block_output = &ac_block_output;
        ei_status.get_8390_hdr = &ac_get_8390_hdr;
 
-       dev->open = &ac_open;
-       dev->stop = &ac_close_card;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = ei_poll;
-#endif
+       dev->netdev_ops = &ac_netdev_ops;
        NS8390_init(dev, 0);
 
        retval = register_netdev(dev);
@@ -327,8 +338,7 @@ static void ac_block_input(struct net_device *dev, int count, struct sk_buff *sk
                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, start, count, 0);
+               memcpy_fromio(skb->data, start, count);
        }
 }
 
@@ -370,8 +380,7 @@ MODULE_PARM_DESC(mem, "Memory base address(es)");
 MODULE_DESCRIPTION("Ansel AC3200 EISA ethernet driver");
 MODULE_LICENSE("GPL");
 
-int
-init_module(void)
+static int __init ac3200_module_init(void)
 {
        struct net_device *dev;
        int this_dev, found = 0;
@@ -406,8 +415,7 @@ static void cleanup_card(struct net_device *dev)
        iounmap(ei_status.mem);
 }
 
-void
-cleanup_module(void)
+static void __exit ac3200_module_exit(void)
 {
        int this_dev;
 
@@ -420,4 +428,6 @@ cleanup_module(void)
                }
        }
 }
+module_init(ac3200_module_init);
+module_exit(ac3200_module_exit);
 #endif /* MODULE */