2009-11-24 02:26:08

by Arnaud Lacombe

[permalink] [raw]
Subject: [PATCH 08/13] Add compatibility macro for register_sysctl_table()

The API was changed on commit 0b4d4147. register_sysctl_table() lost its
last
argument.

Signed-off-by: Arnaud Lacombe <[email protected]>
---
compat-2.6.21.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/compat-2.6.21.h b/compat-2.6.21.h
index c185cfb..263ebd2 100644
--- a/compat-2.6.21.h
+++ b/compat-2.6.21.h
@@ -7,6 +7,13 @@
/* Compat work for 2.6.21 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))

+#include <linux/sysctl.h>
+
+#define register_sysctl_table(table) \
+ ({ \
+ register_sysctl_table((table), 0); \
+ })
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) */

#endif /* LINUX_26_21_COMPAT_H */
--
1.6.3.3.385.g60647.dirty




2009-12-01 08:39:58

by Arnaud Lacombe

[permalink] [raw]
Subject: [PATCH 2/5] Add compatibility call for dev_get_stats()

Added on commit eeda3fd6 by Stephen Hemminger in include/linux/netdevice.h.

Signed-off-by: Arnaud Lacombe <[email protected]>
---
compat-2.6.29.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/compat-2.6.29.h b/compat-2.6.29.h
index ff97b37..cad5e6b 100644
--- a/compat-2.6.29.h
+++ b/compat-2.6.29.h
@@ -6,6 +6,7 @@

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))

+#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/usb.h>

@@ -40,6 +41,12 @@ static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
return skb->prev;
}

+
+static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
+{
+ return dev->get_stats(dev);
+}
+
extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);

#define DIV_ROUND_CLOSEST(x, divisor)( \
--
1.6.3.3.385.g60647.dirty


2009-12-01 08:39:31

by Arnaud Lacombe

[permalink] [raw]
Subject: [PATCH 1/5] Add posix SHUT_RD/SHUT_WR/SHUT_RDWR macros

Added on commit 91cf45f0 by Trond Myklebust in include/linux/net.h.

Signed-off-by: Arnaud Lacombe <[email protected]>
---
compat-2.6.24.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/compat-2.6.24.h b/compat-2.6.24.h
index d8f7c2c..68d33c7 100644
--- a/compat-2.6.24.h
+++ b/compat-2.6.24.h
@@ -10,6 +10,13 @@
/* Added on 2.6.24 in include/linux/types.h by Al viro on commit 142956af */
typedef unsigned long uintptr_t;

+/* From include/linux/net.h */
+enum sock_shutdown_cmd {
+ SHUT_RD = 0,
+ SHUT_WR = 1,
+ SHUT_RDWR = 2,
+};
+
#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,23)) /* Local check */
/* Added as of 2.6.24 in include/linux/skbuff.h.
*
--
1.6.3.3.385.g60647.dirty


2009-12-01 17:58:56

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 1/5] Add posix SHUT_RD/SHUT_WR/SHUT_RDWR macros

On Tue, Dec 1, 2009 at 12:38 AM, Arnaud Lacombe <[email protected]> wrote:
> Added on commit 91cf45f0 by Trond Myklebust in include/linux/net.h.
>
> Signed-off-by: Arnaud Lacombe <[email protected]>

Thanks, all were applied.

Luis

2009-12-01 08:40:18

by Arnaud Lacombe

[permalink] [raw]
Subject: [PATCH 5/5] Trailing space nits

Signed-off-by: Arnaud Lacombe <[email protected]>
---
Makefile | 4 ++--
compat-2.6.23.c | 6 +++---
compat-2.6.23.h | 2 +-
compat-2.6.24.h | 2 +-
compat-2.6.25.c | 2 +-
compat-2.6.25.h | 2 +-
compat-2.6.26.h | 16 ++++++++--------
7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/Makefile b/Makefile
index 1677589..d2c08d1 100644
--- a/Makefile
+++ b/Makefile
@@ -38,8 +38,8 @@ compat-$(CONFIG_COMPAT_KERNEL_30) += compat-2.6.30.o
compat-$(CONFIG_COMPAT_KERNEL_31) += compat-2.6.31.o
compat-$(CONFIG_COMPAT_KERNEL_32) += compat-2.6.32.o

-modules:
- $(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules
+modules:
+ $(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules
install: modules
$(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) \
modules_install
diff --git a/compat-2.6.23.c b/compat-2.6.23.c
index 9845b82..d232b1a 100644
--- a/compat-2.6.23.c
+++ b/compat-2.6.23.c
@@ -14,7 +14,7 @@
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))

/* Part of net/core/dev_mcast.c as of 2.6.23. This is a slightly different version.
- * Since da->da_synced is not part of 2.6.22 we need to take longer route when
+ * Since da->da_synced is not part of 2.6.22 we need to take longer route when
* syncing */

