Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
Show First 20 Lines • Show All 2,052 Lines • ▼ Show 20 Lines | |||||
out: | out: | ||||
mutex_unlock(&mdev->state_lock); | mutex_unlock(&mdev->state_lock); | ||||
VLAN_CAPABILITIES(dev); | VLAN_CAPABILITIES(dev); | ||||
break; | break; | ||||
#if __FreeBSD_version >= 1100036 | #if __FreeBSD_version >= 1100036 | ||||
case SIOCGI2C: { | case SIOCGI2C: { | ||||
struct ifi2creq i2c; | struct ifi2creq 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; | ||||
} | } | ||||
/* | /* | ||||
* Note that we ignore i2c.addr here. The driver hardcodes | * Note that we ignore i2c.addr here. The driver hardcodes | ||||
* the address to 0x50, while standard expects it to be 0xA0. | * the address to 0x50, while standard expects it to be 0xA0. | ||||
*/ | */ | ||||
error = mlx4_get_module_info(mdev->dev, priv->port, | error = mlx4_get_module_info(mdev->dev, priv->port, | ||||
i2c.offset, i2c.len, i2c.data); | i2c.offset, i2c.len, i2c.data); | ||||
if (error < 0) { | if (error < 0) { | ||||
error = -error; | error = -error; | ||||
break; | break; | ||||
} | } | ||||
error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); | error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); | ||||
break; | break; | ||||
} | } | ||||
#endif | #endif | ||||
case SIOCGIFRSSKEY: | case SIOCGIFRSSKEY: | ||||
ifrk = (struct ifrsskey *)data; | ifrk = (struct ifrsskey *)data; | ||||
ifrk->ifrk_func = RSS_FUNC_TOEPLITZ; | ifrk->ifrk_func = RSS_FUNC_TOEPLITZ; | ||||
mutex_lock(&mdev->state_lock); | mutex_lock(&mdev->state_lock); | ||||
key = mlx4_en_get_rss_key(priv, &ifrk->ifrk_keylen); | key = mlx4_en_get_rss_key(priv, &ifrk->ifrk_keylen); | ||||
▲ Show 20 Lines • Show All 795 Lines • Show Last 20 Lines |