commit e4d6e4cf4f03c6605fbf928549fd441d26f11fc5
Author: Nicolas Viéville <nicolas.vieville(a)uphf.fr>
Date: Mon Sep 25 18:35:09 2023 +0200
Spec file clean-up - Fix patchN macro is deprecated
Add patch for kernel >= 6.5
Based loosely on
https://gist.github.com/joanbm/9cd5fda1dcfab9a67b42cc6195b7b269 by
Joan Bruguera
wl-kmod-025_kernel_6.5_adaptation.patch | 208 ++++++++++++++++++++++++++++++++
wl-kmod.spec | 57 +++++----
2 files changed, 240 insertions(+), 25 deletions(-)
---
diff --git a/wl-kmod-025_kernel_6.5_adaptation.patch
b/wl-kmod-025_kernel_6.5_adaptation.patch
new file mode 100644
index 0000000..34e55f6
--- /dev/null
+++ b/wl-kmod-025_kernel_6.5_adaptation.patch
@@ -0,0 +1,208 @@
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/include/bcmutils.h
hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/include/bcmutils.h
+--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/include/bcmutils.h 2023-01-03
00:23:40.088556742 +0100
++++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/include/bcmutils.h 2023-08-30
14:18:41.387888952 +0200
+@@ -21,6 +21,8 @@
+ #ifndef _bcmutils_h_
+ #define _bcmutils_h_
+
++#include <linux/version.h>
++
+ #define bcm_strcpy_s(dst, noOfElements, src) strcpy((dst), (src))
+ #define bcm_strncpy_s(dst, noOfElements, src, count) strncpy((dst), (src), (count))
+ #define bcm_strcat_s(dst, noOfElements, src) strcat((dst), (src))
+@@ -558,7 +560,11 @@
+ typedef struct bcm_tlv {
+ uint8 id;
+ uint8 len;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ uint8 data[];
++#else
+ uint8 data[1];
++#endif
+ } bcm_tlv_t;
+
+ #define bcm_valid_tlv(elt, buflen) ((buflen) >= 2 && (int)(buflen) >=
(int)(2 + (elt)->len))
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/include/wlioctl.h
hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/include/wlioctl.h
+--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/include/wlioctl.h 2023-01-03
00:23:40.089556752 +0100
++++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/include/wlioctl.h 2023-08-30
14:52:25.925883656 +0200
+@@ -24,6 +24,7 @@
+ #ifndef _wlioctl_h_
+ #define _wlioctl_h_
+
++#include <linux/version.h>
+ #include <typedefs.h>
+ #include <proto/ethernet.h>
+ #include <proto/bcmeth.h>
+@@ -91,7 +92,11 @@
+ uint32 buflen;
+ uint32 version;
+ uint32 count;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ wl_bss_info_t bss_info[];
++#else
+ wl_bss_info_t bss_info[1];
++#endif
+ } wl_scan_results_t;
+
+ #define WL_MAXRATES_IN_SET 16
+@@ -129,7 +134,11 @@
+
+ uint32 count;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ uint32 element[];
++#else
+ uint32 element[1];
++#endif
+ } wl_uint32_list_t;
+
+ typedef struct wl_assoc_params {
+@@ -247,7 +256,11 @@
+
+ typedef struct _pmkid_list {
+ uint32 npmkid;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ pmkid_t pmkid[];
++#else
+ pmkid_t pmkid[1];
++#endif
+ } pmkid_list_t;
+
+ typedef struct _pmkid_cand {
+@@ -257,7 +270,11 @@
+
+ typedef struct _pmkid_cand_list {
+ uint32 npmkid_cand;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ pmkid_cand_t pmkid_cand[];
++#else
+ pmkid_cand_t pmkid_cand[1];
++#endif
+ } pmkid_cand_list_t;
+
+ typedef struct {
+@@ -278,7 +295,11 @@
+
+ struct maclist {
+ uint count;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ struct ether_addr ea[];
++#else
+ struct ether_addr ea[1];
++#endif
+ };
+
+ typedef struct wl_ioctl {
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_cfg80211_hybrid.c
hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c
+---
hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_cfg80211_hybrid.c 2023-01-03
09:20:31.743032501 +0100
++++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2023-08-30
14:37:43.085793226 +0200
+@@ -1655,7 +1655,11 @@
+ struct cfg80211_pmksa *pmksa)
+ {
+ struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ struct { pmkid_t pmkid[1]; } pmkid;
++#else
+ struct _pmkid_list pmkid;
++#endif
+ s32 err = 0;
+ int i;
+
+@@ -2113,7 +2117,11 @@
+ WL_DBG(("Beacon is larger than buffer. Discarding\n"));
+ return -E2BIG;
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) +
++#else
+ notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) +
++#endif
+ WL_BSS_INFO_MAX, GFP_KERNEL);
+ if (!notif_bss_info) {
+ WL_ERR(("notif_bss_info alloc failed\n"));
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_cfg80211_hybrid.h
hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.h
+---
hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_cfg80211_hybrid.h 2023-01-03
00:23:40.092556781 +0100
++++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.h 2023-08-30
14:42:11.976820187 +0200
+@@ -22,6 +22,7 @@
+ #ifndef _wl_cfg80211_h_
+ #define _wl_cfg80211_h_
+
++#include <linux/version.h>
+ #include <net/cfg80211.h>
+ #include <wlioctl.h>
+
+@@ -103,7 +104,11 @@
+ __le64 timestamp;
+ __le16 beacon_int;
+ __le16 capab_info;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ u8 variable[];
++#else
+ u8 variable[0];
++#endif
+ } __attribute__ ((packed));
+
+ struct wl_cfg80211_conf {
+@@ -126,7 +131,11 @@
+ u16 channel;
+ s16 rssi;
+ u16 frame_len;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ u8 frame_buf[];
++#else
+ u8 frame_buf[1];
++#endif
+ };
+
+ struct wl_cfg80211_scan_req {
+@@ -142,7 +151,11 @@
+ struct list_head eq_list;
+ u32 etype;
+ wl_event_msg_t emsg;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ s8 edata[];
++#else
+ s8 edata[1];
++#endif
+ };
+
+ struct wl_cfg80211_security {
+@@ -174,7 +187,11 @@
+
+ struct wl_cfg80211_pmk_list {
+ pmkid_list_t pmkids;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ pmkid_t foo[MAXPMKID];
++#else
+ pmkid_t foo[MAXPMKID - 1];
++#endif
+ };
+
+ struct wl_cfg80211_priv {
+diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_iw.c
hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_iw.c
+--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_iw.c 2023-01-03
00:23:40.091556771 +0100
++++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_iw.c 2023-08-30
14:45:12.154012702 +0200
+@@ -1907,7 +1907,11 @@
+ #if WIRELESS_EXT > 17
+ struct {
+ pmkid_list_t pmkids;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ pmkid_t foo[MAXPMKID];
++#else
+ pmkid_t foo[MAXPMKID-1];
++#endif
+ } pmkid_list;
+ static int
+ wl_iw_set_pmksa(
+@@ -1930,7 +1934,11 @@
+ bzero((char *)&pmkid_list, sizeof(pmkid_list));
+ }
+ if (iwpmksa->cmd == IW_PMKSA_REMOVE) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
++ struct { pmkid_t pmkid[1]; } pmkid, *pmkidptr;
++#else
+ pmkid_list_t pmkid, *pmkidptr;
++#endif
+ pmkidptr = &pmkid;
+ bcopy(&iwpmksa->bssid.sa_data[0], &pmkidptr->pmkid[0].BSSID,
ETHER_ADDR_LEN);
+ bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID, WPA2_PMKID_LEN);
diff --git a/wl-kmod.spec b/wl-kmod.spec
index 1f25d35..a0aca9e 100644
--- a/wl-kmod.spec
+++ b/wl-kmod.spec
@@ -10,7 +10,7 @@
Name: wl-kmod
Version: 6.30.223.271
-Release: 47%{?dist}
+Release: 48%{?dist}
Summary: Kernel module for Broadcom wireless devices
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -42,6 +42,7 @@ Patch20: wl-kmod-021_kernel_5.17_adaptation.patch
Patch21: wl-kmod-022_kernel_5.18_adaptation.patch
Patch22: wl-kmod-023_kernel_6.0_adaptation.patch
Patch23: wl-kmod-024_kernel_6.1_adaptation.patch
+Patch24: wl-kmod-025_kernel_6.5_adaptation.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64
@@ -82,30 +83,31 @@ pushd %{name}-%{version}-src
%else
tar xzf %{SOURCE1}
%endif
-%patch0 -p1 -b .wext_workaround.patch
-%patch1 -p1 -b .kernel_3.18_null_pointer.patch
-%patch2 -p1 -b .gcc_4.9_remove_TIME_DATE_macros
-%patch3 -p1 -b .kernel_4.3_rdtscl_to_rdtsc.patch
-%patch4 -p1 -b .kernel_4.7_IEEE80211_BAND_to_NL80211_BAND
-%patch5 -p1 -b .gcc_6_fix_indentation_warnings
-%patch6 -p1 -b .kernel_4.8_add_cfg80211_scan_info_struct
-%patch7 -p1 -b .fix_kernel_warnings
-%patch8 -p1 -b .kernel_4.11_remove_last_rx_in_net_device_struct
-%patch9 -p1 -b .kernel_4.12_add_cfg80211_roam_info_struct
-%patch10 -p1 -b .kernel_4.14_new_kernel_read_function_prototype
-%patch11 -p1 -b .kernel_4.15_new_timer
-%patch12 -p1 -b .gcc8_fix_bounds_check_warnings
-%patch13 -p1 -b .kernel_read_pos_increment_fix
-%patch14 -p1 -b .kernel_5.1_get_ds_removed
-%patch15 -p1 -b .fix_unsupported_mesh_point
-%patch16 -p1 -b .fix_gcc_fallthrough_warning.patch
-%patch17 -p1 -b .kernel_5.6_adaptations.patch
-%patch18 -p1 -b .kernel_5.9_segment_eq_removed
-%patch19 -p1 -b .kernel_5.10_get_set_fs_removed
-%patch20 -p1 -b .kernel_5.17_adaptation
-%patch21 -p1 -b .kernel_5.18_adaptation
-%patch22 -p1 -b .kernel_6.0_adaptation
-%patch23 -p1 -b .kernel_6.1_adaptation
+%patch -P 0 -p1 -b .wext_workaround.patch
+%patch -P 1 -p1 -b .kernel_3.18_null_pointer.patch
+%patch -P 2 -p1 -b .gcc_4.9_remove_TIME_DATE_macros
+%patch -P 3 -p1 -b .kernel_4.3_rdtscl_to_rdtsc.patch
+%patch -P 4 -p1 -b .kernel_4.7_IEEE80211_BAND_to_NL80211_BAND
+%patch -P 5 -p1 -b .gcc_6_fix_indentation_warnings
+%patch -P 6 -p1 -b .kernel_4.8_add_cfg80211_scan_info_struct
+%patch -P 7 -p1 -b .fix_kernel_warnings
+%patch -P 8 -p1 -b .kernel_4.11_remove_last_rx_in_net_device_struct
+%patch -P 9 -p1 -b .kernel_4.12_add_cfg80211_roam_info_struct
+%patch -P 10 -p1 -b .kernel_4.14_new_kernel_read_function_prototype
+%patch -P 11 -p1 -b .kernel_4.15_new_timer
+%patch -P 12 -p1 -b .gcc8_fix_bounds_check_warnings
+%patch -P 13 -p1 -b .kernel_read_pos_increment_fix
+%patch -P 14 -p1 -b .kernel_5.1_get_ds_removed
+%patch -P 15 -p1 -b .fix_unsupported_mesh_point
+%patch -P 16 -p1 -b .fix_gcc_fallthrough_warning.patch
+%patch -P 17 -p1 -b .kernel_5.6_adaptations.patch
+%patch -P 18 -p1 -b .kernel_5.9_segment_eq_removed
+%patch -P 19 -p1 -b .kernel_5.10_get_set_fs_removed
+%patch -P 20 -p1 -b .kernel_5.17_adaptation
+%patch -P 21 -p1 -b .kernel_5.18_adaptation
+%patch -P 22 -p1 -b .kernel_6.0_adaptation
+%patch -P 23 -p1 -b .kernel_6.1_adaptation
+%patch -P 24 -p1 -b .kernel_6.5_adaptation
# Manual patching to build for RHEL - inspired by CentOS wl-kmod.spec
# Actually works for RHEL 6.x and 7.x
@@ -345,6 +347,11 @@ chmod 0755
$RPM_BUILD_ROOT%{kmodinstdir_prefix}*%{kmodinstdir_postfix}/* || :
%{?akmod_install}
%changelog
+* Mon Sep 25 2023 Nicolas Viéville <nicolas.vieville(a)uphf.fr> - 6.30.223.271-47
+- Spec file clean-up - Fix patchN macro is deprecated
+- Add patch for kernel >= 6.5
+ Based loosely on
https://gist.github.com/joanbm/9cd5fda1dcfab9a67b42cc6195b7b269 by
Joan Bruguera
+
* Thu Aug 03 2023 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
6.30.223.271-47
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild