diff options
Diffstat (limited to 'drivers/net/vxge/vxge-ethtool.c')
-rw-r--r-- | drivers/net/vxge/vxge-ethtool.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c index b67746eef923..f8fd8da4f173 100644 --- a/drivers/net/vxge/vxge-ethtool.c +++ b/drivers/net/vxge/vxge-ethtool.c | |||
@@ -1119,6 +1119,40 @@ static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset) | |||
1119 | } | 1119 | } |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | static int vxge_set_flags(struct net_device *dev, u32 data) | ||
1123 | { | ||
1124 | struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); | ||
1125 | enum vxge_hw_status status; | ||
1126 | |||
1127 | if (data & ~ETH_FLAG_RXHASH) | ||
1128 | return -EOPNOTSUPP; | ||
1129 | |||
1130 | if (!!(data & ETH_FLAG_RXHASH) == vdev->devh->config.rth_en) | ||
1131 | return 0; | ||
1132 | |||
1133 | if (netif_running(dev) || (vdev->config.rth_steering == NO_STEERING)) | ||
1134 | return -EINVAL; | ||
1135 | |||
1136 | vdev->devh->config.rth_en = !!(data & ETH_FLAG_RXHASH); | ||
1137 | |||
1138 | /* Enabling RTH requires some of the logic in vxge_device_register and a | ||
1139 | * vpath reset. Due to these restrictions, only allow modification | ||
1140 | * while the interface is down. | ||
1141 | */ | ||
1142 | status = vxge_reset_all_vpaths(vdev); | ||
1143 | if (status != VXGE_HW_OK) { | ||
1144 | vdev->devh->config.rth_en = !vdev->devh->config.rth_en; | ||
1145 | return -EFAULT; | ||
1146 | } | ||
1147 | |||
1148 | if (vdev->devh->config.rth_en) | ||
1149 | dev->features |= NETIF_F_RXHASH; | ||
1150 | else | ||
1151 | dev->features &= ~NETIF_F_RXHASH; | ||
1152 | |||
1153 | return 0; | ||
1154 | } | ||
1155 | |||
1122 | static const struct ethtool_ops vxge_ethtool_ops = { | 1156 | static const struct ethtool_ops vxge_ethtool_ops = { |
1123 | .get_settings = vxge_ethtool_gset, | 1157 | .get_settings = vxge_ethtool_gset, |
1124 | .set_settings = vxge_ethtool_sset, | 1158 | .set_settings = vxge_ethtool_sset, |
@@ -1140,6 +1174,7 @@ static const struct ethtool_ops vxge_ethtool_ops = { | |||
1140 | .phys_id = vxge_ethtool_idnic, | 1174 | .phys_id = vxge_ethtool_idnic, |
1141 | .get_sset_count = vxge_ethtool_get_sset_count, | 1175 | .get_sset_count = vxge_ethtool_get_sset_count, |
1142 | .get_ethtool_stats = vxge_get_ethtool_stats, | 1176 | .get_ethtool_stats = vxge_get_ethtool_stats, |
1177 | .set_flags = vxge_set_flags, | ||
1143 | }; | 1178 | }; |
1144 | 1179 | ||
1145 | void vxge_initialize_ethtool_ops(struct net_device *ndev) | 1180 | void vxge_initialize_ethtool_ops(struct net_device *ndev) |