New helper: deactivate_locked_super()
[safe/jmp/linux-2.6] / include / linux / netdevice.h
index 7a5057f..5a96a1a 100644 (file)
@@ -32,6 +32,7 @@
 #ifdef __KERNEL__
 #include <linux/timer.h>
 #include <linux/delay.h>
+#include <linux/mm.h>
 #include <asm/atomic.h>
 #include <asm/cache.h>
 #include <asm/byteorder.h>
@@ -96,14 +97,14 @@ struct wireless_dev;
  *     Compute the worst case header length according to the protocols
  *     used.
  */
+
 #if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 # if defined(CONFIG_MAC80211_MESH)
 #  define LL_MAX_HEADER 128
 # else
 #  define LL_MAX_HEADER 96
 # endif
-#elif defined(CONFIG_TR)
+#elif defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
 # define LL_MAX_HEADER 48
 #else
 # define LL_MAX_HEADER 32
@@ -124,7 +125,7 @@ struct wireless_dev;
  *     Network device statistics. Akin to the 2.0 ether stats but
  *     with byte counters.
  */
+
 struct net_device_stats
 {
        unsigned long   rx_packets;             /* total packets received       */
@@ -285,7 +286,7 @@ enum netdev_state_t
 
 /*
  * This structure holds at boot time configured netdevice settings. They
- * are then used in the device probing. 
+ * are then used in the device probing.
  */
 struct netdev_boot_setup {
        char name[IFNAMSIZ];
@@ -314,6 +315,9 @@ struct napi_struct {
        spinlock_t              poll_lock;
        int                     poll_owner;
 #endif
+
+       unsigned int            gro_count;
+
        struct net_device       *dev;
        struct list_head        dev_list;
        struct sk_buff          *gro_list;
@@ -327,6 +331,14 @@ enum
        NAPI_STATE_NPSVC,       /* Netpoll - don't dequeue from poll_list */
 };
 
+enum {
+       GRO_MERGED,
+       GRO_MERGED_FREE,
+       GRO_HELD,
+       GRO_NORMAL,
+       GRO_DROP,
+};
+
 extern void __napi_schedule(struct napi_struct *n);
 
 static inline int napi_disable_pending(struct napi_struct *n)
@@ -488,7 +500,7 @@ struct netdev_queue {
  *
  * int (*ndo_set_mac_address)(struct net_device *dev, void *addr);
  *     This function  is called when the Media Access Control address
- *     needs to be changed. If not this interface is not defined, the
+ *     needs to be changed. If this interface is not defined, the
  *     mac address can not be changed.
  *
  * int (*ndo_validate_addr)(struct net_device *dev);
@@ -582,6 +594,14 @@ struct net_device_ops {
 #define HAVE_NETDEV_POLL
        void                    (*ndo_poll_controller)(struct net_device *dev);
 #endif
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+       int                     (*ndo_fcoe_ddp_setup)(struct net_device *dev,
+                                                     u16 xid,
+                                                     struct scatterlist *sgl,
+                                                     unsigned int sgc);
+       int                     (*ndo_fcoe_ddp_done)(struct net_device *dev,
+                                                    u16 xid);
+#endif
 };
 
 /*
@@ -650,14 +670,17 @@ struct net_device
 #define NETIF_F_GRO            16384   /* Generic receive offload */
 #define NETIF_F_LRO            32768   /* large receive offload */
 
+#define NETIF_F_FCOE_CRC       (1 << 24) /* FCoE CRC32 */
+
        /* Segmentation offload features */
 #define NETIF_F_GSO_SHIFT      16
-#define NETIF_F_GSO_MASK       0xffff0000
+#define NETIF_F_GSO_MASK       0x00ff0000
 #define NETIF_F_TSO            (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
 #define NETIF_F_UFO            (SKB_GSO_UDP << NETIF_F_GSO_SHIFT)
 #define NETIF_F_GSO_ROBUST     (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT)
 #define NETIF_F_TSO_ECN                (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
 #define NETIF_F_TSO6           (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
+#define NETIF_F_FSO            (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT)
 
        /* List of features with software fallbacks. */
 #define NETIF_F_GSO_SOFTWARE   (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
@@ -740,7 +763,7 @@ struct net_device
        void                    *dsa_ptr;       /* dsa specific data */
 #endif
        void                    *atalk_ptr;     /* AppleTalk link       */
-       void                    *ip_ptr;        /* IPv4 specific data   */  
+       void                    *ip_ptr;        /* IPv4 specific data   */
        void                    *dn_ptr;        /* DECnet specific data */
        void                    *ip6_ptr;       /* IPv6 specific data */
        void                    *ec_ptr;        /* Econet specific data */
@@ -753,7 +776,7 @@ struct net_device
  */
        unsigned long           last_rx;        /* Time of last Rx      */
        /* Interface address info used in eth_type_trans() */
-       unsigned char           dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast 
+       unsigned char           dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast
                                                           because most packets are unicast) */
 
        unsigned char           broadcast[MAX_ADDR_LEN];        /* hw bcast add */
@@ -840,6 +863,11 @@ struct net_device
        struct dcbnl_rtnl_ops *dcbnl_ops;
 #endif
 
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+       /* max exchange id for FCoE LRO by ddp */
+       unsigned int            fcoe_ddp_xid;
+#endif
+
 #ifdef CONFIG_COMPAT_NET_DEV_OPS
        struct {
                int                     (*init)(struct net_device *dev);
@@ -1082,6 +1110,7 @@ extern void               synchronize_net(void);
 extern int             register_netdevice_notifier(struct notifier_block *nb);
 extern int             unregister_netdevice_notifier(struct notifier_block *nb);
 extern int             init_dummy_netdev(struct net_device *dev);
+extern void            netdev_resync_ops(struct net_device *dev);
 
 extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
 extern struct net_device       *dev_get_by_index(struct net *net, int ifindex);
@@ -1114,6 +1143,13 @@ static inline void skb_gro_reset_offset(struct sk_buff *skb)
        NAPI_GRO_CB(skb)->data_offset = 0;
 }
 
+static inline void *skb_gro_mac_header(struct sk_buff *skb)
+{
+       return skb_mac_header(skb) < skb->data ? skb_mac_header(skb) :
+              page_address(skb_shinfo(skb)->frags[0].page) +
+              skb_shinfo(skb)->frags[0].page_offset;
+}
+
 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
                                  unsigned short type,
                                  const void *daddr, const void *saddr,
@@ -1853,7 +1889,7 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)
 
                if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
                        if ((dev->priv_flags & IFF_SLAVE_NEEDARP) &&
-                           skb->protocol == __constant_htons(ETH_P_ARP))
+                           skb->protocol == __cpu_to_be16(ETH_P_ARP))
                                return 0;
 
                        if (master->priv_flags & IFF_MASTER_ALB) {
@@ -1862,7 +1898,7 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)
                                        return 0;
                        }
                        if (master->priv_flags & IFF_MASTER_8023AD &&
-                           skb->protocol == __constant_htons(ETH_P_SLOW))
+                           skb->protocol == __cpu_to_be16(ETH_P_SLOW))
                                return 0;
 
                        return 1;