summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-6.1/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch
blob: a7a4bafbb695f68662bb6e92c85b3c6ea9f9cfa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 686c603f67ae87bf21a61b5e4b1564443f41c3ee Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Thu, 20 Oct 2022 03:34:43 +0200
Subject: [PATCH] net: permit ieee80211_ptr even with no CFG82111 support

Introduce a new flag CONFIG_CFG80211_HEADERS to compile in ieee80211_ptr
even if CFG80211 support is not compiled in. This is needed for the
backports project and for any downstream wireless driver that loads in
the kernel dynamically.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 include/linux/netdevice.h       | 2 +-
 net/batman-adv/hard-interface.c | 2 +-
 net/wireless/Kconfig            | 4 ++++
 3 files changed, 6 insertions(+), 2 deletions(-)

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2192,7 +2192,7 @@ struct net_device {
 #if IS_ENABLED(CONFIG_AX25)
 	void			*ax25_ptr;
 #endif
-#if IS_ENABLED(CONFIG_CFG80211)
+#if IS_ENABLED(CONFIG_CFG80211_HEADERS)
 	struct wireless_dev	*ieee80211_ptr;
 #endif
 #if IS_ENABLED(CONFIG_IEEE802154) || IS_ENABLED(CONFIG_6LOWPAN)
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -308,7 +308,7 @@ static bool batadv_is_cfg80211_netdev(st
 	if (!net_device)
 		return false;
 
-#if IS_ENABLED(CONFIG_CFG80211)
+#if IS_ENABLED(CONFIG_CFG80211_HEADERS)
 	/* cfg80211 drivers have to set ieee80211_ptr */
 	if (net_device->ieee80211_ptr)
 		return true;
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -26,6 +26,7 @@ config CFG80211
 	# using a different algorithm, though right now they shouldn't
 	# (this is here rather than below to allow it to be a module)
 	select CRYPTO_SHA256 if CFG80211_USE_KERNEL_REGDB_KEYS
+	select CFG80211_HEADERS
 	help
 	  cfg80211 is the Linux wireless LAN (802.11) configuration API.
 	  Enable this if you have a wireless device.
@@ -36,6 +37,9 @@ config CFG80211
 
 	  When built as a module it will be called cfg80211.
 
+config CFG80211_HEADERS
+	bool "cfg80211 - headers support"
+
 if CFG80211
 
 config NL80211_TESTMODE