summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-03-03 12:32:51 +0000
committerglebius <glebius@FreeBSD.org>2006-03-03 12:32:51 +0000
commit8e5a8ec53bc22b0b2b0708d25898254255f22db1 (patch)
tree01de4a0bc33c10e3f078a837c4325b21f76da453 /sys/dev/re
parent3c6ea150e2403bf8fc50f1370cdb052de3a30a78 (diff)
downloadFreeBSD-src-8e5a8ec53bc22b0b2b0708d25898254255f22db1.zip
FreeBSD-src-8e5a8ec53bc22b0b2b0708d25898254255f22db1.tar.gz
Correctly switch IFCAP_VLAN_HWTAGGING on and off.
Reported & tested by: Peter Blok <pblok bsd4all.org>
Diffstat (limited to 'sys/dev/re')
-rw-r--r--sys/dev/re/if_re.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 8b86714..4abc3d8 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -2335,7 +2335,10 @@ re_ioctl(ifp, command, data)
break;
case SIOCSIFCAP:
{
- int mask = ifr->ifr_reqcap ^ ifp->if_capenable;
+ int mask, reinit;
+
+ mask = ifr->ifr_reqcap ^ ifp->if_capenable;
+ reinit = 0;
#ifdef DEVICE_POLLING
if (mask & IFCAP_POLLING) {
if (ifr->ifr_reqcap & IFCAP_POLLING) {
@@ -2359,16 +2362,19 @@ re_ioctl(ifp, command, data)
}
#endif /* DEVICE_POLLING */
if (mask & IFCAP_HWCSUM) {
- RL_LOCK(sc);
- ifp->if_capenable |= ifr->ifr_reqcap & IFCAP_HWCSUM;
+ ifp->if_capenable ^= IFCAP_HWCSUM;
if (ifp->if_capenable & IFCAP_TXCSUM)
ifp->if_hwassist = RE_CSUM_FEATURES;
else
ifp->if_hwassist = 0;
- if (ifp->if_drv_flags & IFF_DRV_RUNNING)
- re_init_locked(sc);
- RL_UNLOCK(sc);
+ reinit = 1;
+ }
+ if (mask & IFCAP_VLAN_HWTAGGING) {
+ ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
+ reinit = 1;
}
+ if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING)
+ re_init(sc);
}
break;
default:
OpenPOWER on IntegriCloud