Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Show First 20 Lines • Show All 2,878 Lines • ▼ Show 20 Lines | out: | ||||
case SIOCGI2C: | case SIOCGI2C: | ||||
ifr = (struct ifreq *)data; | ifr = (struct ifreq *)data; | ||||
/* | /* | ||||
* Copy from the user-space address ifr_data to the | * Copy from the user-space address ifr_data to the | ||||
* kernel-space address i2c | * kernel-space address i2c | ||||
*/ | */ | ||||
error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); | error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); | ||||
if (error) | if (error) | ||||
break; | break; | ||||
if (i2c.len > sizeof(i2c.data)) { | if (i2c.len > sizeof(i2c.data)) { | ||||
error = EINVAL; | error = EINVAL; | ||||
break; | break; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | case SIOCGI2C: | ||||
} | } | ||||
if (error) { | if (error) { | ||||
if_printf(ifp, "Query eeprom failed, eeprom " | if_printf(ifp, "Query eeprom failed, eeprom " | ||||
"reading is not supported\n"); | "reading is not supported\n"); | ||||
error = EINVAL; | error = EINVAL; | ||||
goto err_i2c; | goto err_i2c; | ||||
} | } | ||||
error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); | error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); | ||||
err_i2c: | err_i2c: | ||||
PRIV_UNLOCK(priv); | PRIV_UNLOCK(priv); | ||||
break; | break; | ||||
default: | default: | ||||
error = ether_ioctl(ifp, command, data); | error = ether_ioctl(ifp, command, data); | ||||
break; | break; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 829 Lines • Show Last 20 Lines |