diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-09-29 17:00:00 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-09-29 17:00:00 +0000 |
commit | eae0669870b6625afd165a410856d70407e215ca (patch) | |
tree | a83274835213beff4de170543059d09a8136d69a /sys/dev | |
parent | 5efd3c0a9754f1f08c7e94a8ce2256c17cc744f3 (diff) |
move the checksum stuff under EM_CSUM_OFFLOAD.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_em.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 41704fa5e2b..f2d07bb8a88 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.149 2006/09/17 21:35:58 brad Exp $ */ +/* $OpenBSD: if_em.c,v 1.150 2006/09/29 16:59:59 brad Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -956,10 +956,14 @@ em_encap(struct em_softc *sc, struct mbuf *m_head) return (ENOBUFS); } -#if 0 - em_transmit_checksum_setup(sc, m_head, &txd_upper, &txd_lower); -#endif +#ifdef EM_CSUM_OFFLOAD + if (sc->hw.mac_type >= em_82543) + em_transmit_checksum_setup(sc, m_head, &txd_upper, &txd_lower); + else + txd_upper = txd_lower = 0; +#else txd_upper = txd_lower = 0; +#endif i = sc->next_avail_tx_desc; if (sc->pcix_82544) { @@ -1591,6 +1595,11 @@ em_setup_interface(struct em_softc *sc) ifp->if_capabilities = IFCAP_VLAN_MTU; +#ifdef EM_CSUM_OFFLOAD + if (sc->hw.mac_type >= em_82543) + ifp->if_capabilities |= IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4; +#endif + /* * Specify the media types supported by this adapter and register * callbacks to update media and link information |