204440c41fb3d9aafa0cbff15edd897d18c8a006
[openwrt/staging/hauke.git] / target / linux / generic / pending-6.1 / 731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch
1 From 686c603f67ae87bf21a61b5e4b1564443f41c3ee Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Thu, 20 Oct 2022 03:34:43 +0200
4 Subject: [PATCH] net: permit ieee80211_ptr even with no CFG82111 support
5
6 Introduce a new flag CONFIG_CFG80211_HEADERS to compile in ieee80211_ptr
7 even if CFG80211 support is not compiled in. This is needed for the
8 backports project and for any downstream wireless driver that loads in
9 the kernel dynamically.
10
11 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
12 ---
13 include/linux/netdevice.h | 2 +-
14 net/batman-adv/hard-interface.c | 2 +-
15 net/wireless/Kconfig | 4 ++++
16 3 files changed, 6 insertions(+), 2 deletions(-)
17
18 --- a/include/linux/netdevice.h
19 +++ b/include/linux/netdevice.h
20 @@ -2167,7 +2167,7 @@ struct net_device {
21 #if IS_ENABLED(CONFIG_AX25)
22 void *ax25_ptr;
23 #endif
24 -#if IS_ENABLED(CONFIG_CFG80211)
25 +#if IS_ENABLED(CONFIG_CFG80211_HEADERS)
26 struct wireless_dev *ieee80211_ptr;
27 #endif
28 #if IS_ENABLED(CONFIG_IEEE802154) || IS_ENABLED(CONFIG_6LOWPAN)
29 --- a/net/batman-adv/hard-interface.c
30 +++ b/net/batman-adv/hard-interface.c
31 @@ -308,7 +308,7 @@ static bool batadv_is_cfg80211_netdev(st
32 if (!net_device)
33 return false;
34
35 -#if IS_ENABLED(CONFIG_CFG80211)
36 +#if IS_ENABLED(CONFIG_CFG80211_HEADERS)
37 /* cfg80211 drivers have to set ieee80211_ptr */
38 if (net_device->ieee80211_ptr)
39 return true;
40 --- a/net/wireless/Kconfig
41 +++ b/net/wireless/Kconfig
42 @@ -26,6 +26,7 @@ config CFG80211
43 # using a different algorithm, though right now they shouldn't
44 # (this is here rather than below to allow it to be a module)
45 select CRYPTO_SHA256 if CFG80211_USE_KERNEL_REGDB_KEYS
46 + select CFG80211_HEADERS
47 help
48 cfg80211 is the Linux wireless LAN (802.11) configuration API.
49 Enable this if you have a wireless device.
50 @@ -36,6 +37,9 @@ config CFG80211
51
52 When built as a module it will be called cfg80211.
53
54 +config CFG80211_HEADERS
55 + bool "cfg80211 - headers support"
56 +
57 if CFG80211
58
59 config NL80211_TESTMODE