From e0ae0351d0ae63a0b5d7d50cd43cb2abc6eefdd0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Miros=C5=82aw?= Date: Tue, 15 Nov 2011 15:29:55 +0000 Subject: [PATCH] net: introduce and use netdev_features_t for device features sets MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit v2: add couple missing conversions in drivers split unexporting netdev_fix_features() implemented %pNF convert sock::sk_route_(no?)caps Signed-off-by: Michał Mirosław Signed-off-by: David S. Miller --- jme.c | 11 ++++++++++- jme.h | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/jme.c b/jme.c index 66865b9..c62014d 100644 --- a/jme.c +++ b/jme.c @@ -1991,7 +1991,7 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx) struct jme_ring *txring = &(jme->txring[0]); struct txdesc *txdesc = txring->desc, *ctxdesc; struct jme_buffer_info *txbi = txring->bufinf, *ctxbi; - u8 hidma = jme->dev->features & NETIF_F_HIGHDMA; + u8 hidma = !!(jme->dev->features & NETIF_F_HIGHDMA); int i, nr_frags = skb_shinfo(skb)->nr_frags; int mask = jme->tx_ring_mask; const struct skb_frag_struct *frag; @@ -2862,8 +2862,13 @@ jme_set_tso(struct net_device *netdev, u32 on) return 0; } #else +#ifndef __NEW_FIX_FEATURES_TYPE__ static u32 jme_fix_features(struct net_device *netdev, u32 features) +#else +static netdev_features_t +jme_fix_features(struct net_device *netdev, netdev_features_t features) +#endif { if (netdev->mtu > 1900) features &= ~(NETIF_F_ALL_TSO | NETIF_F_ALL_CSUM); @@ -2871,7 +2876,11 @@ jme_fix_features(struct net_device *netdev, u32 features) } static int +#ifndef __NEW_FIX_FEATURES_TYPE__ jme_set_features(struct net_device *netdev, u32 features) +#else +jme_set_features(struct net_device *netdev, netdev_features_t features) +#endif { struct jme_adapter *jme = netdev_priv(netdev); diff --git a/jme.h b/jme.h index fd226cd..2e108be 100644 --- a/jme.h +++ b/jme.h @@ -125,6 +125,10 @@ do { \ #define __USE_SKB_FRAG_API__ #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) +#define __NEW_FIX_FEATURES_TYPE__ +#endif + /* * Extra PCI Configuration space interface */ -- 2.39.3