diff options
Diffstat (limited to 'sys/dev/pci/if_nfe.c')
-rw-r--r-- | sys/dev/pci/if_nfe.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 14d4aeb6eb6..62452aceb3a 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,7 +1,7 @@ -/* $OpenBSD: if_nfe.c,v 1.67 2006/11/15 02:24:37 brad Exp $ */ +/* $OpenBSD: if_nfe.c,v 1.68 2007/01/08 18:39:27 damien Exp $ */ /*- - * Copyright (c) 2006 Damien Bergamini <damien.bergamini@free.fr> + * Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr> * Copyright (c) 2005, 2006 Jonathan Gray <jsg@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any @@ -286,12 +286,10 @@ nfe_attach(struct device *parent, struct device *self, void *aux) if (sc->sc_flags & NFE_HW_VLAN) ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; #endif -#ifdef NFE_CSUM if (sc->sc_flags & NFE_HW_CSUM) { ifp->if_capabilities |= IFCAP_CSUM_IPv4 | IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4; } -#endif sc->sc_mii.mii_ifp = ifp; sc->sc_mii.mii_readreg = nfe_miibus_readreg; @@ -755,19 +753,14 @@ nfe_rxeof(struct nfe_softc *sc) m->m_pkthdr.len = m->m_len = len; m->m_pkthdr.rcvif = ifp; -#ifdef notyet - if (sc->sc_flags & NFE_HW_CSUM) { - if (flags & NFE_RX_IP_CSUMOK) - m->m_pkthdr.csum_flags |= M_IPV4_CSUM_IN_OK; + if ((sc->sc_flags & NFE_HW_CSUM) && + (flags & NFE_RX_IP_CSUMOK)) { + m->m_pkthdr.csum_flags |= M_IPV4_CSUM_IN_OK; if (flags & NFE_RX_UDP_CSUMOK) m->m_pkthdr.csum_flags |= M_UDP_CSUM_IN_OK; if (flags & NFE_RX_TCP_CSUMOK) m->m_pkthdr.csum_flags |= M_TCP_CSUM_IN_OK; } -#elif defined(NFE_CSUM) - if ((sc->sc_flags & NFE_HW_CSUM) && (flags & NFE_RX_CSUMOK)) - m->m_pkthdr.csum_flags = M_IPV4_CSUM_IN_OK; -#endif #if NBPFILTER > 0 if (ifp->if_bpf) @@ -911,12 +904,10 @@ nfe_encap(struct nfe_softc *sc, struct mbuf *m0) vtag = NFE_TX_VTAG | htons(ifv->ifv_tag); } #endif -#ifdef NFE_CSUM if (m0->m_pkthdr.csum_flags & M_IPV4_CSUM_OUT) flags |= NFE_TX_IP_CSUM; if (m0->m_pkthdr.csum_flags & (M_TCPV4_CSUM_OUT | M_UDPV4_CSUM_OUT)) - flags |= NFE_TX_TCP_CSUM; -#endif + flags |= NFE_TX_TCP_UDP_CSUM; for (i = 0; i < map->dm_nsegs; i++) { data = &sc->txq.data[sc->txq.cur]; @@ -947,7 +938,7 @@ nfe_encap(struct nfe_softc *sc, struct mbuf *m0) * Checksum flags and vtag belong to the first fragment * only. */ - flags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_CSUM); + flags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_UDP_CSUM); #if NVLAN > 0 vtag = 0; #endif @@ -1061,10 +1052,8 @@ nfe_init(struct ifnet *ifp) sc->rxtxctl |= NFE_RXTX_V3MAGIC; else if (sc->sc_flags & NFE_JUMBO_SUP) sc->rxtxctl |= NFE_RXTX_V2MAGIC; -#ifdef NFE_CSUM if (sc->sc_flags & NFE_HW_CSUM) sc->rxtxctl |= NFE_RXTX_RXCSUM; -#endif #if NVLAN > 0 /* * Although the adapter is capable of stripping VLAN tags from received |