diff mbox

[OpenWrt-Devel] generic: add linux 4.1-rc1 support

Message ID 5549C8F1.5070804@hauke-m.de
State RFC
Headers show

Commit Message

Hauke Mehrtens May 6, 2015, 7:55 a.m. UTC
On 05/02/2015 10:49 AM, Dirk Neukirchen wrote:
> On 01.05.2015 11:21, Hauke Mehrtens wrote:
>> On 05/01/2015 10:59 AM, Dirk Neukirchen wrote:
>>> On 28.04.2015 23:08, Álvaro Fernández Rojas wrote:
>>>> Boot tested: http://pastebin.com/L6aAb9xj
>>>>
>>>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>>>
>>> Great work !
>>>
>>
>>> 2. any(?) mac80211 does not built
>>>
>>> Error: include/net/cfg80211.h:3249:25: error: 'struct wiphy' has no member named '_net'
>>>   return read_pnet(&wiphy->_net);
>>>
>>> I did try to use the v4.1-rc1 Backports package as drop-in (only some OpenWrt specific driver series patches were not applied) 
>>> since it should deal with that error, (
>>>
>>> but I get compile errors with that too:
>>> include/net/cfg80211.h:3253:2: error: implicit declaration of function 'possible_write_pnet'
>>> include/net/cfg80211.h:3248:2: error: implicit declaration of function 'possible_read_pnet'
>>> (introduced by https://git.kernel.org/cgit/linux/kernel/git/backports/backports.git/tree/patches/collateral-evolutions/network/0053-possible_net_t.patch )
>>>
>>
>> Hi,
>>
>> This looks like a bug in backports, I haven't tested this image against
>> kernel 4.1. Please try the attached patch.
>>
>> Hauke
>>
> 
> Still errors :/
> 
> steps to replicate: 
> - Kernel 4.1 patch
> - symbol fixup and mac80211 change to use backports package that is 4.1-rc1 versioned
> (so Kernel 4.1 with backports 4.1-rc1)
> - backports: remove non applying patches
> - your patch
> a patch series that contains all the changes/steps can be found at:
> https://github.com/plntyk/openwrt-patches/tree/master/kernel_4_1_backports
> 
> results in compile error:
> 
> linux-x86_64/backports-4.1-rc1-1/drivers/net/wireless/ath/main.c
> In file included from ...../linux-x86_64/backports-4.1-rc1-1/include/net/mac80211.h:22:0,
>                  from ...../linux-x86_64/backports-4.1-rc1-1/drivers/net/wireless/ath/ath.h:24,
>                  from ...../linux-x86_64/backports-4.1-rc1-1/drivers/net/wireless/ath/main.c:22:
> ...../linux-x86_64/backports-4.1-rc1-1/include/net/cfg80211.h: In function 'wiphy_net':
> ...../linux-x86_64/backports-4.1-rc1-1/include/net/cfg80211.h:3248:2: error: too few arguments to function 'write_pnet'
>   return possible_read_pnet(&wiphy->_net);
>   ^
> In file included from ...../linux-x86_64/backports-4.1-rc1-1/backport-include/net/net_namespace.h:4:0,
>                  from include/linux/netdevice.h:44,
>                  from ...../linux-x86_64/backports-4.1-rc1-1/backport-include/linux/netdevice.h:3,
>                  from include/linux/etherdevice.h:26,
>                  from ...../linux-x86_64/backports-4.1-rc1-1/backport-include/linux/etherdevice.h:3,
>                  from ...../linux-x86_64/backports-4.1-rc1-1/drivers/net/wireless/ath/ath.h:20,
>                  from ...../linux-x86_64/backports-4.1-rc1-1/drivers/net/wireless/ath/main.c:22:
> include/net/net_namespace.h:240:20: note: declared here
>  static inline void write_pnet(possible_net_t *pnet, struct net *net)

I didn't compile tested the patch before, there was still an error in
it, attached is a fixed version.

Hauke
diff mbox

Patch

From ac06e72e9a98177524c8708d260c4be724b0668c Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Fri, 1 May 2015 11:17:24 +0200
Subject: [PATCH] header: add possible_{write,read}_pnet() on kernel >= 4.1

backports only adds the possible_{write,read}_pnet() functions for
kernel < 4.1. This results in a compile error on kernel 4.1. This patch
make it use the original functions on these kernel versions. This fixes
a problem introduced in 3d418885971.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/net/net_namespace.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/backport/backport-include/net/net_namespace.h b/backport/backport-include/net/net_namespace.h
index 90c044f..4d0b721 100644
--- a/backport/backport-include/net/net_namespace.h
+++ b/backport/backport-include/net/net_namespace.h
@@ -57,6 +57,9 @@  static inline struct net *possible_read_pnet(const possible_net_t *pnet)
 	return &init_net;
 #endif
 }
+#else
+#define possible_write_pnet(pnet, net) write_pnet(pnet, net)
+#define possible_read_pnet(pnet) read_pnet(pnet)
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */
 
 #endif	/* _COMPAT_NET_NET_NAMESPACE_H */
-- 
2.1.4