Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[sfrench/cifs-2.6.git] / include / linux / netdevice.h
index 91ee3643ccc8df3f8d244b6dd5f47526ea688274..20ce8df115ac4ce92903ab0f8b5b51fb2e983d1e 100644 (file)
@@ -1456,7 +1456,6 @@ enum netdev_priv_flags {
  *     @ptype_specific: Device-specific, protocol-specific packet handlers
  *
  *     @adj_list:      Directly linked devices, like slaves for bonding
- *     @all_adj_list:  All linked devices, *including* neighbours
  *     @features:      Currently active device features
  *     @hw_features:   User-changeable features
  *
@@ -1506,6 +1505,8 @@ enum netdev_priv_flags {
  *     @if_port:       Selectable AUI, TP, ...
  *     @dma:           DMA channel
  *     @mtu:           Interface MTU value
+ *     @min_mtu:       Interface Minimum MTU value
+ *     @max_mtu:       Interface Maximum MTU value
  *     @type:          Interface hardware type
  *     @hard_header_len: Maximum hardware header length.
  *
@@ -1673,11 +1674,6 @@ struct net_device {
                struct list_head lower;
        } adj_list;
 
-       struct {
-               struct list_head upper;
-               struct list_head lower;
-       } all_adj_list;
-
        netdev_features_t       features;
        netdev_features_t       hw_features;
        netdev_features_t       wanted_features;
@@ -1726,6 +1722,8 @@ struct net_device {
        unsigned char           dma;
 
        unsigned int            mtu;
+       unsigned int            min_mtu;
+       unsigned int            max_mtu;
        unsigned short          type;
        unsigned short          hard_header_len;
 
@@ -2686,71 +2684,6 @@ static inline void skb_gro_remcsum_cleanup(struct sk_buff *skb,
        remcsum_unadjust((__sum16 *)ptr, grc->delta);
 }
 
-struct skb_csum_offl_spec {
-       __u16           ipv4_okay:1,
-                       ipv6_okay:1,
-                       encap_okay:1,
-                       ip_options_okay:1,
-                       ext_hdrs_okay:1,
-                       tcp_okay:1,
-                       udp_okay:1,
-                       sctp_okay:1,
-                       vlan_okay:1,
-                       no_encapped_ipv6:1,
-                       no_not_encapped:1;
-};
-
-bool __skb_csum_offload_chk(struct sk_buff *skb,
-                           const struct skb_csum_offl_spec *spec,
-                           bool *csum_encapped,
-                           bool csum_help);
-
-static inline bool skb_csum_offload_chk(struct sk_buff *skb,
-                                       const struct skb_csum_offl_spec *spec,
-                                       bool *csum_encapped,
-                                       bool csum_help)
-{
-       if (skb->ip_summed != CHECKSUM_PARTIAL)
-               return false;
-
-       return __skb_csum_offload_chk(skb, spec, csum_encapped, csum_help);
-}
-
-static inline bool skb_csum_offload_chk_help(struct sk_buff *skb,
-                                            const struct skb_csum_offl_spec *spec)
-{
-       bool csum_encapped;
-
-       return skb_csum_offload_chk(skb, spec, &csum_encapped, true);
-}
-
-static inline bool skb_csum_off_chk_help_cmn(struct sk_buff *skb)
-{
-       static const struct skb_csum_offl_spec csum_offl_spec = {
-               .ipv4_okay = 1,
-               .ip_options_okay = 1,
-               .ipv6_okay = 1,
-               .vlan_okay = 1,
-               .tcp_okay = 1,
-               .udp_okay = 1,
-       };
-
-       return skb_csum_offload_chk_help(skb, &csum_offl_spec);
-}
-
-static inline bool skb_csum_off_chk_help_cmn_v4_only(struct sk_buff *skb)
-{
-       static const struct skb_csum_offl_spec csum_offl_spec = {
-               .ipv4_okay = 1,
-               .ip_options_okay = 1,
-               .tcp_okay = 1,
-               .udp_okay = 1,
-               .vlan_okay = 1,
-       };
-
-       return skb_csum_offload_chk_help(skb, &csum_offl_spec);
-}
-
 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
                                  unsigned short type,
                                  const void *daddr, const void *saddr,
@@ -3869,12 +3802,13 @@ struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
             updev; \
             updev = netdev_upper_get_next_dev_rcu(dev, &(iter)))
 
-/* iterate through upper list, must be called under RCU read lock */
-#define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \
-       for (iter = &(dev)->all_adj_list.upper, \
-            updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)); \
-            updev; \
-            updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)))
+int netdev_walk_all_upper_dev_rcu(struct net_device *dev,
+                                 int (*fn)(struct net_device *upper_dev,
+                                           void *data),
+                                 void *data);
+
+bool netdev_has_upper_dev_all_rcu(struct net_device *dev,
+                                 struct net_device *upper_dev);
 
 void *netdev_lower_get_next_private(struct net_device *dev,
                                    struct list_head **iter);
@@ -3907,17 +3841,14 @@ struct net_device *netdev_all_lower_get_next(struct net_device *dev,
 struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
                                                 struct list_head **iter);
 
-#define netdev_for_each_all_lower_dev(dev, ldev, iter) \
-       for (iter = (dev)->all_adj_list.lower.next, \
-            ldev = netdev_all_lower_get_next(dev, &(iter)); \
-            ldev; \
-            ldev = netdev_all_lower_get_next(dev, &(iter)))
-
-#define netdev_for_each_all_lower_dev_rcu(dev, ldev, iter) \
-       for (iter = &(dev)->all_adj_list.lower, \
-            ldev = netdev_all_lower_get_next_rcu(dev, &(iter)); \
-            ldev; \
-            ldev = netdev_all_lower_get_next_rcu(dev, &(iter)))
+int netdev_walk_all_lower_dev(struct net_device *dev,
+                             int (*fn)(struct net_device *lower_dev,
+                                       void *data),
+                             void *data);
+int netdev_walk_all_lower_dev_rcu(struct net_device *dev,
+                                 int (*fn)(struct net_device *lower_dev,
+                                           void *data),
+                                 void *data);
 
 void *netdev_adjacent_get_private(struct list_head *adj_list);
 void *netdev_lower_get_first_private_rcu(struct net_device *dev);
@@ -3994,19 +3925,6 @@ static inline bool can_checksum_protocol(netdev_features_t features,
        }
 }
 
-/* Map an ethertype into IP protocol if possible */
-static inline int eproto_to_ipproto(int eproto)
-{
-       switch (eproto) {
-       case htons(ETH_P_IP):
-               return IPPROTO_IP;
-       case htons(ETH_P_IPV6):
-               return IPPROTO_IPV6;
-       default:
-               return -1;
-       }
-}
-
 #ifdef CONFIG_BUG
 void netdev_rx_csum_fault(struct net_device *dev);
 #else