datapath: Check for backported __wsum and __sum16.
authorJesse Gross <jesse@nicira.com>
Wed, 8 Sep 2010 17:04:47 +0000 (10:04 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 8 Sep 2010 17:24:42 +0000 (10:24 -0700)
Reported-by: Alexey I. Froloff <raorn@altlinux.org>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
acinclude.m4
datapath/linux-2.6/compat-2.6/include/linux/kernel.h
datapath/linux-2.6/compat-2.6/include/linux/types.h

index 80794dac309d4f7a6ffb12f0a6c3e93d86713943..f1322fa0e125532556b8fc9e037d0becd5b3918e 100644 (file)
@@ -188,6 +188,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
 
   OVS_GREP_IFELSE([$KSRC26/include/linux/types.h], [bool],
                   [OVS_DEFINE([HAVE_BOOL_TYPE])])
+  OVS_GREP_IFELSE([$KSRC26/include/linux/types.h], [__wsum],
+                  [OVS_DEFINE([HAVE_CSUM_TYPES])])
 
   OVS_GREP_IFELSE([$KSRC26/include/net/checksum.h], [csum_unfold],
                   [OVS_DEFINE([HAVE_CSUM_UNFOLD])])
index 1f65c099ab74cfadfc2f05cfcffbcf0a4647aa16..13361f78d0132da48528cec7b242cf84a8f64ad7 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/log2.h>
 #endif
 
+#include <linux/version.h>
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
 #undef pr_emerg
 #define pr_emerg(fmt, ...) \
index d88baf71ce9ffca51d62ccaedf9e3e0332e712aa..b989d96c38ef18dccf0fee557d89484e185bdd23 100644 (file)
@@ -3,13 +3,10 @@
 
 #include_next <linux/types.h>
 
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-
+#ifndef HAVE_CSUM_TYPES
 typedef __u16 __bitwise __sum16;
 typedef __u32 __bitwise __wsum;
-
-#endif /* linux kernel < 2.6.20 */
+#endif
 
 #ifndef HAVE_BOOL_TYPE
 typedef _Bool bool;