From 0a3f017fa4ded7218cfe5262b4971f8c09397a62 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 10 Jul 2020 10:55:40 +0200 Subject: [PATCH] Fix compilation error with 5-8-rc1 Remove EOL kernel --- .travis.yml | 1 - core/rtw_security.c | 10 +++++----- include/rtw_security.h | 2 +- os_dep/linux/ioctl_cfg80211.c | 15 ++++++++++++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 442a35e..a9c720c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,6 @@ jobs: - env: COMPILER=gcc-7 KVER=$(curl -s https://www.kernel.org/releases.json | grep 'mainline' -B1 | head -1 | cut -d'"' -f4) - env: COMPILER=gcc-7 KVER=$(curl -s https://www.kernel.org/releases.json | grep -A1 'latest_stable' | tail -1 | cut -d'"' -f4) - - env: COMPILER=gcc-7 KVER=5.5.18 #Kernels 5.4 with minor versions > 28 are failing on amd64. Not upgrade the minor version without check https://kernel.ubuntu.com/~kernel-ppa/mainline/ - env: COMPILER=gcc-7 KVER=5.4.28 - env: COMPILER=gcc-7 KVER=4.19.116 diff --git a/core/rtw_security.c b/core/rtw_security.c index ffee304..9c1eb59 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -2131,7 +2131,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 rtw_sha256_state *md, unsigned char *buf) { u32 S[8], W[64], t0, t1; u32 t; @@ -2179,7 +2179,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 rtw_sha256_state *md) { md->curlen = 0; md->length = 0; @@ -2200,7 +2200,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 rtw_sha256_state *md, unsigned char *in, unsigned long inlen) { unsigned long n; @@ -2241,7 +2241,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 rtw_sha256_state *md, unsigned char *out) { int i; @@ -2291,7 +2291,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 rtw_sha256_state ctx; size_t i; sha256_init(&ctx); diff --git a/include/rtw_security.h b/include/rtw_security.h index 58362eb..f4fc8fb 100644 --- a/include/rtw_security.h +++ b/include/rtw_security.h @@ -254,7 +254,7 @@ struct security_priv { #define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE #endif -struct sha256_state { +struct rtw_sha256_state { u64 length; u32 state[8], curlen; u8 buf[64]; diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index fe7374d..e702202 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -7603,12 +7603,20 @@ 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 _adapter *adapter; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) + u16 frame_type = BIT(upd->global_stypes << 4); + bool reg = false; +#endif struct rtw_wdev_priv *pwdev_priv; @@ -10069,11 +10077,16 @@ 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, #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) .action = cfg80211_rtw_mgmt_tx, #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) + .update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register, +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, +#endif + #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) .tdls_mgmt = cfg80211_rtw_tdls_mgmt, .tdls_oper = cfg80211_rtw_tdls_oper,