[ovs-dev] [PATCH 09/14] datapath: Provide compatibility code for SET_ETHTOOL_OPS constness.
Jesse Gross
jesse at nicira.com
Thu Dec 2 20:36:58 UTC 2010
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 <jesse at nicira.com>
---
.../linux-2.6/compat-2.6/include/linux/netdevice.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
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 e8988c9..ac1ff82 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
--
1.7.1
More information about the dev
mailing list