diff options
author | yongari <yongari@FreeBSD.org> | 2008-11-13 04:11:01 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2008-11-13 04:11:01 +0000 |
commit | 6d919d87d2a68b8352ada74f72bfab027ee7a740 (patch) | |
tree | 5ba13ab240d3d6b61ef9701c7872c949ec786da6 /sys/dev/vge | |
parent | af8731f3f9503636b9a1b53a8cc814e2deab2c92 (diff) | |
download | FreeBSD-src-6d919d87d2a68b8352ada74f72bfab027ee7a740.zip FreeBSD-src-6d919d87d2a68b8352ada74f72bfab027ee7a740.tar.gz |
Fix Rx/Tx checksum offload ioctl handling. Now checksum offload
can be controlled by ifconfig(8). Note, VLAN hardware tagging
controls still lacks required handler but it requires more driver
cleanups so I didn't touch that part.
PR: kern/128766
Diffstat (limited to 'sys/dev/vge')
-rw-r--r-- | sys/dev/vge/if_vge.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index 9acbdac..fd4216d 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -2226,15 +2226,17 @@ vge_ioctl(ifp, command, data) } } #endif /* DEVICE_POLLING */ - if (mask & IFCAP_HWCSUM) { - ifp->if_capenable |= ifr->ifr_reqcap & (IFCAP_HWCSUM); - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist = VGE_CSUM_FEATURES; + 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 |= VGE_CSUM_FEATURES; else - ifp->if_hwassist = 0; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_init(sc); + ifp->if_hwassist &= ~VGE_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; } break; default: |