731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch 2.0 KB

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