diff options
author | yongari <yongari@FreeBSD.org> | 2011-01-13 22:49:10 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2011-01-13 22:49:10 +0000 |
commit | 24ec74fe0491dff2d2536c128461ad4060a7b4bc (patch) | |
tree | e6129bba789bf4eafcfc896fbae4da340dfef7be | |
parent | 38c0ce34b0e87556a90d2209eedb79da0e6998a1 (diff) | |
download | FreeBSD-src-24ec74fe0491dff2d2536c128461ad4060a7b4bc.zip FreeBSD-src-24ec74fe0491dff2d2536c128461ad4060a7b4bc.tar.gz |
Allow TX/RX checksum offloading to be configured independently.
-rw-r--r-- | sys/dev/re/if_re.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index c0816fc..30d9df5 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -2923,14 +2923,20 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } } #endif /* DEVICE_POLLING */ - if (mask & IFCAP_HWCSUM) { - ifp->if_capenable ^= IFCAP_HWCSUM; - if (ifp->if_capenable & IFCAP_TXCSUM) + 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 |= RE_CSUM_FEATURES; else ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_RXCSUM; + reinit = 1; + } if ((mask & IFCAP_TSO4) != 0 && (ifp->if_capabilities & IFCAP_TSO) != 0) { ifp->if_capenable ^= IFCAP_TSO4; |