tree e140e27b52b70ecad6c79c46ed7653b2c7002283
parent a3bc068022b968a3042b48eb9a8e8b0418fb9cdd
author Manfred Spraul <[EMAIL PROTECTED]> Sat, 06 Aug 2005 23:47:55 +0200
committer Jeff Garzik <[EMAIL PROTECTED]> Fri, 19 Aug 2005 10:12:16 -0400

[PATCH] forcedeth: Initialize link settings in every nv_open()

R�diger found a bug in nv_open that explains some of the reports
with duplex mismatches:
nv_open calls nv_update_link_speed for initializing the hardware link speed
registers. If current link setting matches the values in np->linkspeed and
np->duplex, then the function does nothing.
Usually, doing nothing is the right thing, but not in nv_open: During
nv_open, the registers must be initialized because the nic was reset.

The attached patch fixes that by setting np->linkspeed to an invalid value
before calling nv_update_link_speed from nv_open.

Signed-Off-By: Manfred Spraul <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>

 drivers/net/forcedeth.c |    5 +++++
 1 files changed, 5 insertions(+)

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -93,6 +93,8 @@
  *      0.40: 19 Jul 2005: Add support for mac address change.
  *      0.41: 30 Jul 2005: Write back original MAC in nv_close instead
  *                        of nv_remove
+ *      0.42: 06 Aug 2005: Fix lack of link speed initialization
+ *                        in the second (and later) nv_open call
  *
  * Known bugs:
  * We suspect that on some hardware no TX done interrupts are generated.
@@ -2178,6 +2180,9 @@ static int nv_open(struct net_device *de
                writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
                dprintk(KERN_INFO "startup: got 0x%08x.\n", miistat);
        }
+       /* set linkspeed to invalid value, thus force nv_update_linkspeed
+        * to init hw */
+       np->linkspeed = 0;
        ret = nv_update_linkspeed(dev);
        nv_start_rx(dev);
        nv_start_tx(dev);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to