rtl8821cu: drop broken package

Doesn't have these usb wireless network cards, but did a simple test
on rtl8852be, it turns out that the rtl driver is completely rubbish
and is no longer usable.
This commit is contained in:
AmadeusGhost 2022-08-14 23:21:06 +08:00
parent 41f59a6c2e
commit 3c6c5fac6c
7 changed files with 0 additions and 306 deletions

View File

@ -1,86 +0,0 @@
#
# Copyright (C) 2021 ImmortalWrt
# <https://immortalwrt.org>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=rtl8821cu
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/brektrou/rtl8821CU.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2022-04-09
PKG_SOURCE_VERSION:=8c2226a74ae718439d56248bd2e44ccf717086d5
PKG_MIRROR_HASH:=3353a3bc4c73652eceaab95809aab27c3ae8bbf7e915b73488361a061ba91b84
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINTER:=CN_SZTL <cnsztl@immortalwrt.org>
PKG_BUILD_PARALLEL:=1
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/rtl8821cu
SUBMENU:=Wireless Drivers
TITLE:=Realtek RTL8811CU/RTL8821CU support
DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT
FILES:=$(PKG_BUILD_DIR)/rtl8821cu.ko
AUTOLOAD:=$(call AutoProbe,rtl8821cu)
PROVIDES:=kmod-rtl8821cu
endef
NOSTDINC_FLAGS = \
-I$(PKG_BUILD_DIR) \
-I$(PKG_BUILD_DIR)/include \
-I$(STAGING_DIR)/usr/include/mac80211-backport \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
-include backport/autoconf.h \
-include backport/backport.h
EXTRA_KCONFIG:= \
CONFIG_RTL8821CU=m \
USER_MODULE_NAME=rtl8821cu
ifeq ($(ARCH),aarch64)
EXTRA_KCONFIG += CONFIG_MP_VHT_HW_TX_MODE=n
endif
EXTRA_CFLAGS:= \
-DRTW_SINGLE_WIPHY \
-DRTW_USE_CFG80211_STA_EVENT \
-DCONFIG_IOCTL_CFG80211 \
-DCONFIG_CONCURRENT_MODE \
-DBUILD_OPENWRT
ifeq ($(ARCH),arm)
EXTRA_CFLAGS += -mfloat-abi=softfp
endif
ifeq ($(BOARD),x86)
EXTRA_CFLAGS += -mhard-float
endif
MAKE_OPTS:= \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
USER_EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
$(EXTRA_KCONFIG)
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
modules
endef
$(eval $(call KernelPackage,rtl8821cu))

View File

@ -1,15 +0,0 @@
Fix compile problem when rtw_byteorder.h and asm/byteorder.h gets
included in addition for example indirectly, do not use realtek own copy
of the byteorder headers.
--- a/include/drv_types.h
+++ b/include/drv_types.h
@@ -25,7 +25,7 @@
#include <drv_conf.h>
#include <basic_types.h>
#include <osdep_service.h>
-#include <rtw_byteorder.h>
+#include <asm/byteorder.h>
#include <wlan_bssdef.h>
#include <wifi.h>
#include <ieee80211.h>

View File

@ -1,39 +0,0 @@
From 9b2b0ec1bc2d31ddf93ed74d63fdfa6044e329a4 Mon Sep 17 00:00:00 2001
From: Ben Greear <greearb@candelatech.com>
Date: Fri, 9 Nov 2018 16:21:43 -0800
Subject: [PATCH] Fix build against openwrt backports tree.
Like breaks builds elsewhere, can fix it up later.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
include/drv_conf.h | 4 +++-
.../{wireless.h => old_unused_rtl_wireless.h} | 0
include/{autoconf.h => rtl_autoconf.h} | 0
3 files changed, 3 insertions(+), 1 deletions(-)
rename include/linux/{wireless.h => old_unused_rtl_wireless.h} (100%)
rename include/{autoconf.h => rtl_autoconf.h} (100%)
diff --git a/include/drv_conf.h b/include/drv_conf.h
index 0d20a7e..f0a9f88 100644
--- a/include/drv_conf.h
+++ b/include/drv_conf.h
@@ -14,7 +14,9 @@
*****************************************************************************/
#ifndef __DRV_CONF_H__
#define __DRV_CONF_H__
-#include "autoconf.h"
+
+#include <generated/autoconf.h>
+#include "rtl_autoconf.h"
#include "hal_ic_cfg.h"
#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
diff --git a/include/linux/wireless.h b/include/linux/old_unused_rtl_wireless.h
similarity index 100%
rename from include/linux/wireless.h
rename to include/linux/old_unused_rtl_wireless.h
diff --git a/include/autoconf.h b/include/rtl_autoconf.h
similarity index 100%
rename from include/autoconf.h
rename to include/rtl_autoconf.h

View File

