2010-11-25 07:53:05

by Youquan Song

[permalink] [raw]
Subject: [PATCH] compat-wireless:Fix interface redefine when backport to 2.6.32

Netdev_alloc_skb_ip_align already define at 2.6.32 kernel, so only < 2.6.32
kernel needs it, so when backport latest compat-wirelss to 2.6.32, it report
redefine the interface.

This patch fix the above issue.

Signed-off-by: Youquan Song <[email protected]>
Signed-off-by: Hui Xiao <[email protected]>
---


diff --git a/include/linux/compat-2.6.32.h b/include/linux/compat-2.6.32.h
index 321a89a..164aa6c 100644
--- a/include/linux/compat-2.6.32.h
+++ b/include/linux/compat-2.6.32.h
@@ -96,6 +96,16 @@ struct dev_pm_ops name = { \

#define lockdep_assert_held(l) do { } while (0)

+static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
+ unsigned int length)
+{
+ struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
+
+ if (NET_IP_ALIGN && skb)
+ skb_reserve(skb, NET_IP_ALIGN);
+ return skb;
+}
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */

#endif /* LINUX_26_32_COMPAT_H */
diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h
index c2dbc1b..4646d28 100644
--- a/include/linux/compat-2.6.33.h
+++ b/include/linux/compat-2.6.33.h
@@ -55,16 +55,6 @@ static inline void compat_release_firmware(const struct firmware *fw)
/* this will never happen on older kernels */
#define NETDEV_POST_INIT 0xffff

-static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
- unsigned int length)
-{
- struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
-
- if (NET_IP_ALIGN && skb)
- skb_reserve(skb, NET_IP_ALIGN);
- return skb;
-}
-
#if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)

#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)


2010-11-25 18:28:26

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless:Fix interface redefine when backport to 2.6.32

On Thu, Nov 25, 2010 at 12:27 AM, Johannes Berg
<[email protected]> wrote:
> On Thu, 2010-11-25 at 15:05 -0500, Youquan Song wrote:
>> Netdev_alloc_skb_ip_align already define at 2.6.32 kernel, so only < 2.6.32
>> kernel needs it, so when backport latest compat-wirelss to 2.6.32, it report
>> redefine the interface.
>
> That doesn't seem to be true:
>
> $ git describe --contains --match=v* 61321bbd
> v2.6.33-rc1~388^2~825
>
> Maybe you're using a patched (distro) kernel?

Also please note that you sent a patch using compat-wireless but the
code in questions is part of the compat.git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/compat.git

Luis

2010-11-25 08:27:21

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless:Fix interface redefine when backport to 2.6.32

On Thu, 2010-11-25 at 15:05 -0500, Youquan Song wrote:
> Netdev_alloc_skb_ip_align already define at 2.6.32 kernel, so only < 2.6.32
> kernel needs it, so when backport latest compat-wirelss to 2.6.32, it report
> redefine the interface.

That doesn't seem to be true:

$ git describe --contains --match=v* 61321bbd
v2.6.33-rc1~388^2~825

Maybe you're using a patched (distro) kernel?

johannes