netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gary Spiess <Gary.Spiess@Intermec.com>
To: netdev@oss.sgi.com
Cc: Manfred Spraul <manfred@colorfullife.com>,
	Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [PATCH] natsemi long cable fix
Date: Tue, 15 Feb 2005 15:00:15 -0600	[thread overview]
Message-ID: <421262DF.9050503@Intermec.com> (raw)
In-Reply-To: <421129DE.4070101@Intermec.com>

This is a minor modification to the previous patch submission that does 
not assume the default contents of the DSPCFG register are zero.

When used with Revision D of the DP83815, the "Recommended Registers 
Configuration" from page 78 of the DP83815 data sheet is not entirely 
compatible with the driver's "short cable patch".  When the DSPCFG 
register is written with the value suggested in the document, then 
do_cable_magic() can't read the DSP coefficient and determines that all 
cables attached to the DP83815D are 'short', regardless of actual 
length.  Short cables (< 30m) cause do_cable_magic to enable additional 
attenuation to reduce CRC and idle errors.  If the extra attenuation is 
unintentionally enabled for long cables (> 50m?), they will not operate 
properly.  The National Semiconductor driver, 'dp83815.c' from 
http://www.national.com/appinfo/networks/files/linux_2_4.tar.gz was used 
as a basis for this modification.  This patch applies to the driver 
distributed in linux-2.6.10.

--- linux-2.6.10.orig/drivers/net/natsemi.c	2004-12-24 15:33:50.000000000 -0600
+++ linux-2.6.10/drivers/net/natsemi.c	2005-02-14 16:45:46.000000000 -0600
@@ -441,6 +441,7 @@
 #define DSPCFG_VAL	0x5040
 #define SDCFG_VAL	0x008c	/* set voltage thresholds for Signal Detect */
 #define DSPCFG_LOCK	0x20	/* coefficient lock bit in DSPCFG */
+#define DSPCFG_COEF	0x1000	/* see coefficient (in TSTDAT) bit in DSPCFG */
 #define TSTDAT_FIXED	0xe8	/* magic number for bad coefficients */
 
 /* misc PCI space registers */
@@ -1243,7 +1244,8 @@
 		writew(1, ioaddr + PGSEL);
 		writew(PMDCSR_VAL, ioaddr + PMDCSR);
 		writew(TSTDAT_VAL, ioaddr + TSTDAT);
-		np->dspcfg = DSPCFG_VAL;
+		np->dspcfg = (np->srr <= SRR_DP83815_C)?
+			DSPCFG_VAL : (DSPCFG_COEF | readw(ioaddr + DSPCFG));
 		writew(np->dspcfg, ioaddr + DSPCFG);
 		writew(SDCFG_VAL, ioaddr + SDCFG);
 		writew(0, ioaddr + PGSEL);

      parent reply	other threads:[~2005-02-15 21:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <421129DE.4070101@Intermec.com>
2005-02-14 22:53 ` [PATCH] natsemi long cable fix Gary Spiess
2005-02-15 21:00 ` Gary Spiess [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=421262DF.9050503@Intermec.com \
    --to=gary.spiess@intermec.com \
    --cc=jgarzik@pobox.com \
    --cc=manfred@colorfullife.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).