commit 80fdda20960f4374db6229649ffb941b4a30d2aff21dca360289bd3e4d141941 Author: Michal Suchanek Date: Wed Oct 20 18:01:00 2021 +0000 Accepting request 924513 from home:MasterPatricko:branches:hardware New package of rtl88x2bu for Realtek USB devices, from https://github.com/cilynx/rtl88x2bu OBS-URL: https://build.opensuse.org/request/show/924513 OBS-URL: https://build.opensuse.org/package/show/hardware/rtl88x2bu?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..e5f86c8 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + git + https://github.com/cilynx/rtl88x2bu.git + rtl88x2bu + 5.8.7.1+git%cd.%h + 5.8.7.1_35809.20191129_COEX20191120-7777 + + + + + xz + *.tar + + diff --git a/fix-backported-update_mgmt_frame_registrations.patch b/fix-backported-update_mgmt_frame_registrations.patch new file mode 100644 index 0000000..a23d46f --- /dev/null +++ b/fix-backported-update_mgmt_frame_registrations.patch @@ -0,0 +1,56 @@ +From: Antonio Larrosa +Subject: Fix build with SLE 15-SP3 / Leap 15.3 + +The SLE 15 SP3/Leap 15.3's kernel includes +backported patches to support update_mgmt_frame_registrations +instead of mgmt_frame_register which would be expected +according to the kernel version, so we force to use the +more modern interface. + +--- os_dep/linux/ioctl_cfg80211.c.orig ++++ os_dep/linux/ioctl_cfg80211.c +@@ -7771,7 +7771,7 @@ exit: + return ret; + } + +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 18)) + + static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) +@@ -7787,7 +7787,7 @@ static void cfg80211_rtw_update_mgmt_fra + struct mgmt_frame_regs *upd) + #endif + { +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 18)) + u32 rtw_mask = BIT(IEEE80211_STYPE_PROBE_REQ >> 4); + #endif + +@@ -7805,7 +7805,7 @@ static void cfg80211_rtw_update_mgmt_fra + pwdev_priv = adapter_wdev_data(adapter); + + #ifdef CONFIG_DEBUG_CFG80211 +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 18)) + RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter), + frame_type, reg); + #else +@@ -7817,7 +7817,7 @@ static void cfg80211_rtw_update_mgmt_fra + /* Wait QC Verify */ + return; + +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 18)) + switch (frame_type) { + case IEEE80211_STYPE_AUTH: /* 0x00B0 */ + if (reg > 0) +@@ -10230,7 +10230,7 @@ static struct cfg80211_ops rtw_cfg80211_ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + .mgmt_tx = cfg80211_rtw_mgmt_tx, + +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 18)) + .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, + #else + .update_mgmt_frame_registrations = diff --git a/rtl88x2bu-5.8.7.1+git20210928.f2bccb9.obscpio b/rtl88x2bu-5.8.7.1+git20210928.f2bccb9.obscpio new file mode 100644 index 0000000..ad63ade --- /dev/null +++ b/rtl88x2bu-5.8.7.1+git20210928.f2bccb9.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f939a7d75069e2f3a27b511a58f6a3fd62146712c94e222b1bbc017f80f90c40 +size 27613197 diff --git a/rtl88x2bu-5.8.7.1+git20210928.f2bccb9.tar.xz b/rtl88x2bu-5.8.7.1+git20210928.f2bccb9.tar.xz new file mode 100644 index 0000000..260f410 --- /dev/null +++ b/rtl88x2bu-5.8.7.1+git20210928.f2bccb9.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc523391910d9b89a36b6393ba755943d02ff9e87d1b3e9b46fdacd88d62e598 +size 2392372 diff --git a/rtl88x2bu-preamble b/rtl88x2bu-preamble new file mode 100644 index 0000000..bb3f1e0 --- /dev/null +++ b/rtl88x2bu-preamble @@ -0,0 +1,2 @@ +Requires: kernel-%1 +Enhances: kernel-%1 diff --git a/rtl88x2bu.changes b/rtl88x2bu.changes new file mode 100644 index 0000000..dadb16b --- /dev/null +++ b/rtl88x2bu.changes @@ -0,0 +1,9 @@ +------------------------------------------------------------------- +Mon Oct 4 00:39:57 UTC 2021 - Tejas Guruswamy + +- Add fix-backported-update_mgmt_frame_registrations.patch for build on 15.3 kernel + +------------------------------------------------------------------- +Mon Oct 4 00:11:41 UTC 2021 - Tejas Guruswamy + +- Initial package from https://github.com/cilynx/rtl88x2bu diff --git a/rtl88x2bu.obsinfo b/rtl88x2bu.obsinfo new file mode 100644 index 0000000..31606f8 --- /dev/null +++ b/rtl88x2bu.obsinfo @@ -0,0 +1,5 @@ +name: rtl88x2bu +version: 5.8.7.1+git20210928.f2bccb9 +mtime: 1632829912 +commit: f2bccb96ac8e54b63ef35a3c873075f21fb95030 + diff --git a/rtl88x2bu.spec b/rtl88x2bu.spec new file mode 100644 index 0000000..56e2dbb --- /dev/null +++ b/rtl88x2bu.spec @@ -0,0 +1,107 @@ +# +# spec file for package rtl88x2bu +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: rtl88x2bu +Version: 5.8.7.1+git20210928.f2bccb9 +Release: 0 +Summary: Kernel driver for Realtek 88x2bu wifi cards +License: GPL-2.0-only +Group: System/Kernel +URL: https://github.com/cilynx/rtl88x2bu +ExcludeArch: s390x +Source0: %{name}-%{version}.tar.xz +Source1: %{name}-preamble +# PATCH-FIX-OPENSUSE rtl88x2bu_nodate_time.patch +Patch0: rtl88x2bu_nodate_time.patch +# PATCH-FIX-OPENSUSE fix-backported-update_mgmt_frame_registrations.patch +Patch1: fix-backported-update_mgmt_frame_registrations.patch +BuildRequires: %{kernel_module_package_buildreqs} +BuildRequires: kernel-syms +BuildRequires: module-init-tools + +%description +Kernel driver for Realtek 88x2bu wifi cards + +The sources were obtained from https://github.com/cilynx/rtl88x2bu, which adapts the official driver +released by Realtek to build on recent kernels. + +%package KMP +Summary: Kernel driver for Realtek rtl88x2bu wifi cards +Group: System/Kernel + +%description KMP +Kernel driver for Realtek 88x2bu wifi cards + +The sources were obtained from https://github.com/cilynx/rtl88x2bu, which adapts the official driver +released by Realtek to build on recent kernels. + +%kernel_module_package -p %{name}-preamble + +%prep +%setup -q +sed -i '/EXTRA_CFLAGS += -O2/d' Makefile +sed -i '/EXTRA_LDFLAGS += --strip-debug/d' Makefile +%patch0 -p0 +%if 0%{?sle_version} == 150300 +%patch1 -p0 +%endif + +set -- * +mkdir source +mv "$@" source/ +mkdir obj + +%build +%ifarch %{arm} +export ARCH=arm +%endif +%ifarch aarch64 +export ARCH=arm64 +%endif +%ifarch %{ppc} ppc64 ppc64le +export ARCH=powerpc +%endif +%ifarch riscv64 +export ARCH=riscv +%endif + +for flavor in %{flavors_to_build} ; do + rm -rf obj/$flavor + cp -a source obj/$flavor + pushd obj/$flavor + sed -i -e "s,^KSRC := /lib/modules/\$(KVER)/build$,KSRC := %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor," Makefile + %make_build + popd +done + +%install +export INSTALL_MOD_PATH=%{buildroot} +export INSTALL_MOD_DIR=%{kernel_module_package_moddir} +kernel_version=`uname -r | sed -e "s/-[^-]*$//"` +echo ${kernel_version} +for flavor in %{flavors_to_build} ; do + pushd obj/$flavor + install -d %{buildroot}/lib/modules/${kernel_version}-${flavor}/${INSTALL_MOD_DIR}/ + install -p -m 644 88x2bu.ko %{buildroot}/lib/modules/${kernel_version}-${flavor}/${INSTALL_MOD_DIR}/ + popd +done + +%files +%license source/LICENSE + +%changelog diff --git a/rtl88x2bu_nodate_time.patch b/rtl88x2bu_nodate_time.patch new file mode 100644 index 0000000..779710f --- /dev/null +++ b/rtl88x2bu_nodate_time.patch @@ -0,0 +1,11 @@ +--- core/rtw_debug.c.orig ++++ core/rtw_debug.c +@@ -42,7 +42,7 @@ const char *rtw_log_level_str[] = { + void dump_drv_version(void *sel) + { + RTW_PRINT_SEL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION); +- RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__); ++// RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__); + } + + void dump_drv_cfg(void *sel)