/**
@@ -70,8 +70,8 @@ int dev_mc_sync(struct net_device *to, struct net_device *from)
EXPORT_SYMBOL(dev_mc_sync);


-/* Part of net/core/dev_mcast.c as of 2.6.23. This is a slighty different version.
- * Since da->da_synced is not part of 2.6.22 we need to take longer route when
+/* Part of net/core/dev_mcast.c as of 2.6.23. This is a slighty different version.
+ * Since da->da_synced is not part of 2.6.22 we need to take longer route when
* unsyncing */

/**
diff --git a/compat-2.6.23.h b/compat-2.6.23.h
index 5eb6dbf..c36f90d 100644
--- a/compat-2.6.23.h
+++ b/compat-2.6.23.h
@@ -70,7 +70,7 @@ static inline void tcf_destroy_chain_compat(struct tcf_proto **fl)
#define da_users dmi_users
#define da_gusers dmi_gusers

-/* dev_set_promiscuity() was moved to __dev_set_promiscuity() on 2.6.23 and
+/* dev_set_promiscuity() was moved to __dev_set_promiscuity() on 2.6.23 and
* dev_set_promiscuity() became a wrapper. */
#define __dev_set_promiscuity dev_set_promiscuity

diff --git a/compat-2.6.24.h b/compat-2.6.24.h
index 68d33c7..43e6302 100644
--- a/compat-2.6.24.h
+++ b/compat-2.6.24.h
@@ -148,7 +148,7 @@ struct header_ops {
unsigned char *haddr);
};

-/* net/ieee80211/ieee80211_crypt_tkip uses sg_init_table. This was added on
+/* net/ieee80211/ieee80211_crypt_tkip uses sg_init_table. This was added on
* 2.6.24. CONFIG_DEBUG_SG was added in 2.6.24 as well, so lets just ignore
* the debug stuff. Note that adding this required changes to the struct
* scatterlist on include/asm/scatterlist*, so the right way to port this
diff --git a/compat-2.6.25.c b/compat-2.6.25.c
index e39971a..e872447 100644
--- a/compat-2.6.25.c
+++ b/compat-2.6.25.c
@@ -15,7 +15,7 @@

/* Backport work for QoS dependencies (kernel/pm_qos_params.c)
* ipw2100 now makes use of
- * pm_qos_add_requirement(),
+ * pm_qos_add_requirement(),
* pm_qos_update_requirement() and
* pm_qos_remove_requirement() from it
*
diff --git a/compat-2.6.25.h b/compat-2.6.25.h
index fa42fd9..23cf487 100644
--- a/compat-2.6.25.h
+++ b/compat-2.6.25.h
@@ -82,7 +82,7 @@ static inline void be64_add_cpu(__be64 *var, u64 val)
*var = cpu_to_be64(v + val);
}

-/* 2.6.25 changes hwrng_unregister()'s behaviour by supporting
+/* 2.6.25 changes hwrng_unregister()'s behaviour by supporting
* suspend of its parent device (the misc device, which is itself the
* hardware random number generator). It does this by passing a parameter to
* unregister_miscdev() which is not supported in older kernels. The suspend
diff --git a/compat-2.6.26.h b/compat-2.6.26.h
index 7f1a9f1..b7c3b05 100644
--- a/compat-2.6.26.h
+++ b/compat-2.6.26.h
@@ -88,19 +88,19 @@ static inline const char *dev_name(struct device *dev)
return dev->bus_id;
}

-/* This is from include/linux/kernel.h, which was added as of 2.6.26 */
+/* This is from include/linux/kernel.h, which was added as of 2.6.26 */

/**
* clamp_val - return a value clamped to a given range using val's type
* @val: current value
* @min: minimum allowable value
* @max: maximum allowable value
- *
+ *
* This macro does no typechecking and uses temporary variables of whatever
* type the input argument 'val' is. This is useful when val is an unsigned
* type and min and max are literals that will otherwise be assigned a signed
* integer type.
- */
+ */

