summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-07-01 01:13:46 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-07-01 01:13:46 +0000
commit82b65f207e81d439b91b93976b8976f6a2f18b91 (patch)
tree3abee4aa8e8f7e5deb95921ffe364bf3b0e1661d /sys/dev/pci
parent4e7e02960727da7b9bd0d8d477578e0f0ee19659 (diff)
enable RX HW checksum offload
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_stge.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c
index 78084f58809..d543ae1e766 100644
--- a/sys/dev/pci/if_stge.c
+++ b/sys/dev/pci/if_stge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_stge.c,v 1.15 2005/06/28 03:48:31 brad Exp $ */
+/* $OpenBSD: if_stge.c,v 1.16 2005/07/01 01:13:45 brad Exp $ */
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/*-
@@ -1202,21 +1202,19 @@ stge_rxintr(struct stge_softc *sc)
m = nm;
}
-#ifdef STGE_CHECKSUM
/*
* Set the incoming checksum information for the packet.
*/
if (status & RFD_IPDetected) {
- m->m_pkthdr.csum_flags |= (status & RFD_IPError) ?
- M_IPV4_CSUM_IN_BAD : M_IPV4_CSUM_IN_OK;
- if (status & RFD_TCPDetected)
- m->m_pkthdr.csum_flags |= (status & RFD_TCPError) ?
- M_TCP_CSUM_IN_BAD : M_TCP_CSUM_IN_OK;
- else if (status & RFD_UDPDetected)
- m->m_pkthdr.csum_flags |= (status & RFD_UDPError) ?
- M_UDP_CSUM_IN_BAD : M_UDP_CSUM_IN_OK;
+ if (!(status & RFD_IPError))
+ m->m_pkthdr.csum_flags |= M_IPV4_CSUM_IN_OK;
+ if ((status & RFD_TCPDetected) &&
+ (!(status & RFD_TCPError)))
+ m->m_pkthdr.csum_flags |= M_TCP_CSUM_IN_OK;
+ else if ((status & RFD_UDPDetected) &&
+ (!(status & RFD_UDPError)))
+ m->m_pkthdr.csum_flags |= M_UDP_CSUM_IN_OK;
}
-#endif
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = len;