The netdev_features_t typedef appeared in Linux 3.3, but checking the kernel
version isn't enough with some distributions (such as Debian Wheezy) that
backported it into 3.2, causing a compilation failure due to redefinition.
Since the presence of a typedef can't be tested at compile time, this commit
adds type kni_netdev_features_t, which, depending on the kernel version,
translates either to u32 or netdev_features_t.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
}
#ifdef HAVE_NDO_SET_FEATURES
-static netdev_features_t igb_fix_features(struct net_device *netdev,
- netdev_features_t features)
+static kni_netdev_features_t igb_fix_features(struct net_device *netdev,
+ kni_netdev_features_t features)
{
/*
* Since there is no support for separate tx vlan accel
}
static int igb_set_features(struct net_device *netdev,
- netdev_features_t features)
+ kni_netdev_features_t features)
{
u32 changed = netdev->features ^ features;
#endif
/*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) )
-typedef u32 netdev_features_t;
+typedef u32 kni_netdev_features_t;
#undef PCI_EXP_TYPE_RC_EC
#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */
#ifndef CONFIG_BQL
#define netdev_reset_queue(_n) do {} while (0)
#endif
#else /* ! < 3.3.0 */
+typedef netdev_features_t kni_netdev_features_t;
#define HAVE_INT_NDO_VLAN_RX_ADD_VID
#ifdef ETHTOOL_SRXNTUPLE
#undef ETHTOOL_SRXNTUPLE
/*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) )
-typedef u32 netdev_features_t;
+typedef u32 kni_netdev_features_t;
#else /* ! < 3.3.0 */
+typedef netdev_features_t kni_netdev_features_t;
#define HAVE_INT_NDO_VLAN_RX_ADD_VID
#ifdef ETHTOOL_SRXNTUPLE
#undef ETHTOOL_SRXNTUPLE