#define clamp_val(val, min, max) ({ \
typeof(val) __val = (val); \
@@ -193,10 +193,10 @@ struct net *dev_net(const struct net_device *dev)
* implementation. The AVR32 AP implementation can handle unaligned
* words, but halfwords must be halfword-aligned, and doublewords must
* be word-aligned.
- *
+ *
* However, swapped word loads must be word-aligned so we can't
* optimize word loads in general.
- */
+ */

#include <linux/unaligned/be_struct.h>
#include <linux/unaligned/le_byteshift.h>
@@ -213,7 +213,7 @@ struct net *dev_net(const struct net_device *dev)
#ifdef CONFIG_CRIS

/*
- * CRIS can do unaligned accesses itself.
+ * CRIS can do unaligned accesses itself.
*/
#include <linux/unaligned/access_ok.h>
#include <linux/unaligned/generic.h>
@@ -300,7 +300,7 @@ struct net *dev_net(const struct net_device *dev)
#ifdef CONFIG_PPC
/*
* The PowerPC can do unaligned accesses itself in big endian mode.
- */
+ */
#include <linux/unaligned/access_ok.h>
#include <linux/unaligned/generic.h>

@@ -308,7 +308,7 @@ struct net *dev_net(const struct net_device *dev)
#ifdef CONFIG_S390

/*
- * The S390 can do unaligned accesses itself.
+ * The S390 can do unaligned accesses itself.
*/
#include <linux/unaligned/access_ok.h>
#include <linux/unaligned/generic.h>
--
1.6.3.3.385.g60647.dirty


2009-12-01 07:24:15

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 08/13] Add compatibility macro for register_sysctl_table()

On Mon, Nov 23, 2009 at 6:25 PM, Arnaud Lacombe <[email protected]> wrote:
> The API was changed on commit 0b4d4147. register_sysctl_table() lost its
> last
> argument.
>
> Signed-off-by: Arnaud Lacombe <[email protected]>

Thanks, applied up to here fine the rest fail because your mailer line
wrapped after 70 something chars. Can you try resenting 9-on using git
send-email?

Luis

2009-12-01 08:40:15

by Arnaud Lacombe

[permalink] [raw]
Subject: [PATCH 4/5] Add `enum nf_inet_hooks'

Introduced on commit 6e23ae2a by Patrick McHardy in include/linux/netfilter.h in
order to factor common macro value used by IPv6 and IPv4 code.

Signed-off-by: Arnaud Lacombe <[email protected]>
---
compat-2.6.25.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/compat-2.6.25.h b/compat-2.6.25.h
index 5502741..fa42fd9 100644
--- a/compat-2.6.25.h
+++ b/compat-2.6.25.h
@@ -29,6 +29,15 @@ extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct

#define seq_file_net &init_net;

+enum nf_inet_hooks {
+ NF_INET_PRE_ROUTING = 0,
+ NF_INET_LOCAL_IN = 1,
+ NF_INET_FORWARD = 2,
+ NF_INET_LOCAL_OUT = 3,
+ NF_INET_POST_ROUTING = 4,
+ NF_INET_NUMHOOKS = 5
+};
+
/* The patch:
* commit 8b5f6883683c91ad7e1af32b7ceeb604d68e2865
* Author: Marcin Slusarz <[email protected]>
--
1.6.3.3.385.g60647.dirty


2009-12-01 08:40:04

by Arnaud Lacombe

[permalink] [raw]
Subject: [PATCH 3/5] Add more `skb->dst' accessors

Signed-off-by: Arnaud Lacombe <[email protected]>
---
compat-2.6.31.h | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/compat-2.6.31.h b/compat-2.6.31.h
index a91e033..6b2dd5e 100644
--- a/compat-2.6.31.h
+++ b/compat-2.6.31.h
@@ -99,6 +99,21 @@ static inline void skb_dst_drop(struct sk_buff *skb)
skb->dst = NULL;
}

+static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
+{
+ return (struct dst_entry *)skb->dst;
+}
+
+static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
+{
+ skb->dst = (unsigned long)dst;
+}
+
+static inline struct rtable *skb_rtable(const struct sk_buff *skb)
+{
+ return (struct rtable *)skb_dst(skb);
+}
+
extern int genl_register_family_with_ops(struct genl_family *family,
struct genl_ops *ops, size_t n_ops);

--
1.6.3.3.385.g60647.dirty