From 827a02287a1661b6ae58425eb52200027995b7a8 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 23 Aug 2020 17:37:36 +0100 Subject: [PATCH] Fix the 5.8 fix The original fix stopped calling cfg80211_rtw_mgmt_frame_register. --- os_dep/linux/ioctl_cfg80211.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 912ff6a..0e10e2f 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -7533,6 +7533,35 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, exit: return; } +#else +static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, + struct wireless_dev *wdev, + struct mgmt_frame_regs *upd) +{ + struct net_device *ndev = wdev_to_ndev(wdev); + _adapter *adapter; + struct rtw_wdev_priv *pwdev_priv; + + // Other bits not yet supported + u32 rtw_mask = BIT(IEEE80211_STYPE_AUTH >> 4); + + if (ndev == NULL) + goto exit; + + adapter = (_adapter *)rtw_netdev_priv(ndev); + pwdev_priv = adapter_wdev_data(adapter); + +#ifdef CONFIG_DEBUG_CFG80211 + RTW_INFO(FUNC_ADPT_FMT" old_regs:%x new_regs:%x\n", FUNC_ADPT_ARG(adapter), + pwdev_priv->report_mgmt, upd->interface_stypes); +#endif + + if ((upd->interface_stypes & rtw_mask) == (pwdev_priv->report_mgmt & rtw_mask)) + return; + pwdev_priv->report_mgmt = upd->interface_stypes; +exit: + return; +} #endif #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) @@ -9915,6 +9944,8 @@ static struct cfg80211_ops rtw_cfg80211_ops = { .mgmt_tx = cfg80211_rtw_mgmt_tx, #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, +#else + .update_mgmt_frame_registrations = 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,