From a3a93e34af46ac625319f2fa27500be5a1b2fcbf Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 8 Sep 2022 20:43:08 +0300 Subject: [PATCH 1/3] build support for kernel 5.19 --- os_dep/linux/ioctl_cfg80211.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 86c45b9..22422b7 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -417,7 +417,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 if (ret != _SUCCESS) goto exit; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); +#else cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); +#endif #else int freq = rtw_ch2freq(ch); @@ -4876,7 +4880,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd return ret; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 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); @@ -9634,7 +9642,11 @@ 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(5, 19, 0)) + if (wdev->connected) { + #elif 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); } From 2ea2c91f5ea3cab6cd4a6d42a3199c3c1925e89c Mon Sep 17 00:00:00 2001 From: Daniil Bolsun Date: Sun, 18 Sep 2022 08:43:21 +0300 Subject: [PATCH 2/3] build for debian LTS fix --- os_dep/linux/ioctl_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 22422b7..02ed8dc 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -9644,7 +9644,7 @@ void rtw_wdev_unregister(struct wireless_dev *wdev) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) if (wdev->connected) { - #elif + #else if (wdev->current_bss) { #endif RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); From 33c4ae08f105943ca5c3848c71554bcd5e3e1bf6 Mon Sep 17 00:00:00 2001 From: Daniil Bolsun Date: Sun, 23 Oct 2022 13:50:27 +0300 Subject: [PATCH 3/3] build support for kernel 6.0 --- os_dep/linux/ioctl_cfg80211.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 02ed8dc..b68e5eb 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -1103,7 +1103,11 @@ check_bss: #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) || defined(RHEL79)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) + roam_info.links[0].bssid = cur_network->network.MacAddress; + #else roam_info.bssid = cur_network->network.MacAddress; + #endif roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2; roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2; roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;