I had completely forgotten that we had a top-level compat.h and compat26.h.
It's better to distribute their contents to individual compat headers, so
this commit does so and deletes them.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
openvswitch_headers = \
actions.h \
checksum.h \
- compat.h \
datapath.h \
dp_sysfs.h \
flow.h \
/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009, 2011 Nicira Networks.
* Distributed under the terms of the GNU GPL version 2.
*
* Significant portions of this file may be copied from parts of the Linux
#include <linux/rtnetlink.h>
#include <net/genetlink.h>
-#include "compat.h"
#include "openvswitch/brcompat-netlink.h"
#include "brc_procfs.h"
#include "datapath.h"
+++ /dev/null
-/*
- * Copyright (c) 2009 Nicira Networks.
- * Distributed under the terms of the GNU GPL version 2.
- *
- * Significant portions of this file may be copied from parts of the Linux
- * kernel, by Linus Torvalds and others.
- */
-
-#ifndef COMPAT_H
-#define COMPAT_H 1
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-
-#include "compat26.h"
-
-#else
-
-#include "compat24.h"
-
-#endif
-
-
-#endif /* compat.h */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Nicira Networks.
* Distributed under the terms of the GNU GPL version 2.
*
* Significant portions of this file may be copied from parts of the Linux
#include "table.h"
#include "vport-internal_dev.h"
-#include "compat.h"
-
int (*dp_ioctl_hook)(struct net_device *dev, struct ifreq *rq, int cmd);
EXPORT_SYMBOL(dp_ioctl_hook);
/*
* Distributed under the terms of the GNU GPL version 2.
- * Copyright (c) 2007, 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Nicira Networks.
*
* Significant portions of this file may be copied from parts of the Linux
* kernel, by Linus Torvalds and others.
#include <net/inet_ecn.h>
#include <net/ip.h>
-#include "compat.h"
-
static struct kmem_cache *flow_cache;
static unsigned int hash_seed __read_mostly;
linux-2.6/compat-2.6/skbuff-openvswitch.c \
linux-2.6/compat-2.6/time.c
openvswitch_headers += \
- linux-2.6/compat-2.6/compat26.h \
linux-2.6/compat-2.6/include/asm-generic/bug.h \
linux-2.6/compat-2.6/include/linux/bottom_half.h \
linux-2.6/compat-2.6/include/linux/compiler.h \
+++ /dev/null
-#ifndef __COMPAT26_H
-#define __COMPAT26_H 1
-
-#include <linux/version.h>
-
-#if defined(CONFIG_PREEMPT) && LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
-#error "CONFIG_PREEMPT is broken with 2.6.x before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\""
-#endif
-
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
-/*----------------------------------------------------------------------------
- * In 2.6.24, a namespace argument became required for dev_get_by_name. */
-
-#define dev_get_by_name(net, name) \
- dev_get_by_name((name))
-
-#define dev_get_by_index(net, ifindex) \
- dev_get_by_index((ifindex))
-
-#define __dev_get_by_name(net, name) \
- __dev_get_by_name((name))
-
-#define __dev_get_by_index(net, ifindex) \
- __dev_get_by_index((ifindex))
-
-#endif /* linux kernel <= 2.6.23 */
-
-
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22)
-/*----------------------------------------------------------------------------
- * In 2.6.23, the last argument was dropped from kmem_cache_create. */
-#define kmem_cache_create(n, s, a, f, c) \
- kmem_cache_create((n), (s), (a), (f), (c), NULL)
-
-#endif /* linux kernel <= 2.6.22 */
-
-#endif /* compat26.h */
#define pr_warn pr_warning
#endif
+#if defined(CONFIG_PREEMPT) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
+#error "CONFIG_PREEMPT is broken before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\""
+#endif
+
#endif /* linux/kernel.h */
( (netdev)->ethtool_ops = (struct ethtool_ops *)(ops) )
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+#define dev_get_by_name(net, name) dev_get_by_name(name)
+#define dev_get_by_index(net, ifindex) dev_get_by_index(ifindex)
+#define __dev_get_by_name(net, name) __dev_get_by_name(name)
+#define __dev_get_by_index(net, ifindex) __dev_get_by_index(ifindex)
+#endif
+
#endif
extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+#define kmem_cache_create(n, s, a, f, c) kmem_cache_create(n, s, a, f, c, NULL)
+#endif
+
#endif
/*
- * Copyright (c) 2010 Nicira Networks.
+ * Copyright (c) 2010, 2011 Nicira Networks.
* Distributed under the terms of the GNU GPL version 2.
*
* Significant portions of this file may be copied from parts of the Linux
#include "vport-internal_dev.h"
#include "vport-netdev.h"
-#include "compat.h"
-
/* If the native device stats aren't 64 bit use the vport stats tracking instead. */
#define USE_VPORT_STATS (sizeof(((struct net_device_stats *)0)->rx_bytes) < sizeof(u64))