Module Name:    src
Committed By:   msaitoh
Date:           Thu Feb  7 15:38:42 UTC 2013

Modified Files:
        src/sys/dev/pci: if_wm.c if_wmreg.h

Log Message:
Fix RAL_TABSIZE for ICH8, 82576, 82580 and I350.


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.241 src/sys/dev/pci/if_wm.c:1.242
--- src/sys/dev/pci/if_wm.c:1.241	Thu Feb  7 02:10:18 2013
+++ src/sys/dev/pci/if_wm.c	Thu Feb  7 15:38:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.241 2013/02/07 02:10:18 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.242 2013/02/07 15:38:42 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.241 2013/02/07 02:10:18 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.242 2013/02/07 15:38:42 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -5643,10 +5643,17 @@ wm_set_filter(struct wm_softc *sc)
 	 * Set the station address in the first RAL slot, and
 	 * clear the remaining slots.
 	 */
-	if ((sc->sc_type == WM_T_ICH8) || (sc->sc_type == WM_T_ICH9)
-	    || (sc->sc_type == WM_T_ICH10) || (sc->sc_type == WM_T_PCH)
-	    || (sc->sc_type == WM_T_PCH2))
-		size = WM_ICH8_RAL_TABSIZE;
+	if (sc->sc_type == WM_T_ICH8)
+		size = WM_RAL_TABSIZE_ICH8 -1;
+	else if ((sc->sc_type == WM_T_ICH9) || (sc->sc_type == WM_T_ICH10)
+	    || (sc->sc_type == WM_T_PCH) || (sc->sc_type == WM_T_PCH2))
+		size = WM_RAL_TABSIZE_ICH8;
+	else if (sc->sc_type == WM_T_82575)
+		size = WM_RAL_TABSIZE_82575;
+	else if ((sc->sc_type == WM_T_82576) || (sc->sc_type == WM_T_82580))
+		size = WM_RAL_TABSIZE_82576;
+	else if (sc->sc_type == WM_T_I350)
+		size = WM_RAL_TABSIZE_I350;
 	else
 		size = WM_RAL_TABSIZE;
 	wm_set_ral(sc, CLLADDR(ifp->if_sadl), 0);

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.48 src/sys/dev/pci/if_wmreg.h:1.49
--- src/sys/dev/pci/if_wmreg.h:1.48	Wed Aug 29 20:39:24 2012
+++ src/sys/dev/pci/if_wmreg.h	Thu Feb  7 15:38:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.48 2012/08/29 20:39:24 bouyer Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.49 2013/02/07 15:38:42 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -420,8 +420,11 @@ struct livengood_tcpip_ctxdesc {
 #define	RAL_RDR1	(1U << 30)	/* put packet in alt. rx ring */
 #define	RAL_AV		(1U << 31)	/* entry is valid */
 
-#define	WM_RAL_TABSIZE	16
-#define	WM_ICH8_RAL_TABSIZE 7
+#define	WM_RAL_TABSIZE		15	/* RAL size for old devices */
+#define	WM_RAL_TABSIZE_ICH8	7	/* RAL size for ICH* and PCH* */
+#define	WM_RAL_TABSIZE_82575	16	/* RAL size for 82575 */
+#define	WM_RAL_TABSIZE_82576	24	/* RAL size for 82576 and 82580 */
+#define	WM_RAL_TABSIZE_I350	32	/* RAL size for I350 */
 
 #define	WMREG_ICR	0x00c0	/* Interrupt Cause Register */
 #define	ICR_TXDW	(1U << 0)	/* Tx desc written back */

Reply via email to