From f981c8b0da9c8efec309064367e36338518eba15 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Wed, 24 Nov 2010 09:27:10 -0800 Subject: [PATCH] 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 --- datapath/linux-2.6/compat-2.6/include/linux/netdevice.h | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.30.2