diff -up linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c.kernel58 linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c --- linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c.kernel58 2020-08-12 18:12:12.492276511 +0200 +++ linux-5.8/3rdparty/rtl8821ce/core/rtw_security.c 2020-08-12 18:13:07.202678858 +0200 @@ -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 sha256_state *md, unsigned char *buf) { u32 S[8], W[64], t0, t1; u32 t; @@ -2181,7 +2181,7 @@ static int sha256_compress(struct _sha25 } /* Initialize the hash state */ -static void sha256_init(struct _sha256_state *md) +static void sha256_init(struct sha256_state *md) { md->curlen = 0; md->length = 0; @@ -2202,7 +2202,7 @@ static void sha256_init(struct _sha256_s @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 *md, unsigned char *in, unsigned long inlen) { unsigned long n; @@ -2243,7 +2243,7 @@ static int sha256_process(struct _sha256 @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 *md, unsigned char *out) { int i; @@ -2293,7 +2293,7 @@ static int sha256_done(struct _sha256_st static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len, u8 *mac) { - struct _sha256_state ctx; + struct sha256_state ctx; size_t i; sha256_init(&ctx); diff -up linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h.kernel58 linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h --- linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h.kernel58 2020-08-12 18:12:12.860279218 +0200 +++ linux-5.8/3rdparty/rtl8821ce/include/rtw_security.h 2020-08-12 18:13:07.202678858 +0200 @@ -249,11 +249,13 @@ struct security_priv { #define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE #endif -struct _sha256_state { +#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 -up linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c.kernel58 linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c --- linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c.kernel58 2020-08-12 18:12:12.867279269 +0200 +++ linux-5.8/3rdparty/rtl8821ce/os_dep/linux/ioctl_cfg80211.c 2020-08-12 18:13:07.204678873 +0200 @@ -80,7 +80,7 @@ #endif /* - * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant) + * In the current design of Wi-Fi driver, it will return success to the system (e.g. supplicant) * when Wi-Fi driver decides to abort the scan request in the scan flow by default. * Defining this flag makes Wi-Fi driver to return -EBUSY to the system if Wi-Fi driver is too busy to do the scan. */ @@ -321,7 +321,7 @@ static u8 rtw_chbw_to_cfg80211_chan_def( if (!chan) goto exit; - if (bw == CHANNEL_WIDTH_20) + if (bw == CHANNEL_WIDTH_20) chdef->width = ht ? NL80211_CHAN_WIDTH_20 : NL80211_CHAN_WIDTH_20_NOHT; else if (bw == CHANNEL_WIDTH_40) chdef->width = NL80211_CHAN_WIDTH_40; @@ -355,7 +355,7 @@ static void rtw_get_chbw_from_cfg80211_c rtw_warn_on(1); *ch = 0; return; - } + } switch (chdef->width) { case NL80211_CHAN_WIDTH_20_NOHT: @@ -1577,8 +1577,8 @@ static int rtw_cfg80211_set_encryption(s _rtw_memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); _rtw_memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); padapter->securitypriv.binstallGrpkey = _TRUE; - if (param->u.crypt.idx < 4) - _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); + if (param->u.crypt.idx < 4) + _rtw_memcpy(padapter->securitypriv.iv_seq[param->u.crypt.idx], param->u.crypt.seq, 8); padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx; rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1, _TRUE); @@ -1826,7 +1826,7 @@ static int cfg80211_rtw_get_key(struct w #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) || (MLME_IS_STA(adapter) && !pairwise) #endif - ) { + ) { /* WEP key, TX GTK/IGTK, RX GTK/IGTK(for STA mode) */ if (is_wep_enc(sec->dot118021XGrpPrivacy)) { if (keyid >= WEP_KEYS) @@ -1915,7 +1915,7 @@ static int cfg80211_rtw_get_key(struct w } ret = 0; - + exit: RTW_INFO(FUNC_NDEV_FMT GET_KEY_PARAM_FMT_S @@ -5565,7 +5565,7 @@ release_plink_ctl: if (del_sta) { u8 sta_addr[ETH_ALEN]; u8 updated = _FALSE; - + _rtw_memcpy(sta_addr, del_sta->cmn.mac_addr, ETH_ALEN); updated = ap_free_sta(adapter, del_sta, 0, 0, 1); rtw_mesh_expire_peer(stapriv->padapter, sta_addr); @@ -5650,7 +5650,7 @@ static int cfg80211_rtw_dump_station(str else _rtw_memcpy(mac, plink->addr, ETH_ALEN); #endif - + sinfo->filled = 0; if (psta) { @@ -7307,11 +7307,22 @@ static void cfg80211_rtw_mgmt_frame_regi #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; @@ -7330,7 +7341,12 @@ static void cfg80211_rtw_mgmt_frame_regi /* 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; @@ -7682,7 +7698,7 @@ void dump_mesh_config(void *sel, const s RTW_PRINT_SEL(sel, "path_refresh_time:%u\n", conf->path_refresh_time); RTW_PRINT_SEL(sel, "min_discovery_timeout:%u\n", conf->min_discovery_timeout); RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathTimeout:%u\n", conf->dot11MeshHWMPactivePathTimeout); - RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval); + RTW_PRINT_SEL(sel, "dot11MeshHWMPpreqMinInterval:%u\n", conf->dot11MeshHWMPpreqMinInterval); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)) RTW_PRINT_SEL(sel, "dot11MeshHWMPperrMinInterval:%u\n", conf->dot11MeshHWMPperrMinInterval); #endif @@ -7697,11 +7713,11 @@ void dump_mesh_config(void *sel, const s RTW_PRINT_SEL(sel, "dot11MeshForwarding:%d\n", conf->dot11MeshForwarding); RTW_PRINT_SEL(sel, "rssi_threshold:%d\n", conf->rssi_threshold); #endif - + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) RTW_PRINT_SEL(sel, "ht_opmode:0x%04x\n", conf->ht_opmode); #endif - + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) RTW_PRINT_SEL(sel, "dot11MeshHWMPactivePathToRootTimeout:%u\n", conf->dot11MeshHWMPactivePathToRootTimeout); RTW_PRINT_SEL(sel, "dot11MeshHWMProotInterval:%u\n", conf->dot11MeshHWMProotInterval); @@ -7712,7 +7728,7 @@ void dump_mesh_config(void *sel, const s RTW_PRINT_SEL(sel, "power_mode:%s\n", nl80211_mesh_power_mode_str(conf->power_mode)); RTW_PRINT_SEL(sel, "dot11MeshAwakeWindowDuration:%u\n", conf->dot11MeshAwakeWindowDuration); #endif - + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) RTW_PRINT_SEL(sel, "plink_timeout:%u\n", conf->plink_timeout); #endif @@ -7848,14 +7864,14 @@ static void rtw_cfg80211_mesh_cfg_set(_a if (chk_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask)); #endif #endif - + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) if (chk_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask)) mcfg->dot11MeshHWMPactivePathToRootTimeout = conf->dot11MeshHWMPactivePathToRootTimeout; if (chk_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask)) mcfg->dot11MeshHWMProotInterval = conf->dot11MeshHWMProotInterval; if (chk_mesh_attr(NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, mask)) - mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; + mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; #endif #if 0 /* TBD */ @@ -7913,7 +7929,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_i #endif if (!ch) goto exit; - + #if defined(CONFIG_80211AC_VHT) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) vht = ht && ch > 14 && bw >= CHANNEL_WIDTH_80; /* VHT40/VHT20? */ #endif @@ -8244,7 +8260,7 @@ static int cfg80211_rtw_join_mesh(struct ret = -EINVAL; goto exit; } - + rtw_mesh_work(&adapter->mesh_work); exit: @@ -8325,7 +8341,7 @@ static int cfg80211_rtw_del_mpath(struct } } else { rtw_mesh_path_flush_by_iface(adapter); - } + } exit: return ret; @@ -8626,13 +8642,13 @@ int cfg80211_rtw_resume(struct wiphy *wi //rtw_sitesurvey_cmd(padapter, NULL); rtw_sitesurvey_cmd(padapter, &parm); _exit_critical_bh(&pmlmepriv->lock, &irqL); - + for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) { if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE) break; rtw_msleep_os(1000); } - + _enter_critical_bh(&pmlmepriv->lock, &irqL); cfg80211_sched_scan_results(padapter->rtw_wdev->wiphy); _exit_critical_bh(&pmlmepriv->lock, &irqL); @@ -8640,7 +8656,7 @@ int cfg80211_rtw_resume(struct wiphy *wi } RTW_DBG("<== %s\n",__func__); return 0; - + } #endif /* CONFIG_PNO_SUPPORT */ @@ -9530,7 +9546,7 @@ int rtw_hostapd_acs_dump_survey(struct w #elif defined(CONFIG_RTW_ACS) && defined(CONFIG_BACKGROUND_NOISE_MONITOR) rtw_cfg80211_set_survey_info_with_clm(padapter, idx, info); #else - RTW_ERR("%s: unknown acs operation!\n", __func__); + RTW_ERR("%s: unknown acs operation!\n", __func__); #endif return ret; @@ -9631,7 +9647,11 @@ static struct cfg80211_ops rtw_cfg80211_ #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