qlge: Add disable/enable firmare irqs to handler.
[safe/jmp/linux-2.6] / drivers / net / hp.c
index 59cf841..5c4d78c 100644 (file)
@@ -59,8 +59,6 @@ static unsigned int hppclan_portlist[] __initdata =
 
 static int hp_probe1(struct net_device *dev, int ioaddr);
 
-static int hp_open(struct net_device *dev);
-static int hp_close(struct net_device *dev);
 static void hp_reset_8390(struct net_device *dev);
 static void hp_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
                                        int ring_page);
@@ -75,7 +73,7 @@ static void hp_init_card(struct net_device *dev);
 /* My default is IRQ5               0  1  2  3  4  5  6  7  8  9 10 11 */
 static char irqmap[16] __initdata= { 0, 0, 4, 6, 8,10, 0,14, 0, 4, 2,12,0,0,0,0};
 
-\f
+
 /*     Probe for an HP LAN adaptor.
        Also initialize the card and fill in STATION_ADDR with the station
        address. */
@@ -86,8 +84,6 @@ static int __init do_hp_probe(struct net_device *dev)
        int base_addr = dev->base_addr;
        int irq = dev->irq;
 
-       SET_MODULE_OWNER(dev);
-
        if (base_addr > 0x1ff)          /* Check a single specified location. */
                return hp_probe1(dev, base_addr);
        else if (base_addr != 0)        /* Don't probe at all. */
@@ -102,16 +98,10 @@ static int __init do_hp_probe(struct net_device *dev)
        return -ENODEV;
 }
 
-static void cleanup_card(struct net_device *dev)
-{
-       free_irq(dev->irq, dev);
-       release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
-}
-
 #ifndef MODULE
 struct net_device * __init hp_probe(int unit)
 {
-       struct net_device *dev = alloc_ei_netdev();
+       struct net_device *dev = alloc_eip_netdev();
        int err;
 
        if (!dev)
@@ -166,7 +156,9 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
        printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr);
 
        for(i = 0; i < ETHER_ADDR_LEN; i++)
-               printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i));
+               dev->dev_addr[i] = inb(ioaddr + i);
+
+       printk(" %pM", dev->dev_addr);
 
        /* Snarf the interrupt now.  Someday this could be moved to open(). */
        if (dev->irq < 2) {
@@ -181,7 +173,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
                                outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE);
                                outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE);
                                if (irq == probe_irq_off(cookie)                 /* It's a good IRQ line! */
-                                       && request_irq (irq, ei_interrupt, 0, DRV_NAME, dev) == 0) {
+                                       && request_irq (irq, eip_interrupt, 0, DRV_NAME, dev) == 0) {
                                        printk(" selecting IRQ %d.\n", irq);
                                        dev->irq = *irqp;
                                        break;
@@ -196,7 +188,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
        } else {
                if (dev->irq == 2)
                        dev->irq = 9;
-               if ((retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev))) {
+               if ((retval = request_irq(dev->irq, eip_interrupt, 0, DRV_NAME, dev))) {
                        printk (" unable to get IRQ %d.\n", dev->irq);
                        goto out;
                }
@@ -204,11 +196,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
 
        /* Set the base address to point to the NIC, not the "real" base! */
        dev->base_addr = ioaddr + NIC_OFFSET;
-       dev->open = &hp_open;
-       dev->stop = &hp_close;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = ei_poll;
-#endif
+       dev->netdev_ops = &eip_netdev_ops;
 
        ei_status.name = name;
        ei_status.word16 = wordmode;
@@ -233,20 +221,6 @@ out:
        return retval;
 }
 
-static int
-hp_open(struct net_device *dev)
-{
-       ei_open(dev);
-       return 0;
-}
-
-static int
-hp_close(struct net_device *dev)
-{
-       ei_close(dev);
-       return 0;
-}
-
 static void
 hp_reset_8390(struct net_device *dev)
 {
@@ -390,11 +364,11 @@ hp_block_output(struct net_device *dev, int count,
 }
 
 /* This function resets the ethercard if something screws up. */
-static void
+static void __init
 hp_init_card(struct net_device *dev)
 {
        int irq = dev->irq;
-       NS8390_init(dev, 0);
+       NS8390p_init(dev, 0);
        outb_p(irqmap[irq&0x0f] | HP_RUN,
                   dev->base_addr - NIC_OFFSET + HP_CONFIGURE);
        return;
@@ -415,7 +389,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;
@@ -426,7 +400,7 @@ init_module(void)
                        if (this_dev != 0) break; /* only autoprobe 1st one */
                        printk(KERN_NOTICE "hp.c: Presently autoprobing (not recommended) for a single card.\n");
                }
-               dev = alloc_ei_netdev();
+               dev = alloc_eip_netdev();
                if (!dev)
                        break;
                dev->irq = irq[this_dev];
@@ -444,7 +418,13 @@ init_module(void)
        return -ENXIO;
 }
 
-void
+static void cleanup_card(struct net_device *dev)
+{
+       free_irq(dev->irq, dev);
+       release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
+}
+
+void __exit
 cleanup_module(void)
 {
        int this_dev;