From patchwork Sun Sep 13 00:16:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 1362989 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=paral.in Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bpqnc60lJz9sTN for ; Sun, 13 Sep 2020 10:17:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 27C01204E7; Sun, 13 Sep 2020 00:17:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YFShhksb+52h; Sun, 13 Sep 2020 00:17:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2E6DD204E2; Sun, 13 Sep 2020 00:17:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 88C341BF86D for ; Sun, 13 Sep 2020 00:17:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8356286FE8 for ; Sun, 13 Sep 2020 00:17:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pVDahgPCQ8XN for ; Sun, 13 Sep 2020 00:17:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id E75A286FD6 for ; Sun, 13 Sep 2020 00:17:08 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id c3so2708280plz.5 for ; Sat, 12 Sep 2020 17:17:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M52ARIFrWQEEGcE3T62pa1B1cswnlJI42BtBPSf88AM=; b=GULOXtCb9wuH1V47OexlkFFA1ntAqasXBNhBYAhhx8BZKr7grXknKmJGGleQCtkTaz dVhaPo2GSeyUyaIrD2VD+/7NvQAoZl+F4YywDcdPrta4wNJhM7O1upIVBkQyDXN2mMZw ocq+zqm1GPtJVhj2SZrxW2iAKDsmZQxNtOpcd2UmhMXZ99+sQWTz1WxGmQtCcIpbTV58 ubnL+fpcaEeooJ5Nlt4Q+iaLl/5OTX3fcHKU0H7FD9EtUgSUbysHXrS/9S0/4NVO/qlZ ia3qnq21KgSyreKwl5YVrdNiD8vBTztF3HE2BHQre36xjwjO+4Qm4Y9Xe6ycY/OR3DcZ UPyA== X-Gm-Message-State: AOAM531pnS0WsZNJzwNmzI+3Q0/x5BXJ7PJaJm+wikzNEvF7YtkqSX3g eM1vUMDvICvJ5y1kbuwr4voxoVt4ny6LK8b9 X-Google-Smtp-Source: ABdhPJwO4GQ6Ftc/SasbyO6kBJxMXaS2EZLnj2nVsyo4FokMDO9M7VzJr0K5+wl7P7u9J44rX2j7xw== X-Received: by 2002:a17:902:6bc3:: with SMTP id m3mr8131959plt.137.1599956228190; Sat, 12 Sep 2020 17:17:08 -0700 (PDT) Received: from localhost.localdomain (ip72-194-208-254.sb.sd.cox.net. [72.194.208.254]) by smtp.gmail.com with ESMTPSA id o15sm4888723pgi.74.2020.09.12.17.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2020 17:17:07 -0700 (PDT) From: Christian Stewart To: buildroot@buildroot.org Date: Sat, 12 Sep 2020 17:16:59 -0700 Message-Id: <20200913001659.472814-6-christian@paral.in> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200913001659.472814-1-christian@paral.in> References: <20200913001659.472814-1-christian@paral.in> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/1] package/rtl8821au: fix build against 5.8.x kernel X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mirza Krak , Peter Korsgaard , Christian Stewart , Christian Stewart , Anisse Astier , Thomas Petazzoni , "Yann E . MORIN" , Adam Duskett , Angelo Compagnucci Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Christian Stewart --- v1 -> v2: - added patch by @lwfinger to disable rtw_mgmt_frame_register - wrote patch for change to proc_ops in 5.6.x from file_operations Signed-off-by: Christian Stewart --- ...ate-to-rtl_sha256_state-to-avoid-nam.patch | 79 +++++++++++++ ..._mgmt_frame_register-on-kernel-5.8.0.patch | 47 ++++++++ ...-file_operations-to-proc_ops-for-5.6.patch | 109 ++++++++++++++++++ 3 files changed, 235 insertions(+) create mode 100644 package/rtl8821au/0004-rename-sha256_state-to-rtl_sha256_state-to-avoid-nam.patch create mode 100644 package/rtl8821au/0005-disable-rtw_mgmt_frame_register-on-kernel-5.8.0.patch create mode 100644 package/rtl8821au/0006-rtw_proc-convert-file_operations-to-proc_ops-for-5.6.patch diff --git a/package/rtl8821au/0004-rename-sha256_state-to-rtl_sha256_state-to-avoid-nam.patch b/package/rtl8821au/0004-rename-sha256_state-to-rtl_sha256_state-to-avoid-nam.patch new file mode 100644 index 0000000000..41cee2b247 --- /dev/null +++ b/package/rtl8821au/0004-rename-sha256_state-to-rtl_sha256_state-to-avoid-nam.patch @@ -0,0 +1,79 @@ +From 19aee91e45788d594615a9be58fa5d0879ec816a Mon Sep 17 00:00:00 2001 +From: youcai +Date: Tue, 18 Aug 2020 00:43:16 +0800 +Subject: [PATCH] rename sha256_state to rtl_sha256_state to avoid name + conflict with crypto + +[Upstream: https://github.com/abperiasamy/rtl8812AU_8821AU_linux/pull/338/commits/af6f6c1578f16145478326a939bb7593bbcdb4e7.patch] +Signed-off-by: Coleman +Signed-off-by: Christian Stewart +--- + core/rtw_security.c | 10 +++++----- + include/rtw_security.h | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/core/rtw_security.c b/core/rtw_security.c +index d54e6af..de2d91f 100644 +--- a/core/rtw_security.c ++++ b/core/rtw_security.c +@@ -2200,7 +2200,7 @@ BIP_exit: + + #ifndef PLATFORM_FREEBSD + /* compress 512-bits */ +-static int sha256_compress(struct sha256_state *md, unsigned char *buf) ++static int sha256_compress(struct rtl_sha256_state *md, unsigned char *buf) + { + u32 S[8], W[64], t0, t1; + u32 t; +@@ -2249,7 +2249,7 @@ static int sha256_compress(struct sha256_state *md, unsigned char *buf) + } + + /* Initialize the hash state */ +-static void sha256_init(struct sha256_state *md) ++static void sha256_init(struct rtl_sha256_state *md) + { + md->curlen = 0; + md->length = 0; +@@ -2270,7 +2270,7 @@ static void sha256_init(struct sha256_state *md) + @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 rtl_sha256_state *md, unsigned char *in, + unsigned long inlen) + { + unsigned long n; +@@ -2311,7 +2311,7 @@ static int sha256_process(struct sha256_state *md, unsigned char *in, + @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 rtl_sha256_state *md, unsigned char *out) + { + int i; + +@@ -2363,7 +2363,7 @@ static int sha256_done(struct sha256_state *md, unsigned char *out) + static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len, + u8 *mac) + { +- struct sha256_state ctx; ++ struct rtl_sha256_state ctx; + size_t i; + + sha256_init(&ctx); +diff --git a/include/rtw_security.h b/include/rtw_security.h +index d41014e..98feb69 100644 +--- a/include/rtw_security.h ++++ b/include/rtw_security.h +@@ -233,7 +233,7 @@ struct security_priv { + #endif /* DBG_SW_SEC_CNT */ + }; + +-struct sha256_state { ++struct rtl_sha256_state { + u64 length; + u32 state[8], curlen; + u8 buf[64]; +-- +2.28.0 + diff --git a/package/rtl8821au/0005-disable-rtw_mgmt_frame_register-on-kernel-5.8.0.patch b/package/rtl8821au/0005-disable-rtw_mgmt_frame_register-on-kernel-5.8.0.patch new file mode 100644 index 0000000000..6d09153b82 --- /dev/null +++ b/package/rtl8821au/0005-disable-rtw_mgmt_frame_register-on-kernel-5.8.0.patch @@ -0,0 +1,47 @@ +From 9421b0763e5f20babb2c0fd437979a71fbac1739 Mon Sep 17 00:00:00 2001 +From: Christian Stewart +Date: Tue, 8 Sep 2020 22:46:45 -0700 +Subject: [PATCH] disable rtw_mgmt_frame_register on kernel 5.8.0 + +rtl8812au: fix build for kernel 5.8 + +[Source: https://github.com/lwfinger/rtl8812au/commit/ec1591b90dd323185717fa42887f96444cca5921.patch] +Signed-off-by: Larry Finger +Signed-off-by: Christian Stewart +--- + os_dep/linux/ioctl_cfg80211.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c +index 019daf9..13238cb 100644 +--- a/os_dep/linux/ioctl_cfg80211.c ++++ b/os_dep/linux/ioctl_cfg80211.c +@@ -5177,6 +5177,7 @@ exit: + return ret; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) + static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) + struct wireless_dev *wdev, +@@ -5205,6 +5206,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, + exit: + return; + } ++#endif + + #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, +@@ -6021,7 +6023,9 @@ 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) + .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 +-- +2.28.0 + diff --git a/package/rtl8821au/0006-rtw_proc-convert-file_operations-to-proc_ops-for-5.6.patch b/package/rtl8821au/0006-rtw_proc-convert-file_operations-to-proc_ops-for-5.6.patch new file mode 100644 index 0000000000..607d00d604 --- /dev/null +++ b/package/rtl8821au/0006-rtw_proc-convert-file_operations-to-proc_ops-for-5.6.patch @@ -0,0 +1,109 @@ +From d3bd26812728c9ac2249ea29bda674dd31034ac6 Mon Sep 17 00:00:00 2001 +From: Christian Stewart +Date: Tue, 8 Sep 2020 23:08:39 -0700 +Subject: [PATCH] rtw_proc: convert file_operations to proc_ops for 5.6.x + compat + +Signed-off-by: Christian Stewart +--- + os_dep/linux/rtw_proc.c | 40 ++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 38 insertions(+), 2 deletions(-) + +diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c +index 048080a..d944649 100644 +--- a/os_dep/linux/rtw_proc.c ++++ b/os_dep/linux/rtw_proc.c +@@ -65,9 +65,15 @@ inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_ + } + + inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent, +- const struct file_operations *fops, void * data) ++ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)) ++ const struct file_operations *fops, ++ #else ++ const struct proc_ops *fops, ++ #endif ++ void * data ++ ) + { +- struct proc_dir_entry *entry; ++ struct proc_dir_entry *entry; + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) + entry = proc_create_data(name, S_IFREG|S_IRUGO|S_IWUGO, parent, fops, data); +@@ -167,6 +173,7 @@ static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, + return -EROFS; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)) + static const struct file_operations rtw_drv_proc_fops = { + .owner = THIS_MODULE, + .open = rtw_drv_proc_open, +@@ -174,7 +181,16 @@ static const struct file_operations rtw_drv_proc_fops = { + .llseek = seq_lseek, + .release = single_release, + .write = rtw_drv_proc_write, ++} ++#else ++static const struct proc_ops rtw_drv_proc_fops = { ++ .proc_open = rtw_drv_proc_open, ++ .proc_read = seq_read, ++ .proc_lseek = seq_lseek, ++ .proc_release = seq_release, ++ .proc_write = rtw_drv_proc_write, + }; ++#endif + + int rtw_drv_proc_init(void) + { +@@ -776,6 +792,7 @@ static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buff + return -EROFS; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)) + static const struct file_operations rtw_adapter_proc_fops = { + .owner = THIS_MODULE, + .open = rtw_adapter_proc_open, +@@ -784,6 +801,15 @@ static const struct file_operations rtw_adapter_proc_fops = { + .release = single_release, + .write = rtw_adapter_proc_write, + }; ++#else ++static const struct proc_ops rtw_adapter_proc_fops = { ++ .proc_open = rtw_adapter_proc_open, ++ .proc_read = seq_read, ++ .proc_lseek = seq_lseek, ++ .proc_release = single_release, ++ .proc_write = rtw_adapter_proc_write, ++}; ++#endif + + int proc_get_odm_dbg_comp(struct seq_file *m, void *v) + { +@@ -1030,6 +1056,7 @@ static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer, + return -EROFS; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)) + static const struct file_operations rtw_odm_proc_fops = { + .owner = THIS_MODULE, + .open = rtw_odm_proc_open, +@@ -1038,6 +1065,15 @@ static const struct file_operations rtw_odm_proc_fops = { + .release = single_release, + .write = rtw_odm_proc_write, + }; ++#else ++static const struct proc_ops rtw_odm_proc_fops = { ++ .proc_open = rtw_odm_proc_open, ++ .proc_read = seq_read, ++ .proc_lseek = seq_lseek, ++ .proc_release = single_release, ++ .proc_write = rtw_odm_proc_write, ++}; ++#endif + + struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev) + { +-- +2.28.0 +