Sun May 3 17:56:06 2009 UTC ()
Pull up following revision(s) (requested by tls in ticket #627):
	sys/dev/pci/if_wm.c: revision 1.172
Missed a small but important change to enable hardware VLAN support.


(snj)
diff -r1.162.4.5 -r1.162.4.6 src/sys/dev/pci/if_wm.c

cvs diff -r1.162.4.5 -r1.162.4.6 src/sys/dev/pci/if_wm.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wm.c 2009/05/03 17:54:07 1.162.4.5
+++ src/sys/dev/pci/if_wm.c 2009/05/03 17:56:05 1.162.4.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_wm.c,v 1.162.4.5 2009/05/03 17:54:07 snj Exp $ */ 1/* $NetBSD: if_wm.c,v 1.162.4.6 2009/05/03 17:56:05 snj Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -69,27 +69,27 @@ @@ -69,27 +69,27 @@
69*******************************************************************************/ 69*******************************************************************************/
70/* 70/*
71 * Device driver for the Intel i8254x family of Gigabit Ethernet chips. 71 * Device driver for the Intel i8254x family of Gigabit Ethernet chips.
72 * 72 *
73 * TODO (in order of importance): 73 * TODO (in order of importance):
74 * 74 *
75 * - Rework how parameters are loaded from the EEPROM. 75 * - Rework how parameters are loaded from the EEPROM.
76 * - Figure out what to do with the i82545GM and i82546GB 76 * - Figure out what to do with the i82545GM and i82546GB
77 * SERDES controllers. 77 * SERDES controllers.
78 * - Fix hw VLAN assist. 78 * - Fix hw VLAN assist.
79 */ 79 */
80 80
81#include <sys/cdefs.h> 81#include <sys/cdefs.h>
82__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.162.4.5 2009/05/03 17:54:07 snj Exp $"); 82__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.162.4.6 2009/05/03 17:56:05 snj Exp $");
83 83
84#include "bpfilter.h" 84#include "bpfilter.h"
85#include "rnd.h" 85#include "rnd.h"
86 86
87#include <sys/param.h> 87#include <sys/param.h>
88#include <sys/systm.h> 88#include <sys/systm.h>
89#include <sys/callout.h> 89#include <sys/callout.h>
90#include <sys/mbuf.h> 90#include <sys/mbuf.h>
91#include <sys/malloc.h> 91#include <sys/malloc.h>
92#include <sys/kernel.h> 92#include <sys/kernel.h>
93#include <sys/socket.h> 93#include <sys/socket.h>
94#include <sys/ioctl.h> 94#include <sys/ioctl.h>
95#include <sys/errno.h> 95#include <sys/errno.h>
@@ -1536,27 +1536,27 @@ wm_attach(device_t parent, device_t self @@ -1536,27 +1536,27 @@ wm_attach(device_t parent, device_t self
1536 ifp->if_stop = wm_stop; 1536 ifp->if_stop = wm_stop;
1537 IFQ_SET_MAXLEN(&ifp->if_snd, max(WM_IFQUEUELEN, IFQ_MAXLEN)); 1537 IFQ_SET_MAXLEN(&ifp->if_snd, max(WM_IFQUEUELEN, IFQ_MAXLEN));
1538 IFQ_SET_READY(&ifp->if_snd); 1538 IFQ_SET_READY(&ifp->if_snd);
1539 1539
1540 if (sc->sc_type != WM_T_82573 && sc->sc_type != WM_T_82574 && 1540 if (sc->sc_type != WM_T_82573 && sc->sc_type != WM_T_82574 &&
1541 sc->sc_type != WM_T_ICH8) 1541 sc->sc_type != WM_T_ICH8)
1542 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU; 1542 sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU;
1543 1543
1544 /* 1544 /*
1545 * If we're a i82543 or greater, we can support VLANs. 1545 * If we're a i82543 or greater, we can support VLANs.
1546 */ 1546 */
1547 if (sc->sc_type >= WM_T_82543) 1547 if (sc->sc_type >= WM_T_82543)
1548 sc->sc_ethercom.ec_capabilities |= 1548 sc->sc_ethercom.ec_capabilities |=
1549 ETHERCAP_VLAN_MTU /* XXXJRT | ETHERCAP_VLAN_HWTAGGING */; 1549 ETHERCAP_VLAN_MTU | ETHERCAP_VLAN_HWTAGGING;
1550 1550
1551 /* 1551 /*
1552 * We can perform TCPv4 and UDPv4 checkums in-bound. Only 1552 * We can perform TCPv4 and UDPv4 checkums in-bound. Only
1553 * on i82543 and later. 1553 * on i82543 and later.
1554 */ 1554 */
1555 if (sc->sc_type >= WM_T_82543) { 1555 if (sc->sc_type >= WM_T_82543) {
1556 ifp->if_capabilities |= 1556 ifp->if_capabilities |=
1557 IFCAP_CSUM_IPv4_Tx | IFCAP_CSUM_IPv4_Rx | 1557 IFCAP_CSUM_IPv4_Tx | IFCAP_CSUM_IPv4_Rx |
1558 IFCAP_CSUM_TCPv4_Tx | IFCAP_CSUM_TCPv4_Rx | 1558 IFCAP_CSUM_TCPv4_Tx | IFCAP_CSUM_TCPv4_Rx |
1559 IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx | 1559 IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx |
1560 IFCAP_CSUM_TCPv6_Tx | 1560 IFCAP_CSUM_TCPv6_Tx |
1561 IFCAP_CSUM_UDPv6_Tx; 1561 IFCAP_CSUM_UDPv6_Tx;
1562 } 1562 }