From ec1591b90dd323185717fa42887f96444cca5921 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 10 Jun 2020 15:01:32 -0500 Subject: [PATCH] rtl8812au: Fix build for kernel 5.8 Signed-off-by: Larry Finger --- core/rtw_security.c | 10 +++++----- include/rtw_security.h | 2 +- os_dep/ioctl_cfg80211.c | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/rtw_security.c b/core/rtw_security.c index 29fe8ec..874c902 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -1963,7 +1963,7 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe) return res; } /* compress 512-bits */ -static int sha256_compress(struct sha256_state *md, unsigned char *buf) +static int sha256_compress(struct sha256_state_rtk *md, unsigned char *buf) { u32 S[8], W[64], t0, t1; u32 t; @@ -2005,7 +2005,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 sha256_state_rtk *md) { md->curlen = 0; md->length = 0; @@ -2026,7 +2026,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 sha256_state_rtk *md, unsigned char *in, unsigned long inlen) { unsigned long n; @@ -2067,7 +2067,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 sha256_state_rtk *md, unsigned char *out) { int i; @@ -2119,7 +2119,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 sha256_state_rtk ctx; size_t i; sha256_init(&ctx); diff --git a/include/rtw_security.h b/include/rtw_security.h index 3e26535..bee0d63 100644 --- a/include/rtw_security.h +++ b/include/rtw_security.h @@ -183,7 +183,7 @@ struct security_priv u8 bWepDefaultKeyIdxSet; }; -struct sha256_state { +struct sha256_state_rtk { u64 length; u32 state[8], curlen; u8 buf[64]; diff --git a/os_dep/ioctl_cfg80211.c b/os_dep/ioctl_cfg80211.c index 84383f4..fb1799d 100644 --- a/os_dep/ioctl_cfg80211.c +++ b/os_dep/ioctl_cfg80211.c @@ -4680,6 +4680,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, 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, @@ -4700,6 +4701,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, return; } +#endif static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *ndev, char *buf, int len) { @@ -5102,7 +5104,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