From: Jesse Gross Date: Wed, 24 Nov 2010 17:27:10 +0000 (-0800) Subject: datapath: Provide compatibility code for SET_ETHTOOL_OPS constness. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f981c8b0da9c8efec309064367e36338518eba15;p=openvswitch datapath: Provide compatibility code for SET_ETHTOOL_OPS constness. On 2.6.18 dev->ethtool_ops was not marked as const. This adds a compatibility macro that casts away the constness so we can mark our ethtool ops as const on later kernels. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h b/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h index e8988c90..ac1ff828 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h @@ -110,4 +110,10 @@ static inline void netdev_rx_handler_unregister(struct net_device *dev) } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#undef SET_ETHTOOL_OPS +#define SET_ETHTOOL_OPS(netdev, ops) \ + ( (netdev)->ethtool_ops = (struct ethtool_ops *)(ops) ) +#endif + #endif