broadcom_sta: fix build on linux 6.0 (#195392)

Fix build issues when building against linux 6.0

authored by X9VoiD and committed by GitHub 105e8974 33a0a67c

+45 -8
+2
pkgs/os-specific/linux/broadcom-sta/default.nix
··· 43 43 ./linux-5.17.patch 44 44 # source: https://github.com/archlinux/svntogit-community/blob/2e1fd240f9ce06f500feeaa3e4a9675e65e6b967/trunk/013-linux518.patch 45 45 ./linux-5.18.patch 46 + # source: https://gist.github.com/joanbm/207210d74637870c01ef5a3c262a597d 47 + ./linux-6.0.patch 46 48 ./pedantic-fix.patch 47 49 ./null-pointer-fix.patch 48 50 ./gcc.patch
+30
pkgs/os-specific/linux/broadcom-sta/linux-6.0.patch
··· 1 + From dbee29df729e543a89b3f95c1436e982eb0047c1 Mon Sep 17 00:00:00 2001 2 + From: Joan Bruguera <joanbrugueram@gmail.com> 3 + Date: Thu, 30 Jun 2022 02:15:35 +0200 4 + Subject: [PATCH] Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 6.0-rc1 5 + 6 + Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-33 on Arch Linux. 7 + --- 8 + src/wl/sys/wl_cfg80211_hybrid.c | 5 +++++ 9 + 1 file changed, 5 insertions(+) 10 + 11 + diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c 12 + index d815b33..7faa735 100644 13 + --- a/src/wl/sys/wl_cfg80211_hybrid.c 14 + +++ b/src/wl/sys/wl_cfg80211_hybrid.c 15 + @@ -2381,7 +2381,12 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, 16 + bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, 17 + ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); 18 + struct cfg80211_roam_info roam_info = { 19 + +// Rel. commit "cfg80211: Indicate MLO connection info in connect and roam callbacks" (Veerendranath Jakkam, Wed Jun 8) 20 + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) 21 + .bss = bss, 22 + +#else 23 + + .links[0].bss = bss, 24 + +#endif 25 + .req_ie = conn_info->req_ie, 26 + .req_ie_len = conn_info->req_ie_len, 27 + .resp_ie = conn_info->resp_ie, 28 + -- 29 + 2.37.0 30 +
+13 -8
pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch
··· 1 - diff --git a/src/shared/linux_osl.c b/shared/linux_osl.c 1 + diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c 2 2 index 711b771..5a2636a 100644 3 3 --- a/src/shared/linux_osl.c 4 4 +++ b/src/shared/linux_osl.c ··· 11 11 if (rdlen > 0) 12 12 fp->f_pos += rdlen; 13 13 14 - diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/wl/sys/wl_cfg80211_hybrid.c 15 - index 41c16d8..d39d9de 100644 14 + diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c 15 + index 2b3c290..093dce6 100644 16 16 --- a/src/wl/sys/wl_cfg80211_hybrid.c 17 17 +++ b/src/wl/sys/wl_cfg80211_hybrid.c 18 18 @@ -790,6 +790,7 @@ wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme) ··· 23 23 default: 24 24 val = 2; 25 25 WL_ERR(("invalid auth type (%d)\n", sme->auth_type)); 26 - @@ -2347,21 +2348,20 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, 26 + @@ -2347,26 +2348,24 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, 27 27 const wl_event_msg_t *e, void *data) 28 28 { 29 29 struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); ··· 36 36 bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, 37 37 ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); 38 38 - struct cfg80211_roam_info roam_info = { 39 + // Rel. commit "cfg80211: Indicate MLO connection info in connect and roam callbacks" (Veerendranath Jakkam, Wed Jun 8) 40 + #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) 39 41 - .bss = bss, 42 + + roam_info.bss = bss; 43 + #else 44 + - .links[0].bss = bss, 45 + + roam_info.links[0].bss = bss; 46 + #endif 40 47 - .req_ie = conn_info->req_ie, 41 48 - .req_ie_len = conn_info->req_ie_len, 42 49 - .resp_ie = conn_info->resp_ie, 43 50 - .resp_ie_len = conn_info->resp_ie_len, 44 51 - }; 45 - + roam_info.bss = bss; 46 52 + roam_info.req_ie = conn_info->req_ie; 47 53 + roam_info.req_ie_len = conn_info->req_ie_len; 48 54 + roam_info.resp_ie = conn_info->resp_ie; 49 - + roam_info.resp_ie_len = conn_info->resp_ie_len; 50 55 #endif 51 56 - s32 err = 0; 52 57 53 58 wl_get_assoc_ies(wl); 54 59 memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); 55 - diff --git a/src/wl/sys/wl_iw.h b/wl/sys/wl_iw.h 60 + diff --git a/src/wl/sys/wl_iw.h b/src/wl/sys/wl_iw.h 56 61 index 3ab084f..471d11f 100644 57 62 --- a/src/wl/sys/wl_iw.h 58 63 +++ b/src/wl/sys/wl_iw.h ··· 64 69 #define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1) 65 70 #define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3) 66 71 #define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5) 67 - diff --git a/src/wl/sys/wl_linux.c b/wl/sys/wl_linux.c 72 + diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c 68 73 index d13fb98..97ae2a6 100644 69 74 --- a/src/wl/sys/wl_linux.c 70 75 +++ b/src/wl/sys/wl_linux.c