]> Pileus Git - ~andy/linux/blobdiff - include/linux/skbuff.h
Merge branch 'linux-2.6' into for-linus
[~andy/linux] / include / linux / skbuff.h
index 755e9cddac47eebe516751a55929f4339b576c5f..14ec16d2d9ba7bd6254093df7db05a242bb4f7a0 100644 (file)
@@ -34,8 +34,9 @@
 #define HAVE_ALIGNABLE_SKB     /* Ditto 8)                */
 
 #define CHECKSUM_NONE 0
-#define CHECKSUM_HW 1
+#define CHECKSUM_PARTIAL 1
 #define CHECKSUM_UNNECESSARY 2
+#define CHECKSUM_COMPLETE 3
 
 #define SKB_DATA_ALIGN(X)      (((X) + (SMP_CACHE_BYTES - 1)) & \
                                 ~(SMP_CACHE_BYTES - 1))
  *           Apparently with secret goal to sell you new device, when you
  *           will add new protocol to your host. F.e. IPv6. 8)
  *
- *     HW: the most generic way. Device supplied checksum of _all_
+ *     COMPLETE: the most generic way. Device supplied checksum of _all_
  *         the packet as seen by netif_rx in skb->csum.
  *         NOTE: Even if device supports only some protocols, but
- *         is able to produce some skb->csum, it MUST use HW,
+ *         is able to produce some skb->csum, it MUST use COMPLETE,
  *         not UNNECESSARY.
  *
  * B. Checksumming on output.
  *
  *     NONE: skb is checksummed by protocol or csum is not required.
  *
- *     HW: device is required to csum packet as seen by hard_start_xmit
+ *     PARTIAL: device is required to csum packet as seen by hard_start_xmit
  *     from skb->h.raw to the end and to record the checksum
  *     at skb->h.raw+skb->csum.
  *
@@ -138,7 +139,7 @@ struct skb_shared_info {
        /* Warning: this field is not always filled in (UFO)! */
        unsigned short  gso_segs;
        unsigned short  gso_type;
-       unsigned int    ip6_frag_id;
+       __be32          ip6_frag_id;
        struct sk_buff  *frag_list;
        skb_frag_t      frags[MAX_SKB_FRAGS];
 };
@@ -215,7 +216,7 @@ enum {
  *     @tail: Tail pointer
  *     @end: End pointer
  *     @destructor: Destruct function
- *     @nfmark: Can be used for communication between hooks
+ *     @mark: Generic packet mark
  *     @nfct: Associated connection, if any
  *     @ipvs_property: skbuff is owned by ipvs
  *     @nfctinfo: Relationship of this skb to the connection
@@ -272,8 +273,11 @@ struct sk_buff {
 
        unsigned int            len,
                                data_len,
-                               mac_len,
-                               csum;
+                               mac_len;
+       union {
+               __wsum          csum;
+               __u32           csum_offset;
+       };
        __u32                   priority;
        __u8                    local_df:1,
                                cloned:1,
@@ -294,7 +298,6 @@ struct sk_buff {
 #ifdef CONFIG_BRIDGE_NETFILTER
        struct nf_bridge_info   *nf_bridge;
 #endif
-       __u32                   nfmark;
 #endif /* CONFIG_NETFILTER */
 #ifdef CONFIG_NET_SCHED
        __u16                   tc_index;       /* traffic control index */
@@ -309,6 +312,7 @@ struct sk_buff {
        __u32                   secmark;
 #endif
 
+       __u32                   mark;
 
        /* These elements must be at the end, see alloc_skb() for details.  */
        unsigned int            truesize;
@@ -1198,8 +1202,7 @@ static inline int skb_add_data(struct sk_buff *skb,
 
        if (skb->ip_summed == CHECKSUM_NONE) {
                int err = 0;
-               unsigned int csum = csum_and_copy_from_user(from,
-                                                           skb_put(skb, copy),
+               __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy),
                                                            copy, 0, &err);
                if (!err) {
                        skb->csum = csum_block_add(skb->csum, csum, off);
@@ -1261,14 +1264,14 @@ static inline int skb_linearize_cow(struct sk_buff *skb)
  *     @len: length of data pulled
  *
  *     After doing a pull on a received packet, you need to call this to
- *     update the CHECKSUM_HW checksum, or set ip_summed to CHECKSUM_NONE
- *     so that it can be recomputed from scratch.
+ *     update the CHECKSUM_COMPLETE checksum, or set ip_summed to
+ *     CHECKSUM_NONE so that it can be recomputed from scratch.
  */
 
 static inline void skb_postpull_rcsum(struct sk_buff *skb,
                                      const void *start, unsigned int len)
 {
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
                skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
 }
 
@@ -1287,7 +1290,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
 {
        if (likely(len >= skb->len))
                return 0;
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
                skb->ip_summed = CHECKSUM_NONE;
        return __pskb_trim(skb, len);
 }
@@ -1334,15 +1337,15 @@ extern int             skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
 extern void           skb_free_datagram(struct sock *sk, struct sk_buff *skb);
 extern void           skb_kill_datagram(struct sock *sk, struct sk_buff *skb,
                                         unsigned int flags);
-extern unsigned int    skb_checksum(const struct sk_buff *skb, int offset,
-                                   int len, unsigned int csum);
+extern __wsum         skb_checksum(const struct sk_buff *skb, int offset,
+                                   int len, __wsum csum);
 extern int            skb_copy_bits(const struct sk_buff *skb, int offset,
                                     void *to, int len);
 extern int            skb_store_bits(const struct sk_buff *skb, int offset,
                                      void *from, int len);
-extern unsigned int    skb_copy_and_csum_bits(const struct sk_buff *skb,
+extern __wsum         skb_copy_and_csum_bits(const struct sk_buff *skb,
                                              int offset, u8 *to, int len,
-                                             unsigned int csum);
+                                             __wsum csum);
 extern void           skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
 extern void           skb_split(struct sk_buff *skb,
                                 struct sk_buff *skb1, const u32 len);
@@ -1398,7 +1401,7 @@ static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *
 
 extern void __net_timestamp(struct sk_buff *skb);
 
-extern unsigned int __skb_checksum_complete(struct sk_buff *skb);
+extern __sum16 __skb_checksum_complete(struct sk_buff *skb);
 
 /**
  *     skb_checksum_complete - Calculate checksum of an entire packet