diff --git a/core/rtw_security.c b/core/rtw_security.c index b537a26..9c1fe43 100755 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -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 rtw_sha256_state *md, unsigned char *buf) { u32 S[8], W[64], t0, t1; u32 t; @@ -2181,7 +2181,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 rtw_sha256_init(struct rtw_sha256_state *md) { md->curlen = 0; md->length = 0; @@ -2202,7 +2202,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; @@ -2243,7 +2243,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; @@ -2293,10 +2293,10 @@ 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); + rtw_sha256_init(&ctx); for (i = 0; i < num_elem; i++) if (sha256_process(&ctx, addr[i], len[i])) return -1; diff --git a/include/rtw_security.h b/include/rtw_security.h index ac8432e..765fa0c 100755 --- a/include/rtw_security.h +++ b/include/rtw_security.h @@ -249,7 +249,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 c0df148..901cf85 100755 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -7149,7 +7149,11 @@ 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); @@ -7164,14 +7168,19 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, adapter = (_adapter *)rtw_netdev_priv(ndev); pwdev_priv = adapter_wdev_data(adapter); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0)) #ifdef CONFIG_DEBUG_CFG80211 RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter), frame_type, reg); +#endif #endif /* Wait QC Verify */ return; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) + SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, upd->interface_stypes & BIT(IEEE80211_STYPE_PROBE_REQ >> 4)); +#else switch (frame_type) { case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */ SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg); @@ -7182,6 +7191,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, default: break; } +#endif exit: return; @@ -9457,7 +9467,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