]> bbs.cooldavid.org Git - jme.git/commitdiff
net: introduce and use netdev_features_t for device features sets
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Tue, 15 Nov 2011 15:29:55 +0000 (15:29 +0000)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Fri, 24 Feb 2012 03:14:54 +0000 (11:14 +0800)
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 <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
jme.c
jme.h

diff --git a/jme.c b/jme.c
index 66865b9903751358e5c07dc8baaa532d965aacaa..c62014dcecebd39ab83d94b3b5f453076d6bfcd6 100644 (file)
--- 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;
        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;
        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
        return 0;
 }
 #else
+#ifndef __NEW_FIX_FEATURES_TYPE__
 static u32
 jme_fix_features(struct net_device *netdev, u32 features)
 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);
 {
        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
 }
 
 static int
+#ifndef __NEW_FIX_FEATURES_TYPE__
 jme_set_features(struct net_device *netdev, u32 features)
 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);
 
 {
        struct jme_adapter *jme = netdev_priv(netdev);
 
diff --git a/jme.h b/jme.h
index fd226cd83d8171c87f9aca72ab001f5ee0dc032c..2e108be75e137e7d8f9671cf90b358b1debe8c83 100644 (file)
--- a/jme.h
+++ b/jme.h
@@ -125,6 +125,10 @@ do {                                                                       \
 #define __USE_SKB_FRAG_API__
 #endif
 
 #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
  */
 /*
  * Extra PCI Configuration space interface
  */