public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC rev 32
@ 2001-05-11 23:57 H . J . Lu
  2001-05-12  0:49 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: H . J . Lu @ 2001-05-11 23:57 UTC (permalink / raw)
  To: linux kernel; +Cc: alan

The tulip driver in 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC
rev 32 in the NetGear FA310TX REV-D2. It sends BOOTP request and
times out.


H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC rev 32
  2001-05-11 23:57 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC rev 32 H . J . Lu
@ 2001-05-12  0:49 ` Jeff Garzik
  2001-05-12  0:53   ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2001-05-12  0:49 UTC (permalink / raw)
  To: H . J . Lu; +Cc: linux kernel, alan,  Mads Martin Jørgensen

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

Does this patch, against ac8, help with the PNIC problem?
-- 
Jeff Garzik      | Game called on account of naked chick
Building 1024    |
MandrakeSoft     |

[-- Attachment #2: tulip.patch --]
[-- Type: text/plain, Size: 3079 bytes --]

Index: drivers/net/tulip/media.c
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/drivers/net/tulip/media.c,v
retrieving revision 1.1.1.30
diff -u -r1.1.1.30 media.c
--- drivers/net/tulip/media.c	2001/05/11 23:58:47	1.1.1.30
+++ drivers/net/tulip/media.c	2001/05/12 00:47:16
@@ -255,7 +255,7 @@
 		case 1: case 3: {
 			int phy_num = p[0];
 			int init_length = p[1];
-			u16 *misc_info;
+			u16 *misc_info, tmp_info;
 
 			dev->if_port = 11;
 			new_csr6 = 0x020E0000;
@@ -282,8 +282,10 @@
 				for (i = 0; i < init_length; i++)
 					outl(init_sequence[i], ioaddr + CSR12);
 			}
-			tp->advertising[phy_num] = get_u16(&misc_info[1]) | 1;
-			if (startup < 2) {
+			tmp_info = get_u16(&misc_info[1]);
+			if (tmp_info)
+				tp->advertising[phy_num] = tmp_info | 1;
+			if (tmp_info && startup < 2) {
 				if (tp->mii_advertise == 0)
 					tp->mii_advertise = tp->advertising[phy_num];
 				if (tulip_debug > 1)
Index: drivers/net/tulip/tulip_core.c
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/drivers/net/tulip/tulip_core.c,v
retrieving revision 1.1.1.43
diff -u -r1.1.1.43 tulip_core.c
--- drivers/net/tulip/tulip_core.c	2001/05/11 23:58:48	1.1.1.43
+++ drivers/net/tulip/tulip_core.c	2001/05/12 00:47:17
@@ -20,10 +20,11 @@
 #include <linux/init.h>
 #include <linux/etherdevice.h>
 #include <linux/delay.h>
+#include <linux/mii.h>
 #include <asm/unaligned.h>
 
 static char version[] __devinitdata =
-	"Linux Tulip driver version 0.9.14f (May 10, 2001)\n";
+	"Linux Tulip driver version 0.9.15cvs (April XX, 2001)\n";
 
 
 /* A few user-configurable values. */
@@ -1434,7 +1435,7 @@
 				((mii_status & 0x8000) == 0  && (mii_status & 0x7800) != 0)) {
 				int mii_reg0 = tulip_mdio_read(dev, phy, 0);
 				int mii_advert = tulip_mdio_read(dev, phy, 4);
-				int to_advert;
+				unsigned int to_advert, new_bmcr;
 
 				if (tp->mii_advertise)
 					to_advert = tp->mii_advertise;
@@ -1455,10 +1456,30 @@
 						   board_idx, to_advert, phy, mii_advert);
 					tulip_mdio_write(dev, phy, 4, to_advert);
 				}
+
 				/* Enable autonegotiation: some boards default to off. */
-				tulip_mdio_write(dev, phy, 0, mii_reg0 |
-						   (tp->full_duplex ? 0x1100 : 0x1000) |
-						   (tulip_media_cap[tp->default_port]&MediaIs100 ? 0x2000:0));
+				if (tp->default_port == 0) {
+					new_bmcr = mii_reg0 | BMCR_ANENABLE;
+					if (new_bmcr != mii_reg0)
+						new_bmcr |= BMCR_ANRESTART;
+				}
+				/* ...or disable nway, if forcing media */
+				else
+					new_bmcr = mii_reg0 & ~BMCR_ANENABLE;
+
+				if (new_bmcr != mii_reg0)
+					tulip_mdio_write(dev, phy, MII_BMCR, new_bmcr);
+
+				if (tp->full_duplex) new_bmcr |= BMCR_FULLDPLX;
+				else		     new_bmcr &= ~BMCR_FULLDPLX;
+				if (tulip_media_cap[tp->default_port] & MediaIs100)
+					new_bmcr |= BMCR_SPEED100;
+				else    new_bmcr &= ~BMCR_SPEED100;
+
+				if (new_bmcr != mii_reg0) {
+					udelay(10);
+					tulip_mdio_write(dev, phy, MII_BMCR, new_bmcr);
+				}
 			}
 		}
 		tp->mii_cnt = phy_idx;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC rev 32
  2001-05-12  0:49 ` Jeff Garzik
@ 2001-05-12  0:53   ` Jeff Garzik
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2001-05-12  0:53 UTC (permalink / raw)
  To: H . J . Lu; +Cc: linux kernel, alan,  Mads Martin Jørgensen

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

Here's another patch to try, for PNIC.  Feedback welcome.
-- 
Jeff Garzik      | Game called on account of naked chick
Building 1024    |
MandrakeSoft     |

[-- Attachment #2: patch-pnic --]
[-- Type: text/plain, Size: 743 bytes --]

diff -ur 2.4/drivers/net/tulip/media.c build-2.4/drivers/net/tulip/media.c
--- 2.4/drivers/net/tulip/media.c	Fri May 11 22:12:51 2001
+++ build-2.4/drivers/net/tulip/media.c	Fri May 11 22:10:03 2001
@@ -409,8 +409,6 @@
 	struct tulip_private *tp = dev->priv;
 	unsigned int bmsr, lpa, negotiated, new_csr6;
 
-	if (tp->full_duplex_lock)
-		return 0;
 	bmsr = tulip_mdio_read(dev, tp->phys[0], MII_BMSR);
 	lpa = tulip_mdio_read(dev, tp->phys[0], MII_LPA);
 	if (tulip_debug > 1)
@@ -428,7 +426,7 @@
 		}
 	}
 	negotiated = lpa & tp->advertising[0];
-	tp->full_duplex = (mii_nway_result(negotiated) & LPA_DUPLEX) ? 1 : 0;
+	tp->full_duplex = tp->full_duplex_lock | (mii_nway_result(negotiated) & LPA_DUPLEX) ? 1 : 0;
 
 	new_csr6 = tp->csr6;
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-12  0:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-11 23:57 2.4.4-ac8 doesn't work with Lite-On 82c168 PNIC rev 32 H . J . Lu
2001-05-12  0:49 ` Jeff Garzik
2001-05-12  0:53   ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox