]> git.openfabrics.org - ~emulex/for-vlad/compat.git/commitdiff
compat: backport skb_checksum_start_offset
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 17 Dec 2010 22:41:36 +0000 (14:41 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Sat, 18 Dec 2010 20:07:00 +0000 (12:07 -0800)
This is needed by atlx, atl1c and atl1e.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-2.6.38.h

index dfc406e95981c4b1674c24d1b1210e5f09cfe5b2..05211564e36d7d02a347839bb46a63f726bef892 100644 (file)
@@ -6,6 +6,7 @@
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
 
 #include <linux/kernel.h>
+#include <linux/skbuff.h>
 
 /*
  * This is not part of The 2.6.37 kernel yet but we
@@ -56,6 +57,11 @@ static inline unsigned long ewma_read(const struct ewma *avg)
 
 #define pr_warn pr_warning
 
+static inline int skb_checksum_start_offset(const struct sk_buff *skb)
+{
+       return skb->csum_start - skb_headroom(skb);
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) */
 
 #endif /* LINUX_26_38_COMPAT_H */