0003-cfg80211.c-fix-build-failure-with-Linux-5.19-and-6.1.patch 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. From a608cdd7903505217529317c04b5b58cb7e25081 Mon Sep 17 00:00:00 2001
  2. From: Giulio Benetti <giulio.benetti@benettiengineering.com>
  3. Date: Wed, 28 Dec 2022 21:06:43 +0100
  4. Subject: [PATCH] cfg80211.c: fix build failure with Linux 5.19 and 6.1
  5. Starting from Linux 5.19 stop_ap() requires unsigned int link_id as
  6. parameter. Then from Linux 6.1 on lot of other cfg80211 APIs require
  7. int link_id to deal with MLO, so let's add that parameter too.
  8. [Upstream status: https://github.com/embeddedTS/wilc3000-external-module/pull/2]
  9. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
  10. ---
  11. cfg80211.c | 35 +++++++++++++++++++++++++++++------
  12. 1 file changed, 29 insertions(+), 6 deletions(-)
  13. diff --git a/cfg80211.c b/cfg80211.c
  14. index 41edd02..57c777d 100644
  15. --- a/cfg80211.c
  16. +++ b/cfg80211.c
  17. @@ -674,8 +674,12 @@ static int wilc_wfi_cfg_copy_wpa_info(struct wilc_wfi_key *key_info,
  18. return 0;
  19. }
  20. -static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
  21. - bool pairwise, const u8 *mac_addr, struct key_params *params)
  22. +static int add_key(struct wiphy *wiphy, struct net_device *netdev,
  23. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
  24. + int link_id,
  25. +#endif
  26. + u8 key_index, bool pairwise, const u8 *mac_addr,
  27. + struct key_params *params)
  28. {
  29. int ret = 0, keylen = params->key_len, seqlen = params->seq_len;
  30. @@ -792,6 +796,9 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
  31. }
  32. static int del_key(struct wiphy *wiphy, struct net_device *netdev,
  33. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
  34. + int link_id,
  35. +#endif
  36. u8 key_index,
  37. bool pairwise,
  38. const u8 *mac_addr)
  39. @@ -833,9 +840,13 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
  40. return ret;
  41. }
  42. -static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
  43. - bool pairwise, const u8 *mac_addr, void *cookie,
  44. - void (*callback)(void *cookie, struct key_params *))
  45. +static int get_key(struct wiphy *wiphy, struct net_device *netdev,
  46. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
  47. + int link_id,
  48. +#endif
  49. + u8 key_index, bool pairwise, const u8 *mac_addr,
  50. + void *cookie, void (*callback)(void *cookie,
  51. + struct key_params *))
  52. {
  53. struct wilc_vif *vif = netdev_priv(netdev);
  54. struct wilc_priv *priv = &vif->priv;
  55. @@ -877,12 +888,18 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
  56. /* wiphy_new() will WARN if not present*/
  57. static int set_default_key(struct wiphy *wiphy, struct net_device *netdev,
  58. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
  59. + int link_id,
  60. +#endif
  61. u8 key_index, bool unicast, bool multicast)
  62. {
  63. return 0;
  64. }
  65. static int set_default_mgmt_key (struct wiphy *wiphy,struct net_device *netdev,
  66. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
  67. + int link_id,
  68. +#endif
  69. u8 key_index)
  70. {
  71. return 0;
  72. @@ -1814,7 +1831,13 @@ static int change_beacon(struct wiphy *wiphy, struct net_device *dev,
  73. return wilc_add_beacon(vif, 0, 0, beacon);
  74. }
  75. -static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
  76. +static int stop_ap(struct wiphy *wiphy, struct net_device *dev
  77. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
  78. + , unsigned int link_id
  79. +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
  80. + , int link_id
  81. +#endif
  82. + )
  83. {
  84. int ret;
  85. struct wilc_vif *vif = netdev_priv(dev);
  86. --
  87. 2.34.1