[NET]: IPV6 checksum offloading in network devices
[pandora-kernel.git] / include / linux / netdevice.h
index f671cd2..7a8f22f 100644 (file)
@@ -314,9 +314,10 @@ struct net_device
        /* Net device features */
        unsigned long           features;
 #define NETIF_F_SG             1       /* Scatter/gather IO. */
-#define NETIF_F_IP_CSUM                2       /* Can checksum only TCP/UDP over IPv4. */
+#define NETIF_F_IP_CSUM                2       /* Can checksum TCP/UDP over IPv4. */
 #define NETIF_F_NO_CSUM                4       /* Does not require checksum. F.e. loopack. */
 #define NETIF_F_HW_CSUM                8       /* Can checksum all the packets. */
+#define NETIF_F_IPV6_CSUM      16      /* Can checksum TCP/UDP over IPV6 */
 #define NETIF_F_HIGHDMA                32      /* Can DMA to high memory. */
 #define NETIF_F_FRAGLIST       64      /* Scatter/gather IO. */
 #define NETIF_F_HW_VLAN_TX     128     /* Transmit VLAN hw acceleration */
@@ -338,8 +339,11 @@ struct net_device
        /* List of features with software fallbacks. */
 #define NETIF_F_GSO_SOFTWARE   (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
 
+
 #define NETIF_F_GEN_CSUM       (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
-#define NETIF_F_ALL_CSUM       (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
+#define NETIF_F_V4_CSUM                (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
+#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)
 
        struct net_device       *next_sched;
 
@@ -540,13 +544,16 @@ struct net_device
        struct device           dev;
        /* space for optional statistics and wireless sysfs groups */
        struct attribute_group  *sysfs_groups[3];
+
+       /* rtnetlink link ops */
+       const struct rtnl_link_ops *rtnl_link_ops;
 };
 #define to_net_dev(d) container_of(d, struct net_device, dev)
 
 #define        NETDEV_ALIGN            32
 #define        NETDEV_ALIGN_CONST      (NETDEV_ALIGN - 1)
 
-static inline void *netdev_priv(struct net_device *dev)
+static inline void *netdev_priv(const struct net_device *dev)
 {
        return (char *)dev + ((sizeof(struct net_device)
                                        + NETDEV_ALIGN_CONST)
@@ -910,6 +917,17 @@ static inline int netif_rx_reschedule(struct net_device *dev, int undo)
        return 0;
 }
 
+/* same as netif_rx_complete, except that local_irq_save(flags)
+ * has already been issued
+ */
+static inline void __netif_rx_complete(struct net_device *dev)
+{
+       BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
+       list_del(&dev->poll_list);
+       smp_mb__before_clear_bit();
+       clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
+}
+
 /* Remove interface from poll list: it must be in the poll list
  * on current cpu. This primitive is called by dev->poll(), when
  * it completes the work. The device cannot be out of poll list at this
@@ -920,10 +938,7 @@ static inline void netif_rx_complete(struct net_device *dev)
        unsigned long flags;
 
        local_irq_save(flags);
-       BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
-       list_del(&dev->poll_list);
-       smp_mb__before_clear_bit();
-       clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
+       __netif_rx_complete(dev);
        local_irq_restore(flags);
 }
 
@@ -940,17 +955,6 @@ static inline void netif_poll_enable(struct net_device *dev)
        clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
 }
 
-/* same as netif_rx_complete, except that local_irq_save(flags)
- * has already been issued
- */
-static inline void __netif_rx_complete(struct net_device *dev)
-{
-       BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
-       list_del(&dev->poll_list);
-       smp_mb__before_clear_bit();
-       clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
-}
-
 static inline void netif_tx_lock(struct net_device *dev)
 {
        spin_lock(&dev->_xmit_lock);