Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/if_ixl.c
Show First 20 Lines • Show All 1,618 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data) | ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data) | ||||
{ | { | ||||
struct ixl_pf *pf = iflib_get_softc(ctx); | struct ixl_pf *pf = iflib_get_softc(ctx); | ||||
struct ifdrv *ifd = (struct ifdrv *)data; | struct ifdrv *ifd = (struct ifdrv *)data; | ||||
int error = 0; | int error = 0; | ||||
/* | |||||
* The iflib_if_ioctl forwards SIOCxDRVSPEC and SIOGPRIVATE_0 without | |||||
* performing privilege checks. It is important that this function | |||||
* perform the necessary checks for commands which should only be | |||||
* executed by privileged threads. | |||||
*/ | |||||
switch(command) { | |||||
case SIOCGDRVSPEC: | |||||
case SIOCSDRVSPEC: | |||||
/* NVM update command */ | /* NVM update command */ | ||||
if (ifd->ifd_cmd == I40E_NVM_ACCESS) | if (ifd->ifd_cmd == I40E_NVM_ACCESS) { | ||||
err = priv_check(curthread, PRIV_DRIVER); | |||||
if (err) | |||||
break; | |||||
error = ixl_handle_nvmupd_cmd(pf, ifd); | error = ixl_handle_nvmupd_cmd(pf, ifd); | ||||
else | } else { | ||||
error = EINVAL; | error = EINVAL; | ||||
} | |||||
break; | |||||
default: | |||||
error = EOPNOTSUPP; | |||||
} | |||||
return (error); | return (error); | ||||
} | } | ||||
static u_int | static u_int | ||||
ixl_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused) | ixl_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused) | ||||
{ | { | ||||
struct ixl_vsi *vsi = arg; | struct ixl_vsi *vsi = arg; | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |