aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-12-05 09:37:56 -0500
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-12-05 09:37:56 -0500
commit4c1ac1b49122b805adfa4efc620592f68dccf5db (patch)
tree87557f4bc2fd4fe65b7570489c2f610c45c0adcd /drivers/net/r8169.c
parentc4028958b6ecad064b1a6303a6a5906d4fe48d73 (diff)
parentd916faace3efc0bf19fe9a615a1ab8fa1a24cd93 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/infiniband/core/iwcm.c drivers/net/chelsio/cxgb2.c drivers/net/wireless/bcm43xx/bcm43xx_main.c drivers/net/wireless/prism54/islpci_eth.c drivers/usb/core/hub.h drivers/usb/input/hid-core.c net/core/netpoll.c Fix up merge failures with Linus's head and fix new compilation failures. Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 1f9663a7082..85a392fab5c 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -572,8 +572,8 @@ static void rtl8169_xmii_reset_enable(void __iomem *ioaddr)
572{ 572{
573 unsigned int val; 573 unsigned int val;
574 574
575 val = (mdio_read(ioaddr, MII_BMCR) | BMCR_RESET) & 0xffff; 575 mdio_write(ioaddr, MII_BMCR, BMCR_RESET);
576 mdio_write(ioaddr, MII_BMCR, val); 576 val = mdio_read(ioaddr, MII_BMCR);
577} 577}
578 578
579static void rtl8169_check_link_status(struct net_device *dev, 579static void rtl8169_check_link_status(struct net_device *dev,
@@ -1407,6 +1407,22 @@ static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev,
1407 free_netdev(dev); 1407 free_netdev(dev);
1408} 1408}
1409 1409
1410static void rtl8169_phy_reset(struct net_device *dev,
1411 struct rtl8169_private *tp)
1412{
1413 void __iomem *ioaddr = tp->mmio_addr;
1414 int i;
1415
1416 tp->phy_reset_enable(ioaddr);
1417 for (i = 0; i < 100; i++) {
1418 if (!tp->phy_reset_pending(ioaddr))
1419 return;
1420 msleep(1);
1421 }
1422 if (netif_msg_link(tp))
1423 printk(KERN_ERR "%s: PHY reset failed.\n", dev->name);
1424}
1425
1410static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp) 1426static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
1411{ 1427{
1412 void __iomem *ioaddr = tp->mmio_addr; 1428 void __iomem *ioaddr = tp->mmio_addr;
@@ -1435,6 +1451,8 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
1435 1451
1436 rtl8169_link_option(board_idx, &autoneg, &speed, &duplex); 1452 rtl8169_link_option(board_idx, &autoneg, &speed, &duplex);
1437 1453
1454 rtl8169_phy_reset(dev, tp);
1455
1438 rtl8169_set_speed(dev, autoneg, speed, duplex); 1456 rtl8169_set_speed(dev, autoneg, speed, duplex);
1439 1457
1440 if ((RTL_R8(PHYstatus) & TBI_Enable) && netif_msg_link(tp)) 1458 if ((RTL_R8(PHYstatus) & TBI_Enable) && netif_msg_link(tp))
@@ -1474,8 +1492,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1474 struct rtl8169_private *tp; 1492 struct rtl8169_private *tp;
1475 struct net_device *dev; 1493 struct net_device *dev;
1476 void __iomem *ioaddr; 1494 void __iomem *ioaddr;
1477 unsigned int i, pm_cap; 1495 unsigned int pm_cap;
1478 int rc; 1496 int i, rc;
1479 1497
1480 if (netif_msg_drv(&debug)) { 1498 if (netif_msg_drv(&debug)) {
1481 printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n", 1499 printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n",