From: Jesse Gross Date: Tue, 6 Apr 2010 02:38:31 +0000 (-0400) Subject: datapath: Add dev_get_stats compatibility function. X-Git-Tag: v1.0.0~140 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c5ccff0db1e0ef75e36a414e8c0c2b8421cdeda8;p=sliver-openvswitch.git datapath: Add dev_get_stats compatibility function. The dev_get_stats function wasn't added until 2.6.29 so provide a replacement for it. --- 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 924dc0d3e..7080d0128 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 @@ -77,4 +77,12 @@ extern void unregister_netdevice_many(struct list_head *head); extern void dev_disable_lro(struct net_device *dev); #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) +static inline const struct net_device_stats * +dev_get_stats(struct net_device *dev) +{ + return dev->get_stats(dev); +} +#endif + #endif