diff options
Diffstat (limited to 'drivers/net/3c59x.c')
-rw-r--r-- | drivers/net/3c59x.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 70f63891b19c..274b0138d442 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -788,7 +788,7 @@ struct vortex_private { | |||
788 | int options; /* User-settable misc. driver options. */ | 788 | int options; /* User-settable misc. driver options. */ |
789 | unsigned int media_override:4, /* Passed-in media type. */ | 789 | unsigned int media_override:4, /* Passed-in media type. */ |
790 | default_media:4, /* Read from the EEPROM/Wn3_Config. */ | 790 | default_media:4, /* Read from the EEPROM/Wn3_Config. */ |
791 | full_duplex:1, force_fd:1, autoselect:1, | 791 | full_duplex:1, autoselect:1, |
792 | bus_master:1, /* Vortex can only do a fragment bus-m. */ | 792 | bus_master:1, /* Vortex can only do a fragment bus-m. */ |
793 | full_bus_master_tx:1, full_bus_master_rx:2, /* Boomerang */ | 793 | full_bus_master_tx:1, full_bus_master_rx:2, /* Boomerang */ |
794 | flow_ctrl:1, /* Use 802.3x flow control (PAUSE only) */ | 794 | flow_ctrl:1, /* Use 802.3x flow control (PAUSE only) */ |
@@ -1633,12 +1633,6 @@ vortex_set_duplex(struct net_device *dev) | |||
1633 | ((vp->full_duplex && vp->flow_ctrl && vp->partner_flow_ctrl) ? | 1633 | ((vp->full_duplex && vp->flow_ctrl && vp->partner_flow_ctrl) ? |
1634 | 0x100 : 0), | 1634 | 0x100 : 0), |
1635 | ioaddr + Wn3_MAC_Ctrl); | 1635 | ioaddr + Wn3_MAC_Ctrl); |
1636 | |||
1637 | issue_and_wait(dev, TxReset); | ||
1638 | /* | ||
1639 | * Don't reset the PHY - that upsets autonegotiation during DHCP operations. | ||
1640 | */ | ||
1641 | issue_and_wait(dev, RxReset|0x04); | ||
1642 | } | 1636 | } |
1643 | 1637 | ||
1644 | static void vortex_check_media(struct net_device *dev, unsigned int init) | 1638 | static void vortex_check_media(struct net_device *dev, unsigned int init) |
@@ -1663,7 +1657,7 @@ vortex_up(struct net_device *dev) | |||
1663 | struct vortex_private *vp = netdev_priv(dev); | 1657 | struct vortex_private *vp = netdev_priv(dev); |
1664 | void __iomem *ioaddr = vp->ioaddr; | 1658 | void __iomem *ioaddr = vp->ioaddr; |
1665 | unsigned int config; | 1659 | unsigned int config; |
1666 | int i; | 1660 | int i, mii_reg1, mii_reg5; |
1667 | 1661 | ||
1668 | if (VORTEX_PCI(vp)) { | 1662 | if (VORTEX_PCI(vp)) { |
1669 | pci_set_power_state(VORTEX_PCI(vp), PCI_D0); /* Go active */ | 1663 | pci_set_power_state(VORTEX_PCI(vp), PCI_D0); /* Go active */ |
@@ -1723,14 +1717,23 @@ vortex_up(struct net_device *dev) | |||
1723 | printk(KERN_DEBUG "vortex_up(): writing 0x%x to InternalConfig\n", config); | 1717 | printk(KERN_DEBUG "vortex_up(): writing 0x%x to InternalConfig\n", config); |
1724 | iowrite32(config, ioaddr + Wn3_Config); | 1718 | iowrite32(config, ioaddr + Wn3_Config); |
1725 | 1719 | ||
1726 | netif_carrier_off(dev); | ||
1727 | if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) { | 1720 | if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) { |
1728 | EL3WINDOW(4); | 1721 | EL3WINDOW(4); |
1722 | mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR); | ||
1723 | mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA); | ||
1724 | vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0); | ||
1725 | |||
1729 | vortex_check_media(dev, 1); | 1726 | vortex_check_media(dev, 1); |
1730 | } | 1727 | } |
1731 | else | 1728 | else |
1732 | vortex_set_duplex(dev); | 1729 | vortex_set_duplex(dev); |
1733 | 1730 | ||
1731 | issue_and_wait(dev, TxReset); | ||
1732 | /* | ||
1733 | * Don't reset the PHY - that upsets autonegotiation during DHCP operations. | ||
1734 | */ | ||
1735 | issue_and_wait(dev, RxReset|0x04); | ||
1736 | |||
1734 | 1737 | ||
1735 | iowrite16(SetStatusEnb | 0x00, ioaddr + EL3_CMD); | 1738 | iowrite16(SetStatusEnb | 0x00, ioaddr + EL3_CMD); |
1736 | 1739 | ||
@@ -2083,16 +2086,14 @@ vortex_error(struct net_device *dev, int status) | |||
2083 | } | 2086 | } |
2084 | if (tx_status & 0x14) vp->stats.tx_fifo_errors++; | 2087 | if (tx_status & 0x14) vp->stats.tx_fifo_errors++; |
2085 | if (tx_status & 0x38) vp->stats.tx_aborted_errors++; | 2088 | if (tx_status & 0x38) vp->stats.tx_aborted_errors++; |
2089 | if (tx_status & 0x08) vp->xstats.tx_max_collisions++; | ||
2086 | iowrite8(0, ioaddr + TxStatus); | 2090 | iowrite8(0, ioaddr + TxStatus); |
2087 | if (tx_status & 0x30) { /* txJabber or txUnderrun */ | 2091 | if (tx_status & 0x30) { /* txJabber or txUnderrun */ |
2088 | do_tx_reset = 1; | 2092 | do_tx_reset = 1; |
2089 | } else if (tx_status & 0x08) { /* maxCollisions */ | 2093 | } else if ((tx_status & 0x08) && (vp->drv_flags & MAX_COLLISION_RESET)) { /* maxCollisions */ |
2090 | vp->xstats.tx_max_collisions++; | 2094 | do_tx_reset = 1; |
2091 | if (vp->drv_flags & MAX_COLLISION_RESET) { | 2095 | reset_mask = 0x0108; /* Reset interface logic, but not download logic */ |
2092 | do_tx_reset = 1; | 2096 | } else { /* Merely re-enable the transmitter. */ |
2093 | reset_mask = 0x0108; /* Reset interface logic, but not download logic */ | ||
2094 | } | ||
2095 | } else { /* Merely re-enable the transmitter. */ | ||
2096 | iowrite16(TxEnable, ioaddr + EL3_CMD); | 2097 | iowrite16(TxEnable, ioaddr + EL3_CMD); |
2097 | } | 2098 | } |
2098 | } | 2099 | } |