From 0f7096d9dfa797f634e45b45a095cb27828f2c66 Mon Sep 17 00:00:00 2001 From: darkalexpp Date: Mon, 17 Aug 2020 13:20:12 -0500 Subject: [PATCH] Add support Kernel 5.8.x --- include/rtw_security.h | 2 ++ os_dep/linux/ioctl_cfg80211.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/rtw_security.h b/include/rtw_security.h index ac8432e..6e40499 100644 --- a/include/rtw_security.h +++ b/include/rtw_security.h @@ -249,11 +249,13 @@ struct security_priv { #define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE #endif +#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 --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 01fab29..3bd5a7b 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -7094,11 +7094,22 @@ 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; struct rtw_wdev_priv *pwdev_priv; @@ -7117,7 +7128,12 @@ 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; @@ -9432,7 +9448,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, +#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