From 2.6.39 kernel netdev features are set using set_features and
fix_features APIs. Since internal-dev does not need any special
checks on setting feature, there is no need to define set_features
or fix_features. Only hw_features needs to be set to features that
are supported by internal-dev.
Following patch does same and drops discrete offload setting ops for
newer kernel.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #7772
static const struct ethtool_ops internal_dev_ethtool_ops = {
.get_drvinfo = internal_dev_getinfo,
.get_link = ethtool_op_get_link,
static const struct ethtool_ops internal_dev_ethtool_ops = {
.get_drvinfo = internal_dev_getinfo,
.get_link = ethtool_op_get_link,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_hw_csum,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso,
.get_sg = ethtool_op_get_sg,
.set_sg = ethtool_op_set_sg,
.get_tx_csum = ethtool_op_get_tx_csum,
.set_tx_csum = ethtool_op_set_tx_hw_csum,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso,
};
static int internal_dev_change_mtu(struct net_device *netdev, int new_mtu)
};
static int internal_dev_change_mtu(struct net_device *netdev, int new_mtu)
netdev->features |= NETIF_F_HW_VLAN_TX;
#endif
netdev->features |= NETIF_F_HW_VLAN_TX;
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
+ netdev->hw_features = netdev->features & ~NETIF_F_LLTX;
+#endif
vport_gen_rand_ether_addr(netdev->dev_addr);
}
vport_gen_rand_ether_addr(netdev->dev_addr);
}