]> Pileus Git - ~andy/linux/blobdiff - drivers/net/tulip/media.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux...
[~andy/linux] / drivers / net / tulip / media.c
index 1594160a0f6252bbdc1c3d25c1ea7eddca278912..91cf9c863910600b8c910e51196cb3ed6c16aa50 100644 (file)
@@ -1,7 +1,6 @@
 /*
        drivers/net/tulip/media.c
 
-       Maintained by Valerie Henson <val_henson@linux.intel.com>
        Copyright 2000,2001  The Linux Kernel Team
        Written/copyright 1994-2001 by Donald Becker.
 
@@ -9,9 +8,9 @@
        of the GNU General Public License, incorporated herein by reference.
 
        Please refer to Documentation/DocBook/tulip-user.{pdf,ps,html}
-       for more information on this driver, or visit the project
-       Web page at http://sourceforge.net/projects/tulip/
+       for more information on this driver.
 
+       Please submit bugs to http://bugzilla.kernel.org/ .
 */
 
 #include <linux/kernel.h>
@@ -263,11 +262,27 @@ void tulip_select_media(struct net_device *dev, int startup)
                                u16 *reset_sequence = &((u16*)(p+3))[init_length];
                                int reset_length = p[2 + init_length*2];
                                misc_info = reset_sequence + reset_length;
-                               if (startup)
+                               if (startup) {
+                                       int timeout = 10;       /* max 1 ms */
                                        for (i = 0; i < reset_length; i++)
                                                iowrite32(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15);
+
+                                       /* flush posted writes */
+                                       ioread32(ioaddr + CSR15);
+
+                                       /* Sect 3.10.3 in DP83840A.pdf (p39) */
+                                       udelay(500);
+
+                                       /* Section 4.2 in DP83840A.pdf (p43) */
+                                       /* and IEEE 802.3 "22.2.4.1.1 Reset" */
+                                       while (timeout-- &&
+                                               (tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
+                                               udelay(100);
+                               }
                                for (i = 0; i < init_length; i++)
                                        iowrite32(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15);
+
+                               ioread32(ioaddr + CSR15);       /* flush posted writes */
                        } else {
                                u8 *init_sequence = p + 2;
                                u8 *reset_sequence = p + 3 + init_length;