update to 5.3.9.20220319git [release 5.3.9.20220319git-1mamba;Tue Aug 09 2022]

This commit is contained in:
Silvan Calarco 2024-01-05 17:31:28 +01:00
parent 46caf4a6d8
commit 4cf67a1f4a
3 changed files with 154 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# rtl8188eus # rtl8188eus
RealTek RTL8188eus WiFi driver with monitor mode & frame injection support.

View File

@ -0,0 +1,77 @@
From 13cc38399eb44f234a52dde5f94509e54a09c71f Mon Sep 17 00:00:00 2001
From: Victor Golovanenko <drygdryg2014@yandex.com>
Date: Thu, 31 Mar 2022 11:47:19 +0300
Subject: [PATCH] Build support with kernel v5.17: replace PDE_DATA() with
pde_data():
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=359745d78351c6f5442435f81549f0207ece28aa
rename complete_and_exit to kthread_complete_and_exit:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cead18552660702a4a46f58e65188fe5f36e9dfe
use eth_hw_addr_set:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5b6d5affd27486ec9152a66df1741cf67782712a
---
os_dep/linux/os_intfs.c | 8 ++++++++
os_dep/linux/rtw_proc.c | 4 ++++
os_dep/osdep_service.c | 4 ++++
3 files changed, 16 insertions(+)
diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c
index bd7da8b..f006fc8 100644
--- a/os_dep/linux/os_intfs.c
+++ b/os_dep/linux/os_intfs.c
@@ -1199,7 +1199,11 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
}
_rtw_memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+ eth_hw_addr_set(pnetdev, sa->sa_data);
+#else
_rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
+#endif
#if 0
if (rtw_is_hw_init_completed(padapter)) {
@@ -1628,7 +1632,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
/* alloc netdev name */
rtw_init_netdev_name(ndev, name);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+ eth_hw_addr_set(ndev, adapter_mac_addr(adapter));
+#else
_rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
+#endif
#if defined(CONFIG_NET_NS)
dev_net_set(ndev, wiphy_net(adapter_to_wiphy(adapter)));
#endif //defined(CONFIG_NET_NS)
diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c
index 8a0fd3e..8b1a424 100644
--- a/os_dep/linux/rtw_proc.c
+++ b/os_dep/linux/rtw_proc.c
@@ -45,6 +45,10 @@ inline struct proc_dir_entry *get_rtw_drv_proc(void)
#define get_proc_net init_net.proc_net
#endif
+#if(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+#define PDE_DATA(inode) pde_data(inode)
+#endif
+
inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_dir_entry *parent, void *data)
{
struct proc_dir_entry *entry;
diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
index 81b951d..7367bca 100644
--- a/os_dep/osdep_service.c
+++ b/os_dep/osdep_service.c
@@ -1268,8 +1268,12 @@ u32 _rtw_down_sema(_sema *sema)
inline void thread_exit(_completion *comp)
{
#ifdef PLATFORM_LINUX
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+ kthread_complete_and_exit(comp, 0);
+#else
complete_and_exit(comp, 0);
#endif
+#endif
#ifdef PLATFORM_FREEBSD
printf("%s", "RTKTHREAD_exit");

75
rtl8188eus.spec Normal file
View File

@ -0,0 +1,75 @@
%define git_branch %(echo %version | cut -d. -f1-3)
Name: rtl8188eus
Version: 5.3.9.20220319git
Release: 1mamba
Summary: RealTek RTL8188eus WiFi driver with monitor mode & frame injection support
Group: System/Kernel and Hardware/Drivers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/aircrack-ng/rtl8188eus
Source: https://github.com/aircrack-ng/rtl8188eus.git/v%{git_branch}/rtl8188eus-%{version}.tar.bz2
Patch0: rtl8188eus-5.3.9.20220319git-kernel-5.17.patch
License: GPL
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
Requires(post):dkms
%description
RealTek RTL8188eus WiFi driver with monitor mode & frame injection support.
%prep
%setup -q
%patch0 -p1 -b .kernel-5.17
%build
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
# dkms
install -d -m0755 %{buildroot}%{_prefix}/src/%{name}-%{version}
install -D -m644 dkms.conf %{buildroot}%{_prefix}/src/%{name}-%{version}/dkms.conf
for d in core hal include os_dep platform; do
for f in $(find "$d" -type f); do
install -D -m644 $f %{buildroot}%{_prefix}/src/%{name}-%{version}/$f
done
done
install -m644 Makefile %{buildroot}%{_prefix}/src/%{name}-%{version}/Makefile
install -d -m0755 %{buildroot}%{_modprobedir}
cat > %{buildroot}%{_modprobedir}/r8188eu.conf << _EOF
blacklist r8188eu
_EOF
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%preun
dkms remove -q -m %{name} -v %{version} --all --rpm_safe_upgrade
:
%posttrans
if [ $1 -ge 1 ]; then
# clean any legacy alternatives symlink
dkms remove -q -m %{name} -v %{version} --all --rpm_safe_upgrade
dkms add -q -m %{name} -v %{version}
dkms install -q -m %{name} -v %{version}
fi
:
%files
%defattr(-,root,root)
%{_modprobedir}/r8188eu.conf
%dir %{_prefix}/src/%{name}-%{version}
%{_prefix}/src/%{name}-%{version}/*
%doc README.md
%changelog
* Tue Aug 09 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 5.3.9.20220319git-1mamba
- update to 5.3.9.20220319git
* Tue Aug 09 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 0.20220319git-1mamba
- package created using the webbuild interface