Fix IFCAP_TXCSUM/IFCAP_RXCSUM handling. Previously bge(4) used

IFCAP_HWCSUM to know which capability should be changed such that
disabling RX checksun offloading resulted in disabling TX checksum
offloading.
This commit is contained in:
Pyun YongHyeon 2010-09-30 22:34:15 +00:00
parent 95aec0e66d
commit d8b57f98ab

View File

@ -4630,15 +4630,19 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
}
}
#endif
if (mask & IFCAP_HWCSUM) {
ifp->if_capenable ^= IFCAP_HWCSUM;
if (IFCAP_HWCSUM & ifp->if_capenable &&
IFCAP_HWCSUM & ifp->if_capabilities)
if ((mask & IFCAP_TXCSUM) != 0 &&
(ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
ifp->if_capenable ^= IFCAP_TXCSUM;
if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
ifp->if_hwassist |= sc->bge_csum_features;
else
ifp->if_hwassist &= ~sc->bge_csum_features;
}
if ((mask & IFCAP_RXCSUM) != 0 &&
(ifp->if_capabilities & IFCAP_RXCSUM) != 0)
ifp->if_capenable ^= IFCAP_RXCSUM;
if ((mask & IFCAP_TSO4) != 0 &&
(ifp->if_capabilities & IFCAP_TSO4) != 0) {
ifp->if_capenable ^= IFCAP_TSO4;