1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-27 16:39:08 +00:00

Implement TCP/IP checksum off-loading on send for the 3c905B and later

generation cards.
This commit is contained in:
Alan Cox 2001-10-22 06:45:42 +00:00
parent d75c1b4a90
commit eab754b91d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85303

View File

@ -155,6 +155,8 @@ static const char rcsid[] =
"$FreeBSD$";
#endif
#define XL905B_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP)
/*
* Various supported device vendors/types and their names.
*/
@ -1464,7 +1466,8 @@ static int xl_attach(dev)
ifp->if_output = ether_output;
if (sc->xl_type == XL_TYPE_905B) {
ifp->if_start = xl_start_90xB;
ifp->if_capabilities = IFCAP_RXCSUM;
ifp->if_hwassist = XL905B_CSUM_FEATURES;
ifp->if_capabilities = IFCAP_HWCSUM;
} else
ifp->if_start = xl_start;
ifp->if_watchdog = xl_watchdog;
@ -2446,6 +2449,14 @@ static int xl_encap_90xB(sc, c, m_head)
c->xl_ptr->xl_frag[frag - 1].xl_len |= XL_LAST_FRAG;
c->xl_ptr->xl_status = XL_TXSTAT_RND_DEFEAT;
if (m_head->m_pkthdr.csum_flags) {
if (m_head->m_pkthdr.csum_flags & CSUM_IP)
c->xl_ptr->xl_status |= XL_TXSTAT_IPCKSUM;
if (m_head->m_pkthdr.csum_flags & CSUM_TCP)
c->xl_ptr->xl_status |= XL_TXSTAT_TCPCKSUM;
if (m_head->m_pkthdr.csum_flags & CSUM_UDP)
c->xl_ptr->xl_status |= XL_TXSTAT_UDPCKSUM;
}
return(0);
}