1From febe94b43294a3155e39e844db4ac4ee81614ad1 Mon Sep 17 00:00:00 2001
2From: Joan Bruguera <joanbrugueram@gmail.com>
3Date: Mon, 29 Aug 2022 00:06:53 +0200
4Subject: [PATCH 16/16] linuxPackages.broadcom_sta: fix build for kernel 6.1+
5
6Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 6.1-rc1
7
8Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-35 on Arch Linux
9
10Source: https://gist.github.com/joanbm/94323ea99eff1e1d1c51241b5b651549
11---
12 src/wl/sys/wl_cfg80211_hybrid.c | 21 +++++++++++++--------
13 1 file changed, 13 insertions(+), 8 deletions(-)
14
15diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
16index a6b2ca2..333866c 100644
17--- a/src/wl/sys/wl_cfg80211_hybrid.c
18+++ b/src/wl/sys/wl_cfg80211_hybrid.c
19@@ -104,20 +104,25 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wd
20 static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
21 #endif
22
23+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
24+#define MAYBE_INT_LINK_ID int link_id,
25+#else
26+#define MAYBE_INT_LINK_ID
27+#endif
28 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
29 static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
30- struct net_device *dev, u8 key_idx, bool unicast, bool multicast);
31+ struct net_device *dev, MAYBE_INT_LINK_ID u8 key_idx, bool unicast, bool multicast);
32 #else
33 static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
34 struct net_device *dev, u8 key_idx);
35 #endif
36 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
37 static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
38- u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params);
39+ MAYBE_INT_LINK_ID u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params);
40 static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
41- u8 key_idx, bool pairwise, const u8 *mac_addr);
42+ MAYBE_INT_LINK_ID u8 key_idx, bool pairwise, const u8 *mac_addr);
43 static s32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
44- u8 key_idx, bool pairwise, const u8 *mac_addr,
45+ MAYBE_INT_LINK_ID u8 key_idx, bool pairwise, const u8 *mac_addr,
46 void *cookie, void (*callback) (void *cookie, struct key_params *params));
47 #else
48 static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
49@@ -1165,7 +1170,7 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
50 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
51 static s32
52 wl_cfg80211_config_default_key(struct wiphy *wiphy,
53- struct net_device *dev, u8 key_idx, bool unicast, bool multicast)
54+ struct net_device *dev, MAYBE_INT_LINK_ID u8 key_idx, bool unicast, bool multicast)
55 #else
56 static s32
57 wl_cfg80211_config_default_key(struct wiphy *wiphy,
58@@ -1190,7 +1195,7 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy,
59 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
60 static s32
61 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
62- u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params)
63+ MAYBE_INT_LINK_ID u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params)
64 #else
65 static s32
66 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
67@@ -1311,7 +1316,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
68 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
69 static s32
70 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
71- u8 key_idx, bool pairwise, const u8 *mac_addr)
72+ MAYBE_INT_LINK_ID u8 key_idx, bool pairwise, const u8 *mac_addr)
73 #else
74 static s32
75 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
76@@ -1354,7 +1359,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
77 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
78 static s32
79 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
80- u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
81+ MAYBE_INT_LINK_ID u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
82 void (*callback) (void *cookie, struct key_params * params))
83 #else
84 static s32
85--
862.45.1
87