perf 5.10.3

This commit is contained in:
Idris Kalp
2020-12-27 20:48:11 +03:00
parent 6071c4a202
commit 2faef952db
55 changed files with 1838933 additions and 6 deletions
@@ -0,0 +1,53 @@
Include 3rdparty directory into the main build-system.
Original author is unknown.
(Was either Juan Quintela or Jeff Garzik)
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
[Simplified for Mageia 7 / kernel 5.1.6 and up / tmb]
Signed-off-by: Thomas Backlund <tmb@mageia.org>
---
Makefile | 2 +-
arch/arm/Kconfig | 2 ++
arch/arm64/Kconfig | 2 ++
arch/x86/Kconfig | 2 ++
4 files changed, 7 insertions(+), 1 deletion(-)
--- linux-5.8/arch/arm64/Kconfig.orig 2020-08-05 16:08:02.466740952 +0200
+++ linux-5.8/arch/arm64/Kconfig 2020-08-05 16:08:13.368741815 +0200
@@ -1910,3 +1910,5 @@ source "arch/arm64/kvm/Kconfig"
if CRYPTO
source "arch/arm64/crypto/Kconfig"
endif
+
+source "3rdparty/Kconfig"
--- linux-5.8/Makefile.orig 2020-08-05 16:09:32.265748061 +0200
+++ linux-5.8/Makefile 2020-08-05 16:10:02.553750458 +0200
@@ -651,7 +651,7 @@ endif
ifeq ($(KBUILD_EXTMOD),)
# Objects we will link into vmlinux / subdirs we need to visit
core-y := init/ usr/
-drivers-y := drivers/ sound/
+drivers-y := drivers/ sound/ 3rdparty/
drivers-$(CONFIG_SAMPLES) += samples/
drivers-y += net/ virt/
libs-y := lib/
--- linux-5.8/arch/x86/Kconfig.orig 2020-08-05 16:10:48.805754119 +0200
+++ linux-5.8/arch/x86/Kconfig 2020-08-05 16:11:04.602755370 +0200
@@ -2913,3 +2913,5 @@ source "drivers/firmware/Kconfig"
source "arch/x86/kvm/Kconfig"
source "arch/x86/Kconfig.assembler"
+
+source "3rdparty/Kconfig"
--- linux-5.8/arch/arm/Kconfig.orig 2020-08-05 16:12:08.314760413 +0200
+++ linux-5.8/arch/arm/Kconfig 2020-08-05 16:12:22.786761559 +0200
@@ -2064,3 +2064,5 @@ source "arch/arm/crypto/Kconfig"
endif
source "arch/arm/Kconfig.assembler"
+
+source "3rdparty/Kconfig"
@@ -0,0 +1,21 @@
3rdparty/Kconfig | 5 +++++
3rdparty/Makefile | 3 +++
2 files changed, 8 insertions(+)
diff -Nurp linux-5.1.6/3rdparty/Kconfig linux-5.1.6-3rd/3rdparty/Kconfig
--- linux-5.1.6/3rdparty/Kconfig 1970-01-01 02:00:00.000000000 +0200
+++ linux-5.1.6-3rd/3rdparty/Kconfig 2019-05-31 23:02:53.380127780 +0300
@@ -0,0 +1,5 @@
+#
+
+menu "External 3rdparty kernel additions"
+
+endmenu
diff -Nurp linux-5.1.6/3rdparty/Makefile linux-5.1.6-3rd/3rdparty/Makefile
--- linux-5.1.6/3rdparty/Makefile 1970-01-01 02:00:00.000000000 +0200
+++ linux-5.1.6-3rd/3rdparty/Makefile 2019-05-31 23:03:58.338529850 +0300
@@ -0,0 +1,3 @@
+#
+
+obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
@@ -0,0 +1,45 @@
diff -up ./3rdparty/rtl8723de/Kconfig.tv ./3rdparty/rtl8723de/Kconfig
--- ./3rdparty/rtl8723de/Kconfig.tv 2020-10-13 21:02:42.452125426 +0200
+++ ./3rdparty/rtl8723de/Kconfig 2020-10-13 20:59:14.012371730 +0200
@@ -1,6 +1,6 @@
config RTL8723DE
tristate "Realtek 8723DE PCI WiFi"
depends on PCI
- ---help---
+ help
Help message of RTL8723DE
diff -up ./3rdparty/rtl8812au/Kconfig.tv ./3rdparty/rtl8812au/Kconfig
--- ./3rdparty/rtl8812au/Kconfig.tv 2020-10-13 21:02:36.391016614 +0200
+++ ./3rdparty/rtl8812au/Kconfig 2020-10-13 20:59:07.421226249 +0200
@@ -1,6 +1,6 @@
config RTL8812AU
tristate "Realtek 8812au USB WiFi"
depends on USB
- ---help---
+ help
Help message of 8812au
diff -up ./3rdparty/rtl8821ce/Kconfig.tv ./3rdparty/rtl8821ce/Kconfig
--- ./3rdparty/rtl8821ce/Kconfig.tv 2020-10-13 16:09:11.157856145 +0200
+++ ./3rdparty/rtl8821ce/Kconfig 2020-10-13 20:58:17.242118685 +0200
@@ -1,6 +1,6 @@
config RTL8821CE
tristate "Realtek 8821C PCI WiFi"
depends on PCI
- ---help---
+ help
Help message of RTL8821CE
diff -up ./3rdparty/viahss/Kconfig.tv ./3rdparty/viahss/Kconfig
--- ./3rdparty/viahss/Kconfig.tv 2020-10-13 21:02:44.844168369 +0200
+++ ./3rdparty/viahss/Kconfig 2020-10-13 20:59:19.875488718 +0200
@@ -1,7 +1,7 @@
config VIAHSS
tristate "VIA High Speed Serial"
depends on SERIAL_CORE && m
- ---help---
+ help
VIA High Speed Serial is a little kernel module (1 KB) which enables
high speed serial port modes of VIA VT82C686A or VT82C686B
southbridge-equipped motherboards. With this module, you can use the
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
--- linux-2.6.24.orig/3rdparty/ndiswrapper/Kconfig 1969-12-31 21:00:00.000000000 -0300
+++ linux-2.6.24/3rdparty/ndiswrapper/Kconfig 2007-11-26 15:11:31.000000000 -0200
@@ -0,0 +1,4 @@
+
+config NDISWRAPPER
+ tristate "NDIS driver wrapper support"
+ depends on PCI && USB && !X86_64_XEN
@@ -0,0 +1,45 @@
--- linux-3.12.2-ndiswrapper-1.59/3rdparty/ndiswrapper/Makefile.orig 2013-11-28 21:42:10.000000000 +0200
+++ linux-3.12.2-ndiswrapper-1.59/3rdparty/ndiswrapper/Makefile 2013-11-30 21:41:19.550504380 +0200
@@ -9,24 +9,10 @@ DISTFILES = \
winnt_types.h workqueue.c wrapmem.c wrapmem.h wrapndis.c wrapndis.h \
wrapper.c wrapper.h
-# By default, we try to compile the modules for the currently running
-# kernel. But it's the first approximation, as we will re-read the
-# version from the kernel sources.
-KVERS_UNAME ?= $(shell uname -r)
-
# KBUILD is the path to the Linux kernel build tree. It is usually the
# same as the kernel source tree, except when the kernel was compiled in
# a separate directory.
-KBUILD ?= $(shell readlink -f /lib/modules/$(KVERS_UNAME)/build)
-
-ifeq (,$(KBUILD))
-$(error Kernel build tree not found - please set KBUILD to configured kernel)
-endif
-
-KCONFIG := $(KBUILD)/.config
-ifeq (,$(wildcard $(KCONFIG)))
-$(error No .config found in $(KBUILD), please set KBUILD to configured kernel)
-endif
+KBUILD ?= $(srctree)
ifneq (,$(wildcard $(KBUILD)/include/linux/version.h))
ifneq (,$(wildcard $(KBUILD)/include/generated/uapi/linux/version.h))
@@ -43,16 +29,9 @@ endif
ifeq (,$(wildcard $(VERSION_H)))
VERSION_H := $(KBUILD)/include/linux/version.h
endif
-ifeq (,$(wildcard $(VERSION_H)))
-$(error Please run 'make modules_prepare' in $(KBUILD))
-endif
KVERS := $(shell sed -ne 's/"//g;s/^\#define UTS_RELEASE //p' $(VERSION_H))
-ifeq (,$(KVERS))
-$(error Cannot find UTS_RELEASE in $(VERSION_H), please report)
-endif
-
INST_DIR = /lib/modules/$(KVERS)/misc
SRC_DIR=$(shell pwd)
@@ -0,0 +1,16 @@
--- linux/3rdparty/Kconfig.orig 2019-05-31 23:02:53.380127780 +0300
+++ linux/3rdparty/Kconfig 2019-05-31 23:26:48.844304457 +0300
@@ -2,4 +2,6 @@
menu "External 3rdparty kernel additions"
+source "3rdparty/ndiswrapper/Kconfig"
+
endmenu
--- linux/3rdparty/Makefile.orig 2019-05-31 23:03:58.338529850 +0300
+++ linux/3rdparty/Makefile 2019-05-31 23:27:35.405319287 +0300
@@ -1,3 +1,4 @@
#
obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
+obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
@@ -0,0 +1,244 @@
diff -urp linux-5.6.3/3rdparty/rtl8723de.orig/os_dep/linux/rtw_proc.c linux-5.6.3/3rdparty/rtl8723de/os_dep/linux/rtw_proc.c
--- linux-5.6.3/3rdparty/rtl8723de.orig/os_dep/linux/rtw_proc.c 2020-04-10 17:12:12.495541693 +0300
+++ linux-5.6.3/3rdparty/rtl8723de/os_dep/linux/rtw_proc.c 2020-04-10 17:22:51.328340275 +0300
@@ -68,12 +68,19 @@ inline struct proc_dir_entry *rtw_proc_c
return entry;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
+ const struct proc_ops *pops, void * data)
+#else
inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
const struct file_operations *fops, void * data)
+#endif
{
struct proc_dir_entry *entry;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+ entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, pops, data);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, fops, data);
#else
entry = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUGO, parent);
@@ -219,7 +226,24 @@ static ssize_t rtw_drv_proc_write(struct
return -EROFS;
}
-static const struct file_operations rtw_drv_proc_seq_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops rtw_drv_proc_seq_ops = {
+ .proc_open = rtw_drv_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_drv_proc_write,
+};
+
+static const struct proc_ops rtw_drv_proc_sseq_ops = {
+ .proc_open = rtw_drv_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_drv_proc_write,
+};
+#else
+static const struct file_operations rtw_drv_proc_seq_ops = {
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
.read = seq_read,
@@ -228,7 +252,7 @@ static const struct file_operations rtw_
.write = rtw_drv_proc_write,
};
-static const struct file_operations rtw_drv_proc_sseq_fops = {
+static const struct file_operations rtw_drv_proc_sseq_ops = {
.owner = THIS_MODULE,
.open = rtw_drv_proc_open,
.read = seq_read,
@@ -236,6 +260,7 @@ static const struct file_operations rtw_
.release = single_release,
.write = rtw_drv_proc_write,
};
+#endif
int rtw_drv_proc_init(void)
{
@@ -257,9 +282,9 @@ int rtw_drv_proc_init(void)
for (i = 0; i < drv_proc_hdls_num; i++) {
if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
- entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_fops, (void *)i);
+ entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_ops, (void *)i);
else if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
- entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_fops, (void *)i);
+ entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_ops, (void *)i);
else
entry = NULL;
@@ -2335,7 +2360,24 @@ static ssize_t rtw_adapter_proc_write(st
return -EROFS;
}
-static const struct file_operations rtw_adapter_proc_seq_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops rtw_adapter_proc_seq_ops = {
+ .proc_open = rtw_adapter_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_adapter_proc_write,
+};
+
+static const struct proc_ops rtw_adapter_proc_sseq_ops = {
+ .proc_open = rtw_adapter_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_adapter_proc_write,
+};
+#else
+static const struct file_operations rtw_adapter_proc_seq_ops = {
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
.read = seq_read,
@@ -2344,7 +2386,7 @@ static const struct file_operations rtw_
.write = rtw_adapter_proc_write,
};
-static const struct file_operations rtw_adapter_proc_sseq_fops = {
+static const struct file_operations rtw_adapter_proc_sseq_ops = {
.owner = THIS_MODULE,
.open = rtw_adapter_proc_open,
.read = seq_read,
@@ -2352,6 +2394,7 @@ static const struct file_operations rtw_
.release = single_release,
.write = rtw_adapter_proc_write,
};
+#endif
int proc_get_odm_dbg_comp(struct seq_file *m, void *v)
{
@@ -2670,7 +2713,24 @@ static ssize_t rtw_odm_proc_write(struct
return -EROFS;
}
-static const struct file_operations rtw_odm_proc_seq_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops rtw_odm_proc_seq_ops = {
+ .proc_open = rtw_odm_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_odm_proc_write,
+};
+
+static const struct proc_ops rtw_odm_proc_sseq_ops = {
+ .proc_open = rtw_odm_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_odm_proc_write,
+};
+#else
+static const struct file_operations rtw_odm_proc_seq_ops = {
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
.read = seq_read,
@@ -2679,7 +2739,7 @@ static const struct file_operations rtw_
.write = rtw_odm_proc_write,
};
-static const struct file_operations rtw_odm_proc_sseq_fops = {
+static const struct file_operations rtw_odm_proc_sseq_ops = {
.owner = THIS_MODULE,
.open = rtw_odm_proc_open,
.read = seq_read,
@@ -2687,6 +2747,7 @@ static const struct file_operations rtw_
.release = single_release,
.write = rtw_odm_proc_write,
};
+#endif
struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
{
@@ -2715,9 +2776,9 @@ struct proc_dir_entry *rtw_odm_proc_init
for (i = 0; i < odm_proc_hdls_num; i++) {
if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
- entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_fops, (void *)i);
+ entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_ops, (void *)i);
else if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
- entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_fops, (void *)i);
+ entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_ops, (void *)i);
else
entry = NULL;
@@ -2809,7 +2870,24 @@ static ssize_t rtw_mcc_proc_write(struct
return -EROFS;
}
-static const struct file_operations rtw_mcc_proc_seq_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops rtw_mcc_proc_seq_ops = {
+ .proc_open = rtw_mcc_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+ .proc_write = rtw_mcc_proc_write,
+};
+
+static const struct file_operations rtw_mcc_proc_sseq_ops = {
+ .proc_open = rtw_mcc_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+ .proc_write = rtw_mcc_proc_write,
+};
+#else
+static const struct file_operations rtw_mcc_proc_seq_ops = {
.owner = THIS_MODULE,
.open = rtw_mcc_proc_open,
.read = seq_read,
@@ -2818,7 +2896,7 @@ static const struct file_operations rtw_
.write = rtw_mcc_proc_write,
};
-static const struct file_operations rtw_mcc_proc_sseq_fops = {
+static const struct file_operations rtw_mcc_proc_sseq_ops = {
.owner = THIS_MODULE,
.open = rtw_mcc_proc_open,
.read = seq_read,
@@ -2826,6 +2904,7 @@ static const struct file_operations rtw_
.release = single_release,
.write = rtw_mcc_proc_write,
};
+#endif
struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
{
@@ -2854,9 +2933,9 @@ struct proc_dir_entry *rtw_mcc_proc_init
for (i = 0; i < mcc_proc_hdls_num; i++) {
if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
- entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_fops, (void *)i);
+ entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_ops, (void *)i);
else if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
- entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_fops, (void *)i);
+ entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_ops, (void *)i);
else
entry = NULL;
@@ -2920,9 +2999,9 @@ struct proc_dir_entry *rtw_adapter_proc_
for (i = 0; i < adapter_proc_hdls_num; i++) {
if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
- entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_fops, (void *)i);
+ entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_ops, (void *)i);
else if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
- entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_fops, (void *)i);
+ entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_ops, (void *)i);
else
entry = NULL;
@@ -0,0 +1,16 @@
--- linux/3rdparty/Kconfig.orig 2019-05-31 23:30:41.568375751 +0300
+++ linux/3rdparty/Kconfig 2019-05-31 23:33:39.796256889 +0300
@@ -4,5 +4,6 @@ menu "External 3rdparty kernel additions"
source "3rdparty/ndiswrapper/Kconfig"
source "3rdparty/rtl8812au/Kconfig"
+source "3rdparty/rtl8723de/Kconfig"
endmenu
--- linux/3rdparty/Makefile.orig 2019-05-31 23:33:17.610773901 +0300
+++ linux/3rdparty/Makefile 2019-05-31 23:33:57.608644657 +0300
@@ -3,3 +3,4 @@
obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
obj-$(CONFIG_RTL8812AU) += rtl8812au/
+obj-$(CONFIG_RTL8723DE) += rtl8723de/
@@ -0,0 +1,79 @@
--- linux-5.8/3rdparty/rtl8723de/core/rtw_security.c
+++ linux-5.8/3rdparty/rtl8723de/core/rtw_security.c
@@ -33,6 +33,14 @@ static const char *_security_type_str[] = {
"BIP",
};
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+struct sha256_state {
+ u64 length;
+ u32 state[8], curlen;
+ u8 buf[64];
+};
+#endif
+
const char *security_type_str(u8 value)
{
#ifdef CONFIG_IEEE80211W
--- linux-5.8/3rdparty/rtl8723de/include/rtw_security.h
+++ linux-5.8/3rdparty/rtl8723de/include/rtw_security.h
@@ -246,11 +246,13 @@ struct security_priv {
#endif /* DBG_SW_SEC_CNT */
};
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
struct sha256_state {
u64 length;
u32 state[8], curlen;
u8 buf[64];
};
+#endif
#define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
do {\
--- linux-5.8/3rdparty/rtl8723de/os_dep/linux/ioctl_cfg80211.c
+++ linux-5.8/3rdparty/rtl8723de/os_dep/linux/ioctl_cfg80211.c
@@ -5857,10 +5857,18 @@ 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))
+ struct mgmt_frame_regs *upd)
+#else
u16 frame_type, bool reg)
+#endif
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *ndev = wdev_to_ndev(wdev);
+#endif
+/* hardcoded always true, to make it pass compilation */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ bool reg = true;
#endif
_adapter *adapter;
@@ -5880,7 +5888,11 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
/* Wait QC Verify */
return;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ switch (upd->interface_stypes) {
+#else
switch (frame_type) {
+#endif
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
break;
@@ -6846,7 +6858,11 @@ 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,
- .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,
+#else
+ .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
+#endif
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
.action = cfg80211_rtw_mgmt_tx,
#endif
@@ -0,0 +1,13 @@
--- linux/3rdparty/rtl8723de/include/wifi.h.orig 2019-01-19 16:29:26.302342688 +0200
+++ linux/3rdparty/rtl8723de/include/wifi.h 2019-01-19 16:32:25.543905828 +0200
@@ -1003,8 +1003,9 @@ typedef enum _HT_CAP_AMPDU_DENSITY {
* According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
*/
#define IEEE80211_MIN_AMPDU_BUF 0x8
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0))
#define IEEE80211_MAX_AMPDU_BUF 0x40
-
+#endif
/* Spatial Multiplexing Power Save Modes */
#define WLAN_HT_CAP_SM_PS_STATIC 0
@@ -0,0 +1,11 @@
--- ./3rdparty/rtl8723de/Makefile.orig 2019-10-08 13:51:56.729205790 +0300
+++ ./3rdparty/rtl8723de/Makefile 2019-10-08 14:03:32.894164296 +0300
@@ -74,7 +74,7 @@ CONFIG_APPEND_VENDOR_IE_ENABLE = n
CONFIG_RTW_NAPI = y
CONFIG_RTW_GRO = y
########################## Debug ###########################
-CONFIG_RTW_DEBUG = y
+CONFIG_RTW_DEBUG = n
# default log level is _DRV_INFO_ = 4,
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
CONFIG_RTW_LOG_LEVEL = 4
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,16 @@
--- linux/3rdparty/Kconfig.orig 2019-05-31 23:26:48.844304457 +0300
+++ linux/3rdparty/Kconfig 2019-05-31 23:30:41.568375751 +0300
@@ -3,5 +3,6 @@
menu "External 3rdparty kernel additions"
source "3rdparty/ndiswrapper/Kconfig"
+source "3rdparty/rtl8812au/Kconfig"
endmenu
--- linux/3rdparty/Makefile.orig 2019-05-31 23:27:35.405319287 +0300
+++ linux/3rdparty/Makefile 2019-05-31 23:30:56.855708733 +0300
@@ -2,3 +2,4 @@
obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
+obj-$(CONFIG_RTL8812AU) += rtl8812au/
@@ -0,0 +1,281 @@
From ee9619ba0c8840db6d59d11989c31e24a8f0d806 Mon Sep 17 00:00:00 2001
From: Carlos <CGarces@users.noreply.github.com>
Date: Sun, 8 Nov 2020 12:25:43 +0000
Subject: [PATCH] Fix kernel 5.10-rc1
---
3rdparty/rtl8812au/core/rtw_btcoex.c | 7 ++++++-
3rdparty/rtl8812au/core/rtw_wlan_util.c | 10 ++++++----
3rdparty/rtl8812au/os_dep/linux/os_intfs.c | 19 +++++++++++++-----
3rdparty/rtl8812au/os_dep/osdep_service.c | 43 +++++++++++++++++++++++++++--------------
4 files changed, 54 insertions(+), 25 deletions(-)
diff --git a/3rdparty/rtl8812au/core/rtw_btcoex.c b/3rdparty/rtl8812au/core/rtw_btcoex.c
index d5b89bdc..f5e0f567 100644
--- a/3rdparty/rtl8812au/core/rtw_btcoex.c
+++ b/3rdparty/rtl8812au/core/rtw_btcoex.c
@@ -1443,7 +1443,9 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool for
{
u8 error;
struct msghdr udpmsg;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
struct iovec iov;
struct bt_coex_info *pcoex_info = &padapter->coex_info;
@@ -1473,15 +1475,18 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool for
udpmsg.msg_control = NULL;
udpmsg.msg_controllen = 0;
udpmsg.msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL;
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
-
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg);
#else
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg, msg_size);
#endif
+#ifdef set_fs
set_fs(oldfs);
+#endif
if (error < 0) {
RTW_INFO("Error when sendimg msg, error:%d\n", error);
return _FAIL;
diff --git a/3rdparty/rtl8812au/core/rtw_wlan_util.c b/3rdparty/rtl8812au/core/rtw_wlan_util.c
index b4cecd11..e465e9b5 100644
--- a/3rdparty/rtl8812au/core/rtw_wlan_util.c
+++ b/3rdparty/rtl8812au/core/rtw_wlan_util.c
@@ -4744,7 +4744,9 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t *ssid,
int i = 0;
struct file *fp;
+#ifdef set_fs
mm_segment_t fs;
+#endif
loff_t pos = 0;
u8 *source = NULL;
long len = 0;
@@ -4780,10 +4782,10 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t *ssid,
RTW_INFO("Error, cipher array using default value.\n");
return 0;
}
-
+#ifdef set_fs
fs = get_fs();
set_fs(KERNEL_DS);
-
+#endif
source = rtw_zmalloc(2048);
if (source != NULL) {
@@ -4791,10 +4793,10 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t *ssid,
rtw_parse_cipher_list(nlo_info, source);
rtw_mfree(source, 2048);
}
-
+#ifdef set_fs
set_fs(fs);
filp_close(fp, NULL);
-
+#endif
RTW_INFO("-%s-\n", __func__);
return 0;
}
diff --git a/3rdparty/rtl8812au/os_dep/linux/os_intfs.c b/3rdparty/rtl8812au/os_dep/linux/os_intfs.c
index 1085d6cd..a37e488b 100644
--- a/3rdparty/rtl8812au/os_dep/linux/os_intfs.c
+++ b/3rdparty/rtl8812au/os_dep/linux/os_intfs.c
@@ -4029,7 +4029,9 @@ static int route_dump(u32 *gw_addr , int *gw_index)
struct msghdr msg;
struct iovec iov;
struct sockaddr_nl nladdr;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
char *pg;
int size = 0;
@@ -4067,16 +4069,18 @@ static int route_dump(u32 *gw_addr , int *gw_index)
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
-
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
err = sock_sendmsg(sock, &msg);
#else
err = sock_sendmsg(sock, &msg, sizeof(req));
#endif
+#ifdef set_fs
set_fs(oldfs);
-
+#endif
if (err < 0)
goto out_sock;
@@ -4099,16 +4103,18 @@ static int route_dump(u32 *gw_addr , int *gw_index)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
iov_iter_init(&msg.msg_iter, READ, &iov, 1, PAGE_SIZE);
#endif
-
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
err = sock_recvmsg(sock, &msg, MSG_DONTWAIT);
#else
err = sock_recvmsg(sock, &msg, PAGE_SIZE, MSG_DONTWAIT);
#endif
+#ifdef set_fs
set_fs(oldfs);
-
+#endif
if (err < 0)
goto out_sock_pg;
@@ -4178,15 +4184,18 @@ static int route_dump(u32 *gw_addr , int *gw_index)
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
+#ifdef set_fs
oldfs = get_fs();
set_fs(KERNEL_DS);
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
err = sock_sendmsg(sock, &msg);
#else
err = sock_sendmsg(sock, &msg, sizeof(req));
#endif
+#ifdef set_fs
set_fs(oldfs);
-
+#endif
if (err > 0)
goto restart;
}
diff --git a/3rdparty/rtl8812au/os_dep/osdep_service.c b/3rdparty/rtl8812au/os_dep/osdep_service.c
index 7c6d1208..0769b49d 100644
--- a/3rdparty/rtl8812au/os_dep/osdep_service.c
+++ b/3rdparty/rtl8812au/os_dep/osdep_service.c
@@ -2164,11 +2164,21 @@ static int writeFile(struct file *fp, char *buf, int len)
{
int wlen = 0, sum = 0;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
+ if (!(fp->f_mode & FMODE_CAN_WRITE))
+#else
if (!fp->f_op || !fp->f_op->write)
+#endif
return -EPERM;
while (sum < len) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
+ wlen = kernel_write(fp, buf + sum, len - sum, &fp->f_pos);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
+ wlen = __vfs_write(fp, buf + sum, len - sum, &fp->f_pos);
+#else
wlen = fp->f_op->write(fp, buf + sum, len - sum, &fp->f_pos);
+#endif
if (wlen > 0)
sum += wlen;
else if (0 != wlen)
@@ -2191,19 +2201,19 @@ static int isFileReadable(const char *path, u32 *sz)
{
struct file *fp;
int ret = 0;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
char buf;
fp = filp_open(path, O_RDONLY, 0);
if (IS_ERR(fp))
ret = PTR_ERR(fp);
else {
+#ifdef set_fs
oldfs = get_fs();
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
- #else
- set_fs(get_ds());
- #endif
+#endif
if (1 != readFile(fp, &buf, 1))
ret = PTR_ERR(fp);
@@ -2215,8 +2225,9 @@ static int isFileReadable(const char *path, u32 *sz)
*sz = i_size_read(fp->f_dentry->d_inode);
#endif
}
-
+#ifdef set_fs
set_fs(oldfs);
+#endif
filp_close(fp, NULL);
}
return ret;
@@ -2232,22 +2243,23 @@ static int isFileReadable(const char *path, u32 *sz)
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
{
int ret = -1;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
struct file *fp;
if (path && buf) {
ret = openFile(&fp, path, O_RDONLY, 0);
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
-
+#ifdef set_fs
oldfs = get_fs();
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
- #else
- set_fs(get_ds());
- #endif
ret = readFile(fp, buf, sz);
set_fs(oldfs);
+#else
+ ret = readFile(fp, buf, sz);
+#endif
closeFile(fp);
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
@@ -2271,22 +2283,23 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
static int storeToFile(const char *path, u8 *buf, u32 sz)
{
int ret = 0;
+#ifdef set_fs
mm_segment_t oldfs;
+#endif
struct file *fp;
if (path && buf) {
ret = openFile(&fp, path, O_CREAT | O_WRONLY, 0666);
if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
-
+#ifdef set_fs
oldfs = get_fs();
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0))
set_fs(KERNEL_DS);
- #else
- set_fs(get_ds());
- #endif
ret = writeFile(fp, buf, sz);
set_fs(oldfs);
+#else
+ ret = writeFile(fp, buf, sz);
+#endif
closeFile(fp);
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);
@@ -0,0 +1,78 @@
Adjust driver bits so it keeps the name of the replaced driver
Signed-off-by: Thomas Backlund <tmb@mageia.org>
---
3rdparty/rtl8812au/Kconfig | 6 +++---
3rdparty/rtl8812au/Makefile | 8 ++++----
3rdparty/rtl8812au/hal/hal_com.c | 2 +-
3rdparty/rtl8812au/os_dep/linux/ioctl_cfg80211.c | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff -Nurp linux-5.5/3rdparty/rtl8812au.orig/hal/hal_com.c linux-5.5/3rdparty/rtl8812au/hal/hal_com.c
--- linux-5.5/3rdparty/rtl8812au.orig/hal/hal_com.c 2020-03-09 01:46:04.750166543 +0200
+++ linux-5.5/3rdparty/rtl8812au/hal/hal_com.c 2020-03-11 18:23:33.839805026 +0200
@@ -12879,7 +12879,7 @@ bypass_hw_pg:
_rtw_memset(hal_data->EEPROMMACAddr, 0, ETH_ALEN);
ret = _FAIL;
exit:
- dev_info(&udev->dev, "88XXau %pM hw_info[%02x]", hw_addr, addr_offset);
+ dev_info(&udev->dev, "8812au %pM hw_info[%02x]", hw_addr, addr_offset);
return ret;
}
diff -Nurp linux-5.5/3rdparty/rtl8812au.orig/Kconfig linux-5.5/3rdparty/rtl8812au/Kconfig
--- linux-5.5/3rdparty/rtl8812au.orig/Kconfig 2020-03-09 01:46:04.682163430 +0200
+++ linux-5.5/3rdparty/rtl8812au/Kconfig 2020-03-11 18:21:33.457357175 +0200
@@ -1,6 +1,6 @@
-config 88XXAU
- tristate "Realtek 88XXau USB WiFi"
+config RTL8812AU
+ tristate "Realtek 8812au USB WiFi"
depends on USB
---help---
- Help message of 88XXau
+ Help message of 8812au
diff -Nurp linux-5.5/3rdparty/rtl8812au.orig/Makefile linux-5.5/3rdparty/rtl8812au/Makefile
--- linux-5.5/3rdparty/rtl8812au.orig/Makefile 2020-03-09 01:46:04.682163430 +0200
+++ linux-5.5/3rdparty/rtl8812au/Makefile 2020-03-11 18:22:16.769317077 +0200
@@ -179,9 +179,9 @@ endif
ifeq ($(CONFIG_RTL8812A)_$(CONFIG_RTL8821A)_$(CONFIG_RTL8814A), y_y_y)
-EXTRA_CFLAGS += -DDRV_NAME=\"rtl88XXau\"
+EXTRA_CFLAGS += -DDRV_NAME=\"rtl8812au\"
ifeq ($(CONFIG_USB_HCI), y)
-USER_MODULE_NAME = 88XXau
+USER_MODULE_NAME = 8812au
endif
else
EXTRA_CFLAGS += -DDRV_NAME=\"rtl8812au\"
@@ -2233,11 +2233,11 @@ $(MODULE_NAME)-y += $(_PLATFORM_FILES)
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o
-obj-$(CONFIG_88XXAU) := $(MODULE_NAME).o
+obj-$(CONFIG_RTL8812AU) := $(MODULE_NAME).o
else
-export CONFIG_88XXAU = m
+export CONFIG_RTL8812AU = m
all: modules
diff -Nurp linux-5.5/3rdparty/rtl8812au.orig/os_dep/linux/ioctl_cfg80211.c linux-5.5/3rdparty/rtl8812au/os_dep/linux/ioctl_cfg80211.c
--- linux-5.5/3rdparty/rtl8812au.orig/os_dep/linux/ioctl_cfg80211.c 2020-03-09 01:46:04.798168741 +0200
+++ linux-5.5/3rdparty/rtl8812au/os_dep/linux/ioctl_cfg80211.c 2020-03-11 18:24:09.196405329 +0200
@@ -2639,7 +2639,7 @@ void rtw_cfg80211_unlink_bss(_adapter *p
#endif
if (!wiphy) {
- pr_info("88XXAU: rtw_cfg80211_unlink_bss: wiphy is NULL\n");
+ pr_info("8812AU: rtw_cfg80211_unlink_bss: wiphy is NULL\n");
return;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,301 @@
diff -up linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c.kernel58 linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c
--- linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c.kernel58 2020-08-12 18:12:12.492276511 +0200
+++ linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c 2020-08-12 18:13:07.202678858 +0200
@@ -2133,7 +2133,7 @@ BIP_exit:
#ifndef PLATFORM_FREEBSD
#if defined(CONFIG_TDLS)
/* compress 512-bits */
-static int sha256_compress(struct _sha256_state *md, unsigned char *buf)
+static int sha256_compress(struct sha256_state *md, unsigned char *buf)
{
u32 S[8], W[64], t0, t1;
u32 t;
@@ -2181,7 +2181,7 @@ static int sha256_compress(struct _sha25
}
/* Initialize the hash state */
-static void sha256_init(struct _sha256_state *md)
+static void sha256_init(struct sha256_state *md)
{
md->curlen = 0;
md->length = 0;
@@ -2202,7 +2202,7 @@ static void sha256_init(struct _sha256_s
@param inlen The length of the data (octets)
@return CRYPT_OK if successful
*/
-static int sha256_process(struct _sha256_state *md, unsigned char *in,
+static int sha256_process(struct sha256_state *md, unsigned char *in,
unsigned long inlen)
{
unsigned long n;
@@ -2243,7 +2243,7 @@ static int sha256_process(struct _sha256
@param out [out] The destination of the hash (32 bytes)
@return CRYPT_OK if successful
*/
-static int sha256_done(struct _sha256_state *md, unsigned char *out)
+static int sha256_done(struct sha256_state *md, unsigned char *out)
{
int i;
@@ -2293,7 +2293,7 @@ static int sha256_done(struct _sha256_st
static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
u8 *mac)
{
- struct _sha256_state ctx;
+ struct sha256_state ctx;
size_t i;
sha256_init(&ctx);
diff -up linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h.kernel58 linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h
--- linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h.kernel58 2020-08-12 18:12:12.860279218 +0200
+++ linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h 2020-08-12 18:13:07.202678858 +0200
@@ -249,11 +249,13 @@ struct security_priv {
#define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE
#endif
-struct _sha256_state {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
+struct sha256_state {
u64 length;
u32 state[8], curlen;
u8 buf[64];
};
+#endif
#define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
do {\
diff -up linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c.kernel58 linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c
--- linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c.kernel58 2020-08-12 18:12:12.867279269 +0200
+++ linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c 2020-08-12 18:13:07.204678873 +0200
@@ -80,7 +80,7 @@
#endif
/*
- * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant)
+ * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant)
* when Wi-Fi driver decides to abort the scan request in the scan flow by default.
* Defining this flag makes Wi-Fi driver to return -EBUSY to the system if Wi-Fi driver is too busy to do the scan.
*/
@@ -321,7 +321,7 @@ static u8 rtw_chbw_to_cfg80211_chan_def(
if (!chan)
goto exit;
- if (bw == CHANNEL_WIDTH_20)
+ if (bw == CHANNEL_WIDTH_20)
chdef->width = ht ? NL80211_CHAN_WIDTH_20 : NL80211_CHAN_WIDTH_20_NOHT;
else if (bw == CHANNEL_WIDTH_40)
chdef->width = NL80211_CHAN_WIDTH_40;
@@ -355,7 +355,7 @@ static void rtw_get_chbw_from_cfg80211_c
rtw_warn_on(1);
*ch = 0;
return;
- }
+ }
switch (chdef->width) {
case NL80211_CHAN_WIDTH_20_NOHT:
@@ -1577,8 +1577,8 @@ static int rtw_cfg80211_set_encryption(s
_rtw_memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8);
_rtw_memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8);
padapter->securitypriv.binstallGrpkey = _TRUE;
- if (param->u.crypt.idx < 4)
- _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8);
+ if (param->u.crypt.idx < 4)
+ _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8);
padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx;
rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1, _TRUE);
@@ -1826,7 +1826,7 @@ static int cfg80211_rtw_get_key(struct w
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
|| (MLME_IS_STA(adapter) && !pairwise)
#endif
- ) {
+ ) {
/* WEP key, TX GTK/IGTK, RX GTK/IGTK(for STA mode) */
if (is_wep_enc(sec->dot118021XGrpPrivacy)) {
if (keyid >= WEP_KEYS)
@@ -1915,7 +1915,7 @@ static int cfg80211_rtw_get_key(struct w
}
ret = 0;
-
+
exit:
RTW_INFO(FUNC_NDEV_FMT
GET_KEY_PARAM_FMT_S
@@ -5565,7 +5565,7 @@ release_plink_ctl:
if (del_sta) {
u8 sta_addr[ETH_ALEN];
u8 updated = _FALSE;
-
+
_rtw_memcpy(sta_addr, del_sta->cmn.mac_addr, ETH_ALEN);
updated = ap_free_sta(adapter, del_sta, 0, 0, 1);
rtw_mesh_expire_peer(stapriv->padapter, sta_addr);
@@ -5650,7 +5650,7 @@ static int cfg80211_rtw_dump_station(str
else
_rtw_memcpy(mac, plink->addr, ETH_ALEN);
#endif
-
+
sinfo->filled = 0;
if (psta) {
@@ -7307,11 +7307,22 @@ static void cfg80211_rtw_mgmt_frame_regi
#else
struct net_device *ndev,
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ struct mgmt_frame_regs *upd)
+#else
u16 frame_type, bool reg)
+#endif
+
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *ndev = wdev_to_ndev(wdev);
#endif
+
+/* hardcoded always true, to make it pass compilation */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ bool reg = true;
+#endif
+
_adapter *adapter;
struct rtw_wdev_priv *pwdev_priv;
@@ -7330,7 +7341,12 @@ static void cfg80211_rtw_mgmt_frame_regi
/* Wait QC Verify */
return;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
+ switch (upd->interface_stypes) {
+#else
switch (frame_type) {
+#endif
+
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
break;
@@ -7682,7 +7698,7 @@ void dump_mesh_config(void *sel, const s
RTW_PRINT_SEL(sel, "path_refresh_time:%u\n", conf->path_refresh_time);
RTW_PRINT_SEL(sel, "min_discovery_timeout:%u\n", conf->min_discovery_timeout);
RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathTimeout:%u\n", conf->dot11MeshHWMPactivePathTimeout);
- RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval);
+ RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0))
RTW_PRINT_SEL(sel, "dot11MeshHWMPperrMinInterval:%u\n", conf->dot11MeshHWMPperrMinInterval);
#endif
@@ -7697,11 +7713,11 @@ void dump_mesh_config(void *sel, const s
RTW_PRINT_SEL(sel, "dot11MeshForwarding:%d\n", conf->dot11MeshForwarding);
RTW_PRINT_SEL(sel, "rssi_threshold:%d\n", conf->rssi_threshold);
#endif
-
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0))
RTW_PRINT_SEL(sel, "ht_opmode:0x%04x\n", conf->ht_opmode);
#endif
-
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathToRootTimeout:%u\n", conf->dot11MeshHWMPactivePathToRootTimeout);
RTW_PRINT_SEL(sel, "dot11MeshHWMProotInterval:%u\n", conf->dot11MeshHWMProotInterval);
@@ -7712,7 +7728,7 @@ void dump_mesh_config(void *sel, const s
RTW_PRINT_SEL(sel, "power_mode:%s\n", nl80211_mesh_power_mode_str(conf->power_mode));
RTW_PRINT_SEL(sel, "dot11MeshAwakeWindowDuration:%u\n", conf->dot11MeshAwakeWindowDuration);
#endif
-
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
RTW_PRINT_SEL(sel, "plink_timeout:%u\n", conf->plink_timeout);
#endif
@@ -7848,14 +7864,14 @@ static void rtw_cfg80211_mesh_cfg_set(_a
if (chk_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask));
#endif
#endif
-
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
if (chk_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask))
mcfg->dot11MeshHWMPactivePathToRootTimeout = conf->dot11MeshHWMPactivePathToRootTimeout;
if (chk_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask))
mcfg->dot11MeshHWMProotInterval = conf->dot11MeshHWMProotInterval;
if (chk_mesh_attr(NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, mask))
- mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval;
+ mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval;
#endif
#if 0 /* TBD */
@@ -7913,7 +7929,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_i
#endif
if (!ch)
goto exit;
-
+
#if defined(CONFIG_80211AC_VHT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
vht = ht && ch > 14 && bw >= CHANNEL_WIDTH_80; /* VHT40/VHT20? */
#endif
@@ -8244,7 +8260,7 @@ static int cfg80211_rtw_join_mesh(struct
ret = -EINVAL;
goto exit;
}
-
+
rtw_mesh_work(&adapter->mesh_work);
exit:
@@ -8325,7 +8341,7 @@ static int cfg80211_rtw_del_mpath(struct
}
} else {
rtw_mesh_path_flush_by_iface(adapter);
- }
+ }
exit:
return ret;
@@ -8626,13 +8642,13 @@ int cfg80211_rtw_resume(struct wiphy *wi
//rtw_sitesurvey_cmd(padapter, NULL);
rtw_sitesurvey_cmd(padapter, &parm);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
-
+
for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) {
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE)
break;
rtw_msleep_os(1000);
}
-
+
_enter_critical_bh(&pmlmepriv->lock, &irqL);
cfg80211_sched_scan_results(padapter->rtw_wdev->wiphy);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
@@ -8640,7 +8656,7 @@ int cfg80211_rtw_resume(struct wiphy *wi
}
RTW_DBG("<== %s\n",__func__);
return 0;
-
+
}
#endif /* CONFIG_PNO_SUPPORT */
@@ -9530,7 +9546,7 @@ int rtw_hostapd_acs_dump_survey(struct w
#elif defined(CONFIG_RTW_ACS) && defined(CONFIG_BACKGROUND_NOISE_MONITOR)
rtw_cfg80211_set_survey_info_with_clm(padapter, idx, info);
#else
- RTW_ERR("%s: unknown acs operation!\n", __func__);
+ RTW_ERR("%s: unknown acs operation!\n", __func__);
#endif
return ret;
@@ -9631,7 +9647,11 @@ 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))
+ .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,
+#else
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
+#endif
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
.action = cfg80211_rtw_mgmt_tx,
#endif
@@ -0,0 +1,20 @@
--- linux-5.3.orig/3rdparty/Kconfig
+++ linux-5.3/3rdparty/Kconfig
@@ -3,6 +3,7 @@
menu "External 3rdparty kernel additions"
source "3rdparty/ndiswrapper/Kconfig"
+source "3rdparty/rtl8821ce/Kconfig"
source "3rdparty/rtl8812au/Kconfig"
source "3rdparty/rtl8723de/Kconfig"
source "3rdparty/viahss/Kconfig"
--- linux-5.3.orig/3rdparty/Makefile
+++ linux-5.3/3rdparty/Makefile
@@ -2,6 +2,7 @@
obj- := 3rdparty.o # Dummy rule to force built-in.o to be made
obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
+obj-$(CONFIG_RTL8821CE) += rtl8821ce/
obj-$(CONFIG_RTL8812AU) += rtl8812au/
obj-$(CONFIG_RTL8723DE) += rtl8723de/
obj-$(CONFIG_VIAHSS) += viahss/
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,189 @@
3rdparty/viahss/Kconfig | 14 +++++++
3rdparty/viahss/Makefile | 3 +
3rdparty/viahss/README.html | 68 ++++++++++++++++++++++++++++++++++++
3rdparty/viahss/viahss.c | 83 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 168 insertions(+)
diff -Nurp linux-2.6.37/3rdparty/viahss/Kconfig linux-2.6.37.3rdparty/3rdparty/viahss/Kconfig
--- linux-2.6.37/3rdparty/viahss/Kconfig 1970-01-01 02:00:00.000000000 +0200
+++ linux-2.6.37.3rdparty/3rdparty/viahss/Kconfig 2003-12-01 01:53:51.000000000 +0200
@@ -0,0 +1,14 @@
+config VIAHSS
+ tristate "VIA High Speed Serial"
+ depends on SERIAL_CORE && m
+ ---help---
+ VIA High Speed Serial is a little kernel module (1 KB) which enables
+ high speed serial port modes of VIA VT82C686A or VT82C686B
+ southbridge-equipped motherboards. With this module, you can use the
+ serial port at 230400 bit/s so that you can get the full 128000 bit/s
+ from ISDN-TA. The module has been tested with both 686A and 686B
+ chipsets.
+
+ To compile this driver as a module, choose M here: the
+ module will be called viahss.
+
diff -Nurp linux-2.6.37/3rdparty/viahss/Makefile linux-2.6.37.3rdparty/3rdparty/viahss/Makefile
--- linux-2.6.37/3rdparty/viahss/Makefile 1970-01-01 02:00:00.000000000 +0200
+++ linux-2.6.37.3rdparty/3rdparty/viahss/Makefile 2003-12-01 01:43:23.000000000 +0200
@@ -0,0 +1,3 @@
+
+obj-$(CONFIG_VIAHSS) += viahss.o
+
diff -Nurp linux-2.6.37/3rdparty/viahss/README.html linux-2.6.37.3rdparty/3rdparty/viahss/README.html
--- linux-2.6.37/3rdparty/viahss/README.html 1970-01-01 02:00:00.000000000 +0200
+++ linux-2.6.37.3rdparty/3rdparty/viahss/README.html 2003-12-01 01:58:23.000000000 +0200
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+ <title>High speed serial port for VIA VT82C686 chipsets for linux</title>
+</head>
+<body>
+<H3>Setting the serial port speed over 115,200bps</H3>
+<br>
+If you have motherboard which has VIA VT82C686A or VT82C686B chipset
+you can set serial ports in high speed mode with this kernel module.
+I use module with external ISDN-TA and haven't had any problems
+so far but I cannot guarantee that you won't have buffer overflows if
+you use full 230K or 460K speed all the time (FIFO's are still 16550A size).
+ISDN with two channels maxes out at 128 Kb which means that it doesn't
+really stress serial ports at 230400. Unlike SHSMOD-patches you don't have
+to patch serial driver and module takes only 1KB of memory when it's
+loaded which should leave enough room for other programs. It should
+be also possible to make this work from userspace but accessing
+pci devices is so much easier from kernel.
+
+<H3>How to use module</H3>
+Get the <A href=http://www.kati.fi/viahss/viahss-0.92.tar.gz>package</A>
+and compile it using included makefiles.
+<H3>For 2.4</H3>
+If you have kernel in some other location than /usr/src/linux edit Makefile
+before compiling. You can also install module with "make install". After
+you have loaded module in kernel (use modprobe or insmod) you can set serial
+ports to use high speed modes with setserial.<br>
+<H3>For 2.5/2.6</H3>
+Copy Makefile-2.6 on top of Makefile and do make. After loading module set
+serial speed with setserial. (NOTE: This gives a warning on depracated
+method).
+
+<br>
+# setserial /dev/ttyS0 spd_cust divisor 0x8002
+<br><br>
+which sets COM1: speed to 230400. With 0x8001 you should get 460800
+but I haven't tested it. If you want to use COM2: use ttyS1 instead of ttyS0.
+
+After this you should set program which you are using to use 38400 bps
+speed which is now actually 230K or 460K. For more information check
+setserial man page (spd_cust).
+
+You can use serial port work as normal if you do<br>
+<br>
+# setserial /dev/ttyS0 spd_normal <br><br>
+After this you can also remove viahss module with rmmod if you need to. Module doesn't intefere with normal serial port usage so you can leave
+it loaded if you don't need that extra 1KB which module uses.
+<H3>Download</H3>
+<A href=http://www.kati.fi/viahss/viahss-0.92.tar.gz>viahss-0.92.tar.gz</A>
+
+<H3>Acknowledgments</H3>
+
+Thanks to Kimmo Rintala for help with divisor settings.<br>
+I also like to thank Jeff Garzik for help with VIA datasheets.<br>
+Port to 2.5/2.6 by Kingsly John with the help of <A href=http://lwn.net>LWN</A>
+
+<H3>Version History</H3>
+0.90 First release<br>
+0.91 Fixed Makefile <br>
+0.92 Fixed for 2.5/2.6<br>
+
+<H3>Contact</H3>
+
+You can reach me by email: <A href=mailto:jrauti@iki.fi>jrauti@iki.fi</A>
+</body>
+</html>
diff -Nurp linux-2.6.37/3rdparty/viahss/viahss.c linux-2.6.37.3rdparty/3rdparty/viahss/viahss.c
--- linux-2.6.37/3rdparty/viahss/viahss.c 1970-01-01 02:00:00.000000000 +0200
+++ linux-2.6.37.3rdparty/3rdparty/viahss/viahss.c 2003-07-17 09:49:59.000000000 +0300
@@ -0,0 +1,83 @@
+/*
+ * VIA VT 82c686[AB] high speed serial port enabler
+ * Version 0.92
+ * Copyright (c) 2000-2001 Juhani Rautiainen <jrauti@iki.fi>
+ *
+ * 0.92:
+ * Ported to 2.5/2.6 by Kingsly John
+ * - Corrected locking (no more cli() and sti())
+ * - New makefile
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+*/
+
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/version.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+
+const unsigned short confindex=0x3F0,confdata=0x3F1;
+const unsigned char spcidx=0xEE;
+
+spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
+
+static int __init viahss_init(void)
+{
+ struct pci_dev *pcidev = NULL;
+ unsigned char confval,val;
+ pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
+ if (pcidev) {
+ spin_lock_irq(&driver_lock);
+ /* start config */
+ pci_read_config_byte(pcidev,0x85,&confval);
+ confval |= 0x2;
+ pci_write_config_byte (pcidev, 0x85,confval);
+ /* activate high speed bits */
+ outb(spcidx,confindex); /* set index */
+ val = (unsigned char) inb(confdata);
+ val |= 0xC0; /* both ports on high speed*/
+ outb (spcidx,confindex);
+ outb (val,confdata);
+ /*stop config*/
+ confval &= ~0x2;
+ pci_write_config_byte(pcidev, 0x85, confval);
+ spin_unlock_irq(&driver_lock);
+ printk (KERN_INFO "VIA VT82C686[AB] serial port high speed enabled\n");
+ }
+ else {
+ printk (KERN_INFO "Couldn't locate VIA chipset\n");
+ return -ENODEV;
+ }
+ return 0;
+}
+
+static void __exit viahss_exit(void)
+{
+ struct pci_dev *pcidev = NULL;
+ unsigned char confval,val;
+ pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
+ if (pcidev) {
+ spin_lock_irq(&driver_lock);
+ /* start config */
+ pci_read_config_byte(pcidev,0x85,&confval);
+ confval |= 0x2;
+ pci_write_config_byte (pcidev, 0x85,confval);
+ /* activate high speed bits */
+ outb(spcidx,confindex); /* set index */
+ val = (unsigned char) inb(confdata);
+ val &= ~0xC0; /* both ports off high speed*/
+ outb (spcidx,confindex);
+ outb (val,confdata);
+ /*stop config*/
+ confval &= ~0x2;
+ pci_write_config_byte(pcidev, 0x85, confval);
+ spin_unlock_irq(&driver_lock);
+ printk (KERN_INFO "VIA VT82C686[AB] serial port high speed disabled\n");
+ }
+}
+
+module_init(viahss_init);
+module_exit(viahss_exit);
+MODULE_DESCRIPTION("VIA VT82C686[AB] high speed serial port enabler");
+MODULE_AUTHOR("Juhani Rautiainen <jrauti@iki.fi>");
@@ -0,0 +1,20 @@
--- linux-2.6.35-rc6-git-mnb0.1/3rdparty/viahss/viahss.c.orig 2010-07-30 21:17:30.000000000 +0300
+++ linux-2.6.35-rc6-git-mnb0.1/3rdparty/viahss/viahss.c 2010-07-30 23:10:21.324978822 +0300
@@ -25,7 +25,7 @@ static int __init viahss_init(void)
{
struct pci_dev *pcidev = NULL;
unsigned char confval,val;
- pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
+ pcidev = pci_get_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
if (pcidev) {
spin_lock_irq(&driver_lock);
/* start config */
@@ -55,7 +55,7 @@ static void __exit viahss_exit(void)
{
struct pci_dev *pcidev = NULL;
unsigned char confval,val;
- pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
+ pcidev = pci_get_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
if (pcidev) {
spin_lock_irq(&driver_lock);
/* start config */
@@ -0,0 +1,19 @@
fix build with 3.0
Signed-off-by: Thomas Backlund <tmb@mageia.org>
3rdparty/viahss/viahss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/3rdparty/viahss/viahss.c.orig 2011-07-15 02:37:27.000000000 +0300
+++ a/3rdparty/viahss/viahss.c 2011-07-15 13:48:13.204291256 +0300
@@ -19,7 +19,7 @@
const unsigned short confindex=0x3F0,confdata=0x3F1;
const unsigned char spcidx=0xEE;
-spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(driver_lock);
static int __init viahss_init(void)
{
@@ -0,0 +1,16 @@
--- linux/3rdparty/Kconfig.orig 2019-05-31 23:33:39.796256889 +0300
+++ linux/3rdparty/Kconfig 2019-05-31 23:37:16.378970236 +0300
@@ -5,5 +5,6 @@ menu "External 3rdparty kernel additions"
source "3rdparty/ndiswrapper/Kconfig"
source "3rdparty/rtl8812au/Kconfig"
source "3rdparty/rtl8723de/Kconfig"
+source "3rdparty/viahss/Kconfig"
endmenu
--- linux/3rdparty/Makefile.orig 2019-05-31 23:33:57.608644657 +0300
+++ linux/3rdparty/Makefile 2019-05-31 23:37:39.711477814 +0300
@@ -4,3 +4,4 @@ obj- := 3rdparty.o # Dummy rule to forc
obj-$(CONFIG_NDISWRAPPER) += ndiswrapper/
obj-$(CONFIG_RTL8812AU) += rtl8812au/
obj-$(CONFIG_RTL8723DE) += rtl8723de/
+obj-$(CONFIG_VIAHSS) += viahss/
@@ -0,0 +1,18 @@
linux/config.h is gone in 2.6.21
---
3rdparty/viahss/viahss.c | 1 0 + 1 - 0 !
1 files changed, 1 deletion(-)
Index: linux-2.6.21/3rdparty/viahss/viahss.c
===================================================================
--- linux-2.6.21.orig/3rdparty/viahss/viahss.c 2003-07-17 08:49:59.000000000 +0200
+++ linux-2.6.21/3rdparty/viahss/viahss.c 2007-05-14 17:06:56.000000000 +0200
@@ -12,7 +12,6 @@
*/
#include <linux/module.h>
-#include <linux/config.h>
#include <linux/version.h>
#include <linux/init.h>
#include <linux/pci.h>
@@ -0,0 +1,7 @@
--- linux-2.6.25/3rdparty/viahss/viahss.c.orig 2008-06-28 22:50:05.000000000 +0300
+++ linux-2.6.25/3rdparty/viahss/viahss.c 2008-06-29 14:26:55.000000000 +0300
@@ -80,3 +80,4 @@ module_init(viahss_init);
module_exit(viahss_exit);
MODULE_DESCRIPTION("VIA VT82C686[AB] high speed serial port enabler");
MODULE_AUTHOR("Juhani Rautiainen <jrauti@iki.fi>");
+MODULE_LICENSE("GPL");
@@ -0,0 +1,305 @@
From MAILER-DAEMON Wed Oct 14 16:34:37 2020
From: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
To: netdev@vger.kernel.org
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Thadeu Lima de Souza Cascardo <cascardo@canonical.com>, "Gustavo A. R. Silva" <gustavoars@kernel.org>, "Alexander A. Klimov" <grandmaster@al2klimov.de>, Kees Cook <keescook@chromium.org>, Eric Dumazet <edumazet@google.com>, Alexey Kodanev <alexey.kodanev@oracle.com>, dccp@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] dccp: ccid: move timers to struct dccp_sock
Date: Tue, 13 Oct 2020 19:18:48 +0200
Message-Id: <20201013171849.236025-2-kleber.souza@canonical.com>
In-Reply-To: <20201013171849.236025-1-kleber.souza@canonical.com>
References: <20201013171849.236025-1-kleber.souza@canonical.com>
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
From: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
When dccps_hc_tx_ccid is freed, ccid timers may still trigger. The reason
del_timer_sync can't be used is because this relies on keeping a reference
to struct sock. But as we keep a pointer to dccps_hc_tx_ccid and free that
during disconnect, the timer should really belong to struct dccp_sock.
This addresses CVE-2020-16119.
Fixes: 839a6094140a (net: dccp: Convert timers to use timer_setup())
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-bd: Richard Sailer <richard_siegfried@systemli.org>
---
include/linux/dccp.h | 2 ++
net/dccp/ccids/ccid2.c | 32 +++++++++++++++++++-------------
net/dccp/ccids/ccid3.c | 30 ++++++++++++++++++++----------
3 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 07e547c02fd8..504afa1a4be6 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -259,6 +259,7 @@ struct dccp_ackvec;
* @dccps_sync_scheduled - flag which signals "send out-of-band message soon"
* @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets
* @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing)
+ * @dccps_ccid_timer - used by the CCIDs
* @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs)
*/
struct dccp_sock {
@@ -303,6 +304,7 @@ struct dccp_sock {
__u8 dccps_sync_scheduled:1;
struct tasklet_struct dccps_xmitlet;
struct timer_list dccps_xmit_timer;
+ struct timer_list dccps_ccid_timer;
};
static inline struct dccp_sock *dccp_sk(const struct sock *sk)
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 3da1f77bd039..dbca1f1e2449 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -126,21 +126,26 @@ static void dccp_tasklet_schedule(struct sock *sk)
static void ccid2_hc_tx_rto_expire(struct timer_list *t)
{
- struct ccid2_hc_tx_sock *hc = from_timer(hc, t, tx_rtotimer);
- struct sock *sk = hc->sk;
- const bool sender_was_blocked = ccid2_cwnd_network_limited(hc);
+ struct dccp_sock *dp = from_timer(dp, t, dccps_ccid_timer);
+ struct sock *sk = (struct sock *)dp;
+ struct ccid2_hc_tx_sock *hc;
+ bool sender_was_blocked;
bh_lock_sock(sk);
+
+ if (inet_sk_state_load(sk) == DCCP_CLOSED)
+ goto out;
+
+ hc = ccid_priv(dp->dccps_hc_tx_ccid);
+ sender_was_blocked = ccid2_cwnd_network_limited(hc);
+
if (sock_owned_by_user(sk)) {
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + HZ / 5);
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + HZ / 5);
goto out;
}
ccid2_pr_debug("RTO_EXPIRE\n");
- if (sk->sk_state == DCCP_CLOSED)
- goto out;
-
/* back-off timer */
hc->tx_rto <<= 1;
if (hc->tx_rto > DCCP_RTO_MAX)
@@ -166,7 +171,7 @@ static void ccid2_hc_tx_rto_expire(struct timer_list *t)
if (sender_was_blocked)
dccp_tasklet_schedule(sk);
/* restart backed-off timer */
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
out:
bh_unlock_sock(sk);
sock_put(sk);
@@ -330,7 +335,7 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, unsigned int len)
}
#endif
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
#ifdef CONFIG_IP_DCCP_CCID2_DEBUG
do {
@@ -700,9 +705,9 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
/* restart RTO timer if not all outstanding data has been acked */
if (hc->tx_pipe == 0)
- sk_stop_timer(sk, &hc->tx_rtotimer);
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
else
- sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, jiffies + hc->tx_rto);
done:
/* check if incoming Acks allow pending packets to be sent */
if (sender_was_blocked && !ccid2_cwnd_network_limited(hc))
@@ -737,17 +742,18 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
hc->tx_last_cong = hc->tx_lsndtime = hc->tx_cwnd_stamp = ccid2_jiffies32;
hc->tx_cwnd_used = 0;
hc->sk = sk;
- timer_setup(&hc->tx_rtotimer, ccid2_hc_tx_rto_expire, 0);
+ timer_setup(&dp->dccps_ccid_timer, ccid2_hc_tx_rto_expire, 0);
INIT_LIST_HEAD(&hc->tx_av_chunks);
return 0;
}
static void ccid2_hc_tx_exit(struct sock *sk)
{
+ struct dccp_sock *dp = dccp_sk(sk);
struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk);
int i;
- sk_stop_timer(sk, &hc->tx_rtotimer);
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
for (i = 0; i < hc->tx_seqbufc; i++)
kfree(hc->tx_seqbuf[i]);
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index b9ee1a4a8955..685f4d046c0d 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -184,17 +184,24 @@ static inline void ccid3_hc_tx_update_win_count(struct ccid3_hc_tx_sock *hc,
static void ccid3_hc_tx_no_feedback_timer(struct timer_list *t)
{
- struct ccid3_hc_tx_sock *hc = from_timer(hc, t, tx_no_feedback_timer);
- struct sock *sk = hc->sk;
+ struct dccp_sock *dp = from_timer(dp, t, dccps_ccid_timer);
+ struct ccid3_hc_tx_sock *hc;
+ struct sock *sk = (struct sock *)dp;
unsigned long t_nfb = USEC_PER_SEC / 5;
bh_lock_sock(sk);
+
+ if (inet_sk_state_load(sk) == DCCP_CLOSED)
+ goto out;
+
if (sock_owned_by_user(sk)) {
/* Try again later. */
/* XXX: set some sensible MIB */
goto restart_timer;
}
+ hc = ccid_priv(dp->dccps_hc_tx_ccid);
+
ccid3_pr_debug("%s(%p, state=%s) - entry\n", dccp_role(sk), sk,
ccid3_tx_state_name(hc->tx_state));
@@ -250,8 +257,8 @@ static void ccid3_hc_tx_no_feedback_timer(struct timer_list *t)
t_nfb = max(hc->tx_t_rto, 2 * hc->tx_t_ipi);
restart_timer:
- sk_reset_timer(sk, &hc->tx_no_feedback_timer,
- jiffies + usecs_to_jiffies(t_nfb));
+ sk_reset_timer(sk, &dp->dccps_ccid_timer,
+ jiffies + usecs_to_jiffies(t_nfb));
out:
bh_unlock_sock(sk);
sock_put(sk);
@@ -280,7 +287,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
return -EBADMSG;
if (hc->tx_state == TFRC_SSTATE_NO_SENT) {
- sk_reset_timer(sk, &hc->tx_no_feedback_timer, (jiffies +
+ sk_reset_timer(sk, &dp->dccps_ccid_timer, (jiffies +
usecs_to_jiffies(TFRC_INITIAL_TIMEOUT)));
hc->tx_last_win_count = 0;
hc->tx_t_last_win_count = now;
@@ -354,6 +361,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, unsigned int len)
static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
{
struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk);
+ struct dccp_sock *dp = dccp_sk(sk);
struct tfrc_tx_hist_entry *acked;
ktime_t now;
unsigned long t_nfb;
@@ -420,7 +428,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
(unsigned int)(hc->tx_x >> 6));
/* unschedule no feedback timer */
- sk_stop_timer(sk, &hc->tx_no_feedback_timer);
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
/*
* As we have calculated new ipi, delta, t_nom it is possible
@@ -445,8 +453,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
"expire in %lu jiffies (%luus)\n",
dccp_role(sk), sk, usecs_to_jiffies(t_nfb), t_nfb);
- sk_reset_timer(sk, &hc->tx_no_feedback_timer,
- jiffies + usecs_to_jiffies(t_nfb));
+ sk_reset_timer(sk, &dp->dccps_ccid_timer,
+ jiffies + usecs_to_jiffies(t_nfb));
}
static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
@@ -488,21 +496,23 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk)
{
+ struct dccp_sock *dp = dccp_sk(sk);
struct ccid3_hc_tx_sock *hc = ccid_priv(ccid);
hc->tx_state = TFRC_SSTATE_NO_SENT;
hc->tx_hist = NULL;
hc->sk = sk;
- timer_setup(&hc->tx_no_feedback_timer,
+ timer_setup(&dp->dccps_ccid_timer,
ccid3_hc_tx_no_feedback_timer, 0);
return 0;
}
static void ccid3_hc_tx_exit(struct sock *sk)
{
+ struct dccp_sock *dp = dccp_sk(sk);
struct ccid3_hc_tx_sock *hc = ccid3_hc_tx_sk(sk);
- sk_stop_timer(sk, &hc->tx_no_feedback_timer);
+ sk_stop_timer(sk, &dp->dccps_ccid_timer);
tfrc_tx_hist_purge(&hc->tx_hist);
}
--
2.25.1
From MAILER-DAEMON Wed Oct 14 16:34:37 2020
From: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
To: netdev@vger.kernel.org
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Thadeu Lima de Souza Cascardo <cascardo@canonical.com>, "Gustavo A. R. Silva" <gustavoars@kernel.org>, "Alexander A. Klimov" <grandmaster@al2klimov.de>, Kees Cook <keescook@chromium.org>, Eric Dumazet <edumazet@google.com>, Alexey Kodanev <alexey.kodanev@oracle.com>, dccp@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] Revert "dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect()"
Date: Tue, 13 Oct 2020 19:18:49 +0200
Message-Id: <20201013171849.236025-3-kleber.souza@canonical.com>
In-Reply-To: <20201013171849.236025-1-kleber.souza@canonical.com>
References: <20201013171849.236025-1-kleber.souza@canonical.com>
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
From: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
This reverts commit 2677d20677314101293e6da0094ede7b5526d2b1.
This fixes an issue that after disconnect, dccps_hc_tx_ccid will still be
kept, allowing the socket to be reused as a listener socket, and the cloned
socket will free its dccps_hc_tx_ccid, leading to a later use after free,
when the listener socket is closed.
This addresses CVE-2020-16119.
Fixes: 2677d2067731 (dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect())
Reported-by: Hadar Manor
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Richard Sailer <richard_siegfried@systemli.org>
---
net/dccp/proto.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 6d705d90c614..359e848dba6c 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -279,7 +279,9 @@ int dccp_disconnect(struct sock *sk, int flags)
dccp_clear_xmit_timers(sk);
ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
+ ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
dp->dccps_hc_rx_ccid = NULL;
+ dp->dccps_hc_tx_ccid = NULL;
__skb_queue_purge(&sk->sk_receive_queue);
__skb_queue_purge(&sk->sk_write_queue);
--
2.25.1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff