aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/forcedeth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r--drivers/net/forcedeth.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 22aec6ed80f5..6364adbd73a1 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -80,7 +80,7 @@
80 * into nv_close, otherwise reenabling for wol can 80 * into nv_close, otherwise reenabling for wol can
81 * cause DMA to kfree'd memory. 81 * cause DMA to kfree'd memory.
82 * 0.31: 14 Nov 2004: ethtool support for getting/setting link 82 * 0.31: 14 Nov 2004: ethtool support for getting/setting link
83 * capabilities. 83 * capabilities.
84 * 0.32: 16 Apr 2005: RX_ERROR4 handling added. 84 * 0.32: 16 Apr 2005: RX_ERROR4 handling added.
85 * 0.33: 16 May 2005: Support for MCP51 added. 85 * 0.33: 16 May 2005: Support for MCP51 added.
86 * 0.34: 18 Jun 2005: Add DEV_NEED_LINKTIMER to all nForce nics. 86 * 0.34: 18 Jun 2005: Add DEV_NEED_LINKTIMER to all nForce nics.
@@ -89,14 +89,15 @@
89 * 0.37: 10 Jul 2005: Additional ethtool support, cleanup of pci id list 89 * 0.37: 10 Jul 2005: Additional ethtool support, cleanup of pci id list
90 * 0.38: 16 Jul 2005: tx irq rewrite: Use global flags instead of 90 * 0.38: 16 Jul 2005: tx irq rewrite: Use global flags instead of
91 * per-packet flags. 91 * per-packet flags.
92 * 0.39: 18 Jul 2005: Add 64bit descriptor support. 92 * 0.39: 18 Jul 2005: Add 64bit descriptor support.
93 * 0.40: 19 Jul 2005: Add support for mac address change. 93 * 0.40: 19 Jul 2005: Add support for mac address change.
94 * 0.41: 30 Jul 2005: Write back original MAC in nv_close instead 94 * 0.41: 30 Jul 2005: Write back original MAC in nv_close instead
95 * of nv_remove 95 * of nv_remove
96 * 0.42: 06 Aug 2005: Fix lack of link speed initialization 96 * 0.42: 06 Aug 2005: Fix lack of link speed initialization
97 * in the second (and later) nv_open call 97 * in the second (and later) nv_open call
98 * 0.43: 10 Aug 2005: Add support for tx checksum. 98 * 0.43: 10 Aug 2005: Add support for tx checksum.
99 * 0.44: 20 Aug 2005: Add support for scatter gather and segmentation. 99 * 0.44: 20 Aug 2005: Add support for scatter gather and segmentation.
100 * 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check
100 * 101 *
101 * Known bugs: 102 * Known bugs:
102 * We suspect that on some hardware no TX done interrupts are generated. 103 * We suspect that on some hardware no TX done interrupts are generated.
@@ -108,7 +109,7 @@
108 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few 109 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
109 * superfluous timer interrupts from the nic. 110 * superfluous timer interrupts from the nic.
110 */ 111 */
111#define FORCEDETH_VERSION "0.44" 112#define FORCEDETH_VERSION "0.45"
112#define DRV_NAME "forcedeth" 113#define DRV_NAME "forcedeth"
113 114
114#include <linux/module.h> 115#include <linux/module.h>
@@ -1612,6 +1613,17 @@ static void nv_set_multicast(struct net_device *dev)
1612 spin_unlock_irq(&np->lock); 1613 spin_unlock_irq(&np->lock);
1613} 1614}
1614 1615
1616/**
1617 * nv_update_linkspeed: Setup the MAC according to the link partner
1618 * @dev: Network device to be configured
1619 *
1620 * The function queries the PHY and checks if there is a link partner.
1621 * If yes, then it sets up the MAC accordingly. Otherwise, the MAC is
1622 * set to 10 MBit HD.
1623 *
1624 * The function returns 0 if there is no link partner and 1 if there is
1625 * a good link partner.
1626 */
1615static int nv_update_linkspeed(struct net_device *dev) 1627static int nv_update_linkspeed(struct net_device *dev)
1616{ 1628{
1617 struct fe_priv *np = netdev_priv(dev); 1629 struct fe_priv *np = netdev_priv(dev);
@@ -1751,13 +1763,11 @@ set_speed:
1751static void nv_linkchange(struct net_device *dev) 1763static void nv_linkchange(struct net_device *dev)
1752{ 1764{
1753 if (nv_update_linkspeed(dev)) { 1765 if (nv_update_linkspeed(dev)) {
1754 if (netif_carrier_ok(dev)) { 1766 if (!netif_carrier_ok(dev)) {
1755 nv_stop_rx(dev);
1756 } else {
1757 netif_carrier_on(dev); 1767 netif_carrier_on(dev);
1758 printk(KERN_INFO "%s: link up.\n", dev->name); 1768 printk(KERN_INFO "%s: link up.\n", dev->name);
1769 nv_start_rx(dev);
1759 } 1770 }
1760 nv_start_rx(dev);
1761 } else { 1771 } else {
1762 if (netif_carrier_ok(dev)) { 1772 if (netif_carrier_ok(dev)) {
1763 netif_carrier_off(dev); 1773 netif_carrier_off(dev);