]> git.openfabrics.org - ~emulex/for-vlad/compat.git/commitdiff
compat: backport skb_checksum_none_assert
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 11 Sep 2010 16:19:58 +0000 (09:19 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 13 Sep 2010 17:59:03 +0000 (10:59 -0700)
This is needed by atlx, b44, atl1c and atl1e.

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

index 5bd6edb03f382deb7a1d86e5daefc4e510bb3ebe..8ea0bab542b87dff6d4d1358b97eadb25cdd59c4 100644 (file)
@@ -5,6 +5,8 @@
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37))
 
+#include <linux/skbuff.h>
+
 /*
  * This is not part of The 2.6.37 kernel yet but we
  * we use it to optimize the backport code we
 
 extern struct kobj_ns_type_operations net_ns_type_operations;
 
+/**
+ * skb_checksum_none_assert - make sure skb ip_summed is CHECKSUM_NONE
+ * @skb: skb to check
+ *
+ * fresh skbs have their ip_summed set to CHECKSUM_NONE.
+ * Instead of forcing ip_summed to CHECKSUM_NONE, we can
+ * use this helper, to document places where we make this assertion.
+ */
+static inline void skb_checksum_none_assert(struct sk_buff *skb)
+{
+#ifdef DEBUG
+       BUG_ON(skb->ip_summed != CHECKSUM_NONE);
+#endif
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) */
 
 #endif /* LINUX_26_37_COMPAT_H */