From 016d083565a84c3d74221052169a1eeb56c014a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Mon, 15 Aug 2022 18:34:40 +0000 Subject: [PATCH] Fix compilation with kernel 6.0 see commit https://github.com/torvalds/linux/commit/7b0a0e3c3a88260b6fcb017e49f198463aa62ed1 --- os_dep/linux/ioctl_cfg80211.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index b26aaf7..24343ff 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -5072,8 +5072,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd return ret; } - +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) +static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) +#else static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) +#endif { _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); @@ -10131,12 +10134,16 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) rtw_cfg80211_indicate_scan_done(adapter, _TRUE); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) + if (wdev->links[0].client.current_bss) { +#else if (wdev->current_bss) { +#endif RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); rtw_cfg80211_indicate_disconnect(adapter, 0, 1); } - #endif +#endif if (pwdev_priv->pmon_ndev) { RTW_INFO("%s, unregister monitor interface\n", __func__);