Lines 4100-4108
Link Here
|
4100 |
} |
4100 |
} |
4101 |
|
4101 |
|
4102 |
|
4102 |
|
4103 |
#define IFCAP_FLAGS (IFCAP_TXCSUM_IPV6 | IFCAP_RXCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \ |
4103 |
#define IFCAP_FLAGS (IFCAP_HWCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \ |
4104 |
IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ |
4104 |
IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ |
4105 |
IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO) |
4105 |
IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \ |
|
|
4106 |
IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM) |
4106 |
|
4107 |
|
4107 |
static int |
4108 |
static int |
4108 |
iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) |
4109 |
iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) |
Lines 4226-4243
Link Here
|
4226 |
int mask, setmask; |
4227 |
int mask, setmask; |
4227 |
|
4228 |
|
4228 |
mask = ifr->ifr_reqcap ^ if_getcapenable(ifp); |
4229 |
mask = ifr->ifr_reqcap ^ if_getcapenable(ifp); |
4229 |
setmask = 0; |
4230 |
setmask = mask & (IFCAP_FLAGS | IFCAP_WOL); |
4230 |
#ifdef TCP_OFFLOAD |
4231 |
#ifdef TCP_OFFLOAD |
4231 |
setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6); |
4232 |
setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6); |
4232 |
#endif |
4233 |
#endif |
4233 |
setmask |= (mask & IFCAP_FLAGS); |
|
|
4234 |
|
4235 |
if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) |
4236 |
setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); |
4237 |
if ((mask & IFCAP_WOL) && |
4238 |
(if_getcapabilities(ifp) & IFCAP_WOL) != 0) |
4239 |
setmask |= (mask & (IFCAP_WOL_MCAST|IFCAP_WOL_MAGIC)); |
4240 |
if_vlancap(ifp); |
4241 |
/* |
4234 |
/* |
4242 |
* want to ensure that traffic has stopped before we change any of the flags |
4235 |
* want to ensure that traffic has stopped before we change any of the flags |
4243 |
*/ |
4236 |
*/ |
Lines 4244-4255
Link Here
|
4244 |
if (setmask) { |
4237 |
if (setmask) { |
4245 |
CTX_LOCK(ctx); |
4238 |
CTX_LOCK(ctx); |
4246 |
bits = if_getdrvflags(ifp); |
4239 |
bits = if_getdrvflags(ifp); |
4247 |
if (bits & IFF_DRV_RUNNING) |
4240 |
if (bits & IFF_DRV_RUNNING && setmask & ~IFCAP_WOL) |
4248 |
iflib_stop(ctx); |
4241 |
iflib_stop(ctx); |
4249 |
STATE_LOCK(ctx); |
4242 |
STATE_LOCK(ctx); |
4250 |
if_togglecapenable(ifp, setmask); |
4243 |
if_togglecapenable(ifp, setmask); |
4251 |
STATE_UNLOCK(ctx); |
4244 |
STATE_UNLOCK(ctx); |
4252 |
if (bits & IFF_DRV_RUNNING) |
4245 |
if (bits & IFF_DRV_RUNNING && setmask & ~IFCAP_WOL) |
4253 |
iflib_init_locked(ctx); |
4246 |
iflib_init_locked(ctx); |
4254 |
STATE_LOCK(ctx); |
4247 |
STATE_LOCK(ctx); |
4255 |
if_setdrvflags(ifp, bits); |
4248 |
if_setdrvflags(ifp, bits); |
Lines 4256-4261
Link Here
|
4256 |
STATE_UNLOCK(ctx); |
4249 |
STATE_UNLOCK(ctx); |
4257 |
CTX_UNLOCK(ctx); |
4250 |
CTX_UNLOCK(ctx); |
4258 |
} |
4251 |
} |
|
|
4252 |
if_vlancap(ifp); |
4259 |
break; |
4253 |
break; |
4260 |
} |
4254 |
} |
4261 |
case SIOCGPRIVATE_0: |
4255 |
case SIOCGPRIVATE_0: |