@ -1,11 +0,0 @@
--- a/os_dep/linux/os_intfs.c
+++ b/os_dep/linux/os_intfs.c
@@ -238,7 +238,7 @@
#endif /* CONFIG_80211N_HT */
#ifdef CONFIG_80211AC_VHT
-int rtw_vht_enable = 1; /* 0:disable, 1:enable, 2:force auto enable */
+int rtw_vht_enable = 2; /* 0:disable, 1:enable, 2:force auto enable */
module_param(rtw_vht_enable, int, 0644);
int rtw_ampdu_factor = 7;

View File

@ -1,58 +0,0 @@
diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
index d9c81c9..3e7e27a 100755
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -7149,7 +7149,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#else
struct net_device *ndev,
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) || defined(BUILD_OPENWRT)
struct mgmt_frame_regs *upd)
#else
u16 frame_type, bool reg)
@@ -7178,7 +7178,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
/* Wait QC Verify */
return;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) || defined(BUILD_OPENWRT)
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, upd->interface_stypes & BIT(IEEE80211_STYPE_PROBE_REQ >> 4));
#else
switch (frame_type) {
@@ -9467,7 +9467,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
#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,8,0)) || defined(BUILD_OPENWRT)
.update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,
#else
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c
index 257c581..f97fa24 100755
--- a/os_dep/linux/os_intfs.c
+++ b/os_dep/linux/os_intfs.c
@@ -1306,6 +1306,14 @@ unsigned int rtw_classify8021d(struct sk_buff *skb)
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
+static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
+ , struct net_device *sb_dev
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0))
+ , select_queue_fallback_t fallback
+ #endif
+)
+#else
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
, void *accel_priv
@@ -1314,6 +1322,7 @@ static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb
#endif
#endif
)
+#endif
{
_adapter *padapter = rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

View File

@ -1,44 +0,0 @@
From af27791efdde55cdec3b4400c9d1a806c0040e38 Mon Sep 17 00:00:00 2001
From: Butterfly <gokhanlnx@gmail.com>
Date: Tue, 12 Apr 2022 00:31:54 +0300
Subject: [PATCH] Buildfix for Linux 5.18
Buildfix for Linux 5.18
Link: https://github.com/brektrou/rtl8821CU/pull/168
---
include/ieee80211.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -1529,18 +1529,30 @@ enum ieee80211_state {
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0))
+static inline int is_multicast_mac_addr(const u8 *addr)
+#else
extern __inline int is_multicast_mac_addr(const u8 *addr)
+#endif
{
return (addr[0] != 0xff) && (0x01 & addr[0]);
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0))
+static inline int is_broadcast_mac_addr(const u8 *addr)
+#else
extern __inline int is_broadcast_mac_addr(const u8 *addr)
+#endif
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0))
+static inline int is_zero_mac_addr(const u8 *addr)
+#else
extern __inline int is_zero_mac_addr(const u8 *addr)
+#endif
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));

View File

@ -1,53 +0,0 @@
From 7e24201ebdcdbe2d34f5cdfe4065928b381b8d04 Mon Sep 17 00:00:00 2001
From: Butterfly <gokhanlnx@gmail.com>
Date: Tue, 12 Apr 2022 00:05:41 +0300
Subject: [PATCH 1/2] osdep_service.c: fix warning _rtw_memcpy
osdep_service.c: fix warning _rtw_memcpy
---
os_dep/osdep_service.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
index d4a01c8..6a2d3ac 100644
--- a/os_dep/osdep_service.c
+++ b/os_dep/osdep_service.c
@@ -2491,7 +2491,11 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
rtw_init_netdev_name(pnetdev, ifname);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
_rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
+#else
+ dev_addr_set(pnetdev, adapter_mac_addr(padapter));
+#endif
if (rtnl_lock_needed)
ret = register_netdev(pnetdev);
From 924f57d1cce2843aa28d557b74baf00a6482caa8 Mon Sep 17 00:00:00 2001
From: Butterfly <gokhanlnx@gmail.com>
Date: Tue, 12 Apr 2022 00:08:52 +0300
Subject: [PATCH 2/2] ioctl_linux.c: fix warning _rtw_memcpy
ioctl_linux.c: fix warning _rtw_memcpy
---
os_dep/linux/ioctl_linux.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c
index 20dd583..a0d32ee 100644
--- a/os_dep/linux/ioctl_linux.c
+++ b/os_dep/linux/ioctl_linux.c
@@ -9778,7 +9778,11 @@ static int rtw_mp_efuse_set(struct net_device *dev,
rtw_hal_read_chip_info(padapter);
/* set mac addr*/
rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter));
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
_rtw_memcpy(padapter->pnetdev->dev_addr, get_hal_mac_addr(padapter), ETH_ALEN); /* set mac addr to net_device */
+#else
+ dev_addr_set(padapter->pnetdev, get_hal_mac_addr(padapter)); /* set mac addr to net_device */
+#endif
#ifdef CONFIG_P2P
rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter));