]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/netdevice.h
net: Fix disjunct computation of netdev features
[linux-2.6-omap-h63xx.git] / include / linux / netdevice.h
index 9cfd20be8b7fef123018c345ed8324911626b73e..c8bcb59adfdf2570f0a8966eeb7219651d92ab1a 100644 (file)
@@ -11,7 +11,7 @@
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  *             Corey Minyard <wf-rch!minyard@relay.EU.net>
  *             Donald J. Becker, <becker@cesdis.gsfc.nasa.gov>
- *             Alan Cox, <Alan.Cox@linux.org>
+ *             Alan Cox, <alan@lxorguk.ukuu.org.uk>
  *             Bjorn Ekwall. <bj0rn@blox.se>
  *              Pekka Riikonen <priikone@poseidon.pspt.fi>
  *
@@ -42,6 +42,7 @@
 #include <linux/workqueue.h>
 
 #include <net/net_namespace.h>
+#include <net/dsa.h>
 
 struct vlan_group;
 struct ethtool_ops;
@@ -540,6 +541,14 @@ struct net_device
 #define NETIF_F_V6_CSUM                (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
 #define NETIF_F_ALL_CSUM       (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
 
+       /*
+        * If one device supports one of these features, then enable them
+        * for all in netdev_increment_features.
+        */
+#define NETIF_F_ONE_FOR_ALL    (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
+                                NETIF_F_SG | NETIF_F_HIGHDMA | \
+                                NETIF_F_FRAGLIST)
+
        /* Interface index. Unique device identifier    */
        int                     ifindex;
        int                     iflink;
@@ -607,6 +616,9 @@ struct net_device
 
        /* Protocol specific pointers */
        
+#ifdef CONFIG_NET_DSA
+       void                    *dsa_ptr;       /* dsa specific data */
+#endif
        void                    *atalk_ptr;     /* AppleTalk link       */
        void                    *ip_ptr;        /* IPv4 specific data   */  
        void                    *dn_ptr;        /* DECnet specific data */
@@ -798,6 +810,26 @@ void dev_net_set(struct net_device *dev, struct net *net)
 #endif
 }
 
+static inline bool netdev_uses_dsa_tags(struct net_device *dev)
+{
+#ifdef CONFIG_NET_DSA_TAG_DSA
+       if (dev->dsa_ptr != NULL)
+               return dsa_uses_dsa_tags(dev->dsa_ptr);
+#endif
+
+       return 0;
+}
+
+static inline bool netdev_uses_trailer_tags(struct net_device *dev)
+{
+#ifdef CONFIG_NET_DSA_TAG_TRAILER
+       if (dev->dsa_ptr != NULL)
+               return dsa_uses_trailer_tags(dev->dsa_ptr);
+#endif
+
+       return 0;
+}
+
 /**
  *     netdev_priv - access network device private data
  *     @dev: network device
@@ -1674,7 +1706,9 @@ extern char *netdev_drivername(const struct net_device *dev, char *buffer, int l
 
 extern void linkwatch_run_queue(void);
 
-extern int netdev_compute_features(unsigned long all, unsigned long one);
+unsigned long netdev_increment_features(unsigned long all, unsigned long one,
+                                       unsigned long mask);
+unsigned long netdev_fix_features(unsigned long features, const char *name);
 
 static inline int net_gso_ok(int features, int gso_type)
 {