chore: backport system tree from frawhide (#2980)

* backport frawhide system tree to f41

* fix v4l2loopback specs
This commit is contained in:
Cappy Ishihara
2025-01-15 19:14:14 +07:00
committed by GitHub
parent 713fadde5b
commit 1b8c7eaced
46 changed files with 2265 additions and 42 deletions
+14
View File
@@ -0,0 +1,14 @@
### For use only with Terra broadcom-wl, akmod-wl, and kmod-wl packages.
### Required modules to avoid kernel 3.6.* panic at boot on specific devices such as the HP Pavilion dm1 Notebook PC.
### See: https://bugzilla.rpmfusion.org/show_bug.cgi?id=2526#c29 for an example of possible issues.
### INFO: If you hit these issues, add "wl.disable=1" to the GRUB "GRUB_CMDLINE_LINUX_DEFAULT" line in order to boot.
### NOTE: Do NOT report issues to RPM Fusion! The above issue is listed simply to show possible issues when using this module.
#
### Usage:
### TO USE: Uncomment (remove the "#") the line beginning with "add_drivers+=" to add the module to your current and future kernels. Then rebuild the current initramfs by typing sudo dracut -f
### TO REMOVE: Recomment (add "#" in front of) the line beginning with "add_drivers+=" remove the required module of your current and future kernels. Then run sudo dracut -f once more.
#
### NOTE: You may need to rebuild your initramfs manually on updates when using these modules.
#
### This module is disabled by default.
#add_drivers+="lib80211 lib80211_crypt_tkip wl"
@@ -0,0 +1,16 @@
### For use with the Broadcom Wi-Fi driver provided by Terra.
### This file disables MAC address randomization while scanning wireless access point as a workaround for RHBZ#1703745 and RFBZ#5245.
### See:
### - https://bugzilla.gnome.org/show_bug.cgi?id=777523
### - RHBZ#1695696
#
### WARNING: Anonymity is potentially disabled while scanning for a wireless access point.
[device-disable-wifi-scan-rand-mac-address]
match-device=driver:wl
wifi.scan-rand-mac-address=no
[connection-disable-wifi-scan-rand-mac-address]
match-device=driver:wl
wifi.cloned-mac-address=preserve
ethernet.cloned-mac-address=preserve
+6
View File
@@ -0,0 +1,6 @@
project pkg {
arches = ["x86_64"]
rpm {
spec = "broadcom-wl.spec"
}
}
@@ -0,0 +1,6 @@
### These modules must be blacklisted for use with broadcom-wl
blacklist ssb
blacklist bcma
blacklist b43
blacklist brcmsmac
blacklist brcmfmac
+69
View File
@@ -0,0 +1,69 @@
%global _modprobe_d %{_prefix}/lib/modprobe.d
%global _dracut_conf_d %{_prefix}/lib/dracut/dracut.conf.d
%global _nmlibdir_conf_d %{_prefix}/lib/NetworkManager/conf.d
%bcond_without python3
Name: broadcom-wl
Version: 6.30.223.271
Release: 1%{?dist}
Summary: Common files for Broadcom 802.11 STA driver
Group: System Environment/Kernel
License: Redistributable, no modification permitted
URL: https://www.broadcom.com/support/download-search?pg=Legacy+Products&pf=Legacy+Wireless&pn=&pa=&po=&dk=&pl=
Source0: https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_271.tar.gz
Source1: https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
Source2: https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/README_6.30.223.271.txt
Source3: broadcom-wl-blacklist.conf
Source4: 20-wl.conf
Source5: fedora.readme
Source6: com.broadcom.wireless.hybrid.driver.metainfo.xml
Source7: generate-modalias-metadata.py
Source8: 90-broadcom-wl.conf
BuildArch: noarch
Provides: wl-kmod-common = %{?epoch}:%{version}
Requires: wl-kmod >= %{?epoch}:%{version}
ExcludeArch: ppc ppc64
BuildRequires: python3
BuildRequires: libappstream-glib
%description
Packaged Broadcom 802.11 Linux STA Driver for Wi-Fi for BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43142-, BCM43224-, BCM43225-, BCM43227-, BCM43228-, BCM4331-, BCM4360, and -BCM4352-.
%prep
%setup -q -c
iconv -f iso8859-1 -t UTF8 lib/LICENSE.txt -o lib/LICENSE.txt
sed -i 's/\r$//' lib/LICENSE.txt
cp -p %{SOURCE2} .
cp -p %{SOURCE5} .
chmod 644 lib/LICENSE.txt README_6.30.223.271.txt fedora.readme
%build
%install
install -m 0755 -d %{buildroot}%{_modprobe_d}
install -p -m 0644 %{SOURCE3} %{buildroot}%{_modprobe_d}/
install -m 0755 -d %{buildroot}%{_dracut_conf_d}
install -p -m 0644 %{SOURCE4} %{buildroot}%{_dracut_conf_d}/
install -m 0755 -d %{buildroot}%{_nmlibdir_conf_d}/
install -p -m 0644 %{SOURCE8} %{buildroot}%{_nmlibdir_conf_d}/
install -m 0755 -d %{buildroot}%{_metainfodir}/
install -p -m 0644 %{SOURCE6} %{buildroot}%{_metainfodir}/
fn=%{buildroot}%{_metainfodir}/com.broadcom.wireless.hybrid.driver.metainfo.xml
# appstream-util deletes all comments in the metainfo.xml file, so copyright must be saved and rewritten to the resulting file.
copyright_string=$(grep Copyright ${fn})
python3 %{SOURCE7} README_6.30.223.271.txt "SUPPORTED DEVICES" | xargs appstream-util add-provide ${fn} modalias
appstream-util validate-relax --nonet ${fn}
grep -q Copyright ${fn} >/dev/null || sed -i "s%\(^<?xml.*$\)%\1\n${copyright_string}%" ${fn}
%files
%doc README_6.30.223.271.txt fedora.readme
%license lib/LICENSE.txt
%{_metainfodir}/com.broadcom.wireless.hybrid.driver.metainfo.xml
%config %{_nmlibdir_conf_d}/90-broadcom-wl.conf
%config(noreplace) %{_modprobe_d}/broadcom-wl-blacklist.conf
%config(noreplace) %{_dracut_conf_d}/20-wl.conf
%changelog
%autochangelog
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2018 Nicolas Viéville <nicolas.vieville@univ-valenciennes.fr> -->
<component type="driver">
<id>com.broadcom.wireless.hybrid.driver</id>
<name>Broadcom STA wireless driver</name>
<summary>Broadcom proprietary hybrid wireless drivers for certain Broadcom wireless devices</summary>
<description>
<p>
Broadcom's IEEE 802.11a/b/g/n hybrid Linux device drivers for use
with Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-,
BCM43142-, BCM43224-, BCM43225-, BCM43227-, BCM43228-, BCM4331-,
BCM4360 and -BCM4352- based hardware.
</p>
</description>
<translation/>
<url type="homepage">https://www.broadcom.com/support/download-search/?pf=Wireless+LAN+Infrastructure</url>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LicenseRef-proprietary:Broadcom</project_license>
<developer_name>Broadcom Incorporation</developer_name>
<keywords>
<keyword>Broadcom</keyword>
<keyword>driver</keyword>
<keyword>Wireless</keyword>
<keyword>hybrid</keyword>
<keyword>STA</keyword>
</keywords>
<url type="bugtracker">https://bugzilla.rpmfusion.org</url>
<update_contact>broadcom-wl-owner@rpmfusion.org</update_contact>
<provides>
<!-- Auto-generated by generate-modalias-metadata.py -->
<!-- <modalias>pci:v000014e4d*sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004311sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004312sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004313sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004315sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004328sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004329sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d0000432asv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d0000432bsv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d0000432csv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d0000432dsv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004331sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004353sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004357sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004358sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004359sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004365sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d000043a0sv*sd*bc02sc80i*</modalias> -->
<!-- <modalias>pci:v000014e4d00004727sv*sd*bc02sc80i*</modalias> -->
</provides>
</component>
+66
View File
@@ -0,0 +1,66 @@
This file provides some basic information about Broadcom STA wireless driver configuration files on Fedora with packages provided by Terra.
------------------------------------------------------------------------
------------------------------------------------------------------------
Table of content
0. Caution
1. Initramfs configuration file usage
3. NetworkManager configuration file usage
4. Support
------------------------------------------------------------------------
0. Caution
===========
The files mentioned in this document should not be used in systems with working Wi-Fi. Only systems failing to connect should use these solutions.
Use them at your own risk and only if your system's Broadcom device doesn't work properly.
1. Initramfs configuration
==========================
Please read comments in /etc/dracut.conf.d/20-wl.conf file in order to configure loading modules needed by the Broadcom STA wireless driver in your kernel's initramfs.
Edit the /etc/dracut.conf.d/20-wl.conf file and comment/uncomment the one line "add_drivers+=" directive depending on your needs.
For example by CLI with Nano:
sudo nano /etc/dracut.conf.d/20-wl.conf
Ctrl+O will save the file, and Ctrl+X will quit Nano.
NOTE: Any CLI or GUI text editor is fine, this is purely an example.
Then use Dracut to rebuild your current initramfs:
sudo dracut -f
3. NetworkManager configuration file usage
==========================================
To try to fix issues noted in RHBZ#1703745 and RFBZ#5245 the usr/lib/NetworkManager/conf.d/90-broadcom-wl.conf file is provided.
This file disables MAC address randomization for Broadcom devices using this driver while scanning for a wireless access point.
It prevents "CTRL-EVENT-SCAN-FAILED ret=-22 retry=1" messages in logs and the inability to connect to a wireless access point.
The tradeoff of this setting is that scanning for wireless access point uses only the real MAC address of the device and produces is less anonymous.
To disable this setting, reate an empty file with the exact same name in /etc/NetworkManager/conf.d
In a terminal, type:
sudo touch /etc/NetworkManager/conf.d/90-broadcom-wl.conf
To re-enable this setting, remove the file.
In a terminal, type:
sudo rm -f /etc/NetworkManager/conf.d/90-broadcom-wl.conf
4. Support
==========
Support about these configuration files will only be provided on one of the methods of contact listed here:
https://fyralabs.com/contact
@@ -0,0 +1,74 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Richard Hughes <richard@hughsie.com>
# Licensed under the GNU General Public License Version or later
#
# Modified to parse broadcom-wl README_6.30.223.271.txt and for python3
# Copyright (C) 2018 Nicolas Viéville <nicolas.vieville@univ-valenciennes.fr>
# Usage example:
# python3 generate-modalias-metadata.py README_6.30.223.271.txt "SUPPORTED DEVICES" | \
# xargs appstream-util add-provide com.broadcom.driver.wireless.hybrid.test.metainfo.xml
from __future__ import print_function
import sys
def main():
if len(sys.argv) != 3:
print("usage: %s README_FILE.txt \"header to match\"" % sys.argv[0])
return 1
# open file
f = open(sys.argv[1])
in_section = False
in_table = False
pids = []
for line in f.readlines():
# find the right data table
if line.find(sys.argv[2]) != -1:
in_section = True
continue
if not in_section:
continue
# remove Windows and Linux line endings
line = line.replace('\r', '')
line = line.replace('\n', '')
# end of table
if len(line) > 0 and not line.startswith(' '):
in_table = False
continue
# empty line
if len(line) == 0:
continue
# skip the header
if line.startswith(' -----'):
in_table = True
continue
if not in_table:
continue
# end of section
if len(line) > 0 and not line.startswith(' '):
in_section = False
in_table = False
continue
if line.find('0x14e4') != -1:
# get name
pid = int((line.split("0x14e4",1)[1]).split()[0], 16)
if not pid in pids:
pids.append(pid)
# output
vid = 0x14e4
print("pci:v%08xd*sv*sd*bc02sc80i*" % (vid))
for pid in pids:
print("pci:v%08xd%08xsv*sd*bc02sc80i*" % (vid, pid))
if __name__ == "__main__":
main()
+2 -2
View File
@@ -1,5 +1,5 @@
%global debug_package %{nil}
%global commit 10c214fea5560060d387fbd2fb8a1af329cb6232
%global commit 74a01d1208a352ed85d76f959c68200af4ead918
%global commitdate 20230811
%global shortcommit %(c=%{commit}; echo ${c:0:7})
@@ -7,7 +7,7 @@ Name: ivsc-firmware
Summary: Intel iVSC firmware
URL: https://github.com/intel/ivsc-firmware
Version: %{commitdate}.%{shortcommit}
Release: 1%{?dist}
Release: 1%?dist
License: Proprietary
Source0: https://github.com/intel/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
Requires: ipu6-camera-bins
+8
View File
@@ -0,0 +1,8 @@
project pkg {
rpm {
spec = "kmod-v4l2loopback.spec"
}
labels {
mock = 1
}
}
@@ -0,0 +1,129 @@
# https://github.com/rpmfusion/v4l2loopback-kmod/blob/master/v4l2loopback-kmod.spec
%if 0%{?fedora}
%global buildforkernels akmod
%endif
%if 0%{?el9}
# kmod fails on rhel9 kernel with aarch64 - just build an akmod there
%ifarch aarch64
%global buildforkernels akmod
%endif
%endif
%global debug_package %{nil}
%global commit 2c9b67072b15d903fecde67c7f269abeafee4c25
%global commitdate 20230503
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global prjname v4l2loopback
Name: %{prjname}-kmod
Summary: Kernel module (kmod) for %{prjname}
Version: 0.13.2
Release: 1%{?dist}
License: GPLv2+
URL: https://github.com/umlaeute/v4l2loopback
Source0: %{url}/archive/v%{version}/%{prjname}-%{version}.tar.gz
Source1: v4l2loopback-kmod.spec
BuildRequires: gcc
BuildRequires: elfutils-libelf-devel
BuildRequires: kmodtool
%dnl %{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} }
# kmodtool does its magic here
%{expand:%(kmodtool --target %{_target_cpu} --repo terra --kmodname %{prjname} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description
This module allows you to create "virtual video devices". Normal (v4l2)
applications will read these devices as if they were ordinary video
devices, but the video will not be read from e.g. a capture card but
instead it is generated by another application.
This package contains the kmod module for %{prjname}.
%prep
# HACK: put that spec into the specdir
cp %SOURCE1 %_specdir/
# error out if there was something wrong with kmodtool
%{?kmodtool_check}
# print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --repo terra --kmodname %{prjname} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
%setup -q -c
(cd v4l2loopback-%{version}
#patch -P 0 -p1
)
for kernel_version in %{?kernel_versions} ; do
cp -a v4l2loopback-%{version} _kmod_build_${kernel_version%%___*}
done
%build
for kernel_version in %{?kernel_versions} ; do
make V=1 %{?_smp_mflags} -C ${kernel_version##*___} M=${PWD}/_kmod_build_${kernel_version%%___*} modules
done
%install
for kernel_version in %{?kernel_versions}; do
mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
install -D -m 755 _kmod_build_${kernel_version%%___*}/v4l2loopback.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/*.ko
done
%{?akmod_install}
%changelog
* Fri Sep 27 2024 Nicolas Chauvet <kwizart@gmail.com> - 0.13.2-1
- Update to 0.13.2
* Fri Aug 02 2024 RPM Fusion Release Engineering <sergiomb@rpmfusion.org> - 0.13.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Mar 21 2024 Leigh Scott <leigh123linux@gmail.com> - 0.13.1-1
- Update to 0.13.1
* Sun Feb 04 2024 RPM Fusion Release Engineering <sergiomb@rpmfusion.org> - 0.12.7^20230503g2c9b670-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Nov 24 2023 Nicolas Chauvet <kwizart@gmail.com> - 0.12.7^20230503g2c9b670-3
- Rebuilt
* Wed Aug 02 2023 RPM Fusion Release Engineering <sergiomb@rpmfusion.org> - 0.12.7^20230503g2c9b670-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue May 09 2023 Kate Hsuan <hpa@redhat.com> - 0.12.7-20230503g2c9b670-1
- Updated to commit 2c9b67072b15d903fecde67c7f269abeafee4c25
- The patch is used to prevent the value of byteused field becomes too large
* Thu Mar 02 2023 Kate Hsuan <hpa@redhat.com> - 0.12.7-20230220ga669686-1
- Updated to commit a66968647843f57448b59cf98d0318f1e98e072c
* Mon Aug 08 2022 RPM Fusion Release Engineering <sergiomb@rpmfusion.org> - 0.12.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild and ffmpeg
5.1
* Fri Aug 05 2022 Leigh Scott <leigh123linux@gmail.com> - 0.12.7-1
- Update to 0.12.7
* Wed Feb 09 2022 RPM Fusion Release Engineering <sergiomb@rpmfusion.org> - 0.12.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Aug 03 2021 RPM Fusion Release Engineering <leigh123linux@gmail.com> - 0.12.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jun 08 2021 Nicolas Chauvet <kwizart@gmail.com> - 0.12.5-4
- rebuilt
* Tue Feb 23 2021 Nicolas Chauvet <kwizart@gmail.com> - 0.12.5-3
- Bump spec
* Mon Feb 15 2021 Nicolas Chauvet <kwizart@gmail.com> - 0.12.5-2
- Rework spec file
* Sat Dec 26 2020 Neal Gompa <ngompa13@gmail.com> - 0.12.5-1
- Initial packaging
@@ -0,0 +1 @@
rpm.version(gh_tag("umlaeute/v4l2loopback"));
+2 -2
View File
@@ -1,7 +1,7 @@
%global debug_package %{nil}
%global commit dadda7ffdb4f017840f53bd0eb145dbb545acf82
%global commit 0837f46dfe25b6e750abc7e601032bdd12c70be0
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global commit_date 20250113
%global commit_date 20250115
%global patches %{_datadir}/src/nvidia-patch
@@ -1,6 +1,6 @@
Name: nvidia-container-toolkit
Version: 1.11.0
Release: 1%{?dist}
Version: 1.17.3
Release: 1%?dist
Summary: NVIDIA Container Toolkit
License: Apache-2.0
Group: Development/Tools/Other
@@ -1,34 +0,0 @@
From 1be2bafe7a9aabf0389da9e685051859c56e64ce Mon Sep 17 00:00:00 2001
From: Kate Hsuan <hpa@redhat.com>
Date: Thu, 9 Feb 2023 15:26:37 +0800
Subject: [PATCH] Set a new ID offset for the private event
According to the v4l2loopback, the private event ID should be
start from V4L2_EVENT_PRIVATE_START+0x08E00000. Therefore, the
V4L2_EVENT_PRI_CLIENT_USAGE is V4L2_EVENT_PRIVATE_START+
0x08E00000+1
Signed-off-by: Kate Hsuan <hpa@redhat.com>
---
src/v4l2-relayd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/v4l2-relayd.c b/src/v4l2-relayd.c
index 21bb0d5..d731af0 100644
--- a/src/v4l2-relayd.c
+++ b/src/v4l2-relayd.c
@@ -27,7 +27,10 @@
#include <gst/app/gstappsrc.h>
#include <gst/video/video-info.h>
-#define V4L2_EVENT_PRI_CLIENT_USAGE V4L2_EVENT_PRIVATE_START
+#define V4L2LOOPBACK_EVENT_OFFSET 0x08E00000
+#define V4L2_EVENT_PRI_CLIENT_USAGE (V4L2_EVENT_PRIVATE_START+\
+ V4L2LOOPBACK_EVENT_OFFSET+\
+ 1)
struct v4l2_event_client_usage {
__u32 count;
--
2.39.2
+2 -2
View File
@@ -12,8 +12,8 @@ BuildRequires: make
BuildRequires: help2man
BuildRequires: systemd-rpm-macros
### For Akmods package
Provides: %{name}-kmod-common = %{version}-%{release}
Requires: %{name}-kmod >= %{version}
Provides: kmod-%{name}-common = %{version}-%{release}
Requires: kmod-%{name} >= %{version}
### For compatibility with older names
Provides: %{name}-utils = %{version}-%{release}
Obsoletes: %{name}-utils < 0.12.5-2
+9
View File
@@ -0,0 +1,9 @@
project pkg {
arches = ["x86_64", "i386"]
rpm {
spec = "wl-kmod.spec"
}
labels {
mock = 1
}
}
@@ -0,0 +1,17 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2015-09-19 00:47:30.000000000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2015-10-17 18:26:48.174207806 +0200
@@ -2165,8 +2165,13 @@
wlif = WL_DEV_IF(dev);
wl = WL_INFO(dev);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
+ skb->prev = NULL;
+#endif
if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
skb->prev = NULL;
+#endif
TXQ_LOCK(wl);
@@ -0,0 +1,29 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2015-10-17 18:26:48.174207806 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2015-10-18 13:28:13.013818788 +0200
@@ -724,7 +724,11 @@
WL_ALL_PASSIVE_ENAB(wl) ? ", Passive Mode" : "", EPI_VERSION_STR);
#ifdef BCMDBG
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)
printf(" (Compiled in " SRCBASE " at " __TIME__ " on " __DATE__ ")");
+#else
+ printf(" (Compiled in " SRCBASE ")");
+#endif
#endif
printf("\n");
@@ -2053,8 +2057,13 @@
void
wl_dump_ver(wl_info_t *wl, struct bcmstrbuf *b)
{
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)
bcm_bprintf(b, "wl%d: %s %s version %s\n", wl->pub->unit,
__DATE__, __TIME__, EPI_VERSION_STR);
+#else
+ bcm_bprintf(b, "wl%d: version %s\n", wl->pub->unit,
+ EPI_VERSION_STR);
+#endif
}
#if defined(BCMDBG)
@@ -0,0 +1,15 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/shared/linux_osl.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c 2015-09-19 00:47:30.000000000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/shared/linux_osl.c 2015-12-21 10:01:33.892793431 +0100
@@ -932,7 +932,11 @@
uint cycles;
#if defined(__i386__)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
+ cycles = (u32) rdtsc();
+#else
rdtscl(cycles);
+#endif
#else
cycles = 0;
#endif
@@ -0,0 +1,142 @@
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 2015-09-19 00:47:30.000000000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2016-08-15 01:58:51.610278898 +0200
@@ -235,6 +235,25 @@
};
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+#define CHAN2G(_channel, _freq, _flags) { \
+ .band = NL80211_BAND_2GHZ, \
+ .center_freq = (_freq), \
+ .hw_value = (_channel), \
+ .flags = (_flags), \
+ .max_antenna_gain = 0, \
+ .max_power = 30, \
+}
+
+#define CHAN5G(_channel, _flags) { \
+ .band = NL80211_BAND_5GHZ, \
+ .center_freq = 5000 + (5 * (_channel)), \
+ .hw_value = (_channel), \
+ .flags = (_flags), \
+ .max_antenna_gain = 0, \
+ .max_power = 30, \
+}
+#else
#define CHAN2G(_channel, _freq, _flags) { \
.band = IEEE80211_BAND_2GHZ, \
.center_freq = (_freq), \
@@ -252,6 +271,7 @@
.max_antenna_gain = 0, \
.max_power = 30, \
}
+#endif
#define RATE_TO_BASE100KBPS(rate) (((rate) * 10) / 2)
#define RATETAB_ENT(_rateid, _flags) \
@@ -379,7 +399,11 @@
};
static struct ieee80211_supported_band __wl_band_2ghz = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ .band = NL80211_BAND_2GHZ,
+#else
.band = IEEE80211_BAND_2GHZ,
+#endif
.channels = __wl_2ghz_channels,
.n_channels = ARRAY_SIZE(__wl_2ghz_channels),
.bitrates = wl_g_rates,
@@ -387,7 +411,11 @@
};
static struct ieee80211_supported_band __wl_band_5ghz_a = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ .band = NL80211_BAND_5GHZ,
+#else
.band = IEEE80211_BAND_5GHZ,
+#endif
.channels = __wl_5ghz_a_channels,
.n_channels = ARRAY_SIZE(__wl_5ghz_a_channels),
.bitrates = wl_a_rates,
@@ -395,7 +423,11 @@
};
static struct ieee80211_supported_band __wl_band_5ghz_n = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ .band = NL80211_BAND_5GHZ,
+#else
.band = IEEE80211_BAND_5GHZ,
+#endif
.channels = __wl_5ghz_n_channels,
.n_channels = ARRAY_SIZE(__wl_5ghz_n_channels),
.bitrates = wl_a_rates,
@@ -1876,8 +1908,13 @@
wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
#endif
wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
+ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a;
+#else
wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a;
+#endif
wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
wdev->wiphy->cipher_suites = __wl_cipher_suites;
wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
@@ -2000,7 +2037,11 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
freq = ieee80211_channel_to_frequency(notif_bss_info->channel,
(notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ?
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ NL80211_BAND_2GHZ : NL80211_BAND_5GHZ);
+#else
IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
+#endif
#else
freq = ieee80211_channel_to_frequency(notif_bss_info->channel);
#endif
@@ -2116,7 +2157,11 @@
return err;
}
chan = wf_chspec_ctlchan(chanspec);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
+#else
band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
+#endif
freq = ieee80211_channel_to_frequency(chan, band);
channel = ieee80211_get_channel(wiphy, freq);
cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
@@ -2250,10 +2295,18 @@
join_params->params.chanspec_list[0] =
ieee80211_frequency_to_channel(chan->center_freq);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ if (chan->band == NL80211_BAND_2GHZ) {
+#else
if (chan->band == IEEE80211_BAND_2GHZ) {
+#endif
chanspec |= WL_CHANSPEC_BAND_2G;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ else if (chan->band == NL80211_BAND_5GHZ) {
+#else
else if (chan->band == IEEE80211_BAND_5GHZ) {
+#endif
chanspec |= WL_CHANSPEC_BAND_5G;
}
else {
@@ -2885,7 +2938,11 @@
if (phy == 'n' || phy == 'a' || phy == 'v') {
wiphy = wl_to_wiphy(wl);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n;
+#else
wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
+#endif
}
return err;
@@ -0,0 +1,16 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2015-10-18 13:28:13.013818000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2016-08-26 08:24:32.558643780 +0200
@@ -775,9 +775,9 @@
pci_read_config_dword(pdev, 0x40, &val);
if ((val & 0x0000ff00) != 0)
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
- bar1_size = pci_resource_len(pdev, 2);
- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
- bar1_size);
+ bar1_size = pci_resource_len(pdev, 2);
+ bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
+ bar1_size);
wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev,
pdev->irq, bar1_addr, bar1_size);
@@ -0,0 +1,51 @@
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 2016-09-07 22:38:13.303835653 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2016-09-07 22:54:53.550730661 +0200
@@ -2439,8 +2439,17 @@
s32 err = 0;
if (wl->scan_request) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+ struct cfg80211_scan_info info = {
+ .aborted = true,
+ };
+#endif
WL_DBG(("%s: Aborting scan\n", __FUNCTION__));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+ cfg80211_scan_done(wl->scan_request, &info);
+#else
cfg80211_scan_done(wl->scan_request, true);
+#endif
wl->scan_request = NULL;
}
@@ -2541,7 +2550,14 @@
scan_done_out:
if (wl->scan_request) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+ struct cfg80211_scan_info info = {
+ .aborted = false,
+ };
+ cfg80211_scan_done(wl->scan_request, &info);
+#else
cfg80211_scan_done(wl->scan_request, false);
+#endif
wl->scan_request = NULL;
}
rtnl_unlock();
@@ -2970,7 +2986,14 @@
s32 err = 0;
if (wl->scan_request) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+ struct cfg80211_scan_info info = {
+ .aborted = true,
+ };
+ cfg80211_scan_done(wl->scan_request, &info);
+#else
cfg80211_scan_done(wl->scan_request, true);
+#endif
wl->scan_request = NULL;
}
@@ -0,0 +1,165 @@
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 2016-09-07 22:54:53.550730661 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2017-02-08 19:35:44.320100235 +0100
@@ -2005,7 +2005,7 @@
if (dtoh32(bi->length) > WL_BSS_INFO_MAX) {
WL_DBG(("Beacon is larger than buffer. Discarding\n"));
- return err;
+ return -E2BIG;
}
notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) +
WL_BSS_INFO_MAX, GFP_KERNEL);
@@ -2029,9 +2029,15 @@
beacon_proberesp->capab_info = cpu_to_le16(bi->capability);
wl_rst_ie(wl);
- wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length);
- wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX -
- offsetof(struct wl_cfg80211_bss_info, frame_buf));
+ err = wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length);
+ if (err)
+ goto inform_single_bss_out;
+
+ err = wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX -
+ offsetof(struct wl_cfg80211_bss_info, frame_buf));
+ if (err)
+ goto inform_single_bss_out;
+
notif_bss_info->frame_len = offsetof(struct ieee80211_mgmt, u.beacon.variable) +
wl_get_ielen(wl);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
@@ -2047,14 +2053,14 @@
#endif
if (freq == 0) {
WL_ERR(("Invalid channel, fail to chcnage channel to freq\n"));
- kfree(notif_bss_info);
- return -EINVAL;
+ err = -EINVAL;
+ goto inform_single_bss_out;
}
channel = ieee80211_get_channel(wiphy, freq);
if (unlikely(!channel)) {
WL_ERR(("ieee80211_get_channel error\n"));
- kfree(notif_bss_info);
- return -EINVAL;
+ err = -EINVAL;
+ goto inform_single_bss_out;
}
WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n",
@@ -2062,28 +2068,35 @@
mgmt->u.beacon.capab_info, &bi->BSSID));
signal = notif_bss_info->rssi * 100;
- cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt,
- le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL);
- if (unlikely(!cbss)) {
- WL_ERR(("cfg80211_inform_bss_frame error\n"));
- kfree(notif_bss_info);
- return -EINVAL;
+ if (!wl->scan_request) {
+ cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt,
+ le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL);
+ if (unlikely(!cbss)) {
+ WL_ERR(("cfg80211_inform_bss_frame error\n"));
+ err = -ENOMEM;
+ goto inform_single_bss_out;
+ }
}
-
- notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
- notify_ielen = le32_to_cpu(bi->ie_length);
+ else {
+ notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
+ notify_ielen = le32_to_cpu(bi->ie_length);
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
- cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet),
- 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
- (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
-#else
- cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)(bi->BSSID.octet),
- 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
- (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
-#endif
-
- if (unlikely(!cbss))
- return -ENOMEM;
+ cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet),
+ 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
+ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
+#else
+ cbss = cfg80211_inform_bss(wiphy, channel,
+ wl->active_scan ? CFG80211_BSS_FTYPE_PRESP : CFG80211_BSS_FTYPE_BEACON,
+ (const u8 *)(bi->BSSID.octet),
+ 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
+ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
+#endif
+ if (unlikely(!cbss)) {
+ WL_ERR(("cfg80211_inform_bss error\n"));
+ err = -ENOMEM;
+ goto inform_single_bss_out;
+ }
+ }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
cfg80211_put_bss(wiphy, cbss);
@@ -2091,6 +2104,7 @@
cfg80211_put_bss(cbss);
#endif
+inform_single_bss_out:
kfree(notif_bss_info);
return err;
@@ -2369,6 +2383,9 @@
if (err)
goto update_bss_info_out;
+ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
+ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+
ie = ((u8 *)bi) + bi->ie_offset;
ie_len = bi->ie_length;
} else {
@@ -2381,12 +2398,20 @@
ie_len = bss->len_information_elements;
#endif
wl->conf->channel = *bss->channel;
+ }
+
+ if (bss) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
cfg80211_put_bss(wiphy, bss);
#else
cfg80211_put_bss(bss);
#endif
}
+ else {
+ WL_DBG(("Could not update BSS\n"));
+ err = -EINVAL;
+ goto update_bss_info_out;
+ }
tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
if (tim) {
@@ -2413,10 +2438,17 @@
struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl);
s32 err = 0;
- wl_get_assoc_ies(wl);
+ err = wl_get_assoc_ies(wl);
+ if (err)
+ return err;
+
memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN);
memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
- wl_update_bss_info(wl);
+
+ err = wl_update_bss_info(wl);
+ if (err)
+ return err;
+
cfg80211_roamed(ndev,
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)
&wl->conf->channel,
@@ -0,0 +1,27 @@
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 2017-02-08 19:35:44.320100235 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2017-04-10 14:23:40.909434506 +0200
@@ -39,6 +39,10 @@
#include <proto/802.11.h>
#include <wl_cfg80211_hybrid.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#include <linux/sched/signal.h>
+#endif
+
#define EVENT_TYPE(e) dtoh32((e)->event_type)
#define EVENT_FLAGS(e) dtoh16((e)->flags)
#define EVENT_STATUS(e) dtoh32((e)->status)
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2016-08-26 08:24:32.558643000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2017-04-10 14:23:40.884434339 +0200
@@ -2929,7 +2929,9 @@
if (skb == NULL) return;
skb->dev = wl->monitor_dev;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 10, 0)
skb->dev->last_rx = jiffies;
+#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
skb_reset_mac_header(skb);
#else
@@ -0,0 +1,70 @@
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 2017-04-10 14:23:40.909434506 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2017-07-03 11:32:04.271398087 +0200
@@ -54,7 +54,11 @@
#endif
static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
- enum nl80211_iftype type, u32 *flags, struct vif_params *params);
+ enum nl80211_iftype type,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+ u32 *flags,
+#endif
+ struct vif_params *params);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
static s32
wl_cfg80211_scan(struct wiphy *wiphy,
@@ -499,8 +503,11 @@
static s32
wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
- enum nl80211_iftype type, u32 *flags,
- struct vif_params *params)
+ enum nl80211_iftype type,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+ u32 *flags,
+#endif
+ struct vif_params *params)
{
struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
struct wireless_dev *wdev;
@@ -2440,6 +2447,9 @@
const wl_event_msg_t *e, void *data)
{
struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+ struct cfg80211_roam_info roam_info = {};
+#endif
s32 err = 0;
err = wl_get_assoc_ies(wl);
@@ -2453,13 +2463,28 @@
if (err)
return err;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+ roam_info.channel = &wl->conf->channel;
+ roam_info.bssid = (u8*)&wl->bssid;
+ roam_info.req_ie = conn_info->req_ie;
+ roam_info.req_ie_len = conn_info->req_ie_len;
+ roam_info.resp_ie = conn_info->resp_ie;
+ roam_info.resp_ie_len = conn_info->resp_ie_len;
+#endif
+
cfg80211_roamed(ndev,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)
&wl->conf->channel,
#endif
(u8 *)&wl->bssid,
conn_info->req_ie, conn_info->req_ie_len,
- conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
+ conn_info->resp_ie, conn_info->resp_ie_len,
+#else
+ &roam_info,
+#endif
+ GFP_KERNEL);
+
WL_DBG(("Report roaming result\n"));
set_bit(WL_STATUS_CONNECTED, &wl->status);
@@ -0,0 +1,15 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/shared/linux_osl.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c 2017-06-03 15:26:57.092475595 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/shared/linux_osl.c 2017-11-24 10:45:55.764626061 +0100
@@ -1080,7 +1080,11 @@
if (!image)
return 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+ rdlen = kernel_read(fp, buf, len, &fp->f_pos);
+#else
rdlen = kernel_read(fp, fp->f_pos, buf, len);
+#endif
if (rdlen > 0)
fp->f_pos += rdlen;
@@ -0,0 +1,47 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2017-06-03 15:26:57.094475000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2018-02-15 00:54:30.184690464 +0100
@@ -93,7 +93,11 @@
#include <wlc_wowl.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static void wl_timer(struct timer_list *tl);
+#else
static void wl_timer(ulong data);
+#endif
static void _wl_timer(wl_timer_t *t);
static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
@@ -2311,10 +2315,17 @@
atomic_dec(&t->wl->callbacks);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static void
+wl_timer(struct timer_list *tl)
+{
+ wl_timer_t *t = (wl_timer_t *)tl;
+#else
static void
wl_timer(ulong data)
{
wl_timer_t *t = (wl_timer_t *)data;
+#endif
if (!WL_ALL_PASSIVE_ENAB(t->wl))
_wl_timer(t);
@@ -2366,9 +2377,13 @@
bzero(t, sizeof(wl_timer_t));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+ timer_setup(&t->timer, wl_timer, 0);
+#else
init_timer(&t->timer);
t->timer.data = (ulong) t;
t->timer.function = wl_timer;
+#endif
t->wl = wl;
t->fn = fn;
t->arg = arg;
@@ -0,0 +1,18 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2018-02-15 00:54:30.184690464 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2018-04-18 08:07:30.068342420 +0200
@@ -2986,7 +2986,14 @@
}
ASSERT(strlen(wlif->name) > 0);
+#if __GNUC__ < 8
strncpy(wlif->dev->name, wlif->name, strlen(wlif->name));
+#else
+ // Should have been:
+ // strncpy(wlif->dev->name, wlif->name, sizeof(wlif->dev->name) - 1);
+ // wlif->dev->name[sizeof(wlif->dev->name) - 1] = '\0';
+ memcpy(wlif->dev->name, wlif->name, strlen(wlif->name));
+#endif
wl->monitor_dev = dev;
if (wl->monitor_type == 1)
@@ -0,0 +1,20 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/shared/linux_osl.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c 2017-11-24 10:45:55.764626000 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/shared/linux_osl.c 2019-01-26 19:33:46.518389607 +0100
@@ -1075,6 +1075,7 @@
osl_os_get_image_block(char *buf, int len, void *image)
{
struct file *fp = (struct file *)image;
+ loff_t pos = fp->f_pos;
int rdlen;
if (!image)
@@ -1085,7 +1086,7 @@
#else
rdlen = kernel_read(fp, fp->f_pos, buf, len);
#endif
- if (rdlen > 0)
+ if ((rdlen > 0) && (fp->f_pos == pos))
fp->f_pos += rdlen;
return rdlen;
@@ -0,0 +1,30 @@
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 2017-07-03 11:32:04.271398000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2019-04-14 17:35:23.565460847 +0200
@@ -490,7 +490,11 @@
ifr.ifr_data = (caddr_t)&ioc;
fs = get_fs();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
+ set_fs(KERNEL_DS);
+#else
set_fs(get_ds());
+#endif
#if defined(WL_USE_NETDEV_OPS)
err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
#else
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 2017-06-03 15:26:57.095475000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_iw.c 2019-05-30 01:29:32.766280636 +0200
@@ -117,7 +117,11 @@
ifr.ifr_data = (caddr_t) &ioc;
fs = get_fs();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
+ set_fs(KERNEL_DS);
+#else
set_fs(get_ds());
+#endif
#if defined(WL_USE_NETDEV_OPS)
ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
#else
@@ -0,0 +1,117 @@
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 2019-04-14 17:35:23.565460847 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2019-06-01 14:37:25.675650990 +0200
@@ -522,6 +522,10 @@
switch (type) {
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_WDS:
+ case NL80211_IFTYPE_MESH_POINT:
+ case NL80211_IFTYPE_P2P_DEVICE:
+ case NL80211_IFTYPE_P2P_CLIENT:
+ case NL80211_IFTYPE_P2P_GO:
WL_ERR(("type (%d) : currently we do not support this type\n",
type));
return -EOPNOTSUPP;
@@ -532,6 +536,10 @@
wl->conf->mode = WL_MODE_BSS;
infra = 1;
break;
+ case NL80211_IFTYPE_AP:
+ wl->conf->mode = WL_MODE_AP;
+ ap = 1;
+ break;
default:
return -EINVAL;
}
@@ -1893,6 +1901,8 @@
return NL80211_IFTYPE_STATION;
case WL_MODE_IBSS:
return NL80211_IFTYPE_ADHOC;
+ case WL_MODE_AP:
+ return NL80211_IFTYPE_AP;
default:
return NL80211_IFTYPE_UNSPECIFIED;
}
@@ -1900,6 +1910,46 @@
return err;
}
+static const struct ieee80211_txrx_stypes
+wl_txrx_stypes[NUM_NL80211_IFTYPES] = {
+ [NL80211_IFTYPE_STATION] = {
+ .tx = 0xffff,
+ .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+ BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
+ },
+ [NL80211_IFTYPE_AP] = {
+ .tx = 0xffff,
+ .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
+ BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
+ BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
+ BIT(IEEE80211_STYPE_DISASSOC >> 4) |
+ BIT(IEEE80211_STYPE_AUTH >> 4) |
+ BIT(IEEE80211_STYPE_DEAUTH >> 4) |
+ BIT(IEEE80211_STYPE_ACTION >> 4)
+ }
+};
+
+static const struct ieee80211_iface_limit wl_limits[] = {
+ {
+ .max = 1,
+ .types = BIT(NL80211_IFTYPE_STATION),
+ },
+ {
+ .max = 1,
+ .types = BIT(NL80211_IFTYPE_AP),
+ },
+};
+
+static const struct ieee80211_iface_combination wl_combination [] = {
+ {
+ .limits = wl_limits,
+ .n_limits = ARRAY_SIZE(wl_limits),
+ .max_interfaces = 2,
+ .num_different_channels = 1,
+ .beacon_int_infra_match = true,
+ },
+};
+
static s32 wl_alloc_wdev(struct device *dev, struct wireless_dev **rwdev)
{
struct wireless_dev *wdev;
@@ -1922,7 +1972,10 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
#endif
- wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
+ wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP);
+ wdev->wiphy->iface_combinations = wl_combination;
+ wdev->wiphy->n_iface_combinations = ARRAY_SIZE(wl_combination);
+ wdev->wiphy->mgmt_stypes = wl_txrx_stypes;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a;
@@ -2944,15 +2997,22 @@
switch (iftype) {
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_WDS:
+ case NL80211_IFTYPE_MESH_POINT:
+ case NL80211_IFTYPE_P2P_DEVICE:
+ case NL80211_IFTYPE_P2P_CLIENT:
+ case NL80211_IFTYPE_P2P_GO:
WL_ERR(("type (%d) : currently we do not support this mode\n",
iftype));
- err = -EINVAL;
+ err = -EOPNOTSUPP;
return err;
case NL80211_IFTYPE_ADHOC:
break;
case NL80211_IFTYPE_STATION:
infra = 1;
break;
+ case NL80211_IFTYPE_AP:
+ ap = 1;
+ break;
default:
err = -EINVAL;
WL_ERR(("invalid type (%d)\n", iftype));
@@ -0,0 +1,11 @@
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 2019-06-01 14:37:25.675650990 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2019-10-16 16:33:57.319456346 +0200
@@ -856,6 +856,7 @@
break;
case NL80211_AUTHTYPE_NETWORK_EAP:
WL_DBG(("network eap\n"));
+ __attribute__((__fallthrough__)); /* [[fallthrough]]; falls through */
default:
val = 2;
WL_ERR(("invalid auth type (%d)\n", sme->auth_type));
@@ -0,0 +1,59 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/shared/linux_osl.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c 2019-01-26 19:33:46.518389000 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/shared/linux_osl.c 2020-03-19 10:16:53.597986455 +0100
@@ -946,7 +946,11 @@
void *
osl_reg_map(uint32 pa, uint size)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
+#else
+ return (ioremap((unsigned long)pa, (unsigned long)size));
+#endif
}
void
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2018-04-18 13:53:37.484164000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2020-03-19 10:24:18.154395810 +0100
@@ -586,7 +586,11 @@
}
wl->bcm_bustype = bustype;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
+#else
+ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
+#endif
WL_ERROR(("wl%d: ioremap() failed\n", unit));
goto fail;
}
@@ -780,7 +784,11 @@
if ((val & 0x0000ff00) != 0)
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
bar1_size = pci_resource_len(pdev, 2);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
+#else
+ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2),
+#endif
bar1_size);
wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev,
pdev->irq, bar1_addr, bar1_size);
@@ -3373,10 +3381,16 @@
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
static const struct file_operations wl_fops = {
.owner = THIS_MODULE,
.read = wl_proc_read,
.write = wl_proc_write,
+#else
+static const struct proc_ops wl_fops = {
+ .proc_read = wl_proc_read,
+ .proc_write = wl_proc_write,
+#endif
};
#endif
@@ -0,0 +1,15 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2020-03-19 10:24:18.154395810 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2020-11-11 13:39:00.579562572 +0100
@@ -1659,7 +1659,11 @@
goto done2;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
+ if (uaccess_kernel())
+#else
if (segment_eq(get_fs(), KERNEL_DS))
+#endif
buf = ioc.buf;
else if (ioc.buf) {
@@ -0,0 +1,180 @@
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 2019-10-16 16:33:57.319456000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2020-12-29 21:44:24.206777104 +0100
@@ -38,6 +38,9 @@
#include <wlioctl.h>
#include <proto/802.11.h>
#include <wl_cfg80211_hybrid.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
+#include <wl_linux.h>
+#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/signal.h>
@@ -475,13 +478,16 @@
static s32
wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
struct ifreq ifr;
struct wl_ioctl ioc;
mm_segment_t fs;
s32 err = 0;
+#endif
BUG_ON(len < sizeof(int));
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
memset(&ioc, 0, sizeof(ioc));
ioc.cmd = cmd;
ioc.buf = arg;
@@ -503,6 +509,9 @@
set_fs(fs);
return err;
+#else
+ return wlc_ioctl_internal(dev, cmd, arg, len);
+#endif
}
static s32
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wlc_pub.h hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wlc_pub.h
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wlc_pub.h 2017-06-03 15:26:57.095475000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wlc_pub.h 2020-12-29 21:55:44.922067533 +0100
@@ -24,6 +24,9 @@
#include <wlc_types.h>
#include <wlc_utils.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
+#include <siutils.h>
+#endif
#include "proto/802.11.h"
#include "proto/bcmevent.h"
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 2019-05-30 01:32:34.421426000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_iw.c 2020-12-29 21:47:36.457836102 +0100
@@ -37,6 +37,9 @@
#include <wl_dbg.h>
#include <wl_iw.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
+#include <wl_linux.h>
+#endif
extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
uint32 reason, char* stringBuf, uint buflen);
@@ -103,6 +106,7 @@
int len
)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
struct ifreq ifr;
wl_ioctl_t ioc;
mm_segment_t fs;
@@ -130,6 +134,9 @@
set_fs(fs);
return ret;
+#else
+ return wlc_ioctl_internal(dev, cmd, arg, len);
+#endif
}
static int
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2020-11-11 13:39:00.579562572 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.c 2020-12-29 21:55:44.899067286 +0100
@@ -1659,6 +1659,7 @@
goto done2;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
if (uaccess_kernel())
#else
@@ -1667,6 +1668,9 @@
buf = ioc.buf;
else if (ioc.buf) {
+#else
+ if (ioc.buf) {
+#endif
if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
bcmerror = BCME_NORESOURCE;
goto done2;
@@ -1687,7 +1691,11 @@
WL_UNLOCK(wl);
done1:
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
if (ioc.buf && (ioc.buf != buf)) {
+#else
+ if (ioc.buf) {
+#endif
if (copy_to_user(ioc.buf, buf, ioc.len))
bcmerror = BCME_BADADDR;
MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN));
@@ -1697,6 +1705,39 @@
ASSERT(VALID_BCMERROR(bcmerror));
if (bcmerror != 0)
wl->pub->bcmerror = bcmerror;
+ return (OSL_ERROR(bcmerror));
+}
+
+int
+wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len)
+{
+ wl_info_t *wl;
+ wl_if_t *wlif;
+ int bcmerror;
+
+ if (!dev)
+ return -ENETDOWN;
+
+ wl = WL_INFO(dev);
+ wlif = WL_DEV_IF(dev);
+ if (wlif == NULL || wl == NULL || wl->dev == NULL)
+ return -ENETDOWN;
+
+ bcmerror = 0;
+
+ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd));
+
+ WL_LOCK(wl);
+ if (!capable(CAP_NET_ADMIN)) {
+ bcmerror = BCME_EPERM;
+ } else {
+ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif);
+ }
+ WL_UNLOCK(wl);
+
+ ASSERT(VALID_BCMERROR(bcmerror));
+ if (bcmerror != 0)
+ wl->pub->bcmerror = bcmerror;
return (OSL_ERROR(bcmerror));
}
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.h hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.h
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.h 2017-06-03 15:26:57.095475000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_linux.h 2020-12-29 21:55:44.953067865 +0100
@@ -22,6 +22,9 @@
#define _wl_linux_h_
#include <wlc_types.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
+#include <wlc_pub.h>
+#endif
typedef struct wl_timer {
struct timer_list timer;
@@ -187,6 +190,9 @@
extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
extern void wl_free(wl_info_t *wl);
extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
+extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len);
+#endif
extern struct net_device * wl_netdev_get(wl_info_t *wl);
#endif
@@ -0,0 +1,78 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_iw.h hybrid-v35_64-nodebug-pcoem-6_30_223_271-021_kernel_5.17_adaptation/src/wl/sys/wl_iw.h
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_iw.h 2020-12-29 18:29:39.463940664 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271-021_kernel_5.17_adaptation/src/wl/sys/wl_iw.h 2022-04-01 10:25:05.515054893 +0200
@@ -70,7 +70,9 @@
#define WL_IW_RSSI_EXCELLENT -57
#define WL_IW_RSSI_INVALID 0
#define MAX_WX_STRING 80
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
#define isprint(c) bcm_isprint(c)
+#endif
#define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1)
#define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
#define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c hybrid-v35_64-nodebug-pcoem-6_30_223_271-021_kernel_5.17_adaptation/src/wl/sys/wl_linux.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/wl/sys/wl_linux.c 2020-12-29 21:55:44.899067286 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271-021_kernel_5.17_adaptation/src/wl/sys/wl_linux.c 2022-04-01 10:00:24.985252480 +0200
@@ -638,7 +638,11 @@
WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
+#else
+ dev_addr_mod(dev, 0, &wl->pub->cur_etheraddr, ETHER_ADDR_LEN);
+#endif
online_cpus = 1;
@@ -1862,7 +1866,11 @@
WL_LOCK(wl);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
+#else
+ dev_addr_mod(dev, 0, sa->sa_data, ETHER_ADDR_LEN);
+#endif
err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
IOV_SET, (WL_DEV_IF(dev))->wlcif);
WL_UNLOCK(wl);
@@ -3054,7 +3062,11 @@
else
dev->type = ARPHRD_IEEE80211_RADIOTAP;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
+#else
+ dev_addr_mod(dev, 0, wl->dev->dev_addr, ETHER_ADDR_LEN);
+#endif
#if defined(WL_USE_NETDEV_OPS)
dev->netdev_ops = &wl_netdev_monitor_ops;
@@ -3335,8 +3347,12 @@
static ssize_t
wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+ wl_info_t * wl = pde_data(file_inode(filp));
+#else
wl_info_t * wl = PDE_DATA(file_inode(filp));
#endif
+#endif
int bcmerror, len;
int to_user = 0;
char tmp[8];
@@ -3392,8 +3408,12 @@
static ssize_t
wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+ wl_info_t * wl = pde_data(file_inode(filp));
+#else
wl_info_t * wl = PDE_DATA(file_inode(filp));
#endif
+#endif
int from_user = 0;
int bcmerror;
@@ -0,0 +1,101 @@
diff -Naur hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c hybrid-v35_64-nodebug-pcoem-6_30_223_271-022_kernel_5.18_adaptation/src/shared/linux_osl.c
--- hybrid-v35_64-nodebug-pcoem-6_30_223_271.orig/src/shared/linux_osl.c 2020-12-29 18:29:39.434940249 +0100
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271-022_kernel_5.18_adaptation/src/shared/linux_osl.c 2022-06-06 17:14:25.587543256 +0200
@@ -48,7 +48,11 @@
struct osl_info {
osl_pubinfo_t pub;
uint magic;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ struct pci_dev *pdev;
+#else
void *pdev;
+#endif
atomic_t malloced;
atomic_t pktalloced;
uint failed;
@@ -600,8 +604,12 @@
if (va)
*pap = (ulong)__virt_to_phys(va);
#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ va = dma_alloc_coherent(&osh->pdev->dev, size, (dma_addr_t *)pap, GFP_ATOMIC);
+#else
va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap);
#endif
+#endif
return va;
}
@@ -613,8 +621,12 @@
#ifdef __ARM_ARCH_7A__
kfree(va);
#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ dma_free_coherent(&osh->pdev->dev, size, va, (dma_addr_t)pa);
+#else
pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa);
#endif
+#endif
}
uint BCMFASTPATH
@@ -623,7 +635,11 @@
int dir;
ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ dir = (direction == DMA_TX)? DMA_TO_DEVICE : DMA_FROM_DEVICE;
+#else
dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE;
+#endif
#if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL)
if (dmah != NULL) {
@@ -635,13 +651,21 @@
if (skb_is_nonlinear(skb)) {
nsegs = skb_to_sgvec(skb, sg, 0, PKTLEN(osh, skb));
ASSERT((nsegs > 0) && (totsegs + nsegs <= MAX_DMA_SEGS));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ dma_map_sg(&osh->pdev->dev, sg, nsegs, dir);
+#else
pci_map_sg(osh->pdev, sg, nsegs, dir);
+#endif
} else {
nsegs = 1;
ASSERT(totsegs + nsegs <= MAX_DMA_SEGS);
sg->page_link = 0;
sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ dma_map_single(&osh->pdev->dev, PKTDATA(osh, skb), PKTLEN(osh, skb), dir);
+#else
pci_map_single(osh->pdev, PKTDATA(osh, skb), PKTLEN(osh, skb), dir);
+#endif
}
totsegs += nsegs;
totlen += PKTLEN(osh, skb);
@@ -656,7 +680,11 @@
}
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ return (dma_map_single(&osh->pdev->dev, va, size, dir));
+#else
return (pci_map_single(osh->pdev, va, size, dir));
+#endif
}
void BCMFASTPATH
@@ -665,8 +693,13 @@
int dir;
ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+ dir = (direction == DMA_TX)? DMA_TO_DEVICE : DMA_FROM_DEVICE;
+ dma_unmap_single(&osh->pdev->dev, (uint32)pa, size, dir);
+#else
dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE;
pci_unmap_single(osh->pdev, (uint32)pa, size, dir);
+#endif
}
#if defined(BCMDBG_ASSERT)
@@ -0,0 +1,17 @@
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 2022-04-02 19:58:24.236715000 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2022-10-17 01:08:31.537677649 +0200
@@ -2531,8 +2531,13 @@
return err;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+ roam_info.links[0].channel = &wl->conf->channel;
+ roam_info.links[0].bssid = (u8*)&wl->bssid;
+#else
roam_info.channel = &wl->conf->channel;
roam_info.bssid = (u8*)&wl->bssid;
+#endif
roam_info.req_ie = conn_info->req_ie;
roam_info.req_ie_len = conn_info->req_ie_len;
roam_info.resp_ie = conn_info->resp_ie;
@@ -0,0 +1,84 @@
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 2022-10-17 01:08:31.537677649 +0200
+++ hybrid-v35_64-nodebug-pcoem-6_30_223_271/src/wl/sys/wl_cfg80211_hybrid.c 2023-01-03 09:20:31.743032501 +0100
@@ -107,14 +107,25 @@
static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
+ struct net_device *dev, int link_id, u8 key_idx, bool unicast, bool multicast);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
struct net_device *dev, u8 key_idx, bool unicast, bool multicast);
#else
static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
struct net_device *dev, u8 key_idx);
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params);
+static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr);
+static s32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr,
+ void *cookie, void (*callback) (void *cookie, struct key_params *params));
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params);
static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
@@ -1237,7 +1248,11 @@
return err;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+static s32
+wl_cfg80211_config_default_key(struct wiphy *wiphy,
+ struct net_device *dev, int link_id, u8 key_idx, bool unicast, bool multicast)
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
static s32
wl_cfg80211_config_default_key(struct wiphy *wiphy,
struct net_device *dev, u8 key_idx, bool unicast, bool multicast)
@@ -1262,7 +1277,11 @@
return 0;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+static s32
+wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params)
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
static s32
wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params)
@@ -1383,7 +1402,11 @@
return err;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+static s32
+wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr)
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
static s32
wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr)
@@ -1426,7 +1449,12 @@
return err;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+static s32
+wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
+ void (*callback) (void *cookie, struct key_params * params))
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
static s32
wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
@@ -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);
@@ -0,0 +1,57 @@
From 92a12d8861c51ec2f35aba4c746653fb0e9b7256 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <nicolas.vieville@uphf.fr>
Date: Wed, 21 Aug 2024 19:35:27 +0200
Subject: [PATCH] =?UTF-8?q?kernel=206.10:=20wl=5Flinux.c:=20fix=20warning?=
=?UTF-8?q?=20suggest=20braces=20around=20empty=20body=20in=20an=20?=
=?UTF-8?q?=E2=80=98if=E2=80=99=20statement?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Nicolas Viéville <nicolas.vieville@uphf.fr>
---
src/wl/sys/wl_linux.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
index 499752b..2000f6f 100644
--- a/src/wl/sys/wl_linux.c
+++ b/src/wl/sys/wl_linux.c
@@ -1100,8 +1100,9 @@ wl_open(struct net_device *dev)
}
WL_UNLOCK(wl);
- if (!error)
+ if (!error) {
OLD_MOD_INC_USE_COUNT;
+ }
#if defined(USE_CFG80211)
if (wl_cfg80211_up(dev)) {
@@ -1874,9 +1875,10 @@ wl_set_mac_address(struct net_device *dev, void *addr)
err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
IOV_SET, (WL_DEV_IF(dev))->wlcif);
WL_UNLOCK(wl);
- if (err)
+ if (err) {
WL_ERROR(("wl%d: wl_set_mac_address: error setting MAC addr override\n",
wl->pub->unit));
+ }
return err;
}
@@ -2274,9 +2276,10 @@ wl_start(struct sk_buff *skb, struct net_device *dev)
if (!err) {
atomic_inc(&wl->callbacks);
wl->txq_dispatched = TRUE;
- } else
+ } else {
WL_ERROR(("wl%d: wl_start/schedule_work failed\n",
wl->pub->unit));
+ }
}
TXQ_UNLOCK(wl);
--
2.46.0
@@ -0,0 +1,35 @@
From d9d6f584c57f10349876a68f9bf029ef47c9a74b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <nicolas.vieville@uphf.fr>
Date: Wed, 21 Aug 2024 23:49:28 +0200
Subject: [PATCH] wpa_supplicant-2.11: wl_cfg80211_hybrid.c: add
max_scan_ie_len in order to make wpa_supplicant scans not to fail
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Nicolas Viéville <nicolas.vieville@uphf.fr>
---
src/wl/sys/wl_cfg80211_hybrid.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
index ff5a3fb..5ffa0b3 100644
--- a/src/wl/sys/wl_cfg80211_hybrid.c
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
@@ -2011,6 +2011,13 @@ static s32 wl_alloc_wdev(struct device *dev, struct wireless_dev **rwdev)
}
set_wiphy_dev(wdev->wiphy, dev);
wdev->wiphy->max_scan_ssids = WL_NUM_SCAN_MAX;
+
+ /* Set max_scan_ie_len to a random value in order to make wpa_supplicant
+ * scans not to fail. The driver should ignore the extra passed IEs.
+ * Value taken and fix inspired from:
+ * https://patchwork.kernel.org/project/linux-wireless/patch/20211212221310.5453-1-merlijn@wizzup.org/
+ */
+ wdev->wiphy->max_scan_ie_len = 512;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
#endif
--
2.46.0
@@ -0,0 +1,32 @@
From 5f6c5c8b27da17c80ce9bd2d6d714295bd352df5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <nicolas.vieville@uphf.fr>
Date: Tue, 10 Dec 2024 09:22:46 +0100
Subject: [PATCH] wl_linux.c: #include <linux/unaligned.h> for kernel >= 6.12.x
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Nicolas Viéville <nicolas.vieville@uphf.fr>
---
src/wl/sys/wl_linux.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
index 2000f6f..3c25ce4 100644
--- a/src/wl/sys/wl_linux.c
+++ b/src/wl/sys/wl_linux.c
@@ -56,7 +56,11 @@
#include <asm/irq.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
#include <asm/unaligned.h>
+#else
+#include <linux/unaligned.h>
+#endif
#include <proto/802.1d.h>
--
2.47.1
@@ -0,0 +1 @@
xen$
+151
View File
@@ -0,0 +1,151 @@
%if 0%{?fedora} || 0%{?rhel} >= 9
%bcond_with kmod
%if %{with kmod}
%global buildforkernels current
%else
%global buildforkernels akmod
%endif
%endif
%global debug_package %{nil}
Name: wl-kmod
Version: 6.30.223.271
Release: 1%{?dist}
Summary: Kernel module for Broadcom wireless devices
Group: System Environment/Kernel
License: Redistributable, no modification permitted
URL: https://www.broadcom.com/support/download-search?pg=Legacy+Products&pf=Legacy+Wireless&pn=&pa=&po=&dk=&pl=
Source0: https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_271.tar.gz
Source1: https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
Source11: wl-kmod-kmodtool-excludekernel-filterfile
Patch0: wl-kmod-002_kernel_3.18_null_pointer.patch
Patch1: wl-kmod-003_gcc_4.9_remove_TIME_DATE_macros.patch
Patch2: wl-kmod-004_kernel_4.3_rdtscl_to_rdtsc.patch
Patch3: wl-kmod-005_kernel_4.7_IEEE80211_BAND_to_NL80211_BAND.patch
Patch4: wl-kmod-006_gcc_6_fix_indentation_warnings.patch
Patch5: wl-kmod-007_kernel_4.8_add_cfg80211_scan_info_struct.patch
Patch6: wl-kmod-008_fix_kernel_warnings.patch
Patch7: wl-kmod-009_kernel_4.11_remove_last_rx_in_net_device_struct.patch
Patch8: wl-kmod-010_kernel_4.12_add_cfg80211_roam_info_struct.patch
Patch9: wl-kmod-011_kernel_4.14_new_kernel_read_function_prototype.patch
Patch10: wl-kmod-012_kernel_4.15_new_timer.patch
Patch11: wl-kmod-013_gcc8_fix_bounds_check_warnings.patch
Patch12: wl-kmod-014_kernel_read_pos_increment_fix.patch
Patch13: wl-kmod-015_kernel_5.1_get_ds_removed.patch
Patch14: wl-kmod-016_fix_unsupported_mesh_point.patch
Patch15: wl-kmod-017_fix_gcc_fallthrough_warning.patch
Patch16: wl-kmod-018_kernel_5.6_adaptations.patch
Patch17: wl-kmod-019_kernel_5.9_segment_eq_removed.patch
Patch18: wl-kmod-020_kernel_5.10_get_set_fs_removed.patch
Patch19: wl-kmod-021_kernel_5.17_adaptation.patch
Patch20: wl-kmod-022_kernel_5.18_adaptation.patch
Patch21: wl-kmod-023_kernel_6.0_adaptation.patch
Patch22: wl-kmod-024_kernel_6.1_adaptation.patch
Patch23: wl-kmod-025_kernel_6.5_adaptation.patch
Patch24: wl-kmod-026_kernel_6.10_fix_empty_body_in_if_warning.patch
Patch25: wl-kmod-027_wpa_supplicant-2.11_add_max_scan_ie_len.patch
Patch26: wl-kmod-028_kernel_6.12_adaptation.patch
ExclusiveArch: i686 x86_64
BuildRequires: kmodtool
BuildRequires: elfutils-libelf-devel
%{!?kernels:BuildRequires: gcc, elfutils-libelf-devel}
%{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} --filterfile %{SOURCE11} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description
These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43142-, BCM43224-, BCM43225-, BCM43227-, BCM43228-, BCM4331-, BCM4360, and -BCM4352-.
NOTE: Please read the LICENSE.txt file in the docs directory before using this driver. You should read the fedora.readme file in the docs directory in order to know how to configure this software if you encounter problems.
%prep
%{?kmodtool_check}
kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} --filterfile %{SOURCE11} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
%setup -q -c -T
mkdir %{name}-%{version}-src
pushd %{name}-%{version}-src
%ifarch %{ix86}
tar xzf %{SOURCE0}
%else
tar xzf %{SOURCE1}
%endif
%patch -P 0 -p1 -b .kernel_3.18_null_pointer.patch
%patch -P 1 -p1 -b .gcc_4.9_remove_TIME_DATE_macros
%patch -P 2 -p1 -b .kernel_4.3_rdtscl_to_rdtsc.patch
%patch -P 3 -p1 -b .kernel_4.7_IEEE80211_BAND_to_NL80211_BAND
%patch -P 4 -p1 -b .gcc_6_fix_indentation_warnings
%patch -P 5 -p1 -b .kernel_4.8_add_cfg80211_scan_info_struct
%patch -P 6 -p1 -b .fix_kernel_warnings
%patch -P 7 -p1 -b .kernel_4.11_remove_last_rx_in_net_device_struct
%patch -P 8 -p1 -b .kernel_4.12_add_cfg80211_roam_info_struct
%patch -P 9 -p1 -b .kernel_4.14_new_kernel_read_function_prototype
%patch -P 10 -p1 -b .kernel_4.15_new_timer
%patch -P 11 -p1 -b .gcc8_fix_bounds_check_warnings
%patch -P 12 -p1 -b .kernel_read_pos_increment_fix
%patch -P 13 -p1 -b .kernel_5.1_get_ds_removed
%patch -P 14 -p1 -b .fix_unsupported_mesh_point
%patch -P 15 -p1 -b .fix_gcc_fallthrough_warning.patch
%patch -P 16 -p1 -b .kernel_5.6_adaptations.patch
%patch -P 17 -p1 -b .kernel_5.9_segment_eq_removed
%patch -P 18 -p1 -b .kernel_5.10_get_set_fs_removed
%patch -P 19 -p1 -b .kernel_5.17_adaptation
%patch -P 20 -p1 -b .kernel_5.18_adaptation
%patch -P 21 -p1 -b .kernel_6.0_adaptation
%patch -P 22 -p1 -b .kernel_6.1_adaptation
%patch -P 23 -p1 -b .kernel_6.5_adaptation
%patch -P 24 -p1 -b .kernel_6.10_adaptation
%patch -P 25 -p1 -b .wpa_supplicant-2.11_adaptation
%patch -P 26 -p1 -b .kernel_6.12_adaptation
### NOTE: These MUST be added to as new EL versions are released.
%if 0%{?rhel} == 9
%define kvl %(echo %{kernel_versions} | cut -d"-" -f1)
%define kvr %(echo %{kernel_versions} | cut -d"-" -f2 | cut -d"." -f1)
### Patching for various point release kernels.
%if "%{kvl}" == "5.14.0"
%if %{kvr} == 70
%endif
%if %{kvr} >= 70
%{__sed} -i 's/ < KERNEL_VERSION(5, 17, 0)/ < KERNEL_VERSION(5, 14, 0)/g' src/wl/sys/wl_iw.h
%{__sed} -i 's/ >= KERNEL_VERSION(5, 17, 0)/ >= KERNEL_VERSION(5, 14, 0)/g' src/wl/sys/wl_linux.c
%endif
%if %{kvr} >= 162
%endif
%if %{kvr} >= 284
%endif
%if %{kvr} >= 362
%{__sed} -i 's/ >= KERNEL_VERSION(6, [01], 0)/ >= KERNEL_VERSION(5, 14, 0)/g' src/wl/sys/wl_cfg80211_hybrid.c
%endif
%if %{kvr} >= 427
%endif
%endif
%endif
popd
for kernel_version in %{?kernel_versions} ; do
cp -a %{name}-%{version}-src _kmod_build_${kernel_version%%___*}
done
%build
for kernel_version in %{?kernel_versions}; do
pushd _kmod_build_${kernel_version%%___*}
make -C ${kernel_version##*___} M=`pwd` modules
popd
done
%install
rm -rf ${RPM_BUILD_ROOT}
for kernel_version in %{?kernel_versions}; do
pushd _kmod_build_${kernel_version%%___*}
mkdir -p ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}${kernel_version%%___*}%{kmodinstdir_postfix}
install -m 0755 *.ko ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}${kernel_version%%___*}%{kmodinstdir_postfix}
popd
done
chmod 0755 $RPM_BUILD_ROOT%{kmodinstdir_prefix}*%{kmodinstdir_postfix}/* || :
%{?akmod_install}
%changelog
%autochangelog