From eae0669870b6625afd165a410856d70407e215ca Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 29 Sep 2006 17:00:00 +0000 Subject: move the checksum stuff under EM_CSUM_OFFLOAD. --- sys/dev/pci/if_em.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'sys/dev') 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 @@ -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 -- cgit v1.2.3