[PATCH] lockdep: annotate 3c59x.c disable_irq()
[pandora-kernel.git] / drivers / net / 3c59x.c
index 1352eb6..2819de7 100644 (file)
 
 
 #define DRV_NAME       "3c59x"
-#define DRV_VERSION    "LK1.1.19"
-#define DRV_RELDATE    "10 Nov 2002"
 
 
 
@@ -238,7 +236,6 @@ static int vortex_debug = VORTEX_DEBUG;
 static int vortex_debug = 1;
 #endif
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -275,10 +272,8 @@ static char version[] __devinitdata =
 DRV_NAME ": Donald Becker and others. www.scyld.com/network/vortex.html\n";
 
 MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
-MODULE_DESCRIPTION("3Com 3c59x/3c9xx ethernet driver "
-                                       DRV_VERSION " " DRV_RELDATE);
+MODULE_DESCRIPTION("3Com 3c59x/3c9xx ethernet driver ");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);
 
 
 /* Operational parameter that usually are not changed. */
@@ -379,8 +374,7 @@ limit of 4K.
    of the drivers, and will likely be provided by some future kernel.
 */
 enum pci_flags_bit {
-       PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
-       PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3,
+       PCI_USES_MASTER=4,
 };
 
 enum { IS_VORTEX=1, IS_BOOMERANG=2, IS_CYCLONE=4, IS_TORNADO=8,
@@ -450,95 +444,95 @@ static struct vortex_chip_info {
        int io_size;
 } vortex_info_tbl[] __devinitdata = {
        {"3c590 Vortex 10Mbps",
-        PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, },
+        PCI_USES_MASTER, IS_VORTEX, 32, },
        {"3c592 EISA 10Mbps Demon/Vortex",                                      /* AKPM: from Don's 3c59x_cb.c 0.49H */
-        PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, },
+        PCI_USES_MASTER, IS_VORTEX, 32, },
        {"3c597 EISA Fast Demon/Vortex",                                        /* AKPM: from Don's 3c59x_cb.c 0.49H */
-        PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, },
+        PCI_USES_MASTER, IS_VORTEX, 32, },
        {"3c595 Vortex 100baseTx",
-        PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, },
+        PCI_USES_MASTER, IS_VORTEX, 32, },
        {"3c595 Vortex 100baseT4",
-        PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, },
+        PCI_USES_MASTER, IS_VORTEX, 32, },
 
        {"3c595 Vortex 100base-MII",
-        PCI_USES_IO|PCI_USES_MASTER, IS_VORTEX, 32, },
+        PCI_USES_MASTER, IS_VORTEX, 32, },
        {"3c900 Boomerang 10baseT",
-        PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|EEPROM_RESET, 64, },
+        PCI_USES_MASTER, IS_BOOMERANG|EEPROM_RESET, 64, },
        {"3c900 Boomerang 10Mbps Combo",
-        PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|EEPROM_RESET, 64, },
+        PCI_USES_MASTER, IS_BOOMERANG|EEPROM_RESET, 64, },
        {"3c900 Cyclone 10Mbps TPO",                                            /* AKPM: from Don's 0.99M */
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
        {"3c900 Cyclone 10Mbps Combo",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
 
        {"3c900 Cyclone 10Mbps TPC",                                            /* AKPM: from Don's 0.99M */
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
        {"3c900B-FL Cyclone 10base-FL",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
        {"3c905 Boomerang 100baseTx",
-        PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
+        PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
        {"3c905 Boomerang 100baseT4",
-        PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
+        PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
        {"3c905B Cyclone 100baseTx",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
 
        {"3c905B Cyclone 10/100/BNC",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
        {"3c905B-FX Cyclone 100baseFx",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
        {"3c905C Tornado",
-       PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
+       PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
        {"3c920B-EMB-WNM (ATI Radeon 9100 IGP)",
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_MII|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_TORNADO|HAS_MII|HAS_HWCKSM, 128, },
        {"3c980 Cyclone",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
 
        {"3c980C Python-T",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
        {"3cSOHO100-TX Hurricane",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
        {"3c555 Laptop Hurricane",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|EEPROM_8BIT|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|EEPROM_8BIT|HAS_HWCKSM, 128, },
        {"3c556 Laptop Tornado",
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_8BIT|HAS_CB_FNS|INVERT_MII_PWR|
+        PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_8BIT|HAS_CB_FNS|INVERT_MII_PWR|
                                                                        HAS_HWCKSM, 128, },
        {"3c556B Laptop Hurricane",
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_OFFSET|HAS_CB_FNS|INVERT_MII_PWR|
+        PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_OFFSET|HAS_CB_FNS|INVERT_MII_PWR|
                                        WNO_XCVR_PWR|HAS_HWCKSM, 128, },
 
        {"3c575 [Megahertz] 10/100 LAN  CardBus",
-       PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, },
+       PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, },
        {"3c575 Boomerang CardBus",
-        PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, },
+        PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, },
        {"3CCFE575BT Cyclone CardBus",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|
+        PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|
                                                                        INVERT_LED_PWR|HAS_HWCKSM, 128, },
        {"3CCFE575CT Tornado CardBus",
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
+        PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
                                                                        MAX_COLLISION_RESET|HAS_HWCKSM, 128, },
        {"3CCFE656 Cyclone CardBus",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
+        PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
                                                                        INVERT_LED_PWR|HAS_HWCKSM, 128, },
 
        {"3CCFEM656B Cyclone+Winmodem CardBus",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
+        PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
                                                                        INVERT_LED_PWR|HAS_HWCKSM, 128, },
        {"3CXFEM656C Tornado+Winmodem CardBus",                 /* From pcmcia-cs-3.1.5 */
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
+        PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
                                                                        MAX_COLLISION_RESET|HAS_HWCKSM, 128, },
        {"3c450 HomePNA Tornado",                                               /* AKPM: from Don's 0.99Q */
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
        {"3c920 Tornado",
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
        {"3c982 Hydra Dual Port A",
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
+        PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
 
        {"3c982 Hydra Dual Port B",
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
+        PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
        {"3c905B-T4",
-        PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
+        PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
        {"3c920B-EMB-WNM Tornado",
-        PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
+        PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
 
        {NULL,}, /* NULL terminated list. */
 };
@@ -792,7 +786,7 @@ struct vortex_private {
        int options;                                            /* User-settable misc. driver options. */
        unsigned int media_override:4,          /* Passed-in media type. */
                default_media:4,                                /* Read from the EEPROM/Wn3_Config. */
-               full_duplex:1, force_fd:1, autoselect:1,
+               full_duplex:1, autoselect:1,
                bus_master:1,                                   /* Vortex can only do a fragment bus-m. */
                full_bus_master_tx:1, full_bus_master_rx:2, /* Boomerang  */
                flow_ctrl:1,                                    /* Use 802.3x flow control (PAUSE only) */
@@ -904,7 +898,6 @@ static void acpi_set_WOL(struct net_device *dev);
 static struct ethtool_ops vortex_ethtool_ops;
 static void set_8021q_mode(struct net_device *dev, int enable);
 
-\f
 /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */
 /* Option count limit only -- unlimited interfaces are supported. */
 #define MAX_UNITS 8
@@ -919,8 +912,6 @@ static int global_full_duplex = -1;
 static int global_enable_wol = -1;
 static int global_use_mmio = -1;
 
-/* #define dev_alloc_skb dev_alloc_skb_debug */
-
 /* Variables to work-around the Compaq PCI BIOS32 problem. */
 static int compaq_ioaddr, compaq_irq, compaq_device_id = 0x5900;
 static struct net_device *compaq_net_device;
@@ -976,7 +967,7 @@ static void poll_vortex(struct net_device *dev)
 
 #ifdef CONFIG_PM
 
-static int vortex_suspend (struct pci_dev *pdev, pm_message_t state)
+static int vortex_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
 
@@ -994,7 +985,7 @@ static int vortex_suspend (struct pci_dev *pdev, pm_message_t state)
        return 0;
 }
 
-static int vortex_resume (struct pci_dev *pdev)
+static int vortex_resume(struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
        struct vortex_private *vp = netdev_priv(dev);
@@ -1005,7 +996,7 @@ static int vortex_resume (struct pci_dev *pdev)
                pci_enable_device(pdev);
                pci_set_master(pdev);
                if (request_irq(dev->irq, vp->full_bus_master_rx ?
-                               &boomerang_interrupt : &vortex_interrupt, SA_SHIRQ, dev->name, dev)) {
+                               &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev)) {
                        printk(KERN_WARNING "%s: Could not reserve IRQ %d\n", dev->name, dev->irq);
                        pci_disable_device(pdev);
                        return -EBUSY;
@@ -1027,8 +1018,8 @@ static struct eisa_device_id vortex_eisa_ids[] = {
        { "" }
 };
 
-static int vortex_eisa_probe (struct device *device);
-static int vortex_eisa_remove (struct device *device);
+static int vortex_eisa_probe(struct device *device);
+static int vortex_eisa_remove(struct device *device);
 
 static struct eisa_driver vortex_eisa_driver = {
        .id_table = vortex_eisa_ids,
@@ -1039,12 +1030,12 @@ static struct eisa_driver vortex_eisa_driver = {
        }
 };
 
-static int vortex_eisa_probe (struct device *device)
+static int vortex_eisa_probe(struct device *device)
 {
        void __iomem *ioaddr;
        struct eisa_device *edev;
 
-       edev = to_eisa_device (device);
+       edev = to_eisa_device(device);
 
        if (!request_region(edev->base_addr, VORTEX_TOTAL_SIZE, DRV_NAME))
                return -EBUSY;
@@ -1053,7 +1044,7 @@ static int vortex_eisa_probe (struct device *device)
 
        if (vortex_probe1(device, ioaddr, ioread16(ioaddr + 0xC88) >> 12,
                                          edev->id.driver_data, vortex_cards_found)) {
-               release_region (edev->base_addr, VORTEX_TOTAL_SIZE);
+               release_region(edev->base_addr, VORTEX_TOTAL_SIZE);
                return -ENODEV;
        }
 
@@ -1062,15 +1053,15 @@ static int vortex_eisa_probe (struct device *device)
        return 0;
 }
 
-static int vortex_eisa_remove (struct device *device)
+static int vortex_eisa_remove(struct device *device)
 {
        struct eisa_device *edev;
        struct net_device *dev;
        struct vortex_private *vp;
        void __iomem *ioaddr;
 
-       edev = to_eisa_device (device);
-       dev = eisa_get_drvdata (edev);
+       edev = to_eisa_device(device);
+       dev = eisa_get_drvdata(edev);
 
        if (!dev) {
                printk("vortex_eisa_remove called for Compaq device!\n");
@@ -1080,17 +1071,17 @@ static int vortex_eisa_remove (struct device *device)
        vp = netdev_priv(dev);
        ioaddr = vp->ioaddr;
        
-       unregister_netdev (dev);
-       iowrite16 (TotalReset|0x14, ioaddr + EL3_CMD);
-       release_region (dev->base_addr, VORTEX_TOTAL_SIZE);
+       unregister_netdev(dev);
+       iowrite16(TotalReset|0x14, ioaddr + EL3_CMD);
+       release_region(dev->base_addr, VORTEX_TOTAL_SIZE);
 
-       free_netdev (dev);
+       free_netdev(dev);
        return 0;
 }
 #endif
 
 /* returns count found (>= 0), or negative on error */
-static int __init vortex_eisa_init (void)
+static int __init vortex_eisa_init(void)
 {
        int eisa_found = 0;
        int orig_cards_found = vortex_cards_found;
@@ -1121,7 +1112,7 @@ static int __init vortex_eisa_init (void)
 }
 
 /* returns count (>= 0), or negative on error */
-static int __devinit vortex_init_one (struct pci_dev *pdev,
+static int __devinit vortex_init_one(struct pci_dev *pdev,
                                      const struct pci_device_id *ent)
 {
        int rc, unit, pci_bar;
@@ -1129,7 +1120,7 @@ static int __devinit vortex_init_one (struct pci_dev *pdev,
        void __iomem *ioaddr;
 
        /* wake up and enable device */         
-       rc = pci_enable_device (pdev);
+       rc = pci_enable_device(pdev);
        if (rc < 0)
                goto out;
 
@@ -1151,7 +1142,7 @@ static int __devinit vortex_init_one (struct pci_dev *pdev,
        rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq,
                           ent->driver_data, unit);
        if (rc < 0) {
-               pci_disable_device (pdev);
+               pci_disable_device(pdev);
                goto out;
        }
 
@@ -1236,7 +1227,7 @@ static int __devinit vortex_probe1(struct device *gendev,
        if (print_info)
                printk (KERN_INFO "See Documentation/networking/vortex.txt\n");
 
-       printk(KERN_INFO "%s: 3Com %s %s at %p. Vers " DRV_VERSION "\n",
+       printk(KERN_INFO "%s: 3Com %s %s at %p.\n",
               print_name,
               pdev ? "PCI" : "EISA",
               vci->name,
@@ -1266,7 +1257,7 @@ static int __devinit vortex_probe1(struct device *gendev,
 
                /* enable bus-mastering if necessary */         
                if (vci->flags & PCI_USES_MASTER)
-                       pci_set_master (pdev);
+                       pci_set_master(pdev);
 
                if (vci->drv_flags & IS_VORTEX) {
                        u8 pci_latency;
@@ -1310,7 +1301,7 @@ static int __devinit vortex_probe1(struct device *gendev,
        if (pdev)
                pci_set_drvdata(pdev, dev);
        if (edev)
-               eisa_set_drvdata (edev, dev);
+               eisa_set_drvdata(edev, dev);
 
        vp->media_override = 7;
        if (option >= 0) {
@@ -1389,17 +1380,12 @@ static int __devinit vortex_probe1(struct device *gendev,
        for (i = 0; i < 6; i++)
                iowrite8(dev->dev_addr[i], ioaddr + i);
 
-#ifdef __sparc__
-       if (print_info)
-               printk(", IRQ %s\n", __irq_itoa(dev->irq));
-#else
        if (print_info)
                printk(", IRQ %d\n", dev->irq);
        /* Tell them about an invalid IRQ. */
        if (dev->irq <= 0 || dev->irq >= NR_IRQS)
                printk(KERN_WARNING " *** Warning: IRQ %d is unlikely to work! ***\n",
                           dev->irq);
-#endif
 
        EL3WINDOW(4);
        step = (ioread8(ioaddr + Wn4_NetDiag) & 0x1e) >> 1;
@@ -1420,8 +1406,10 @@ static int __devinit vortex_probe1(struct device *gendev,
                }
 
                if (print_info) {
-                       printk(KERN_INFO "%s: CardBus functions mapped %8.8lx->%p\n",
-                               print_name, pci_resource_start(pdev, 2),
+                       printk(KERN_INFO "%s: CardBus functions mapped "
+                               "%16.16llx->%p\n",
+                               print_name,
+                               (unsigned long long)pci_resource_start(pdev, 2),
                                vp->cb_fn_base);
                }
                EL3WINDOW(2);
@@ -1640,12 +1628,6 @@ vortex_set_duplex(struct net_device *dev)
                        ((vp->full_duplex && vp->flow_ctrl && vp->partner_flow_ctrl) ?
                                        0x100 : 0),
                        ioaddr + Wn3_MAC_Ctrl);
-
-       issue_and_wait(dev, TxReset);
-       /*
-        * Don't reset the PHY - that upsets autonegotiation during DHCP operations.
-        */
-       issue_and_wait(dev, RxReset|0x04);
 }
 
 static void vortex_check_media(struct net_device *dev, unsigned int init)
@@ -1670,7 +1652,7 @@ vortex_up(struct net_device *dev)
        struct vortex_private *vp = netdev_priv(dev);
        void __iomem *ioaddr = vp->ioaddr;
        unsigned int config;
-       int i;
+       int i, mii_reg1, mii_reg5;
 
        if (VORTEX_PCI(vp)) {
                pci_set_power_state(VORTEX_PCI(vp), PCI_D0);    /* Go active */
@@ -1730,14 +1712,23 @@ vortex_up(struct net_device *dev)
                printk(KERN_DEBUG "vortex_up(): writing 0x%x to InternalConfig\n", config);
        iowrite32(config, ioaddr + Wn3_Config);
 
-       netif_carrier_off(dev);
        if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
                EL3WINDOW(4);
+               mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
+               mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
+               vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
+
                vortex_check_media(dev, 1);
        }
        else
                vortex_set_duplex(dev);
 
+       issue_and_wait(dev, TxReset);
+       /*
+        * Don't reset the PHY - that upsets autonegotiation during DHCP operations.
+        */
+       issue_and_wait(dev, RxReset|0x04);
+
 
        iowrite16(SetStatusEnb | 0x00, ioaddr + EL3_CMD);
 
@@ -1812,7 +1803,6 @@ vortex_up(struct net_device *dev)
        set_8021q_mode(dev, 1);
        iowrite16(StatsEnable, ioaddr + EL3_CMD); /* Turn on statistics. */
 
-//     issue_and_wait(dev, SetTxStart|0x07ff);
        iowrite16(RxEnable, ioaddr + EL3_CMD); /* Enable the receiver. */
        iowrite16(TxEnable, ioaddr + EL3_CMD); /* Enable transmitter. */
        /* Allow status bits to be seen. */
@@ -1843,7 +1833,7 @@ vortex_open(struct net_device *dev)
 
        /* Use the now-standard shared IRQ implementation. */
        if ((retval = request_irq(dev->irq, vp->full_bus_master_rx ?
-                               &boomerang_interrupt : &vortex_interrupt, SA_SHIRQ, dev->name, dev))) {
+                               &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev))) {
                printk(KERN_ERR "%s: Could not reserve IRQ %d\n", dev->name, dev->irq);
                goto out;
        }
@@ -1907,7 +1897,7 @@ vortex_timer(unsigned long data)
                printk(KERN_DEBUG "dev->watchdog_timeo=%d\n", dev->watchdog_timeo);
        }
 
-       disable_irq(dev->irq);
+       disable_irq_lockdep(dev->irq);
        old_window = ioread16(ioaddr + EL3_CMD) >> 13;
        EL3WINDOW(4);
        media_status = ioread16(ioaddr + Wn4_Media);
@@ -1948,7 +1938,7 @@ vortex_timer(unsigned long data)
        if (vp->medialock)
                goto leave_media_alone;
 
-       if ( ! ok) {
+       if (!ok) {
                unsigned int config;
 
                do {
@@ -1988,7 +1978,7 @@ leave_media_alone:
                         dev->name, media_tbl[dev->if_port].name);
 
        EL3WINDOW(old_window);
-       enable_irq(dev->irq);
+       enable_irq_lockdep(dev->irq);
        mod_timer(&vp->timer, RUN_AT(next_tick));
        if (vp->deferred)
                iowrite16(FakeIntr, ioaddr + EL3_CMD);
@@ -2091,16 +2081,14 @@ vortex_error(struct net_device *dev, int status)
                }
                if (tx_status & 0x14)  vp->stats.tx_fifo_errors++;
                if (tx_status & 0x38)  vp->stats.tx_aborted_errors++;
+               if (tx_status & 0x08)  vp->xstats.tx_max_collisions++;
                iowrite8(0, ioaddr + TxStatus);
                if (tx_status & 0x30) {                 /* txJabber or txUnderrun */
                        do_tx_reset = 1;
-               } else if (tx_status & 0x08) {  /* maxCollisions */
-                       vp->xstats.tx_max_collisions++;
-                       if (vp->drv_flags & MAX_COLLISION_RESET) {
-                               do_tx_reset = 1;
-                               reset_mask = 0x0108;            /* Reset interface logic, but not download logic */
-                       }
-               } else {                                                /* Merely re-enable the transmitter. */
+               } else if ((tx_status & 0x08) && (vp->drv_flags & MAX_COLLISION_RESET))  {      /* maxCollisions */
+                       do_tx_reset = 1;
+                       reset_mask = 0x0108;            /* Reset interface logic, but not download logic */
+               } else {                                /* Merely re-enable the transmitter. */
                        iowrite16(TxEnable, ioaddr + EL3_CMD);
                }
        }
@@ -2183,7 +2171,7 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (vp->bus_master) {
                /* Set the bus-master controller to transfer the packet. */
                int len = (skb->len + 3) & ~3;
-               iowrite32(      vp->tx_skb_dma = pci_map_single(VORTEX_PCI(vp), skb->data, len, PCI_DMA_TODEVICE),
+               iowrite32(vp->tx_skb_dma = pci_map_single(VORTEX_PCI(vp), skb->data, len, PCI_DMA_TODEVICE),
                                ioaddr + Wn7_MasterAddr);
                iowrite16(len, ioaddr + Wn7_MasterLen);
                vp->tx_skb = skb;
@@ -3040,7 +3028,6 @@ static void vortex_get_drvinfo(struct net_device *dev,
        struct vortex_private *vp = netdev_priv(dev);
 
        strcpy(info->driver, DRV_NAME);
-       strcpy(info->version, DRV_VERSION);
        if (VORTEX_PCI(vp)) {
                strcpy(info->bus_info, pci_name(VORTEX_PCI(vp)));
        } else {
@@ -3063,7 +3050,7 @@ static struct ethtool_ops vortex_ethtool_ops = {
        .set_settings           = vortex_set_settings,
        .get_link               = ethtool_op_get_link,
        .nway_reset             = vortex_nway_reset,
-       .get_perm_addr                  = ethtool_op_get_perm_addr,
+       .get_perm_addr          = ethtool_op_get_perm_addr,
 };
 
 #ifdef CONFIG_PCI
@@ -3264,7 +3251,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val
        }
        return;
 }
-\f
+
 /* ACPI: Advanced Configuration and Power Interface. */
 /* Set Wake-On-LAN mode and put the board into D3 (power-down) state. */
 static void acpi_set_WOL(struct net_device *dev)
@@ -3288,7 +3275,7 @@ static void acpi_set_WOL(struct net_device *dev)
 }
 
 
-static void __devexit vortex_remove_one (struct pci_dev *pdev)
+static void __devexit vortex_remove_one(struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
        struct vortex_private *vp;
@@ -3344,7 +3331,7 @@ static int vortex_have_pci;
 static int vortex_have_eisa;
 
 
-static int __init vortex_init (void)
+static int __init vortex_init(void)
 {
        int pci_rc, eisa_rc;
 
@@ -3360,14 +3347,14 @@ static int __init vortex_init (void)
 }
 
 
-static void __exit vortex_eisa_cleanup (void)
+static void __exit vortex_eisa_cleanup(void)
 {
        struct vortex_private *vp;
        void __iomem *ioaddr;
 
 #ifdef CONFIG_EISA
        /* Take care of the EISA devices */
-       eisa_driver_unregister (&vortex_eisa_driver);
+       eisa_driver_unregister(&vortex_eisa_driver);
 #endif
        
        if (compaq_net_device) {
@@ -3375,33 +3362,24 @@ static void __exit vortex_eisa_cleanup (void)
                ioaddr = ioport_map(compaq_net_device->base_addr,
                                    VORTEX_TOTAL_SIZE);
 
-               unregister_netdev (compaq_net_device);
-               iowrite16 (TotalReset, ioaddr + EL3_CMD);
+               unregister_netdev(compaq_net_device);
+               iowrite16(TotalReset, ioaddr + EL3_CMD);
                release_region(compaq_net_device->base_addr,
                               VORTEX_TOTAL_SIZE);
 
-               free_netdev (compaq_net_device);
+               free_netdev(compaq_net_device);
        }
 }
 
 
-static void __exit vortex_cleanup (void)
+static void __exit vortex_cleanup(void)
 {
        if (vortex_have_pci)
-               pci_unregister_driver (&vortex_driver);
+               pci_unregister_driver(&vortex_driver);
        if (vortex_have_eisa)
-               vortex_eisa_cleanup ();
+               vortex_eisa_cleanup();
 }
 
 
 module_init(vortex_init);
 module_exit(vortex_cleanup);
-
-\f
-/*
- * Local variables:
- *  c-indent-level: 4
- *  c-basic-offset: 4
- *  tab-width: 4
- * End:
- */