Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jun 2009 06:27:35 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194571 - head/sys/dev/fxp
Message-ID:  <200906210627.n5L6RZ16097829@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Sun Jun 21 06:27:35 2009
New Revision: 194571
URL: http://svn.freebsd.org/changeset/base/194571

Log:
  Don't blindly enable Rx lock-up workaround. Newer chips do not need
  the Rx lock-up workaround.
  
  Obtained from:	NetBSD

Modified:
  head/sys/dev/fxp/if_fxp.c
  head/sys/dev/fxp/if_fxpvar.h

Modified: head/sys/dev/fxp/if_fxp.c
==============================================================================
--- head/sys/dev/fxp/if_fxp.c	Sun Jun 21 06:18:19 2009	(r194570)
+++ head/sys/dev/fxp/if_fxp.c	Sun Jun 21 06:27:35 2009	(r194571)
@@ -500,6 +500,13 @@ fxp_attach(device_t dev)
 			sc->flags |= FXP_FLAG_WOLCAP;
 	}
 
+	/* Receiver lock-up workaround detection. */
+	fxp_read_eeprom(sc, &data, 3, 1);
+	if ((data & 0x03) != 0x03) {
+		sc->flags |= FXP_FLAG_RXBUG;
+		device_printf(dev, "Enabling Rx lock-up workaround\n");
+	}
+
 	/*
 	 * Determine whether we must use the 503 serial interface.
 	 */
@@ -2021,7 +2028,7 @@ fxp_tick(void *xsc)
 	if (sp->rx_good) {
 		ifp->if_ipackets += le32toh(sp->rx_good);
 		sc->rx_idle_secs = 0;
-	} else {
+	} else if (sc->flags & FXP_FLAG_RXBUG) {
 		/*
 		 * Receiver's been idle for another second.
 		 */

Modified: head/sys/dev/fxp/if_fxpvar.h
==============================================================================
--- head/sys/dev/fxp/if_fxpvar.h	Sun Jun 21 06:18:19 2009	(r194570)
+++ head/sys/dev/fxp/if_fxpvar.h	Sun Jun 21 06:27:35 2009	(r194571)
@@ -204,6 +204,7 @@ struct fxp_softc {
 #define FXP_FLAG_82559_RXCSUM	0x1000	/* 82559 compatible RX checksum */
 #define FXP_FLAG_WOLCAP		0x2000	/* WOL capability */
 #define FXP_FLAG_WOL		0x4000	/* WOL active */
+#define FXP_FLAG_RXBUG		0x8000	/* Rx lock-up bug */
 
 /* Macros to ease CSR access. */
 #define	CSR_READ_1(sc, reg)		bus_read_1(sc->fxp_res[0], reg)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906210627.n5L6RZ16097829>