Simplify Tx checksum offload configuration. Also clear CSUM_IP if

we've computed IP checksum with software method.
This commit is contained in:
Pyun YongHyeon 2008-11-25 04:33:02 +00:00
parent 4e53f83744
commit c583cc04ef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=185286

View file

@ -1295,14 +1295,10 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head)
* in the TCP header. The stack should have
* already done this for us.
*/
if (m->m_pkthdr.csum_flags) {
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
txp->tx_cb->ipcb_ip_schedule =
FXP_IPCB_TCPUDP_CHECKSUM_ENABLE;
if (m->m_pkthdr.csum_flags & CSUM_TCP)
txp->tx_cb->ipcb_ip_schedule |=
FXP_IPCB_TCP_PACKET;
}
if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) {
txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE;
if (m->m_pkthdr.csum_flags & CSUM_TCP)
txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET;
#ifdef FXP_IP_CSUM_WAR
/*
@ -1334,6 +1330,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head)
ip = mtod(m, struct ip *);
ip->ip_sum = in_cksum(m, ip->ip_hl << 2);
m->m_data -= ETHER_HDR_LEN;
m->m_pkthdr.csum_flags &= ~CSUM_IP;
} else {
txp->tx_cb->ipcb_ip_activation_high =
FXP_IPCB_HARDWAREPARSING_ENABLE;